subtitlecomposer-0.5.3/0000755000175000001440000000000011206425533014332 5ustar sergiouserssubtitlecomposer-0.5.3/doc/0000755000175000001440000000000011206423743015100 5ustar sergiouserssubtitlecomposer-0.5.3/doc/CMakeLists.txt0000644000175000001440000000026411151345054017637 0ustar sergiousersinclude_directories( ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en) add_subdirectory( en ) subtitlecomposer-0.5.3/doc/en/0000755000175000001440000000000011206423743015502 5ustar sergiouserssubtitlecomposer-0.5.3/doc/en/CMakeLists.txt0000644000175000001440000000023511151345054020237 0ustar sergiousersinclude_directories( ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) kde4_create_handbook( index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en ) subtitlecomposer-0.5.3/CMakeLists.txt0000644000175000001440000000033711151345073017074 0ustar sergiousersPROJECT( subtitlecomposer ) FIND_PACKAGE( KDE4 REQUIRED ) # FIND_PACKAGE( Msgfmt REQUIRED ) FIND_PACKAGE( Gettext REQUIRED ) INCLUDE( KDE4Defaults ) INCLUDE( MacroLibrary ) ADD_SUBDIRECTORY( po ) ADD_SUBDIRECTORY( src ) subtitlecomposer-0.5.3/AUTHORS0000644000175000001440000000005511151345073015401 0ustar sergiousersSergio Pistone subtitlecomposer-0.5.3/configure0000755000175000001440000000045111151345073016240 0ustar sergiousers#!/bin/sh CURRENT_DIR=$(echo $0 | sed -e 's/^\(.*\/\)[^\/][^\/]*$/\1/') BUILD_TESTS=ON cd ${CURRENT_DIR} && \ (rm -R build; \ mkdir build && \ cd build && \ cmake -GKDevelop3 ../ -DCMAKE_INSTALL_PREFIX=$(kde4-config --prefix) -DCMAKE_BUILD_TYPE=debugfull -DKDE4_BUILD_TESTS:BOOL=${BUILD_TESTS}) subtitlecomposer-0.5.3/COPYING0000644000175000001440000004313111151345073015366 0ustar sergiousers GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. subtitlecomposer-0.5.3/TODO0000644000175000001440000000106111206410124015006 0ustar sergiousersPlanned features / known issues * integrate waveform visuals (check out wave drawing in kdenlive editor) * automatic correction of OCR errors * rename "current line" to "active line" * it's annoying to have a subtitle fail to load because of an invalid encoding issue, perhaps the "next" encoding should be tried and the error informed. * the player controls won't appear on fullscreen mode with KDE4.2 (disabling KWin desktop effects "fixes" the issue) * translation service could improve syncronization issues if it cooperated more closely with the subtitle subtitlecomposer-0.5.3/ChangeLog0000755000175000001440000001622511206423042016106 0ustar sergiousersVersion 0.5.3: - added Czech, Brazilian Portuguese, Bulgarian, French and German translations contributed by Petr Gadula, Marcio P. Moraes, Petar Toushkov, Thomas Gastine and Panagiotis Papadopoulos respectively and updated Spanish translation - added Kross powered scripting interface with some basic examples in Ruby, Python and JavaScript - added action to translate subtitles using Google translation services - fixed many bugs including some that would crash the application * selecting a file from the recently opened list could crash the application when using Qt 4.5 * video playback was completely broken with Qt 4.5 * bugs related to searching text and errors * bugs related to undo/redo that could result in a crash - other minor fixes, user interface changes and improvements Version 0.5.2: - added Polish translation and updated Serbian and Spanish ones (thanks to Tomasz Argasiński and Slobodan Simic) - ported lines and errors views to Qt4 Model/View * greatly improves performance * renders lines using the application style * lines' texts display tooltips with errors information on hover - improved the current line text edit (mainly by using the KDE version of the control) * supports KDE standard shortcuts and spelling with on the fly highlighting of misspelled words * context menu shows suggestions for misspelled words and actions to ignore or add to dictionary * relevant shorcuts are caught so that don't trigger other application actions - improved inline editing behavior * navigation between editable cells is possible with Up/Down arrows and tab/back tab keys - added actions to retrocede and advance the current line (Alt+[Up|Down] arrows) - added a configuration page for spelling options - comply with Shared MIME-info spec for registering file types - fixed switching audio and subtitle streams on video player - fixed actions shortcuts on full screen mode (sequences using the keypad didn't work) - fixed subtitles preview (subtitles disappeared when leaving full screen) - fixed compression of actions (undoing actions broke things) - fixed crash caused by removing lines in some scenarios - fixed crash caused by find/replace/spelling actions when there was no current line - fixed Xine CMake checks (correctly enable XCB support when available) - many other minor fixes and improvements Version 0.5.1: - added Greek translation and completed Spanish one (thanks to Alexandros Perdikomatis) - added automatic tests for important classes - fixed many bugs (lots of crashes, configuration saving, recent files history, GUI glitches, etc.) - minor and not so minor cosmetic changes (fixed strings to comply with HIG, updated some icons, changed some dialogs' layouts) Version 0.5.0: - ported to KDE4/Qt4 - added Phonon player backend Version 0.4.2: - added Spanish and Serbian translations and updated pot file (thanks to Daniel Lambea and Slobodan Simic) - improved styles handling: * styles don't have to be applied to whole lines anymore * added "strike through" style support - added configurable outline for subtitles in video player - use KIO facilities to allow loading and saving subtitles from other than local files - other minor fixes Version 0.4.1: - detection of line terminator used in input subtitle and support for changing it (or not) when saving - show additional information for current line (characters per line / total characters) - added subtitlecomposer.pot file (now the program can be translated) - added action to fix overlapping lines - added "Select All" and "Select None" buttons to check errors and clear errors dialogs - resume playing (if paused) when a line has been double clicked - ensure all error items are visible in the errors dialog when changing the current line - fixed parsing and writing of SSA/ASS files and parsing of MPL files - fixed bug related to setting and clearing the subtitle's dirty state - fixed bug which prevented the error icon from being shown in some cases - fixed compilation with GCC 4.3 (thanks to David Watzke for the patch) Version 0.4.0: - support for working with translations - video player full screen mode - Xine player backend - non destructive edition of files with unnsupported data (such as SSA or ASS) - actions to shift to video position and adjust from video position (anchoring first or last line) - actions for increasing and decreasing the volume - actions for increasing and decreasing the subtitles font size - fix find and replace implementations to support all dialog options and (proper) regex replacements - make find actions to jump to video position in full screen mode - make consistent use of the grabbed video position compensation in all relevant user actions - renamed "Polska" format to its correct name, TMPlayer, and added support TMPlayer+ - many other fixes, changes and general improvements... Version 0.3.1: - fix the opening of files with MPlayer video backend - rename "Polska" subtitles format to it's actual name, TMPlayer Version 0.3: - errors checking and reporting - actions to join and split subtitles - action to sort lines - added support for "Polska" subtitles (*) - added default shortcuts to common actions - open video files dropped into the video widget - correctly handle opening of invalid video files - rearrange the main menu and the main view context menu - rewrite the recent files menus (application should compile in KDE 3.4 now) - many other internal changes including a revamp of the actions classes (which now support "compression" of actions) - updated features plan: next version will focus on KDE4 porting and subtitle translations support (*) I don't know the real name of the format, if anyone does (maybe the guys who requested it?), please, drop me a note. Version 0.2.1: - fix bug in MPlayer video backend wich prevented sound playback - fix a couple of user visible strings - enforce the currently set volume when changing audio streams Version 0.2: - open subtitle files dropped into the application window - command line option to open a given file on start - install mimetypes and update aplication desktop file to handle them - rearrange GUI controls and add a (toggable) editable position control - highlight currently playing line - action to make current line follow video position - actions to make video position jump to next/previous line - actions to make video position jump forwards/backwards - action to set current line show/hide time to video position (+ option to compensate the grabbed time) - actions to join and split lines - action to change lines text case (lower case, upper case, title case and sentence case) - action to fix lines punctuation - action to maximize lines duration - action to automaticaty set lines duration based on text - actions to quick shift selected lines (and option to specify the shift amount) - action to synchronize or adjust the current subtitle with a reference one Version 0.1: - load and save from most common formats (srt, sub, ssa) with support for multiple encodings - full undo/redo support - integrated video player with support for multiple video backends (gstreamer/mplayer) and subtitles overlaying - insert/remove lines - edit text and styles - adjust times - change frame rate - find/replace with regular expressions - check spelling subtitlecomposer-0.5.3/po/0000755000175000001440000000000011206423743014751 5ustar sergiouserssubtitlecomposer-0.5.3/po/CMakeLists.txt0000644000175000001440000000035711170276077017524 0ustar sergiousersADD_SUBDIRECTORY( bg ) ADD_SUBDIRECTORY( cs ) ADD_SUBDIRECTORY( de ) ADD_SUBDIRECTORY( el ) ADD_SUBDIRECTORY( es ) ADD_SUBDIRECTORY( fr ) ADD_SUBDIRECTORY( pl ) ADD_SUBDIRECTORY( pt_BR ) ADD_SUBDIRECTORY( sr ) ADD_SUBDIRECTORY( sr@latin ) subtitlecomposer-0.5.3/po/sr/0000755000175000001440000000000011206423743015375 5ustar sergiouserssubtitlecomposer-0.5.3/po/sr/CMakeLists.txt0000644000175000001440000000016611151345072020135 0ustar sergiousersFILE( GLOB _po_files *.po ) GETTEXT_PROCESS_PO_FILES( sr ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) subtitlecomposer-0.5.3/po/sr/subtitlecomposer.po0000644000175000001440000024245111206411600021335 0ustar sergiousers# translation of subtitlecomposer.po to Serbian # This file is put in the public domain. # # Slobodan Simic , 2008, 2009. # Sergio Pistone , 2009. msgid "" msgstr "" "Project-Id-Version: subtitlecomposer\n" "Report-Msgid-Bugs-To: https://sourceforge.net/tracker/?" "atid=1005652&group_id=208427&func=browse\n" "POT-Creation-Date: 2009-05-25 00:41-0300\n" "PO-Revision-Date: 2009-05-24 17:03-0300\n" "Last-Translator: Sergio Pistone \n" "Language-Team: American English \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 0.3\n" "Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 : n%" "10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #: core/subtitleactions.cpp:62 msgid "Set Frame Rate" msgstr "Постави брзину кадрова" #: core/subtitleactions.cpp:93 msgid "Insert Lines" msgstr "Убаци редове" #: core/subtitleactions.cpp:177 core/subtitle.cpp:446 core/subtitle.cpp:460 #: core/subtitle.cpp:479 msgid "Remove Lines" msgstr "Уклони редове" #: core/subtitleactions.cpp:268 msgid "Move Line" msgstr "Помери ред" #: core/subtitleactions.cpp:381 msgid "Swap Texts" msgstr "Замени текстове" #: core/subtitle.cpp:66 msgid "Set Primary Data" msgstr "Постави главни текст" #: core/subtitle.cpp:121 msgid "Clear Primary Text Data" msgstr "Очисти податке главног текста" #: core/subtitle.cpp:134 msgid "Set Secondary Data" msgstr "Постави секундарне податке" #: core/subtitle.cpp:180 msgid "Clear Secondary Text Data" msgstr "Очисти податке секундарног текста" #: core/subtitle.cpp:265 main/dialogs/changeframeratedialog.cpp:34 msgid "Change Frame Rate" msgstr "Измени број кадрова" #: core/subtitle.cpp:395 core/subtitle.cpp:412 msgid "Insert Line" msgstr "Убаци ред" #: core/subtitle.cpp:533 main/application.cpp:662 main/lineswidget.cpp:1226 msgid "Split Lines" msgstr "Раздвоји редове" #: core/subtitle.cpp:590 main/application.cpp:670 main/lineswidget.cpp:1225 msgid "Join Lines" msgstr "Споји редове" #: core/subtitle.cpp:642 msgid "Shift Lines" msgstr "Помери редове" #: core/subtitle.cpp:690 msgid "Adjust Lines" msgstr "Подеси редове" #: core/subtitle.cpp:700 main/application.cpp:2377 main/lineswidget.cpp:1200 msgid "Sort" msgstr "Поређај" #: core/subtitle.cpp:746 main/dialogs/durationlimitsdialog.cpp:33 msgid "Enforce Duration Limits" msgstr "Присили ограничења трајања" #: core/subtitle.cpp:791 main/application.cpp:2462 main/lineswidget.cpp:1203 msgid "Maximize Durations" msgstr "Максимизуј трајања" #: core/subtitle.cpp:816 main/dialogs/autodurationsdialog.cpp:35 msgid "Set Automatic Durations" msgstr "Постави аутоматска трајања" #: core/subtitle.cpp:856 main/dialogs/fixoverlappingtimesdialog.cpp:32 #: main/lineswidget.cpp:1204 msgid "Fix Overlapping Times" msgstr "Среди преклапајућа времена" #: core/subtitle.cpp:890 msgid "Fix Lines Punctuation" msgstr "Среди интерпункцију реда" #: core/subtitle.cpp:986 msgid "Lower Case" msgstr "Мала слова" #: core/subtitle.cpp:1020 msgid "Upper Case" msgstr "Велика слова" #: core/subtitle.cpp:1054 msgid "Title Case" msgstr "Величина наслова" #: core/subtitle.cpp:1091 msgid "Sentence Case" msgstr "Величина реченица" #: core/subtitle.cpp:1142 main/dialogs/smarttextsadjustdialog.cpp:32 msgid "Break Lines" msgstr "Преломи редове" #: core/subtitle.cpp:1150 main/application.cpp:2530 main/lineswidget.cpp:1146 msgid "Unbreak Lines" msgstr "Врати преломљене редове" #: core/subtitle.cpp:1158 main/application.cpp:2544 main/lineswidget.cpp:1152 msgid "Simplify Spaces" msgstr "Поједностави размаке" #: core/subtitle.cpp:1167 msgid "Synchronize Subtitles" msgstr "Синхронизуј титлове" #: core/subtitle.cpp:1190 main/dialogs/joinsubtitlesdialog.cpp:35 msgid "Join Subtitles" msgstr "Састави титлове" #: core/subtitle.cpp:1236 core/subtitle.cpp:1242 msgid "Split Subtitles" msgstr "Раздвоји титлове" #: core/subtitle.cpp:1259 core/subtitle.cpp:1274 msgid "Set Lines Style" msgstr "Постави стил редова" #: core/subtitle.cpp:1291 msgid "Toggle Lines Style" msgstr "Укљ/искљ. стил реда" #: core/subtitle.cpp:1304 msgid "Set Lines Mark" msgstr "Постави маркер редова" #: core/subtitle.cpp:1304 msgid "Clear Lines Mark" msgstr "Очисти маркер редова" #: core/subtitle.cpp:1318 msgid "Toggle Lines Mark" msgstr "Мењај маркацију редова" #: core/subtitle.cpp:1328 main/application.cpp:2261 main/application.cpp:2271 #: main/errorswidget.cpp:854 msgid "Clear Lines Errors" msgstr "Очисти грешке редова" #: core/subtitle.cpp:1338 core/subtitle.cpp:1358 main/application.cpp:2194 #: main/application.cpp:2239 msgid "Check Lines Errors" msgstr "Провери грешке редова" #: core/subtitlelineactions.cpp:65 msgid "Set Line Text" msgstr "Постави текст реда" #: core/subtitlelineactions.cpp:101 msgid "Set Line Secondary Text" msgstr "Постави секундарни текст реда" #: core/subtitlelineactions.cpp:137 msgid "Set Line Texts" msgstr "Постави текст реда" #: core/subtitlelineactions.cpp:218 msgid "Set Line Show Time" msgstr "Постави време приказивања реда" #: core/subtitlelineactions.cpp:254 msgid "Set Line Hide Time" msgstr "Постави време нестајања реда" #: core/subtitlelineactions.cpp:371 msgid "Set Line Errors" msgstr "Постави грешке реда" #: core/subtitleline.cpp:72 msgid "Empty text" msgstr "Празан текст" #: core/subtitleline.cpp:74 msgid "Too many characters" msgstr "Превише знакова" #: core/subtitleline.cpp:76 msgid "Too many lines" msgstr "Превише редова" #: core/subtitleline.cpp:78 msgid "Unnecessary white space" msgstr "Непотребни размаци" #: core/subtitleline.cpp:80 msgid "Unnecessary dash" msgstr "Непотребна цртица" #: core/subtitleline.cpp:82 msgid "Capital letter after continuation ellipsis" msgstr "Велико слово након цртице за нови ред" #: core/subtitleline.cpp:84 msgid "Too long duration per character" msgstr "Предуго трајање по знаку" #: core/subtitleline.cpp:86 msgid "Too short duration per character" msgstr "Прекратко трајање по карактеру" #: core/subtitleline.cpp:88 msgid "Too long duration" msgstr "Предуго трајање" #: core/subtitleline.cpp:89 msgid "Too short duration" msgstr "Прекратко трајање" #: core/subtitleline.cpp:90 msgid "Overlapping times" msgstr "Преклапање времена" #: core/subtitleline.cpp:91 msgid "Untranslated text" msgstr "Непреведени текст" #: core/subtitleline.cpp:92 msgid "User mark" msgstr "Кориснички маркери" #: core/subtitleline.cpp:112 msgid "Has no primary text." msgstr "Нема главног текста." #: core/subtitleline.cpp:116 msgid "Has no translation text." msgstr "Нема преведеног текста." #: core/subtitleline.cpp:120 msgid "Has too many characters in primary text (1 char)." msgid_plural "Has too many characters in primary text (%1 chars)." msgstr[0] "Има превише знакова у главном тексту (%1 знак)." msgstr[1] "Има превише знакова у главном тексту (%1 знака)." msgstr[2] "Има превише знакова у главном тексту (%1 знакова)." msgstr[3] "Има превише знакова у главном тексту (1 знак)." #: core/subtitleline.cpp:126 msgid "Has too many characters in translation text (1 char)." msgid_plural "Has too many characters in translation text (%1 chars)." msgstr[0] "Има превише знакова у преведеном тексту (%1 знак)." msgstr[1] "Има превише знакова у преведеном тексту (%1 знака)." msgstr[2] "Има превише знакова у преведеном тексту (%1 знакова)." msgstr[3] "Има превише знакова у преведеном тексту (1 знак)." #: core/subtitleline.cpp:132 msgid "Has too many lines in primary text (1 line)." msgid_plural "Has too many lines in primary text (%1 lines)." msgstr[0] "Има превише редова у главном тексту (%1 ред)." msgstr[1] "Има превише редова у главном тексту (%1 реда)." msgstr[2] "Има превише редова у главном тексту (%1 редова)." msgstr[3] "Има превише редова у главном тексту (1 ред)." #: core/subtitleline.cpp:138 msgid "Has too many lines in translation text (1 line)." msgid_plural "Has too many lines in translation text (%1 lines)." msgstr[0] "Има превише редова у преведеном тексту (%1 ред)." msgstr[1] "Има превише редова у преведеном тексту (%1 реда)." msgstr[2] "Има превише редова у преведеном тексту (%1 редова)." msgstr[3] "Има превише редова у преведеном тексту (1 ред)." #: core/subtitleline.cpp:144 msgid "Has unnecessary spaces in primary text." msgstr "Има непотребне размаке у главном тексту." #: core/subtitleline.cpp:148 msgid "Has unnecessary spaces in translation text." msgstr "Има непотребне размаке у преведеном тексту." #: core/subtitleline.cpp:152 msgid "Has unnecessary dash in primary text." msgstr "Има непотребне цртице у главном тексту." #: core/subtitleline.cpp:156 msgid "Has unnecessary dash in translation text." msgstr "Има непотребне цртице у преведеном тексту." #: core/subtitleline.cpp:160 msgid "Has capital letter after line continuation ellipsis in primary text." msgstr "Има велико слово након цртице за нови ред у главном тексту." #: core/subtitleline.cpp:164 msgid "" "Has capital letter after line continuation ellipsis in translation text." msgstr "Има велико слово након цртице за нови ред у преведеном тексту." #: core/subtitleline.cpp:168 msgid "Has too long duration per character in primary text (1 msec/char)." msgid_plural "" "Has too long duration per character in primary text (%1 msecs/char)." msgstr[0] "Има предуго трајање по знаку у главном тексту (%1 ms/знаку)." msgstr[1] "Има предуго трајање по знаку у главном тексту (%1 ms/знаку)." msgstr[2] "Има предуго трајање по знаку у главном тексту (%1 ms/знаку)." msgstr[3] "Има предуго трајање по знаку у главном тексту (1 ms/знаку)." #: core/subtitleline.cpp:174 msgid "Has too long duration per character in translation text (1 msec/char)." msgid_plural "" "Has too long duration per character in translation text (%1 msecs/char)." msgstr[0] "Има предуго трајање по знаку у преведеном тексту (%1 ms/знаку)." msgstr[1] "Има предуго трајање по знаку у преведеном тексту (%1 ms/знаку)." msgstr[2] "Има предуго трајање по знаку у преведеном тексту (%1 ms/знаку)." msgstr[3] "Има предуго трајање по знаку у преведеном тексту (1 ms/знаку)." #: core/subtitleline.cpp:180 msgid "Has too short duration per character in primary text (1 msec/char)." msgid_plural "" "Has too short duration per character in primary text (%1 msecs/char)." msgstr[0] "Има прекратко трајање по знаку у главном тексту (%1 ms/знаку)." msgstr[1] "Има прекратко трајање по знаку у главном тексту (%1 ms/знаку)." msgstr[2] "Има прекратко трајање по знаку у главном тексту (%1 ms/знаку)." msgstr[3] "Има прекратко трајање по знаку у главном тексту (1 ms/знаку)." #: core/subtitleline.cpp:186 msgid "Has too short duration per character in translation text (1 msec/char)." msgid_plural "" "Has too short duration per character in translation text (%1 msecs/char)." msgstr[0] "Има прекратко трајање по знаку у преведеном тексту (%1 ms/знаку)." msgstr[1] "Има прекратко трајање по знаку у преведеном тексту (%1 ms/знаку)." msgstr[2] "Има прекратко трајање по знаку у преведеном тексту (%1 ms/знаку)." msgstr[3] "Има прекратко трајање по знаку у преведеном тексту (1 ms/знаку)." #: core/subtitleline.cpp:192 msgid "Has too long duration (1 msec)." msgid_plural "Has too long duration (%1 msecs)." msgstr[0] "Има предуго трајање (%1 ms)." msgstr[1] "Има предуго трајање (%1 ms)." msgstr[2] "Има предуго трајање (%1 ms)." msgstr[3] "Има предуго трајање (1 ms)." #: core/subtitleline.cpp:198 msgid "Has too short duration (1 msec)." msgid_plural "Has too short duration (%1 msecs)." msgstr[0] "Има прекратко трајање (%1 ms)." msgstr[1] "Има прекратко трајање (%1 ms)." msgstr[2] "Има прекратко трајање (%1 ms)." msgstr[3] "Има прекратко трајање (1 ms)." #: core/subtitleline.cpp:204 msgid "Overlaps with next line." msgstr "Преклапа се са наредним редом." #: core/subtitleline.cpp:208 msgid "Has untranslated text." msgstr "Има непреведени текст." #: core/subtitleline.cpp:212 msgid "Has user mark." msgstr "Има кориснички маркер." #: core/subtitleline.cpp:680 msgid "Set Line Times" msgstr "Постави времена реда" #: core/subtitleline.cpp:691 msgid "Shift Line Times" msgstr "Помери времена реда" #: core/subtitleline.cpp:705 msgid "Adjust Line Times" msgstr "Подеси времена реда" #: main/actions/krecentfilesactionext.cpp:37 msgid "Clear History" msgstr "Очисти историјат" #: main/application.cpp:415 msgid "Video Files" msgstr "Видео фајлови" #: main/application.cpp:423 msgid "Audio Files" msgstr "Аудио фајлови" #: main/application.cpp:425 msgid "Media Files" msgstr "Медија фајлови" #: main/application.cpp:426 msgid "All Files" msgstr "Сви фајлови" #: main/application.cpp:442 msgid "Audio Levels Files" msgstr "Фајлови аудио нивоа" #: main/application.cpp:456 msgid "Exit the application" msgstr "Изађи из програма" #: main/application.cpp:460 msgid "Configure Subtitle Composer" msgstr "Подеси „Састављача титлова“" #: main/application.cpp:465 msgctxt "@action:inmenu Create a new subtitle" msgid "New" msgstr "Нови" #: main/application.cpp:466 msgid "Create an empty subtitle" msgstr "Направи празан титл" #: main/application.cpp:475 msgctxt "@action:inmenu Open subtitle file" msgid "Open..." msgstr "Отвори..." #: main/application.cpp:476 main/application.cpp:486 msgid "Open subtitle file" msgstr "Отвори фајл титла" #: main/application.cpp:485 msgctxt "@action:inmenu Open rencently used subtitle file" msgid "Open &Recent" msgstr "Отвори ско&рашњи" #: main/application.cpp:493 msgid "Save" msgstr "Сачувај" #: main/application.cpp:494 msgid "Save opened subtitle" msgstr "Сачувај отворени титл" #: main/application.cpp:503 msgid "Save As..." msgstr "Сачувај као..." #: main/application.cpp:504 msgid "Save opened subtitle with different settings" msgstr "Сачувај отворени титл са другачијим поставкама" #: main/application.cpp:512 msgid "Close" msgstr "Затвори" #: main/application.cpp:513 msgid "Close opened subtitle" msgstr "Затвори отворени титл" #: main/application.cpp:522 msgid "New Translation" msgstr "Нови превод" #: main/application.cpp:523 msgid "Create an empty translation subtitle" msgstr "Направи празан преведени титл" #: main/application.cpp:532 msgid "Open Translation..." msgstr "Отвори превод..." #: main/application.cpp:533 main/application.cpp:543 msgid "Open translation subtitle file" msgstr "Отвори фајл преведеног титла" #: main/application.cpp:542 msgid "Open &Recent Translation" msgstr "Отвори ско&рашњи превод" #: main/application.cpp:551 msgid "Save Translation" msgstr "Сачувај превод" #: main/application.cpp:552 msgid "Save opened translation subtitle" msgstr "Сачувај отворени преведени титл" #: main/application.cpp:561 msgid "Save Translation As..." msgstr "Сачувај превод као..." #: main/application.cpp:562 msgid "Save opened translation subtitle with different settings" msgstr "Сачувај отворени преведени титл са другачијим поставкама" #: main/application.cpp:570 msgid "Close Translation" msgstr "Затвори превод" #: main/application.cpp:571 msgid "Close opened translation subtitle" msgstr "Затвори отворени преведени титл" #: main/application.cpp:580 msgid "Reload As..." msgstr "Учитај као..." #: main/application.cpp:581 main/application.cpp:592 msgid "Reload opened file with a different encoding" msgstr "Поново учитај отворени титл са другачијим кодирањем" #: main/application.cpp:591 msgid "Quick Reload As..." msgstr "Брзо учитај као..." #: main/application.cpp:600 main/application.cpp:601 #: widgets/simplerichtextedit.cpp:72 msgid "Undo" msgstr "Опозови" #: main/application.cpp:610 main/application.cpp:611 #: widgets/simplerichtextedit.cpp:78 msgid "Redo" msgstr "Понови" #: main/application.cpp:619 msgid "Split Subtitle..." msgstr "Раздвоји титл..." #: main/application.cpp:620 msgid "Split the opened subtitle in two parts" msgstr "Раздвоји отворени титл на два дела" #: main/application.cpp:627 msgid "Join Subtitles..." msgstr "Здружи титлове..." #: main/application.cpp:628 msgid "Append to the opened subtitle another one" msgstr "Додавање другог титла отвореном" #: main/application.cpp:635 main/lineswidget.cpp:1222 msgid "Insert Before" msgstr "Уметни пре" #: main/application.cpp:636 msgid "Insert empty line before current one" msgstr "Уметни празан ред пре текућег" #: main/application.cpp:644 main/lineswidget.cpp:1223 msgid "Insert After" msgstr "Уметни након" #: main/application.cpp:645 msgid "Insert empty line after current one" msgstr "Уметни празан ред након текућег" #: main/application.cpp:653 main/lineswidget.cpp:1221 #: main/scripting/scriptsmanager.cpp:141 msgid "Remove" msgstr "Уклони" #: main/application.cpp:654 msgid "Remove selected lines" msgstr "Уклони изабране редове" #: main/application.cpp:663 msgid "Split selected lines" msgstr "Раздвоји изабране редове" #: main/application.cpp:671 msgid "Join selected lines" msgstr "Здружи изабране редове" #: main/application.cpp:678 main/dialogs/actionwitherrortargetsdialog.cpp:103 #: main/lineswidget.cpp:1219 widgets/simplerichtextedit.cpp:113 msgid "Select All" msgstr "Изабери све" #: main/application.cpp:679 msgid "Select all lines" msgstr "Изабери све редове" #: main/application.cpp:687 msgid "Go to Line..." msgstr "Иди на ред..." #: main/application.cpp:688 msgid "Go to specified line" msgstr "Иди на одређени ред" #: main/application.cpp:697 msgid "Find..." msgstr "Нађи..." #: main/application.cpp:698 msgid "Find occurrences of strings or regular expressions" msgstr "Проналази знаковне низове или регуларне изразе" #: main/application.cpp:708 msgid "Find Next" msgstr "Нађи следеће" #: main/application.cpp:709 msgid "Find next occurrence of string or regular expression" msgstr "Налази следећу појаву знаковног низа или регуларног израза" #: main/application.cpp:719 msgid "Find Previous" msgstr "Нађи претходно" #: main/application.cpp:720 msgid "Find previous occurrence of string or regular expression" msgstr "Налази претходну појаву знаковног низа или регуларног израза" #: main/application.cpp:728 msgid "Replace..." msgstr "Замени..." #: main/application.cpp:729 msgid "Replace occurrences of strings or regular expressions" msgstr "Врши замену знаковних низова или регуларних израза" #: main/application.cpp:738 msgid "Retrocede current line" msgstr "Претеча текућег реда" #: main/application.cpp:739 msgid "Makes the line before the current one active" msgstr "Чини да ред пре текућег буде активан" #: main/application.cpp:748 msgid "Advance current line" msgstr "Следбеник текућег реда" #: main/application.cpp:749 msgid "Makes the line after the current one active" msgstr "Чини да ред након текућег буде активан" #: main/application.cpp:757 main/errorsdialog.cpp:59 main/lineswidget.cpp:1212 msgid "Check Errors..." msgstr "Провери грешке..." #: main/application.cpp:758 msgid "Check for errors in the current subtitle" msgstr "Провери грешке у текућем титлу" #: main/application.cpp:766 main/errorsdialog.cpp:62 main/lineswidget.cpp:1213 msgid "Clear Errors..." msgstr "Очисти грешке..." #: main/application.cpp:767 msgid "Clear errors from selected lines" msgstr "Очисти грешке из изабраних редова" #: main/application.cpp:774 main/lineswidget.cpp:1215 msgid "Show Errors..." msgstr "Прикажи грешке..." #: main/application.cpp:775 msgid "Show errors information for the current subtitle" msgstr "Прикажи податке о грешкама за текући титл" #: main/application.cpp:784 msgid "Find Error..." msgstr "Нађи грешку..." #: main/application.cpp:785 msgid "Find lines with specified errors" msgstr "Нађи редове са наведеним грешкама" #: main/application.cpp:795 msgid "Find Next Error" msgstr "Нађи следећу грешку" #: main/application.cpp:796 msgid "Find next line with specified errors" msgstr "Нађи следећи ред са наведеним грешкама" #: main/application.cpp:806 msgid "Find Previous Error" msgstr "Нађи претходну грешку" #: main/application.cpp:807 msgid "Find previous line with specified errors" msgstr "Нађи претходни ред са наведеним грешкама" #: main/application.cpp:816 main/lineswidget.cpp:1159 msgid "Spelling..." msgstr "Правопис..." #: main/application.cpp:817 msgid "Check lines spelling" msgstr "Провери правопис у редовима" #: main/application.cpp:824 msgid "Toggle Mark" msgstr "Маркирано" #: main/application.cpp:825 msgid "Toggle selected lines mark" msgstr "Мења стање маркираности изабраних редова" #: main/application.cpp:834 main/currentlinewidget.cpp:92 msgid "Toggle Bold" msgstr "Подебљано" #: main/application.cpp:835 msgid "Toggle selected lines bold attribute" msgstr "Укључује или искључује подебљани испис изабраних редова" #: main/application.cpp:844 main/currentlinewidget.cpp:97 msgid "Toggle Italic" msgstr "Курзив" #: main/application.cpp:845 msgid "Toggle selected lines italic attribute" msgstr "Укључује или искључује курзивни испис изабраних редова" #: main/application.cpp:854 main/currentlinewidget.cpp:102 msgid "Toggle Underline" msgstr "Подвучено" #: main/application.cpp:855 msgid "Toggle selected lines underline attribute" msgstr "Укључује или искључује подвучени испис изабраних редова" #: main/application.cpp:864 main/currentlinewidget.cpp:107 msgid "Toggle Strike Through" msgstr "Прецртано" #: main/application.cpp:865 msgid "Toggle selected lines strike through attribute" msgstr "Укључује или искључује прецртани испис изабраних редова" #: main/application.cpp:873 main/lineswidget.cpp:1199 msgid "Shift..." msgstr "Померај..." #: main/application.cpp:874 msgid "Shift lines an specified amount of time" msgstr "Померај редова за одређено време" #: main/application.cpp:901 msgid "Adjust..." msgstr "Подеси..." #: main/application.cpp:902 msgid "Linearly adjust all lines to a specified interval" msgstr "Линеарно подеси све редове на одређени интервал" #: main/application.cpp:910 msgid "Sort..." msgstr "Поређај..." #: main/application.cpp:911 msgid "Sort lines based on their show time" msgstr "Поређај редове на основу времена појављивања" #: main/application.cpp:918 msgid "Change Frame Rate..." msgstr "Измени брзину кадрова..." #: main/application.cpp:919 msgid "Retime subtitle lines by reinterpreting its frame rate" msgstr "Прилагоди времена редова прерачунавајући брзину кадрова" #: main/application.cpp:926 main/lineswidget.cpp:1201 msgid "Enforce Duration Limits..." msgstr "Присили ограничења трајања..." #: main/application.cpp:927 msgid "Enforce lines minimum and/or maximum duration limits" msgstr "Форсирај ограничења максималног и/или минималног трајања" #: main/application.cpp:935 main/lineswidget.cpp:1202 msgid "Set Automatic Durations..." msgstr "Постави аутоматска трајања..." #: main/application.cpp:936 msgid "Set lines durations based on amount of letters, words and line breaks" msgstr "Постави трајање редова на основу броја слова, речи и прелома редова" #: main/application.cpp:943 msgid "Maximize Durations..." msgstr "Максимизуј трајања..." #: main/application.cpp:944 msgid "Extend lines durations up to their next lines show time" msgstr "Продужи трајања редова до времена појављивања наредног реда" #: main/application.cpp:951 msgid "Fix Overlapping Times..." msgstr "Среди преклапајућа времена..." #: main/application.cpp:952 msgid "Fix lines overlapping times" msgstr "Среди времена преклопљених редова" #: main/application.cpp:959 msgid "Synchronize with Subtitle..." msgstr "Синхронизуј са титлом..." #: main/application.cpp:960 msgid "Copy timing information from another subtitle" msgstr "Копирај податке о временима из другог титла" #: main/application.cpp:967 main/lineswidget.cpp:1142 msgid "Break Lines..." msgstr "Преломи редове..." #: main/application.cpp:968 msgid "Automatically set line breaks" msgstr "Аутоматски подеси прелом реда" #: main/application.cpp:975 main/lineswidget.cpp:1145 msgid "Unbreak Lines..." msgstr "Врати преломљене редове..." #: main/application.cpp:976 msgid "Remove line breaks from lines" msgstr "Уклони прелом реда из редова" #: main/application.cpp:983 main/lineswidget.cpp:1151 msgid "Simplify Spaces..." msgstr "Поједностави размаке..." #: main/application.cpp:984 msgid "Remove unneeded spaces from lines" msgstr "Уклони непотребне размаке из редова" #: main/application.cpp:991 main/lineswidget.cpp:1155 msgid "Change Case..." msgstr "Измени велика/мала слова..." #: main/application.cpp:992 msgid "Change lines text to upper, lower, title or sentence case" msgstr "Промени текст у велика или мала слова, наслов или величину за реченицу" #: main/application.cpp:999 main/lineswidget.cpp:1156 msgid "Fix Punctuation..." msgstr "Среди интерпункцију..." #: main/application.cpp:1000 msgid "Fix punctuation errors in lines" msgstr "Среди грешке интерпункције у редовима" #: main/application.cpp:1007 main/lineswidget.cpp:1157 msgid "Translate..." msgstr "Преведи..." #: main/application.cpp:1008 msgid "Translate lines texts using Google services" msgstr "Преведи текст редова помоћу Гугл услуга" #: main/application.cpp:1015 msgid "Edit Line in Place" msgstr "Уреди текст на месту" #: main/application.cpp:1016 msgid "Edit current line text in place" msgstr "Уреди текст текућег реда на месту" #: main/application.cpp:1025 msgid "Open Video..." msgstr "Отвори видео..." #: main/application.cpp:1026 main/application.cpp:1034 msgid "Open video file" msgstr "Отвори видео фајл" #: main/application.cpp:1033 msgid "Open &Recent Video" msgstr "Отвори ско&рашњи видео" #: main/application.cpp:1041 msgid "Close Video" msgstr "Затвори видео" #: main/application.cpp:1042 msgid "Close video file" msgstr "Затвори видео фајл" #: main/application.cpp:1051 msgid "Full Screen Mode" msgstr "Преко целог екрана" #: main/application.cpp:1052 msgid "Toggle full screen mode" msgstr "Укљ/искљ. приказ преко целог екрана" #: main/application.cpp:1060 main/utils/kreplace.cpp:425 msgid "Stop" msgstr "Заустави" #: main/application.cpp:1061 msgid "Stop video playback" msgstr "Заустави пуштање видеа" #: main/application.cpp:1069 main/application.cpp:3156 #: main/application.cpp:3163 msgid "Play" msgstr "Пусти" #: main/application.cpp:1070 msgid "Toggle video playing/paused" msgstr "Пуштам/Паузирано" #: main/application.cpp:1078 msgid "Seek Backwards" msgstr "Тражи уназад" #: main/application.cpp:1087 msgid "Seek Forwards" msgstr "Тражи унапред" #: main/application.cpp:1099 msgid "Jump to Previous Line" msgstr "Скочи на претходни ред" #: main/application.cpp:1100 msgid "Seek to previous subtitle line show time" msgstr "Иди на време приказа претходног реда" #: main/application.cpp:1109 msgid "Jump to Next Line" msgstr "Скочи на следећи ред" #: main/application.cpp:1110 msgid "Seek to next subtitle line show time" msgstr "Иди на време приказа следећег реда" #: main/application.cpp:1120 msgid "Set Current Line Show Time" msgstr "Постави време приказа текућег реда" #: main/application.cpp:1121 msgid "Set current line show time to video position" msgstr "Постави време приказа текућег реда на позицију видеа" #: main/application.cpp:1131 msgid "Set Current Line Hide Time" msgstr "Постави време нестајања текућег реда" #: main/application.cpp:1132 msgid "Set current line hide time to video position" msgstr "Постави време нестајања текућег реда на позицију видеа" #: main/application.cpp:1141 msgid "Current Line Follows Video" msgstr "Текући ред прати видео" #: main/application.cpp:1142 msgid "Make current line follow the playing video position" msgstr "Текући ред прати позицију пуштеног видеа" #: main/application.cpp:1149 msgctxt "@action:inmenu Toggle audio muted" msgid "Mute" msgstr "Умукни" #: main/application.cpp:1151 msgid "Enable/disable playback sound" msgstr "Укључује или искључује звук" #: main/application.cpp:1159 msgid "Increase Volume" msgstr "Повећај јачину" #: main/application.cpp:1160 msgid "Increase volume by 5%" msgstr "Повећај јачину за 5%" #: main/application.cpp:1168 msgid "Decrease Volume" msgstr "Смањи јачину" #: main/application.cpp:1169 msgid "Decrease volume by 5%" msgstr "Смањи јачину за 5%" #: main/application.cpp:1177 msgid "Audio Streams" msgstr "Аудио токови" #: main/application.cpp:1178 msgid "Select active audio stream" msgstr "Изабери активни аудио ток" #: main/application.cpp:1186 msgid "Increase Font Size" msgstr "Повећај величину фонта" #: main/application.cpp:1187 msgid "Increase subtitles font size by 1 point" msgstr "Повећај величину фонта титла за 1 тачку" #: main/application.cpp:1195 msgid "Decrease Font Size" msgstr "Смањи величину фонта" #: main/application.cpp:1196 msgid "Decrease subtitles font size by 1 point" msgstr "Смањи величину фонта титла за 1 тачку" #: main/application.cpp:1204 msgid "Subtitle Streams" msgstr "Токови титла" #: main/application.cpp:1205 msgid "Select active subtitle stream" msgstr "Изабери активни ток титла" #: main/application.cpp:1212 msgid "Shift to Video Position" msgstr "Померај на позицију видеа" #: main/application.cpp:1213 msgid "" "Set current line show time to video position by equally shifting all lines" msgstr "" "Поставља време приказа текућег реда на позицију видеа једнако померајући све " "линије" #: main/application.cpp:1221 msgid "Adjust to Video Position (Anchor Last Line)" msgstr "Подеси на позицију видеа (усидри последњи ред)" #: main/application.cpp:1222 msgid "" "Set current line to video position by fixing the last line and linearly " "adjusting the other ones" msgstr "" "Поставља текући ред на позицију видеа фиксирајући последњи ред и линеарно " "подешавајући остале" #: main/application.cpp:1230 msgid "Adjust to Video Position (Anchor First Line)" msgstr "Подеси на позицију видеа (усидри први ред)" #: main/application.cpp:1231 msgid "" "Set current line to video position by fixing the first line and linearly " "adjusting the other ones" msgstr "" "Поставља текући ред на позицију видеа фиксирајући први ред и линеарно " "подешавајући остале" #: main/application.cpp:1240 msgctxt "@action:inmenu Manage user scripts" msgid "Scripts Manager..." msgstr "Менаџер скрипти..." #: main/application.cpp:1241 msgid "Manage user scripts" msgstr "Управљање корисничким скриптама" #: main/application.cpp:1365 msgid "" "The requested action would make the subtitle and its translation share the " "same file, possibly resulting in loss of information when saving.\n" "Are you sure you want to continue?" msgstr "" "Тражена радња ће учинити да титл и његов превод деле исти фајл, што може " "довести до губитка података при снимању.\n" "Желите ли да наставите?" #: main/application.cpp:1366 msgid "Conflicting Subtitle Files" msgstr "Конфликтни фајлови титла" #: main/application.cpp:1488 msgid "" "Could not parse the subtitle file.
This may have been caused by " "usage of the wrong encoding.
" msgstr "" "Не могу да рашчланим фајл титла.
То може бити проузроковано " "коришћењем погрешног кодирања.
" #: main/application.cpp:1519 msgid "There was an error saving the subtitle." msgstr "Дошло је до грешке при снимању титла." #: main/application.cpp:1561 main/application.cpp:1770 msgid "" "Currently opened translation subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Тренутно отворени преведени титл има несачуване измене.\n" "Желите ли да их сачувате?" #: main/application.cpp:1562 main/application.cpp:1771 msgid "Close Translation Subtitle" msgstr "Затвори преведени титл" #: main/application.cpp:1574 msgid "" "Currently opened subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Тренутно отворени титл има несачуване измене.\n" "Желите ли да их сачувате?" #: main/application.cpp:1575 msgid "Close Subtitle" msgstr "Затвори титл" #: main/application.cpp:1678 msgctxt "@item:inmenu Display primary text in video player" msgid "Primary" msgstr "Главни" #: main/application.cpp:1679 msgctxt "@item:inmenu Display translation text in video player" msgid "Translation" msgstr "Превод" #: main/application.cpp:1689 msgid "Could not parse the subtitle file." msgstr "Не могу да рашчланим фајл титла." #: main/application.cpp:1728 msgid "There was an error saving the translation subtitle." msgstr "Дошло је до грешке при снимању преведеног титла." #: main/application.cpp:1864 msgid "Could not read the subtitle file to append." msgstr "Не могу да прочитам фајл титла за додавање." #: main/application.cpp:1916 msgid "Could not write the splitted subtitle file." msgstr "Не могу да упишем подељени фајл титла." #: main/application.cpp:1917 msgid "Could not write the splitted subtitle translation file." msgstr "Не могу да упишем подељени фајл преведеног титла." #: main/application.cpp:1935 msgid "The specified time does not split the subtitles." msgstr "Наведено време не дели титлове." #: main/application.cpp:1984 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted part was saved as %1." msgstr "" "Не могу да отворим нови прозор „Уређивача титла“.\n" "Подељени део је сачуван као %1." #: main/application.cpp:1989 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted parts were saved as %1 and %2." msgstr "" "Не могу да отворим нови прозор „Уређивача титла“.\n" "Подељени делови су сачувани као %1 и %2." #: main/application.cpp:2077 msgid "Go to Line" msgstr "Иди на ред" #: main/application.cpp:2077 msgid "&Go to line:" msgstr "&Иди на ред:" #: main/application.cpp:2389 msgid "Can not perform sort on selection with multiple ranges." msgstr "Не могу да урадим разврставање избора са вишеструким опсезима." #: main/application.cpp:2499 msgid "The reference subtitle must have more than one line to proceed." msgstr "Референтни титл мора имати више од једног реда да би радио." #: main/application.cpp:2511 msgid "Could not parse the reference subtitle file." msgstr "Не могу да рашчланим фајл референтног титла." #: main/application.cpp:2618 main/dialogs/translatedialog.cpp:31 msgid "Translate" msgstr "Преведи" #: main/application.cpp:2619 msgid "Translating text (%1 to %2)..." msgstr "Преводим текст (%1 у %2)..." #: main/application.cpp:2628 msgid "Translating primary text (%1 to %2)..." msgstr "Преводим главни текст (%1 у %2)..." #: main/application.cpp:2629 msgid "Translating secondary text (%1 to %2)..." msgstr "Преводим секундарни текст (%1 у %2)..." #: main/application.cpp:2661 msgid "" "Unable to perform texts synchronization (sent and received lines count do " "not match)." msgstr "" "Не могу да урадим усклађивање текстова (број послатих и примљених редова " "није исти)." #: main/application.cpp:2670 msgid "Translate Primary Text" msgstr "Преведи главни текст" #: main/application.cpp:2671 msgid "Translate Secondary Text" msgstr "Преведи секундарни текст" #: main/application.cpp:2687 msgid "" "There was an error performing the translation:\n" "\n" "%1" msgstr "" "Грешка током превођења:\n" "\n" "%1" #: main/application.cpp:2740 msgid "Open Video" msgstr "Отвори видео" #: main/application.cpp:2873 main/application.cpp:2911 msgid "" "Continuing would result in loss of timing information for some lines.\n" "Are you sure you want to continue?" msgstr "" "Настављање ће довести до губитка времена на неким редовима.\n" "Желите ли да наставите?" #: main/application.cpp:2929 msgid "Open AudioLevels" msgstr "Отвори аудио нивое" #: main/application.cpp:3035 msgid "modified" msgstr "измењен" #: main/application.cpp:3039 main/application.cpp:3050 msgid "Untitled" msgstr "Безимени" #: main/application.cpp:3041 msgid "Untitled Translation" msgstr "Безимени превод" #: main/application.cpp:3149 msgid "Pause" msgstr "Паузирај" #: main/application.cpp:3190 msgid "Seek backwards 1 second" msgid_plural "Seek backwards %1 seconds" msgstr[0] "Тражи уназад %1 секунду" msgstr[1] "Тражи уназад %1 секунде" msgstr[2] "Тражи уназад %1 секунди" msgstr[3] "Тражи уназад 1 секунду" #: main/application.cpp:3196 msgid "Seek forwards 1 second" msgid_plural "Seek forwards %1 seconds" msgstr[0] "Тражи унапред %1 секунду" msgstr[1] "Тражи унапред %1 секунде" msgstr[2] "Тражи унапред %1 секунди" msgstr[3] "Тражи унапред 1 секунду" #: main/application.cpp:3211 main/application.cpp:3223 msgid "Shift %21 Millisecond" msgid_plural "Shift %2%1 Milliseconds" msgstr[0] "Помери %21 милисекунду" msgstr[1] "Помери %2%1 милисекунде" msgstr[2] "Помери %2%1 милисекунди" msgstr[3] "Помери %2%1 милисекунду" #: main/application.cpp:3216 main/application.cpp:3228 msgid "Shift selected lines %21 millisecond" msgid_plural "Shift selected lines %2%1 milliseconds" msgstr[0] "Померај изабраних редова %21 милисекунду" msgstr[1] "Померај изабраних редова %2%1 милисекунде" msgstr[2] "Померај изабраних редова %2%1 милисекунди" msgstr[3] "Померај изабраних редова %2%1 милисекунду" #: main/configdialog.cpp:46 msgid "Configure" msgstr "Подешавања" #: main/configdialog.cpp:54 msgctxt "@title General settings" msgid "General" msgstr "Општа" #: main/configdialog.cpp:55 msgid "General Settings" msgstr "Опште поставке" #: main/configdialog.cpp:59 msgctxt "@title Error checks settings" msgid "Error Checks" msgstr "Провере грешака" #: main/configdialog.cpp:60 msgid "Error Checks Settings" msgstr "Поставке провере грешака" #: main/configdialog.cpp:64 msgctxt "@title Spelling settings" msgid "Spelling" msgstr "Правопис" #: main/configdialog.cpp:65 msgid "Spelling Settings" msgstr "Поставке правописа" #: main/configdialog.cpp:69 msgctxt "@title Player settings" msgid "Player" msgstr "Плејер" #: main/configdialog.cpp:70 msgid "Player Settings" msgstr "Поставке плејера" #: main/configdialog.cpp:82 msgctxt "@title Player backend settings" msgid "%1 Backend Settings" msgstr "%1 поставке" #: main/configs/errorsconfigwidget.cpp:37 msgctxt "@title:group" msgid "Texts" msgstr "Текстови" #: main/configs/errorsconfigwidget.cpp:40 msgid "Maximum number of characters:" msgstr "Максималан број знакова:" #: main/configs/errorsconfigwidget.cpp:45 #: main/dialogs/smarttextsadjustdialog.cpp:40 msgid " characters" msgstr " знакова" #: main/configs/errorsconfigwidget.cpp:48 msgid "Maximum number of lines:" msgstr "Максималан број редова:" #: main/configs/errorsconfigwidget.cpp:53 msgid " lines" msgstr " редова" #: main/configs/errorsconfigwidget.cpp:56 msgctxt "@title:group" msgid "Absolute Durations" msgstr "Апсолутна трајања" #: main/configs/errorsconfigwidget.cpp:59 #: main/configs/errorsconfigwidget.cpp:78 msgid "Minimum duration:" msgstr "Минимално трајање:" #: main/configs/errorsconfigwidget.cpp:64 #: main/configs/errorsconfigwidget.cpp:72 #: main/configs/generalconfigwidget.cpp:52 #: main/configs/generalconfigwidget.cpp:66 #: main/configs/generalconfigwidget.cpp:74 #: main/dialogs/fixoverlappingtimesdialog.cpp:37 msgid " msecs" msgstr " ms" #: main/configs/errorsconfigwidget.cpp:67 #: main/configs/errorsconfigwidget.cpp:86 msgid "Maximum duration:" msgstr "Максимално трајање:" #: main/configs/errorsconfigwidget.cpp:75 msgctxt "@title:group" msgid "Relative Durations" msgstr "Релативна трајања" #: main/configs/errorsconfigwidget.cpp:83 #: main/configs/errorsconfigwidget.cpp:91 msgid " msecs/character" msgstr " ms/знаку" #: main/configs/errorsconfigwidget.cpp:93 msgctxt "@title:group" msgid "Behavior" msgstr "Понашање" #: main/configs/errorsconfigwidget.cpp:96 msgid "Automatically clear fixed errors" msgstr "Аутоматски очисти сређене грешке" #: main/configs/generalconfigwidget.cpp:38 #: main/configs/playerconfigwidget.cpp:44 #: player/mplayer/mplayerconfigwidget.cpp:37 msgctxt "@title:group General settings" msgid "General" msgstr "Опште" #: main/configs/generalconfigwidget.cpp:41 msgid "Default encoding for opening subtitles:" msgstr "Подразумевано кодирање код отварања титла:" #: main/configs/generalconfigwidget.cpp:47 msgid "On line double click, jump to show time minus:" msgstr "При двоклику на ред, скочи на време приказа минус:" #: main/configs/generalconfigwidget.cpp:55 msgid "Automatically load video file when opening subtitle" msgstr "Аутоматски учитај видео фајл при отварању титла" #: main/configs/generalconfigwidget.cpp:58 msgctxt "@title:group" msgid "Quick Actions" msgstr "Брзе радње" #: main/configs/generalconfigwidget.cpp:61 msgid "Time shift for selected lines:" msgstr "Померај времена за изабране редове:" #: main/configs/generalconfigwidget.cpp:69 msgid "Compensation for captured video times:" msgstr "Компензација за ухваћена времена видеа:" #: main/configs/playerconfigwidget.cpp:47 msgid "Player backend:" msgstr "Програм плејера:" #: main/configs/playerconfigwidget.cpp:53 msgid "Jump length on seek:" msgstr "Скок при премотавању:" #: main/configs/playerconfigwidget.cpp:58 msgid " secs" msgstr " секунди" #: main/configs/playerconfigwidget.cpp:61 main/playerwidget.cpp:452 msgid "Show editable position control" msgstr "Прикажи измењиву контролу позиције" #: main/configs/playerconfigwidget.cpp:64 msgctxt "@title:group" msgid "Subtitles" msgstr "Титлови" #: main/configs/playerconfigwidget.cpp:67 msgctxt "@label:chooser The font family name" msgid "Font family:" msgstr "Фонт:" #: main/configs/playerconfigwidget.cpp:72 msgid "Font size:" msgstr "Величина:" #: main/configs/playerconfigwidget.cpp:77 msgid " points" msgstr " тачака" #: main/configs/playerconfigwidget.cpp:80 msgid "Primary color:" msgstr "Главна боја:" #: main/configs/playerconfigwidget.cpp:85 msgid "Outline color:" msgstr "Боја оивичења:" #: main/configs/playerconfigwidget.cpp:91 msgid "Outline width:" msgstr "Ширина оивичења:" #: main/configs/playerconfigwidget.cpp:96 msgid " pixels" msgstr " тачака" #: main/configs/playerconfigwidget.cpp:99 msgctxt "@title:group" msgid "Subtitles Preview" msgstr "Преглед титлова" #: main/configs/playerconfigwidget.cpp:109 msgctxt "Text for previewing the subtitles font settings" msgid "

The Quick Brown Fox
Jumps Over The Lazy Dog

" msgstr "

Љубазни фењерџија чађавог
лица хоће да ми покаже штос

" #: main/currentlinewidget.cpp:65 msgid "Show" msgstr "Појављивање" #: main/currentlinewidget.cpp:70 msgid "Hide" msgstr "Нестајање" #: main/currentlinewidget.cpp:75 msgid "Duration" msgstr "Трајање" #: main/currentlinewidget.cpp:253 main/currentlinewidget.cpp:259 msgid "No current line" msgstr "Нема текућег реда" #: main/currentlinewidget.cpp:383 msgid "Current line:" msgstr "Текући ред:" #: main/currentlinewidget.cpp:408 msgid "1 character" msgid_plural "%1 characters" msgstr[0] "%1 знак" msgstr[1] "%1 знака" msgstr[2] "%1 знакова" msgstr[3] "1 знак" #: main/dialogs/actionwitherrortargetsdialog.cpp:74 msgid "Available errors" msgstr "Доступне грешке" #: main/dialogs/actionwitherrortargetsdialog.cpp:105 msgid "Select None" msgstr "Ништа изабрано" #: main/dialogs/actionwithtargetdialog.cpp:131 msgid "Target >>" msgstr "Одредиште >>" #: main/dialogs/actionwithtargetdialog.cpp:131 #: main/dialogs/actionwithtargetdialog.cpp:149 msgid "Target <<" msgstr "Одредиште <<" #: main/dialogs/actionwithtargetdialog.cpp:164 msgid "All lines" msgstr "Сви редови" #: main/dialogs/actionwithtargetdialog.cpp:165 main/utils/errorfinder.cpp:48 msgid "Selected lines" msgstr "Изабрани редови" #: main/dialogs/actionwithtargetdialog.cpp:166 msgid "All lines from first selected" msgstr "Сви редови од првог означеног" #: main/dialogs/actionwithtargetdialog.cpp:167 msgid "All lines up to last selected" msgstr "Сви редови до последњег означеног" #: main/dialogs/actionwithtargetdialog.cpp:257 main/utils/finder.cpp:63 #: main/utils/replacer.cpp:61 msgid "Both subtitles" msgstr "Оба титла" #: main/dialogs/actionwithtargetdialog.cpp:260 main/utils/finder.cpp:65 #: main/utils/replacer.cpp:63 msgid "Primary subtitle" msgstr "Главни титл" #: main/dialogs/actionwithtargetdialog.cpp:263 main/utils/finder.cpp:67 #: main/utils/replacer.cpp:65 msgid "Translation subtitle" msgstr "Преведени титл" #: main/dialogs/actionwithtargetdialog.h:78 msgid "Apply To" msgstr "Примени на" #: main/dialogs/adjusttimesdialog.cpp:32 msgid "Adjust" msgstr "Подеси" #: main/dialogs/adjusttimesdialog.cpp:34 msgctxt "@title:group" msgid "New Times" msgstr "Нова времена" #: main/dialogs/adjusttimesdialog.cpp:39 msgid "First spoken line:" msgstr "Први изговорени ред:" #: main/dialogs/adjusttimesdialog.cpp:45 msgid "Last spoken line:" msgstr "Последњи изговорени ред:" #: main/dialogs/autodurationsdialog.cpp:38 #: main/dialogs/changeframeratedialog.cpp:36 #: main/dialogs/fixoverlappingtimesdialog.cpp:34 #: main/dialogs/fixpunctuationdialog.cpp:33 #: main/dialogs/smarttextsadjustdialog.cpp:34 #: main/dialogs/splitsubtitledialog.cpp:38 main/dialogs/translatedialog.cpp:33 msgctxt "@title:group" msgid "Settings" msgstr "Поставке" #: main/dialogs/autodurationsdialog.cpp:46 msgid "Milliseconds per line:" msgstr "Милисекунди по реду:" #: main/dialogs/autodurationsdialog.cpp:55 msgid "Milliseconds per word:" msgstr "Милисекунди по речи:" #: main/dialogs/autodurationsdialog.cpp:64 msgid "Milliseconds per character:" msgstr "Милисекунди по знаку:" #: main/dialogs/autodurationsdialog.cpp:68 #: main/dialogs/durationlimitsdialog.cpp:45 msgid "Prevent overlapping" msgstr "Спречи преклапање" #: main/dialogs/autodurationsdialog.cpp:71 msgctxt "@title:group" msgid "Duration Calculation" msgstr "Прорачун трајања" #: main/dialogs/autodurationsdialog.cpp:77 msgid "Use primary text" msgstr "Користи главни текст" #: main/dialogs/autodurationsdialog.cpp:78 msgid "Use translation text" msgstr "Користи преведени текст" #: main/dialogs/autodurationsdialog.cpp:79 msgid "Calculate both and use maximum" msgstr "Израчунај оба и користи максимум" #: main/dialogs/changeframeratedialog.cpp:45 msgid "Current frame rate:" msgstr "Тренутна брзина кадрова:" #: main/dialogs/changeframeratedialog.cpp:54 msgid "New frame rate:" msgstr "Нова брзина кадрова:" #: main/dialogs/changetextscasedialog.cpp:33 msgid "Change Case" msgstr "Промени величину слова" #: main/dialogs/changetextscasedialog.cpp:35 msgctxt "@title:group" msgid "Change To" msgstr "Промени у" #: main/dialogs/changetextscasedialog.cpp:39 msgid "Lower case" msgstr "Мала слова" #: main/dialogs/changetextscasedialog.cpp:44 msgid "Upper case" msgstr "Велика слова" #: main/dialogs/changetextscasedialog.cpp:48 msgid "Title case" msgstr "Величина наслова" #: main/dialogs/changetextscasedialog.cpp:52 msgid "Sentence case" msgstr "Величина реченице" #: main/dialogs/changetextscasedialog.cpp:56 msgid "Convert to lower case first" msgstr "Прво пребаци у мала слова" #: main/dialogs/checkerrorsdialog.cpp:31 msgid "Check Errors" msgstr "Провери грешке" #: main/dialogs/checkerrorsdialog.cpp:33 msgctxt "@title:group" msgid "Errors to Check" msgstr "Грешке за проверу" #: main/dialogs/checkerrorsdialog.cpp:36 msgctxt "@title:group Miscellaneous settings" msgid "Miscellaneous" msgstr "Разно" #: main/dialogs/checkerrorsdialog.cpp:39 msgid "Clear other errors" msgstr "Очисти остале грешке" #: main/dialogs/checkerrorsdialog.cpp:43 msgid "Clear user marks" msgstr "Очисти корисничке маркере" #: main/dialogs/clearerrorsdialog.cpp:32 msgid "Clear Errors" msgstr "Очисти грешке" #: main/dialogs/clearerrorsdialog.cpp:34 msgctxt "@title:group" msgid "Errors to Clear" msgstr "Грешке за чишћење" #: main/dialogs/durationlimitsdialog.cpp:35 msgctxt "@title:group" msgid "Minimum Duration" msgstr "Минимално трајање" #: main/dialogs/durationlimitsdialog.cpp:41 msgid "Expand duration to:" msgstr "Продужи трајање на:" #: main/dialogs/durationlimitsdialog.cpp:48 msgctxt "@title:group" msgid "Maximum Duration" msgstr "Максимално трајање" #: main/dialogs/durationlimitsdialog.cpp:54 msgid "Shrink duration to:" msgstr "Скрати трајање на:" #: main/dialogs/fixoverlappingtimesdialog.cpp:43 msgid "Minimum interval between lines:" msgstr "Најмањи размак између редова:" #: main/dialogs/fixpunctuationdialog.cpp:31 msgid "Fix Punctuation" msgstr "Среди интерпункцију" #: main/dialogs/fixpunctuationdialog.cpp:36 msgid "Fix and cleanup spaces" msgstr "Среди и очисти размаке" #: main/dialogs/fixpunctuationdialog.cpp:40 msgid "Fix quotes and double quotes" msgstr "Среди наводе и двоструке наводе" #: main/dialogs/fixpunctuationdialog.cpp:44 msgid "Fix English 'I' pronoun" msgstr "Среди енглеско „I“" #: main/dialogs/fixpunctuationdialog.cpp:48 msgid "Add ellipisis indicating non finished lines" msgstr "Додај три тачке за обележавање недовршених редова" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line Before Current" msgstr "Уметни ред пре текућег" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line After Current" msgstr "Уметни ред после текућег" #: main/dialogs/insertlinedialog.cpp:29 msgid "Insert Into" msgstr "Убаци у" #: main/dialogs/joinsubtitlesdialog.cpp:40 msgid "Shift subtitle forwards before append" msgstr "Померај титла унапред пре додавања" #: main/dialogs/joinsubtitlesdialog.cpp:47 #: main/dialogs/splitsubtitledialog.cpp:44 msgid "Set from video length" msgstr "Постави из дужине видеа" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Subtitle" msgstr "Отвори титл" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Translation Subtitle" msgstr "Отвори преведени титл" #: main/dialogs/opensubtitledialog.cpp:46 #: main/dialogs/savesubtitledialog.cpp:80 #: main/dialogs/selectablesubtitledialog.cpp:67 msgid "Encoding:" msgstr "Кодирање:" #: main/dialogs/opensubtitledialog.cpp:73 msgid "All Supported" msgstr "Све подржано" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove Selected Lines" msgstr "Уклони изабране редове" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove From" msgstr "Уклони из" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Subtitle" msgstr "Сачувај титл" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Translation Subtitle" msgstr "Сачувај преведени титл" #: main/dialogs/savesubtitledialog.cpp:69 msgid "EOL:" msgstr "КрЛин:" #: main/dialogs/savesubtitledialog.cpp:145 msgid "" "A file named \"%1\" already exists. Are you sure you want to overwrite it?" msgstr "Фајл по имену „%1“ већ постоји. Желите ли заиста да га пребришете?" #: main/dialogs/savesubtitledialog.cpp:148 msgid "Overwrite File?" msgstr "Пребрисати фајл?" #: main/dialogs/savesubtitledialog.cpp:149 msgid "Overwrite" msgstr "Пребриши" #: main/dialogs/selectablesubtitledialog.cpp:51 msgid "Path:" msgstr "Путања:" #: main/dialogs/selectablesubtitledialog.cpp:56 msgid "Select subtitle" msgstr "Изабери титл" #: main/dialogs/selectablesubtitledialog.h:54 msgid "Subtitle" msgstr "Титл" #: main/dialogs/shifttimesdialog.cpp:32 msgid "Shift" msgstr "Померај" #: main/dialogs/shifttimesdialog.cpp:34 msgctxt "@title:group" msgid "Shifting" msgstr "Померај" #: main/dialogs/shifttimesdialog.cpp:38 msgid "Forwards (+)" msgstr "Унапред (+)" #: main/dialogs/shifttimesdialog.cpp:39 msgid "Backwards (–)" msgstr "Уназад (-)" #: main/dialogs/smarttextsadjustdialog.cpp:43 msgid "Minimum length for line break:" msgstr "Минимална дужина за прелом реда:" #: main/dialogs/splitsubtitledialog.cpp:36 msgid "Split Subtitle" msgstr "Раздвоји титл" #: main/dialogs/splitsubtitledialog.cpp:49 msgid "Split time:" msgstr "Време раздвајања:" #: main/dialogs/splitsubtitledialog.cpp:53 msgid "Shift new part backwards after split" msgstr "Помери нови део уназад након раздвајања" #: main/dialogs/syncsubtitlesdialog.cpp:32 msgid "Synchronize with Subtitle" msgstr "Синхронизуј са титлом" #: main/dialogs/syncsubtitlesdialog.cpp:34 msgid "Reference Subtitle" msgstr "Референтни титл" #: main/dialogs/syncsubtitlesdialog.cpp:36 msgctxt "@title:group" msgid "Synchronization Mode" msgstr "Режим синхронизације" #: main/dialogs/syncsubtitlesdialog.cpp:39 msgid "Adjust to reference's first and last lines" msgstr "Подеси према првом и последњем реду референтног титла" #: main/dialogs/syncsubtitlesdialog.cpp:43 msgid "Copy timing information from reference line by line" msgstr "Копирај податке о временима из референтног титла ред по ред" #: main/dialogs/translatedialog.cpp:49 msgid "Input language:" msgstr "Улазни језик:" #: main/dialogs/translatedialog.cpp:66 msgid "Output language:" msgstr "Излазни језик:" #: main/errorsdialog.cpp:42 msgid "Subtitle Errors" msgstr "Грешке титла" #: main/errorsdialog.cpp:55 msgid "Clear Fixed Errors" msgstr "Очисти сређене грешке" #: main/errorsdialog.cpp:65 msgid "Settings..." msgstr "Поставке..." #: main/errorsdialog.cpp:121 msgid "Showing 1 line with errors" msgid_plural "Showing %1 lines with errors" msgstr[0] "Приказујем %1 ред са грешкама" msgstr[1] "Приказујем %1 реда са грешкама" msgstr[2] "Приказујем %1 редова са грешкама" msgstr[3] "Приказујем ред са грешкама" #: main/errorsdialog.cpp:124 msgid "1 total error" msgid_plural "%1 total errors" msgstr[0] "%1 грешка" msgstr[1] "%1 грешке" msgstr[2] "%1 грешака" msgstr[3] "1 грешка" #: main/errorsdialog.cpp:125 msgid "1 user mark" msgid_plural "%1 user marks" msgstr[0] "%1 кориснички маркер" msgstr[1] "%1 корисничка маркера" msgstr[2] "%1 корисничких маркера" msgstr[3] "1 кориснички маркер" #: main/errorswidget.cpp:491 msgid "Line Errors" msgstr "Грешке реда" #: main/errorswidget.cpp:492 msgid "Count" msgstr "Број" #: main/errorswidget.cpp:493 msgid "Marked" msgstr "Маркирано" #: main/errorswidget.cpp:509 msgid "yes" msgstr "да" #: main/errorswidget.cpp:510 msgid "no" msgstr "не" #: main/errorswidget.cpp:517 msgid "Line %1" msgstr "Ред %1" #: main/errorswidget.cpp:717 msgid "Expand All" msgstr "Рашири све" #: main/errorswidget.cpp:718 msgid "Collapse All" msgstr "Сажми све" #: main/errorswidget.cpp:722 msgid "Clear Selected Marks" msgstr "Очисти изабране маркере" #: main/errorswidget.cpp:723 msgid "Clear Selected Errors" msgstr "Очисти изабране грешке" #: main/errorswidget.cpp:729 msgid "Clear Fixed Selection" msgstr "Очисти сређени избор" #: main/lineswidget.cpp:204 msgid "Observations:" msgstr "Запажања:" #: main/lineswidget.cpp:232 msgctxt "@title:column Subtitle line number" msgid "Line" msgstr "Ред" #: main/lineswidget.cpp:233 msgctxt "@title:column" msgid "Show Time" msgstr "Време појављивања" #: main/lineswidget.cpp:234 msgctxt "@title:column" msgid "Hide Time" msgstr "Време нестајања" #: main/lineswidget.cpp:235 msgctxt "@title:column Subtitle line (primary) text" msgid "Text" msgstr "Текст" #: main/lineswidget.cpp:236 msgctxt "@title:column Subtitle line translation text" msgid "Translation" msgstr "Превод" #: main/lineswidget.cpp:1141 msgid "Texts" msgstr "Текстови" #: main/lineswidget.cpp:1162 msgid "Styles" msgstr "Стилови" #: main/lineswidget.cpp:1166 widgets/simplerichtextedit.cpp:119 msgctxt "@action:inmenu Toggle bold style" msgid "Bold" msgstr "Подебљано" #: main/lineswidget.cpp:1173 widgets/simplerichtextedit.cpp:125 msgctxt "@action:inmenu Toggle italic style" msgid "Italic" msgstr "Курзив" #: main/lineswidget.cpp:1180 widgets/simplerichtextedit.cpp:131 msgctxt "@action:inmenu Toggle underline style" msgid "Underline" msgstr "Подвучено" #: main/lineswidget.cpp:1187 widgets/simplerichtextedit.cpp:137 msgctxt "@action:inmenu Toggle strike through style" msgid "Strike Through" msgstr "Прецртано" #: main/lineswidget.cpp:1194 msgid "Times" msgstr "Времена" #: main/lineswidget.cpp:1196 msgid "Shift +%1 Milliseconds" msgstr "Помери +%1 милисекунди" #: main/lineswidget.cpp:1197 msgid "Shift -%1 Milliseconds" msgstr "Помери -%1 милисекунди" #: main/lineswidget.cpp:1207 msgid "Errors" msgstr "Грешке" #: main/lineswidget.cpp:1208 msgid "Mark" msgstr "Маркирај" #: main/main.cpp:43 msgid "Subtitle Composer" msgstr "Састављач титла (Subtitle Composer)" #: main/main.cpp:45 msgid "A KDE subtitle editor." msgstr "Уређивач титлова за КДЕ." #: main/main.cpp:47 msgid "(C) 2007-2009 Sergio Pistone" msgstr "© 2007-2009 Серђо Пистоне (Sergio Pistone)" #: main/main.cpp:51 msgid "Sergio Pistone" msgstr "Серђо Пистоне (Sergio Pistone)" #: main/main.cpp:52 msgid "Author & maintainer" msgstr "Аутор и одржавалац" #: main/main.cpp:61 msgid "Open location as primary subtitle" msgstr "Отвори локацију као главни титл" #: main/main.cpp:62 msgid "Open location as translation subtitle" msgstr "Отвори локацију као преведени титл" #: main/playerwidget.cpp:103 msgid "Position" msgstr "Позиција" #: main/playerwidget.cpp:111 msgid "Length" msgstr "Дужина" #: main/playerwidget.cpp:116 msgid "FPS" msgstr "Кадрова у сек." #: main/playerwidget.cpp:704 main/playerwidget.cpp:705 #: main/playerwidget.cpp:706 main/playerwidget.cpp:778 #: main/playerwidget.cpp:795 main/playerwidget.cpp:802 msgid "Unknown" msgstr "Непознат" #: main/playerwidget.cpp:715 msgid "There was an error opening file
%1
" msgstr "Дошло је до грешке при отварању фајла
%1
" #: main/playerwidget.cpp:741 msgid "Unexpected error while playing file." msgstr "Неочекивана грешка при пуштању фајла." #: main/scripting/scriptsmanager.cpp:70 msgid "Installed Scripts" msgstr "Инсталиране скрипте" #: main/scripting/scriptsmanager.cpp:88 msgid "Information" msgstr "" #: main/scripting/scriptsmanager.cpp:94 msgid "Warning" msgstr "" #: main/scripting/scriptsmanager.cpp:100 #, fuzzy msgid "Error" msgstr "Грешке" #: main/scripting/scriptsmanager.cpp:113 msgid "Scripts Manager" msgstr "Менаџер скрипти" #: main/scripting/scriptsmanager.cpp:129 msgid "Create..." msgstr "Направи..." #: main/scripting/scriptsmanager.cpp:130 msgid "Creates a new script file." msgstr "Прави нови фајл скрипте." #: main/scripting/scriptsmanager.cpp:135 msgid "Add..." msgstr "Додај..." #: main/scripting/scriptsmanager.cpp:136 msgid "Copies an existing script from a specified location." msgstr "Копира постојећу скрипту са наведене локације." #: main/scripting/scriptsmanager.cpp:142 msgid "Sends the selected script to the trash." msgstr "Шаље изабрану скрипту у смеће." #: main/scripting/scriptsmanager.cpp:147 msgid "Edit" msgstr "Уреди" #: main/scripting/scriptsmanager.cpp:148 msgid "Opens the selected script with an external editor." msgstr "Отвара изабрану скрипту у спољашњем уређивачу." #: main/scripting/scriptsmanager.cpp:154 msgid "Run" msgstr "Покрени" #: main/scripting/scriptsmanager.cpp:155 msgid "Executes the selected script." msgstr "Извршава изабрану скрипту." #: main/scripting/scriptsmanager.cpp:160 msgid "Refresh" msgstr "Освежи" #: main/scripting/scriptsmanager.cpp:161 msgid "Reloads the installed scripts list." msgstr "Освежава списак инсталираних скрипти." #: main/scripting/scriptsmanager.cpp:219 main/scripting/scriptsmanager.cpp:301 msgid "" "You must enter an unused name to continue.\n" "Would you like to enter another name?" msgstr "" "Морате унети име које није већ у употреби.\n" "Желите ли да унесете друго име?" #: main/scripting/scriptsmanager.cpp:220 main/scripting/scriptsmanager.cpp:302 msgid "Name Already Used" msgstr "Име се већ користи" #: main/scripting/scriptsmanager.cpp:226 msgid "Create New Script" msgstr "Направи нову скрипту" #: main/scripting/scriptsmanager.cpp:226 main/scripting/scriptsmanager.cpp:308 msgid "Script name:" msgstr "Име скрипте:" #: main/scripting/scriptsmanager.cpp:239 msgid "There was an error creating the file %1." msgstr "Грешка при стварању фајла %1." #: main/scripting/scriptsmanager.cpp:283 msgid "Select Existing Script" msgstr "Изабери постојећу скрипту" #: main/scripting/scriptsmanager.cpp:308 msgid "Rename Script" msgstr "Преименуј скрипту" #: main/scripting/scriptsmanager.cpp:322 msgid "There was an error opening the file %1." msgstr "Грешка при отварању фајла %1." #: main/scripting/scriptsmanager.cpp:331 msgid "There was an error copying the file to %1." msgstr "Грешка при копирању фајла у %1." #: main/scripting/scriptsmanager.cpp:350 msgid "Do you really want to send file %1 to the trash?" msgstr "Заиста желите да фајл %1 пошаљете у смеће?" #: main/scripting/scriptsmanager.cpp:351 msgid "Move to Trash" msgstr "Премести у смеће" #: main/scripting/scriptsmanager.cpp:359 msgid "There was an error removing the file %1." msgstr "Грешка при уклањању фајла %1." #: main/scripting/scriptsmanager.cpp:377 msgid "Could not launch external editor.\n" msgstr "Не могу да покренем спољашњи уређивач.\n" #: main/scripting/scriptsmanager.cpp:441 main/scripting/scriptsmanager.cpp:448 msgid "Error Running Script" msgstr "Грешка при покретању скрипте" #: main/scripting/scriptsmanager.cpp:462 msgid "Tools" msgstr "Алатке" #: main/utils/errorfinder.cpp:40 main/utils/errorfinder.cpp:221 #: main/utils/errorfinder.cpp:244 msgid "Find Error" msgstr "Нађи грешку" #: main/utils/errorfinder.cpp:42 msgid "Errors to Find" msgstr "Грешке за налажење" #: main/utils/errorfinder.cpp:45 msgid "Options" msgstr "Опције" #: main/utils/errorfinder.cpp:51 msgid "From current line" msgstr "Од текућег реда" #: main/utils/errorfinder.cpp:55 msgid "Find backwards" msgstr "Тражи уназад" #: main/utils/errorfinder.cpp:216 main/utils/finder.cpp:298 #: main/utils/replacer.cpp:258 msgid "" "Beginning of selection reached.\n" "Continue from the end?" msgstr "" "Дошао сам до почетка избора.\n" "Да наставим од краја?" #: main/utils/errorfinder.cpp:217 main/utils/finder.cpp:299 #: main/utils/replacer.cpp:259 msgid "" "Beginning of subtitle reached.\n" "Continue from the end?" msgstr "" "Дошао сам до почетка титла.\n" "Да наставим од краја?" #: main/utils/errorfinder.cpp:219 main/utils/finder.cpp:301 #: main/utils/replacer.cpp:261 msgid "" "End of selection reached.\n" "Continue from the beginning?" msgstr "" "Дошао сам до краја избора.\n" "Да наставим од почетка?" #: main/utils/errorfinder.cpp:220 main/utils/finder.cpp:302 #: main/utils/replacer.cpp:262 main/utils/speller.cpp:143 msgid "" "End of subtitle reached.\n" "Continue from the beginning?" msgstr "" "Дошао сам до краја титла.\n" "Да наставим од почетка?" #: main/utils/errorfinder.cpp:243 msgid "No errors matching given criteria found!" msgstr "За задате услове нема одговарајућих грешака!" #: main/utils/finder.cpp:55 msgid "Find In" msgstr "Нађи у" #: main/utils/finder.cpp:278 main/utils/replacer.cpp:234 msgid "No instances of '%1' found!" msgstr "„%1“ се нигде не појављује!" #: main/utils/finder.cpp:279 main/utils/finder.cpp:303 msgid "Find" msgstr "Нађи" #: main/utils/kreplace.cpp:49 main/utils/kreplace.cpp:53 #: main/utils/replacer.cpp:172 main/utils/replacer.cpp:229 #: main/utils/replacer.cpp:235 main/utils/replacer.cpp:263 msgid "Replace" msgstr "Замени" #: main/utils/kreplace.cpp:51 msgid "&All" msgstr "&Све" #: main/utils/kreplace.cpp:52 msgid "&Skip" msgstr "&Прескочи" #: main/utils/kreplace.cpp:63 msgid "Replace '%1' with '%2'?" msgstr "Заменити „%1“ са „%2“?" #: main/utils/kreplace.cpp:139 main/utils/kreplace.cpp:406 msgid "No text was replaced." msgstr "Ништа није замењено." #: main/utils/kreplace.cpp:141 main/utils/kreplace.cpp:408 #: main/utils/replacer.cpp:228 main/utils/replacer.cpp:255 msgid "1 replacement done." msgid_plural "%1 replacements done." msgstr[0] "Учињена је %1 замена." msgstr[1] "Учињене су %1 замене." msgstr[2] "Учињено је %1 замена." msgstr[3] "Учињена је једна замена." #: main/utils/kreplace.cpp:413 msgid "Beginning of document reached." msgstr "Дошао сам до почетка документа." #: main/utils/kreplace.cpp:415 msgid "End of document reached." msgstr "Дошао сам до краја документа." #: main/utils/kreplace.cpp:422 msgid "Do you want to restart search from the end?" msgstr "Желите ли да поновите тражење са краја?" #: main/utils/kreplace.cpp:423 msgid "Do you want to restart search at the beginning?" msgstr "Желите ли да поновите тражење од почетка?" #: main/utils/kreplace.cpp:425 msgid "Restart" msgstr "Поново покрени" #: main/utils/language.cpp:125 msgid "Automatic" msgstr "Аутоматски" #: main/utils/language.cpp:129 msgctxt "Official language of the Philippines, aka Filipino" msgid "Tagalog" msgstr "Тагалог" #: main/utils/replacer.cpp:53 msgid "Find/Replace In" msgstr "Нађи/Замени у" #: main/utils/speller.cpp:144 msgid "Spell Checking" msgstr "Провера правописа" #: main/utils/translator.cpp:167 msgid "Operation cancelled by user" msgstr "" #: main/utils/translator.cpp:270 main/utils/translator.cpp:280 msgid "Unexpected contents received from translation service" msgstr "Неочекиван садржај је примљен од сервиса за превођење" #: player/gstreamer/gstreamerbackend.cpp:543 #: player/mplayer/mplayerbackend.cpp:259 player/xine/xinebackend.cpp:278 msgid "Audio Stream #%1" msgstr "Аудио ток #%1" #: player/gstreamer/gstreamerconfigwidget.cpp:34 msgctxt "@title:group GStreamer sinks settings" msgid "Sinks" msgstr "Сливници" #: player/gstreamer/gstreamerconfigwidget.cpp:37 msgid "Audio sink:" msgstr "Аудио сливник:" #: player/gstreamer/gstreamerconfigwidget.cpp:46 msgid "Video sink:" msgstr "Видео сливник:" #: player/mplayer/mplayerconfigwidget.cpp:40 msgid "Executable path:" msgstr "Извршна путања:" #: player/mplayer/mplayerconfigwidget.cpp:43 msgid "Select the MPlayer executable" msgstr "Изаберите MPlayer програм" #: player/mplayer/mplayerconfigwidget.cpp:47 msgctxt "@title:group Video settings" msgid "Video" msgstr "Видео" #: player/mplayer/mplayerconfigwidget.cpp:50 msgid "Video output driver:" msgstr "Драјвер видео излаза:" #: player/mplayer/mplayerconfigwidget.cpp:58 msgid "Allow frame dropping" msgstr "Дозволи испуштање кадрова" #: player/mplayer/mplayerconfigwidget.cpp:61 msgid "Allow hard frame dropping" msgstr "Дозволи јако испуштање кадрова" #: player/mplayer/mplayerconfigwidget.cpp:64 msgctxt "@title:group Audio settings" msgid "Audio" msgstr "Аудио" #: player/mplayer/mplayerconfigwidget.cpp:67 msgid "Audio output driver:" msgstr "Драјвер аудио излаза:" #: player/mplayer/mplayerconfigwidget.cpp:75 msgid "A/V synchronization factor:" msgstr "Фактор A/V синхронизације:" #: player/mplayer/mplayerconfigwidget.cpp:83 msgid "Volume normalization" msgstr "Нормализација јачине" #: player/xine/xineconfigwidget.cpp:34 msgctxt "@title:group Xine drivers settings" msgid "Drivers" msgstr "Драјвери" #: player/xine/xineconfigwidget.cpp:37 msgid "Audio driver:" msgstr "Аудио драјвер:" #: player/xine/xineconfigwidget.cpp:45 msgid "Video driver:" msgstr "Видео драјвер:" #: widgets/simplerichtextedit.cpp:84 msgid "Cut" msgstr "Исеци" #: widgets/simplerichtextedit.cpp:90 msgid "Copy" msgstr "Копирај" #: widgets/simplerichtextedit.cpp:96 msgid "Paste" msgstr "Налепи" #: widgets/simplerichtextedit.cpp:102 msgid "Delete" msgstr "Обриши" #: widgets/simplerichtextedit.cpp:108 msgctxt "@action:inmenu Clear all text" msgid "Clear" msgstr "Очисти" #: widgets/simplerichtextedit.cpp:143 msgid "Check Spelling..." msgstr "Провери правопис..." #: widgets/simplerichtextedit.cpp:147 msgid "Auto Spell Check" msgstr "Аутоматска провера правописа" #: widgets/simplerichtextedit.cpp:152 msgid "Allow Tabulations" msgstr "Дозволи табулације" #: widgets/simplerichtextedit.cpp:491 msgid "Suggestions" msgstr "Предлози" #: widgets/simplerichtextedit.cpp:492 msgid "Ignore" msgstr "Игнориши" #: widgets/simplerichtextedit.cpp:493 msgid "Add to Dictionary" msgstr "Додај у речник" #: widgets/simplerichtextedit.cpp:497 msgid "No suggestions" msgstr "Нема предлога" #. i18n: file: main/subtitlecomposerui.rc:5 #. i18n: ectx: Menu (file) #: rc.cpp:3 msgid "&File" msgstr "&Фајл" #. i18n: file: main/subtitlecomposerui.rc:16 #. i18n: ectx: Menu (translation) #: rc.cpp:6 msgid "Translation" msgstr "Превод" #. i18n: file: main/subtitlecomposerui.rc:28 #. i18n: ectx: Menu (edit) #: rc.cpp:9 msgid "&Edit" msgstr "&Уређивање" #. i18n: file: main/subtitlecomposerui.rc:51 #. i18n: ectx: Menu (texts) #: rc.cpp:12 msgid "&Texts" msgstr "&Текстови" #. i18n: file: main/subtitlecomposerui.rc:62 #. i18n: ectx: Menu (styles) #: rc.cpp:15 msgid "St&yles" msgstr "&Стилови" #. i18n: file: main/subtitlecomposerui.rc:69 #. i18n: ectx: Menu (times) #: rc.cpp:18 msgid "T&imes" msgstr "В&ремена" #. i18n: file: main/subtitlecomposerui.rc:91 #. i18n: ectx: Menu (errors) #: rc.cpp:21 msgid "E&rrors" msgstr "&Грешке" #. i18n: file: main/subtitlecomposerui.rc:104 #. i18n: ectx: Menu (video) #: rc.cpp:24 msgid "&Video" msgstr "&Видео" #. i18n: file: main/subtitlecomposerui.rc:132 #. i18n: ectx: Menu (tools) #: rc.cpp:27 msgid "T&ools" msgstr "А&латке" #. i18n: file: main/subtitlecomposerui.rc:137 #. i18n: ectx: Menu (audiolevels) #: rc.cpp:30 msgid "&Audio Levels" msgstr "&Аудио нивои" #. i18n: file: main/subtitlecomposerui.rc:153 #. i18n: ectx: ToolBar (mainToolBar) #: rc.cpp:33 msgid "Main Toolbar" msgstr "Главна трака алатки" #. i18n: file: main/subtitlecomposerui.rc:165 #. i18n: ectx: ToolBar (editToolBar) #: rc.cpp:36 msgctxt "The toolbar name" msgid "Edit Toolbar" msgstr "Трака за уређивање" #: rc.cpp:37 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Слободан Симић" #: rc.cpp:38 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "simicsl@verat.net" #~ msgid "There was an error opening the audiolevels." #~ msgstr "Дошло је до грешке при отварању аудио нивоа." #~ msgid "Save AudioLevels" #~ msgstr "Сачувај аудио нивое" #~ msgid "There was an error saving the audiolevels." #~ msgstr "Дошло је до грешке при снимању аудио нивоа." #~ msgid "Toggle Line Mark" #~ msgstr "Мењај означеност линије" #~ msgctxt "@title:group" #~ msgid "Subtitles font" #~ msgstr "Фонт титлова" #~ msgid "Size:" #~ msgstr "Величина:" #~ msgid "Append to" #~ msgstr "Додај у" #~ msgid "1 mark" #~ msgid_plural "%1 marks" #~ msgstr[0] "%1 маркер" #~ msgstr[1] "%1 маркера" #~ msgstr[2] "%1 маркера" #~ msgstr[3] "1 маркер" #~ msgid "Line Issues" #~ msgstr "Проблеми са редом" #~ msgid "Marks" #~ msgstr "Маркери" #~ msgid "No line with errors found!" #~ msgstr "Нема линија са грешкама!" #~ msgid "Sort Lines" #~ msgstr "Поређај линије" #~ msgid "Apply Duration Limits" #~ msgstr "Примени ограничења трајања" #~ msgid "Smart Lines Adjust" #~ msgstr "Паметно подешавање линија" #~ msgid "Shift selected lines -%1 milliseconds" #~ msgstr "Померај изабраних линија -%1 милисекунди" #~ msgid "Automatic Durations..." #~ msgstr "Аутоматска трајања..." #~ msgid "Smart Lines Adjust..." #~ msgstr "Паметно подешавање линије..." #~ msgid "Adjust Subtitles" #~ msgstr "Подеси титлове" #~ msgid "Shift Subtitles" #~ msgstr "Померај титлова" subtitlecomposer-0.5.3/po/pl/0000755000175000001440000000000011206423743015364 5ustar sergiouserssubtitlecomposer-0.5.3/po/pl/CMakeLists.txt0000644000175000001440000000016611151345073020125 0ustar sergiousersFILE( GLOB _po_files *.po ) GETTEXT_PROCESS_PO_FILES( pl ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) subtitlecomposer-0.5.3/po/pl/subtitlecomposer.po0000755000175000001440000021532111206411600021323 0ustar sergiousers# translation of subtitlecomposer.po to Polish # This file is put in the public domain. # # Tomasz Argasiński , 2008, 2009. # Tomek Argasiński , 2009. # Tomek Argasiński , 2009. # Sergio Pistone , 2009. msgid "" msgstr "" "Project-Id-Version: subtitlecomposer\n" "Report-Msgid-Bugs-To: https://sourceforge.net/tracker/?" "atid=1005652&group_id=208427&func=browse\n" "POT-Creation-Date: 2009-05-25 00:41-0300\n" "PO-Revision-Date: 2009-05-24 17:14-0300\n" "Last-Translator: Sergio Pistone \n" "Language-Team: American English \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 0.3\n" "X-Poedit-Language: Polish\n" "X-Poedit-Country: POLAND\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%" "100<10 || n%100>=20) ? 1 : 2);\n" #: core/subtitleactions.cpp:62 msgid "Set Frame Rate" msgstr "Ustaw liczbę klatek na sekundę" #: core/subtitleactions.cpp:93 msgid "Insert Lines" msgstr "Wstaw linie" #: core/subtitleactions.cpp:177 core/subtitle.cpp:446 core/subtitle.cpp:460 #: core/subtitle.cpp:479 msgid "Remove Lines" msgstr "Usuń linie" #: core/subtitleactions.cpp:268 msgid "Move Line" msgstr "Przesuń linię" #: core/subtitleactions.cpp:381 msgid "Swap Texts" msgstr "Zamień teksty" #: core/subtitle.cpp:66 msgid "Set Primary Data" msgstr "Ustaw dane podstawowe" #: core/subtitle.cpp:121 msgid "Clear Primary Text Data" msgstr "Wyczyść tekst podstawowy" #: core/subtitle.cpp:134 msgid "Set Secondary Data" msgstr "Ustaw dane drugorzędne" #: core/subtitle.cpp:180 msgid "Clear Secondary Text Data" msgstr "Usuń tekst drugorzędny" #: core/subtitle.cpp:265 main/dialogs/changeframeratedialog.cpp:34 msgid "Change Frame Rate" msgstr "Zmień liczbę klatek na sekundę" #: core/subtitle.cpp:395 core/subtitle.cpp:412 msgid "Insert Line" msgstr "Wstaw linię" #: core/subtitle.cpp:533 main/application.cpp:662 main/lineswidget.cpp:1226 msgid "Split Lines" msgstr "Podziel linie" #: core/subtitle.cpp:590 main/application.cpp:670 main/lineswidget.cpp:1225 msgid "Join Lines" msgstr "Połącz linie" #: core/subtitle.cpp:642 msgid "Shift Lines" msgstr "Przesuń linie" #: core/subtitle.cpp:690 msgid "Adjust Lines" msgstr "Dopasuj linie" # fuzzy #: core/subtitle.cpp:700 main/application.cpp:2377 main/lineswidget.cpp:1200 msgid "Sort" msgstr "Sortuj linie" # fuzzy #: core/subtitle.cpp:746 main/dialogs/durationlimitsdialog.cpp:33 msgid "Enforce Duration Limits" msgstr "Zastosuj limity czasu trwania" #: core/subtitle.cpp:791 main/application.cpp:2462 main/lineswidget.cpp:1203 msgid "Maximize Durations" msgstr "Maksymalizuj czas trwania" #: core/subtitle.cpp:816 main/dialogs/autodurationsdialog.cpp:35 msgid "Set Automatic Durations" msgstr "Ustaw automatycznie czasy trwania" # fuzzy #: core/subtitle.cpp:856 main/dialogs/fixoverlappingtimesdialog.cpp:32 #: main/lineswidget.cpp:1204 msgid "Fix Overlapping Times" msgstr "Popraw nakładające się linie" #: core/subtitle.cpp:890 msgid "Fix Lines Punctuation" msgstr "Popraw interpunkcję linii" #: core/subtitle.cpp:986 msgid "Lower Case" msgstr "Zamień na małe litery" #: core/subtitle.cpp:1020 msgid "Upper Case" msgstr "Zamień na duże litery" #: core/subtitle.cpp:1054 msgid "Title Case" msgstr "Jak &tytuł" #: core/subtitle.cpp:1091 msgid "Sentence Case" msgstr "Jak &zdanie" # fuzzy #: core/subtitle.cpp:1142 main/dialogs/smarttextsadjustdialog.cpp:32 msgid "Break Lines" msgstr "Inteligentne dopasowanie linii" #: core/subtitle.cpp:1150 main/application.cpp:2530 main/lineswidget.cpp:1146 msgid "Unbreak Lines" msgstr "Usuń znaki łamania linii" #: core/subtitle.cpp:1158 main/application.cpp:2544 main/lineswidget.cpp:1152 msgid "Simplify Spaces" msgstr "Uprość spacje" #: core/subtitle.cpp:1167 msgid "Synchronize Subtitles" msgstr "Synchronizuj napisy" #: core/subtitle.cpp:1190 main/dialogs/joinsubtitlesdialog.cpp:35 msgid "Join Subtitles" msgstr "Połącz napisy" #: core/subtitle.cpp:1236 core/subtitle.cpp:1242 msgid "Split Subtitles" msgstr "Podziel napisy" #: core/subtitle.cpp:1259 core/subtitle.cpp:1274 msgid "Set Lines Style" msgstr "Ustaw styl linii" #: core/subtitle.cpp:1291 msgid "Toggle Lines Style" msgstr "Przełącz styl linii" #: core/subtitle.cpp:1304 msgid "Set Lines Mark" msgstr "Ustaw znacznik linii" #: core/subtitle.cpp:1304 msgid "Clear Lines Mark" msgstr "Usuń znacznik linii" #: core/subtitle.cpp:1318 msgid "Toggle Lines Mark" msgstr "Przełącz znacznik linii" #: core/subtitle.cpp:1328 main/application.cpp:2261 main/application.cpp:2271 #: main/errorswidget.cpp:854 #, fuzzy msgid "Clear Lines Errors" msgstr "O błędy w linii" #: core/subtitle.cpp:1338 core/subtitle.cpp:1358 main/application.cpp:2194 #: main/application.cpp:2239 #, fuzzy msgid "Check Lines Errors" msgstr "Sprawdź błędy w linii" #: core/subtitlelineactions.cpp:65 msgid "Set Line Text" msgstr "Ustaw tekst linii" #: core/subtitlelineactions.cpp:101 msgid "Set Line Secondary Text" msgstr "Ustaw drugorzędny tekst linii" #: core/subtitlelineactions.cpp:137 msgid "Set Line Texts" msgstr "Ustaw teksty linii" #: core/subtitlelineactions.cpp:218 msgid "Set Line Show Time" msgstr "Ustaw czas pojawienia tekstu" #: core/subtitlelineactions.cpp:254 msgid "Set Line Hide Time" msgstr "Ustaw czas ukrycia tekstu" #: core/subtitlelineactions.cpp:371 #, fuzzy msgid "Set Line Errors" msgstr "Ustaw błędy w linii" #: core/subtitleline.cpp:72 msgid "Empty text" msgstr "Pusty tekst" #: core/subtitleline.cpp:74 msgid "Too many characters" msgstr "Zbyt wiele znaków" #: core/subtitleline.cpp:76 msgid "Too many lines" msgstr "Zbyt wiele linii" #: core/subtitleline.cpp:78 msgid "Unnecessary white space" msgstr "Niepotrzebne odstępy" #: core/subtitleline.cpp:80 msgid "Unnecessary dash" msgstr "Niepotrzebny myślnik" #: core/subtitleline.cpp:82 msgid "Capital letter after continuation ellipsis" msgstr "Wielka litera po wielokropku oznaczającym kontynuację linii" #: core/subtitleline.cpp:84 msgid "Too long duration per character" msgstr "Zbyt długi czas trwania przypadający na znak" #: core/subtitleline.cpp:86 msgid "Too short duration per character" msgstr "Zbyt krótki czas trwania przypadający na znak" #: core/subtitleline.cpp:88 msgid "Too long duration" msgstr "Zbyt długi czas trwania" #: core/subtitleline.cpp:89 msgid "Too short duration" msgstr "Zbyt krótki czas trwania" #: core/subtitleline.cpp:90 msgid "Overlapping times" msgstr "Nakładające się czasy" #: core/subtitleline.cpp:91 msgid "Untranslated text" msgstr "Nieprzetłumaczony tekst" #: core/subtitleline.cpp:92 msgid "User mark" msgstr "Znacznik użytkownika" #: core/subtitleline.cpp:112 msgid "Has no primary text." msgstr "Brak tekstu podstawowego." #: core/subtitleline.cpp:116 msgid "Has no translation text." msgstr "Brak tekstu tłumaczenia." #: core/subtitleline.cpp:120 msgid "Has too many characters in primary text (1 char)." msgid_plural "Has too many characters in primary text (%1 chars)." msgstr[0] "Zbyt wiele znaków w tekście podstawowym (1 znak)." msgstr[1] "Zbyt wiele znaków w tekście podstawowym (%1 znaki)." msgstr[2] "Zbyt wiele znaków w tekście podstawowym (%1 znaków)." #: core/subtitleline.cpp:126 msgid "Has too many characters in translation text (1 char)." msgid_plural "Has too many characters in translation text (%1 chars)." msgstr[0] "Zbyt wiele znaków w tekście tłumaczenia (1 znak)." msgstr[1] "Zbyt wiele znaków w tekście tłumaczenia (%1 znaki)." msgstr[2] "Zbyt wiele znaków w tekście tłumaczenia (%1 znaków)." #: core/subtitleline.cpp:132 msgid "Has too many lines in primary text (1 line)." msgid_plural "Has too many lines in primary text (%1 lines)." msgstr[0] "Zbyt wiele linii w tekście podstawowym (1 linia)." msgstr[1] "Zbyt wiele linii w tekście podstawowym (%1 linie)." msgstr[2] "Zbyt wiele linii w tekście podstawowym (%1 linii)." #: core/subtitleline.cpp:138 msgid "Has too many lines in translation text (1 line)." msgid_plural "Has too many lines in translation text (%1 lines)." msgstr[0] "zbyt wiele linii w tekście tłumaczenia (1 linia)." msgstr[1] "zbyt wiele linii w tekście tłumaczenia (%1 linie)." msgstr[2] "zbyt wiele linii w tekście tłumaczenia (%1 linii)." #: core/subtitleline.cpp:144 msgid "Has unnecessary spaces in primary text." msgstr "Zbędne białe znaki w tekście podstawowym." #: core/subtitleline.cpp:148 msgid "Has unnecessary spaces in translation text." msgstr "Zbędne białe znaki w tekście tłumaczenia." #: core/subtitleline.cpp:152 msgid "Has unnecessary dash in primary text." msgstr "Zbędny myślnik w tekście podstawowym." #: core/subtitleline.cpp:156 msgid "Has unnecessary dash in translation text." msgstr "Zbędny myślnik w tekście tłumaczenia." #: core/subtitleline.cpp:160 msgid "Has capital letter after line continuation ellipsis in primary text." msgstr "" "W tekście głównym znajduje się wielka litera występująca po wielokropku " "oznaczającym kontynuację linii." #: core/subtitleline.cpp:164 msgid "" "Has capital letter after line continuation ellipsis in translation text." msgstr "" "W tekście tłumaczenia znajduje się wielka litera występująca po wielokropku " "oznaczającym kontynuację linii." #: core/subtitleline.cpp:168 msgid "Has too long duration per character in primary text (1 msec/char)." msgid_plural "" "Has too long duration per character in primary text (%1 msecs/char)." msgstr[0] "" "Zbyt długi czas trwania przypadający na znak w tekście podstawowym (1 ms/" "znak)." msgstr[1] "" "Zbyt długi czas trwania przypadający na znak w tekście podstawowym (%1 ms/" "znak)." msgstr[2] "" "Zbyt długi czas trwania przypadający na znak w tekście podstawowym (%1 ms/" "znak)." #: core/subtitleline.cpp:174 msgid "Has too long duration per character in translation text (1 msec/char)." msgid_plural "" "Has too long duration per character in translation text (%1 msecs/char)." msgstr[0] "" "Zbyt długi czas trwania przypadający na znak w tekście tłumaczenia (1 ms/" "znak)." msgstr[1] "" "Zbyt długi czas trwania przypadający na znak w tekście tłumaczenia (%1 ms/" "znak)." msgstr[2] "" "Zbyt długi czas trwania przypadający na znak w tekście tłumaczenia (%1 ms/" "znak)." #: core/subtitleline.cpp:180 msgid "Has too short duration per character in primary text (1 msec/char)." msgid_plural "" "Has too short duration per character in primary text (%1 msecs/char)." msgstr[0] "" "Zbyt krótki czas trwania przypadający na znak w tekście podstawowym (1 ms/" "znak)." msgstr[1] "" "Zbyt krótki czas trwania przypadający na znak w tekście podstawowym (%1 ms/" "znak)." msgstr[2] "" "Zbyt krótki czas trwania przypadający na znak w tekście podstawowym (%1 ms/" "znak)." #: core/subtitleline.cpp:186 msgid "Has too short duration per character in translation text (1 msec/char)." msgid_plural "" "Has too short duration per character in translation text (%1 msecs/char)." msgstr[0] "" "Zbyt krótki czas trwania przypadający na znak w tekście tłumaczenia (1 ms/" "znak)." msgstr[1] "" "Zbyt krótki czas trwania przypadający na znak w tekście tłumaczenia (%1 ms/" "znak)." msgstr[2] "" "Zbyt krótki czas trwania przypadający na znak w tekście tłumaczenia (%1 ms/" "znak)." #: core/subtitleline.cpp:192 msgid "Has too long duration (1 msec)." msgid_plural "Has too long duration (%1 msecs)." msgstr[0] "Zbyt długi czas trwania (1 ms)." msgstr[1] "Zbyt długi czas trwania (%1 ms)." msgstr[2] "Zbyt długi czas trwania (%1 ms)." #: core/subtitleline.cpp:198 msgid "Has too short duration (1 msec)." msgid_plural "Has too short duration (%1 msecs)." msgstr[0] "Zbyt krótki czas trwania (1 ms)." msgstr[1] "Zbyt krótki czas trwania (%1 ms)." msgstr[2] "Zbyt krótki czas trwania (%1 ms)." #: core/subtitleline.cpp:204 msgid "Overlaps with next line." msgstr "Pokrywa się z następną linią." #: core/subtitleline.cpp:208 msgid "Has untranslated text." msgstr "Brak tekstu tłumaczenia." #: core/subtitleline.cpp:212 msgid "Has user mark." msgstr "Posiada znaczniki użytkownika." #: core/subtitleline.cpp:680 msgid "Set Line Times" msgstr "Ustaw czasy linii" #: core/subtitleline.cpp:691 msgid "Shift Line Times" msgstr "Przesuń czasy linii" #: core/subtitleline.cpp:705 msgid "Adjust Line Times" msgstr "Dostosuj czasy linii" #: main/actions/krecentfilesactionext.cpp:37 msgid "Clear History" msgstr "Wyczyść historię" #: main/application.cpp:415 msgid "Video Files" msgstr "Pliki wideo" #: main/application.cpp:423 msgid "Audio Files" msgstr "Pliki audio" #: main/application.cpp:425 msgid "Media Files" msgstr "Pliki mediów" #: main/application.cpp:426 msgid "All Files" msgstr "Wszystkie pliki" #: main/application.cpp:442 msgid "Audio Levels Files" msgstr "Pliki poziomów dźwięku" #: main/application.cpp:456 msgid "Exit the application" msgstr "Kończy działanie programu" #: main/application.cpp:460 msgid "Configure Subtitle Composer" msgstr "Konfiguracja programu Subtitle Composer" #: main/application.cpp:465 msgctxt "@action:inmenu Create a new subtitle" msgid "New" msgstr "Nowy" #: main/application.cpp:466 msgid "Create an empty subtitle" msgstr "Tworzy pusty plik napisów" #: main/application.cpp:475 msgctxt "@action:inmenu Open subtitle file" msgid "Open..." msgstr "Otwórz..." #: main/application.cpp:476 main/application.cpp:486 msgid "Open subtitle file" msgstr "Otwiera plik napisów" #: main/application.cpp:485 msgctxt "@action:inmenu Open rencently used subtitle file" msgid "Open &Recent" msgstr "O&twórz ostatnio używane" #: main/application.cpp:493 msgid "Save" msgstr "Zapisz" #: main/application.cpp:494 msgid "Save opened subtitle" msgstr "Zapisuje otwarte napisy" #: main/application.cpp:503 msgid "Save As..." msgstr "Zapisz jako..." #: main/application.cpp:504 msgid "Save opened subtitle with different settings" msgstr "Zapisuje otwarte napisy z innymi opcjami" #: main/application.cpp:512 msgid "Close" msgstr "Zamknij" #: main/application.cpp:513 msgid "Close opened subtitle" msgstr "Zamyka otwarte napisy" #: main/application.cpp:522 msgid "New Translation" msgstr "Nowe tłumaczenie" #: main/application.cpp:523 msgid "Create an empty translation subtitle" msgstr "Tworzy puste tłumaczenie napisów" #: main/application.cpp:532 msgid "Open Translation..." msgstr "Otwórz tłumaczenie..." #: main/application.cpp:533 main/application.cpp:543 msgid "Open translation subtitle file" msgstr "Otwiera plik tłumaczenia napisów" #: main/application.cpp:542 msgid "Open &Recent Translation" msgstr "Otwórz &poprzednie tłumaczenie" #: main/application.cpp:551 msgid "Save Translation" msgstr "Zapisz tłumaczenie" #: main/application.cpp:552 msgid "Save opened translation subtitle" msgstr "Zapisuje otwarty plik tłumaczenia napisów" #: main/application.cpp:561 msgid "Save Translation As..." msgstr "Zapisz tłumaczenie jako..." #: main/application.cpp:562 msgid "Save opened translation subtitle with different settings" msgstr "Zapisuje otwarte tłumaczenie z innymi ustawieniami" #: main/application.cpp:570 msgid "Close Translation" msgstr "Zamknij tłumaczenie" #: main/application.cpp:571 msgid "Close opened translation subtitle" msgstr "Zamyka otwarte tłumaczenie napisów" #: main/application.cpp:580 msgid "Reload As..." msgstr "Wczytaj ponownie jako..." #: main/application.cpp:581 main/application.cpp:592 msgid "Reload opened file with a different encoding" msgstr "Wczytuje otwarty plik z innym kodowaniem" #: main/application.cpp:591 msgid "Quick Reload As..." msgstr "Szybko wczytaj ponownie jako..." #: main/application.cpp:600 main/application.cpp:601 #: widgets/simplerichtextedit.cpp:72 msgid "Undo" msgstr "Cofnij" #: main/application.cpp:610 main/application.cpp:611 #: widgets/simplerichtextedit.cpp:78 msgid "Redo" msgstr "Ponów" #: main/application.cpp:619 msgid "Split Subtitle..." msgstr "Podziel napisy..." #: main/application.cpp:620 msgid "Split the opened subtitle in two parts" msgstr "Dzieli otwarte napisy na dwie części" #: main/application.cpp:627 msgid "Join Subtitles..." msgstr "Połącz napisy..." #: main/application.cpp:628 msgid "Append to the opened subtitle another one" msgstr "Dołącza inne napisy do otwartych napisów" #: main/application.cpp:635 main/lineswidget.cpp:1222 msgid "Insert Before" msgstr "Wstaw przed" #: main/application.cpp:636 msgid "Insert empty line before current one" msgstr "Wstawia pustą linię przed aktualną" #: main/application.cpp:644 main/lineswidget.cpp:1223 msgid "Insert After" msgstr "Wstaw po" #: main/application.cpp:645 msgid "Insert empty line after current one" msgstr "Wstawia pustą linię po aktualnej" #: main/application.cpp:653 main/lineswidget.cpp:1221 #: main/scripting/scriptsmanager.cpp:141 msgid "Remove" msgstr "Usuń" #: main/application.cpp:654 msgid "Remove selected lines" msgstr "Usuwa wybrane linie" #: main/application.cpp:663 msgid "Split selected lines" msgstr "Podziel wybrane linie" #: main/application.cpp:671 msgid "Join selected lines" msgstr "Łączy wybrane linie" #: main/application.cpp:678 main/dialogs/actionwitherrortargetsdialog.cpp:103 #: main/lineswidget.cpp:1219 widgets/simplerichtextedit.cpp:113 msgid "Select All" msgstr "Wybierz wszytko" #: main/application.cpp:679 msgid "Select all lines" msgstr "Wybiera wszystkie linie" #: main/application.cpp:687 msgid "Go to Line..." msgstr "Przejdź do linii..." #: main/application.cpp:688 msgid "Go to specified line" msgstr "Przechodzi do wskazanej linii" #: main/application.cpp:697 msgid "Find..." msgstr "Znajdź..." #: main/application.cpp:698 msgid "Find occurrences of strings or regular expressions" msgstr "Znajduje wystąpienia ciągu znaków lub wyrażenia regularnego" #: main/application.cpp:708 msgid "Find Next" msgstr "Znajdź następny" #: main/application.cpp:709 msgid "Find next occurrence of string or regular expression" msgstr "Znajduje następne wystąpienie ciągu znaków lub wyrażenia regularnego" #: main/application.cpp:719 msgid "Find Previous" msgstr "Znajdź poprzedni" #: main/application.cpp:720 msgid "Find previous occurrence of string or regular expression" msgstr "Znajduje poprzednie wystąpienie ciągu znaków lub wyrażenia regularnego" #: main/application.cpp:728 msgid "Replace..." msgstr "Zastąp..." #: main/application.cpp:729 msgid "Replace occurrences of strings or regular expressions" msgstr "Zastępuje wystąpienia danego ciągu znaków lub wyrażenia regularnego" #: main/application.cpp:738 msgid "Retrocede current line" msgstr "Przesuń wstecz aktualną linię" #: main/application.cpp:739 msgid "Makes the line before the current one active" msgstr "Wstawia nową linię przed aktualną" #: main/application.cpp:748 msgid "Advance current line" msgstr "Przesuń do przodu aktualną linię" #: main/application.cpp:749 msgid "Makes the line after the current one active" msgstr "Wstawia nową linię po aktualnej" #: main/application.cpp:757 main/errorsdialog.cpp:59 main/lineswidget.cpp:1212 msgid "Check Errors..." msgstr "Sprawdź błędy..." #: main/application.cpp:758 msgid "Check for errors in the current subtitle" msgstr "Sprawdza błędy w bieżącym pliku z napisami" #: main/application.cpp:766 main/errorsdialog.cpp:62 main/lineswidget.cpp:1213 msgid "Clear Errors..." msgstr "Odznacz błędy..." #: main/application.cpp:767 msgid "Clear errors from selected lines" msgstr "Usuwa informacje o błędach z wybranych linii" #: main/application.cpp:774 main/lineswidget.cpp:1215 msgid "Show Errors..." msgstr "Pokaż błędy..." #: main/application.cpp:775 msgid "Show errors information for the current subtitle" msgstr "Pokazuje informacje o błędach w bieżącym pliku z napisami" #: main/application.cpp:784 msgid "Find Error..." msgstr "Znajdź błąd..." #: main/application.cpp:785 msgid "Find lines with specified errors" msgstr "Wyszukuje linie z określonymi błędami" #: main/application.cpp:795 msgid "Find Next Error" msgstr "Znajdź następny błąd" #: main/application.cpp:796 msgid "Find next line with specified errors" msgstr "Wyszukuje następną linię z określonym błędem" #: main/application.cpp:806 msgid "Find Previous Error" msgstr "Znajdź poprzedni błąd" #: main/application.cpp:807 msgid "Find previous line with specified errors" msgstr "Wyszukuje poprzednią linię z określonym błędem" #: main/application.cpp:816 main/lineswidget.cpp:1159 msgid "Spelling..." msgstr "Pisownia..." #: main/application.cpp:817 msgid "Check lines spelling" msgstr "Sprawdza pisownię" #: main/application.cpp:824 msgid "Toggle Mark" msgstr "Przełącz znacznik" #: main/application.cpp:825 msgid "Toggle selected lines mark" msgstr "Przełącza znaczniki w wybranych liniach" #: main/application.cpp:834 main/currentlinewidget.cpp:92 msgid "Toggle Bold" msgstr "Pogrubienie" #: main/application.cpp:835 msgid "Toggle selected lines bold attribute" msgstr "Przełącza atrybut pogrubienia dla wybranych linii" #: main/application.cpp:844 main/currentlinewidget.cpp:97 msgid "Toggle Italic" msgstr "Kursywa" #: main/application.cpp:845 msgid "Toggle selected lines italic attribute" msgstr "Przełącza atrybut kursywy dla wybranych linii" #: main/application.cpp:854 main/currentlinewidget.cpp:102 msgid "Toggle Underline" msgstr "Podkreślenie" #: main/application.cpp:855 msgid "Toggle selected lines underline attribute" msgstr "Przełącza atrybut podkreślenia dla wybranych linii" #: main/application.cpp:864 main/currentlinewidget.cpp:107 msgid "Toggle Strike Through" msgstr "Przekreślenie" #: main/application.cpp:865 msgid "Toggle selected lines strike through attribute" msgstr "Przełącza atrybut przekreślenia dla wybranych linii" # fuzzy #: main/application.cpp:873 main/lineswidget.cpp:1199 msgid "Shift..." msgstr "Przesuń linie..." #: main/application.cpp:874 msgid "Shift lines an specified amount of time" msgstr "Przesuwa wybrane linie o podany czas" # fuzzy #: main/application.cpp:901 msgid "Adjust..." msgstr "Dopasuj linie..." # fuzzy #: main/application.cpp:902 msgid "Linearly adjust all lines to a specified interval" msgstr "Linowo dopasowuje linie do podanego interwału" # fuzzy #: main/application.cpp:910 msgid "Sort..." msgstr "Sortuj linie..." #: main/application.cpp:911 msgid "Sort lines based on their show time" msgstr "Sortuje linie opierając się na czasie wyświetlenia" #: main/application.cpp:918 msgid "Change Frame Rate..." msgstr "Zmień liczbę klatek na sekundę..." #: main/application.cpp:919 msgid "Retime subtitle lines by reinterpreting its frame rate" msgstr "" "Dopasowuje czasy linii napisów poprzez ponowną interpretację liczby klatek " "na sekundę" # fuzzy #: main/application.cpp:926 main/lineswidget.cpp:1201 msgid "Enforce Duration Limits..." msgstr "Zastosuj limity czasu trwania..." #: main/application.cpp:927 msgid "Enforce lines minimum and/or maximum duration limits" msgstr "Wymusza minimalne i/lub maksymalne czasy trwania linii" # fuzzy #: main/application.cpp:935 main/lineswidget.cpp:1202 msgid "Set Automatic Durations..." msgstr "Ustaw automatycznie czasy trwania..." # fuzzy #: main/application.cpp:936 msgid "Set lines durations based on amount of letters, words and line breaks" msgstr "" "Ustawia czasy trwania linii opierając się na liczbie słów i/lub łamaniu linii" #: main/application.cpp:943 msgid "Maximize Durations..." msgstr "Maksymalizuj czasy trwania..." #: main/application.cpp:944 msgid "Extend lines durations up to their next lines show time" msgstr "Wydłuża czasy trwania linii do momentu wyświetlenia następnej linii." # fuzzy #: main/application.cpp:951 msgid "Fix Overlapping Times..." msgstr "Dopasuj nakładające się linie..." #: main/application.cpp:952 msgid "Fix lines overlapping times" msgstr "Naprawia czasy nakładających się linii" #: main/application.cpp:959 msgid "Synchronize with Subtitle..." msgstr "Synchronizuj z napisami..." #: main/application.cpp:960 msgid "Copy timing information from another subtitle" msgstr "Kopiuje informacje o czasie z innego pliku napisów" # fuzzy #: main/application.cpp:967 main/lineswidget.cpp:1142 msgid "Break Lines..." msgstr "Inteligentne dopasowanie linii..." #: main/application.cpp:968 msgid "Automatically set line breaks" msgstr "Ustawia automatycznie znaki łamania linii" #: main/application.cpp:975 main/lineswidget.cpp:1145 msgid "Unbreak Lines..." msgstr "Usuń znaki łamania linii..." #: main/application.cpp:976 msgid "Remove line breaks from lines" msgstr "Usuwa znaki łamania linii..." #: main/application.cpp:983 main/lineswidget.cpp:1151 msgid "Simplify Spaces..." msgstr "Uprość białe znaki..." #: main/application.cpp:984 msgid "Remove unneeded spaces from lines" msgstr "Usuwa niepotrzebne białe znaki" #: main/application.cpp:991 main/lineswidget.cpp:1155 msgid "Change Case..." msgstr "Zmień wielkość liter..." #: main/application.cpp:992 msgid "Change lines text to upper, lower, title or sentence case" msgstr "Zmienia tekst na wielkie, małe litery, na styl tytułu lub zdania" #: main/application.cpp:999 main/lineswidget.cpp:1156 msgid "Fix Punctuation..." msgstr "Popraw interpunkcję..." #: main/application.cpp:1000 msgid "Fix punctuation errors in lines" msgstr "Poprawia błędy interpunkcyjne" #: main/application.cpp:1007 main/lineswidget.cpp:1157 msgid "Translate..." msgstr "Przetłumacz..." #: main/application.cpp:1008 msgid "Translate lines texts using Google services" msgstr "Tłumaczy linie używając usług Google" #: main/application.cpp:1015 msgid "Edit Line in Place" msgstr "Edytuj linię" #: main/application.cpp:1016 msgid "Edit current line text in place" msgstr "Edytuje aktualną linię" #: main/application.cpp:1025 msgid "Open Video..." msgstr "Otwórz wideo..." #: main/application.cpp:1026 main/application.cpp:1034 msgid "Open video file" msgstr "Otwiera plik wideo" #: main/application.cpp:1033 msgid "Open &Recent Video" msgstr "Otwórz &poprzedni plik wideo" #: main/application.cpp:1041 msgid "Close Video" msgstr "Zamknij wideo" #: main/application.cpp:1042 msgid "Close video file" msgstr "Zamyka plik wideo" #: main/application.cpp:1051 msgid "Full Screen Mode" msgstr "Tryb pełnoekranowy" #: main/application.cpp:1052 msgid "Toggle full screen mode" msgstr "Przełącza w tryb pełnoekranowy" #: main/application.cpp:1060 main/utils/kreplace.cpp:425 msgid "Stop" msgstr "Zatrzymaj" #: main/application.cpp:1061 msgid "Stop video playback" msgstr "Zatrzymuje odtwarzanie wideo" #: main/application.cpp:1069 main/application.cpp:3156 #: main/application.cpp:3163 msgid "Play" msgstr "Odtwarzaj" #: main/application.cpp:1070 msgid "Toggle video playing/paused" msgstr "Włącza i zatrzymuje odtwarzanie wideo" #: main/application.cpp:1078 msgid "Seek Backwards" msgstr "Przeskocz wstecz" #: main/application.cpp:1087 msgid "Seek Forwards" msgstr "Przeskocz do przodu" #: main/application.cpp:1099 msgid "Jump to Previous Line" msgstr "Przejdź do poprzedniej linii" #: main/application.cpp:1100 msgid "Seek to previous subtitle line show time" msgstr "Przeskakuje do czasu wyświetlenia poprzedniej linii napisów" #: main/application.cpp:1109 msgid "Jump to Next Line" msgstr "Przejdź do następnej linii" #: main/application.cpp:1110 msgid "Seek to next subtitle line show time" msgstr "Przeskakuje do czasu wyświetlenia następnej linii" #: main/application.cpp:1120 msgid "Set Current Line Show Time" msgstr "Ustaw czas pojawienia bieżącej linii" #: main/application.cpp:1121 msgid "Set current line show time to video position" msgstr "Ustawia czas pojawienia linii w aktualnej pozycji wideo" #: main/application.cpp:1131 msgid "Set Current Line Hide Time" msgstr "Ustaw czas ukrycia bieżącej linii" #: main/application.cpp:1132 msgid "Set current line hide time to video position" msgstr "Ustawia czas ukrycia linii w aktualnej pozycji wideo" #: main/application.cpp:1141 msgid "Current Line Follows Video" msgstr "Bieżąca linia podąża za wideo" #: main/application.cpp:1142 msgid "Make current line follow the playing video position" msgstr "Powoduje, że bieżąca linia podąża za odtwarzanym plikiem wideo" #: main/application.cpp:1149 msgctxt "@action:inmenu Toggle audio muted" msgid "Mute" msgstr "Wycisz" #: main/application.cpp:1151 msgid "Enable/disable playback sound" msgstr "Włącza/wyłącza odtwarzanie dźwięku" #: main/application.cpp:1159 msgid "Increase Volume" msgstr "Głośniej" #: main/application.cpp:1160 msgid "Increase volume by 5%" msgstr "Podnosi głośność o 5%" #: main/application.cpp:1168 msgid "Decrease Volume" msgstr "Ciszej" #: main/application.cpp:1169 msgid "Decrease volume by 5%" msgstr "Obniża głośność o 5%" #: main/application.cpp:1177 msgid "Audio Streams" msgstr "Strumienie audio " #: main/application.cpp:1178 msgid "Select active audio stream" msgstr "Wybiera aktywny strumień audio" #: main/application.cpp:1186 msgid "Increase Font Size" msgstr "Zwiększ rozmiar czcionki" #: main/application.cpp:1187 msgid "Increase subtitles font size by 1 point" msgstr "Zwiększa rozmiar czcionki napisów o 1 punkt" #: main/application.cpp:1195 msgid "Decrease Font Size" msgstr "Zmniejsz rozmiar czcionki" #: main/application.cpp:1196 msgid "Decrease subtitles font size by 1 point" msgstr "Zmniejsza rozmiar czcionki napisów o 1 punkt" #: main/application.cpp:1204 msgid "Subtitle Streams" msgstr "Strumienie napisów" #: main/application.cpp:1205 msgid "Select active subtitle stream" msgstr "Wybiera aktywny strumień napisów" #: main/application.cpp:1212 msgid "Shift to Video Position" msgstr "Przesuń do pozycji wideo" #: main/application.cpp:1213 msgid "" "Set current line show time to video position by equally shifting all lines" msgstr "" "Ustawia czas pojawienia się aktualnej linii w pozycji wideo poprzez " "przesunięcie wszystkich linii" #: main/application.cpp:1221 msgid "Adjust to Video Position (Anchor Last Line)" msgstr "Dopasuj do pozycji wideo (zaczep ostatnią linię)" #: main/application.cpp:1222 msgid "" "Set current line to video position by fixing the last line and linearly " "adjusting the other ones" msgstr "" "Ustawia aktualną linię w pozycji wideo zachowując pozycję ostatniej linii i " "liniowo dopasowując pozostałe" #: main/application.cpp:1230 msgid "Adjust to Video Position (Anchor First Line)" msgstr "Dopasuj do pozycji wideo (zaczep pierwszą linię)" #: main/application.cpp:1231 msgid "" "Set current line to video position by fixing the first line and linearly " "adjusting the other ones" msgstr "" "Ustawia aktualną linię w pozycji wideo zachowując pozycję pierwszej linii i " "liniowo dopasowując pozostałe." #: main/application.cpp:1240 msgctxt "@action:inmenu Manage user scripts" msgid "Scripts Manager..." msgstr "Menedżer skryptów..." #: main/application.cpp:1241 msgid "Manage user scripts" msgstr "Zażądzanie skryptami użytkownika" #: main/application.cpp:1365 msgid "" "The requested action would make the subtitle and its translation share the " "same file, possibly resulting in loss of information when saving.\n" "Are you sure you want to continue?" msgstr "" "To działanie spowoduje, że napisy i ich tłumaczenie będą dzielić ten sam " "plik, powodując tym samym możliwość utraty informacji podczas zapisu.\n" "Czy chcesz kontynuować?" #: main/application.cpp:1366 msgid "Conflicting Subtitle Files" msgstr "Konflikt plików z napisami" #: main/application.cpp:1488 msgid "" "Could not parse the subtitle file.
This may have been caused by " "usage of the wrong encoding.
" msgstr "" "Nie można przetworzyć pliku napisów.
Problemem może być użycie " "niewłaściwego kodowania znaków.
" #: main/application.cpp:1519 msgid "There was an error saving the subtitle." msgstr "Wystąpił błąd podczas zapisywania pliku napisów." #: main/application.cpp:1561 main/application.cpp:1770 msgid "" "Currently opened translation subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Otwarte tłumaczenie napisów posiada niezachowane zmiany.\n" "Czy chcesz je zachować?" #: main/application.cpp:1562 main/application.cpp:1771 msgid "Close Translation Subtitle" msgstr "Zamknij tłumaczenie napisów" #: main/application.cpp:1574 msgid "" "Currently opened subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Otwarte napisy posiadają niezachowane zmiany.\n" "Czy chcesz je zachować?" #: main/application.cpp:1575 msgid "Close Subtitle" msgstr "Zamknij plik napisów" #: main/application.cpp:1678 msgctxt "@item:inmenu Display primary text in video player" msgid "Primary" msgstr "Tekst podstawowy" #: main/application.cpp:1679 msgctxt "@item:inmenu Display translation text in video player" msgid "Translation" msgstr "Tłumaczenie" #: main/application.cpp:1689 msgid "Could not parse the subtitle file." msgstr "Nie można przetworzyć pliku napisów." #: main/application.cpp:1728 msgid "There was an error saving the translation subtitle." msgstr "Wystąpił błąd podczas zachowywania tłumaczenia napisów." #: main/application.cpp:1864 msgid "Could not read the subtitle file to append." msgstr "Nie można odczytać pliku napisów przeznaczonego do dołączenia." #: main/application.cpp:1916 msgid "Could not write the splitted subtitle file." msgstr "Nie można zapisać podzielonego pliku napisów." #: main/application.cpp:1917 msgid "Could not write the splitted subtitle translation file." msgstr "Nie można zapisać podzielonego pliku tłumaczenia napisów." #: main/application.cpp:1935 msgid "The specified time does not split the subtitles." msgstr "Podany czas nie dzieli napisów." #: main/application.cpp:1984 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted part was saved as %1." msgstr "" "Nie można otworzyć kolejnego okna programu Subtitle Composer.\n" "Wydzielona część została zachowana jako %1." #: main/application.cpp:1989 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted parts were saved as %1 and %2." msgstr "" "Nie można otworzyć kolejnego okna programu Subtitle Composer.\n" "Podzielone części zostały zachowane jako %1 i %2." #: main/application.cpp:2077 msgid "Go to Line" msgstr "Przejdź do linii" #: main/application.cpp:2077 msgid "&Go to line:" msgstr "&Przejdź do linii:" #: main/application.cpp:2389 msgid "Can not perform sort on selection with multiple ranges." msgstr "Nie można wykonać sortowania w zaznaczeniu o wielu zasięgach." #: main/application.cpp:2499 msgid "The reference subtitle must have more than one line to proceed." msgstr "Aby kontynuować napisy wzorcowe muszą posiadać więcej niż jedną linię." #: main/application.cpp:2511 msgid "Could not parse the reference subtitle file." msgstr "Nie można przetworzyć wzorcowego pliku napisów." #: main/application.cpp:2618 main/dialogs/translatedialog.cpp:31 msgid "Translate" msgstr "Przetłumacz" #: main/application.cpp:2619 msgid "Translating text (%1 to %2)..." msgstr "Tłumaczenie tekstu (%1 to %2)..." #: main/application.cpp:2628 msgid "Translating primary text (%1 to %2)..." msgstr "Tłumaczenie tekstu podstawowego (%1 jako %2)..." #: main/application.cpp:2629 msgid "Translating secondary text (%1 to %2)..." msgstr "Tłumaczenie tekstu drugorzędnego (%1 jako %2)..." #: main/application.cpp:2661 msgid "" "Unable to perform texts synchronization (sent and received lines count do " "not match)." msgstr "" "Nie można wykonać synchronizacji tekstów (liczba linii wysłanych i " "otrzymanych nie jest równa)." #: main/application.cpp:2670 msgid "Translate Primary Text" msgstr "Przetłumacz tekst podstawowy" #: main/application.cpp:2671 msgid "Translate Secondary Text" msgstr "Przetłumacz tekst drugorzędny" #: main/application.cpp:2687 msgid "" "There was an error performing the translation:\n" "\n" "%1" msgstr "" "Wystąpił błąd podczas tłumaczenia:\n" "\n" "%1" #: main/application.cpp:2740 msgid "Open Video" msgstr "Otwórz wideo" #: main/application.cpp:2873 main/application.cpp:2911 msgid "" "Continuing would result in loss of timing information for some lines.\n" "Are you sure you want to continue?" msgstr "" "Kontynuowanie spowoduje utratę danych o danych o czasach niektórych linii.\n" " Czy na pewno chcesz kontynuować? " #: main/application.cpp:2929 msgid "Open AudioLevels" msgstr "Otwórz plik poziomów audio" #: main/application.cpp:3035 msgid "modified" msgstr "zmieniony" #: main/application.cpp:3039 main/application.cpp:3050 msgid "Untitled" msgstr "Bez nazwy" #: main/application.cpp:3041 msgid "Untitled Translation" msgstr "Tłumaczenie bez nazwy" #: main/application.cpp:3149 msgid "Pause" msgstr "Pauza" #: main/application.cpp:3190 msgid "Seek backwards 1 second" msgid_plural "Seek backwards %1 seconds" msgstr[0] "Przeskakuje wstecz o 1 sekundę" msgstr[1] "Przeskakuje wstecz o %1 sekundy" msgstr[2] "Przeskakuje wstecz o %1 sekund" #: main/application.cpp:3196 msgid "Seek forwards 1 second" msgid_plural "Seek forwards %1 seconds" msgstr[0] "Przeskakuje w przód o 1 sekundę" msgstr[1] "Przeskakuje w przód o %1 sekundy " msgstr[2] "Przeskakuje w przód o %1 sekund" #: main/application.cpp:3211 main/application.cpp:3223 msgid "Shift %21 Millisecond" msgid_plural "Shift %2%1 Milliseconds" msgstr[0] "Przesuń o %21 milisekundę" msgstr[1] "Przesuń o %2%1 milisekundy" msgstr[2] "Przesuń o %2%1 milisekund" #: main/application.cpp:3216 main/application.cpp:3228 msgid "Shift selected lines %21 millisecond" msgid_plural "Shift selected lines %2%1 milliseconds" msgstr[0] "Przesuwa wybrane linie o %21 milisekundę" msgstr[1] "Przesuwa wybrane linie o %2%1 milisekundy" msgstr[2] "Przesuwa wybrane linie o %2%1 milisekund" #: main/configdialog.cpp:46 msgid "Configure" msgstr "Konfiguracja" #: main/configdialog.cpp:54 msgctxt "@title General settings" msgid "General" msgstr "Ogólne" #: main/configdialog.cpp:55 msgid "General Settings" msgstr "Ustawienia ogólne" #: main/configdialog.cpp:59 msgctxt "@title Error checks settings" msgid "Error Checks" msgstr "Sprawdzanie błędów" #: main/configdialog.cpp:60 msgid "Error Checks Settings" msgstr "Ustawienia sprawdzania błędów" #: main/configdialog.cpp:64 msgctxt "@title Spelling settings" msgid "Spelling" msgstr "Pisownia" #: main/configdialog.cpp:65 msgid "Spelling Settings" msgstr "Ustawienia sprawdzania pisowni" #: main/configdialog.cpp:69 msgctxt "@title Player settings" msgid "Player" msgstr "Odtwarzacz" #: main/configdialog.cpp:70 msgid "Player Settings" msgstr "Ustawienia odtwarzacza" #: main/configdialog.cpp:82 msgctxt "@title Player backend settings" msgid "%1 Backend Settings" msgstr "Ustawienia modułu %1" #: main/configs/errorsconfigwidget.cpp:37 msgctxt "@title:group" msgid "Texts" msgstr "Tekst" #: main/configs/errorsconfigwidget.cpp:40 msgid "Maximum number of characters:" msgstr "Maksymalna liczba znaków: " #: main/configs/errorsconfigwidget.cpp:45 #: main/dialogs/smarttextsadjustdialog.cpp:40 msgid " characters" msgstr "znaków" #: main/configs/errorsconfigwidget.cpp:48 msgid "Maximum number of lines:" msgstr "Maksymalna liczba linii:" #: main/configs/errorsconfigwidget.cpp:53 msgid " lines" msgstr "linie " #: main/configs/errorsconfigwidget.cpp:56 msgctxt "@title:group" msgid "Absolute Durations" msgstr "Bezwzględne czasy trwania" #: main/configs/errorsconfigwidget.cpp:59 #: main/configs/errorsconfigwidget.cpp:78 msgid "Minimum duration:" msgstr "Minimalny czas trwania:" #: main/configs/errorsconfigwidget.cpp:64 #: main/configs/errorsconfigwidget.cpp:72 #: main/configs/generalconfigwidget.cpp:52 #: main/configs/generalconfigwidget.cpp:66 #: main/configs/generalconfigwidget.cpp:74 #: main/dialogs/fixoverlappingtimesdialog.cpp:37 msgid " msecs" msgstr "ms" #: main/configs/errorsconfigwidget.cpp:67 #: main/configs/errorsconfigwidget.cpp:86 msgid "Maximum duration:" msgstr "Maksymalny czas trwania:" #: main/configs/errorsconfigwidget.cpp:75 msgctxt "@title:group" msgid "Relative Durations" msgstr "Względne czasy trwania" #: main/configs/errorsconfigwidget.cpp:83 #: main/configs/errorsconfigwidget.cpp:91 msgid " msecs/character" msgstr "ms/znak" #: main/configs/errorsconfigwidget.cpp:93 msgctxt "@title:group" msgid "Behavior" msgstr "Zachowanie" #: main/configs/errorsconfigwidget.cpp:96 msgid "Automatically clear fixed errors" msgstr "Automatycznie odznacz naprawione błędy" #: main/configs/generalconfigwidget.cpp:38 #: main/configs/playerconfigwidget.cpp:44 #: player/mplayer/mplayerconfigwidget.cpp:37 msgctxt "@title:group General settings" msgid "General" msgstr "Ogólne" #: main/configs/generalconfigwidget.cpp:41 msgid "Default encoding for opening subtitles:" msgstr "Domyślne kodowanie otwieranych napisów:" #: main/configs/generalconfigwidget.cpp:47 msgid "On line double click, jump to show time minus:" msgstr "" "Dwukrotne kliknięcie linii powoduje przeskok do czasu pojawienia minus:" #: main/configs/generalconfigwidget.cpp:55 msgid "Automatically load video file when opening subtitle" msgstr "Automatycznie wczytaj plik wideo podczas otwierania napisów" #: main/configs/generalconfigwidget.cpp:58 msgctxt "@title:group" msgid "Quick Actions" msgstr "Szybkie działania" #: main/configs/generalconfigwidget.cpp:61 msgid "Time shift for selected lines:" msgstr "Przesunięcie w czasie dla wybranych linii:" # fuzzy #: main/configs/generalconfigwidget.cpp:69 msgid "Compensation for captured video times:" msgstr "Kompensacja przechwyconych czasów materiału wideo:" #: main/configs/playerconfigwidget.cpp:47 msgid "Player backend:" msgstr "Moduł odtwarzania:" #: main/configs/playerconfigwidget.cpp:53 msgid "Jump length on seek:" msgstr "Długość skoku podczas przeszukiwania:" #: main/configs/playerconfigwidget.cpp:58 msgid " secs" msgstr "s" #: main/configs/playerconfigwidget.cpp:61 main/playerwidget.cpp:452 msgid "Show editable position control" msgstr "Pokaż edytowalną kontrolkę pozycji" #: main/configs/playerconfigwidget.cpp:64 msgctxt "@title:group" msgid "Subtitles" msgstr "Napisy" #: main/configs/playerconfigwidget.cpp:67 msgctxt "@label:chooser The font family name" msgid "Font family:" msgstr "Czcionka:" #: main/configs/playerconfigwidget.cpp:72 msgid "Font size:" msgstr "Rozmiar:" #: main/configs/playerconfigwidget.cpp:77 msgid " points" msgstr "pt" #: main/configs/playerconfigwidget.cpp:80 msgid "Primary color:" msgstr "Kolor tekstu:" #: main/configs/playerconfigwidget.cpp:85 msgid "Outline color:" msgstr "Kolor obwódki:" #: main/configs/playerconfigwidget.cpp:91 msgid "Outline width:" msgstr "Szerokość obwódki:" #: main/configs/playerconfigwidget.cpp:96 msgid " pixels" msgstr "px" #: main/configs/playerconfigwidget.cpp:99 msgctxt "@title:group" msgid "Subtitles Preview" msgstr "Podgląd napisów" #: main/configs/playerconfigwidget.cpp:109 msgctxt "Text for previewing the subtitles font settings" msgid "

The Quick Brown Fox
Jumps Over The Lazy Dog

" msgstr "

O, mógłże sęp chlań
wyjść furtką bździn.

" #: main/currentlinewidget.cpp:65 msgid "Show" msgstr "Wyświetl" #: main/currentlinewidget.cpp:70 msgid "Hide" msgstr "Ukryj" #: main/currentlinewidget.cpp:75 msgid "Duration" msgstr "Czas trwania" #: main/currentlinewidget.cpp:253 main/currentlinewidget.cpp:259 msgid "No current line" msgstr "Brak zaznaczonej linii" #: main/currentlinewidget.cpp:383 msgid "Current line:" msgstr "Aktualna linia:" #: main/currentlinewidget.cpp:408 msgid "1 character" msgid_plural "%1 characters" msgstr[0] "1 znak" msgstr[1] "%1 znaki" msgstr[2] "%1 znaków" #: main/dialogs/actionwitherrortargetsdialog.cpp:74 msgid "Available errors" msgstr "" #: main/dialogs/actionwitherrortargetsdialog.cpp:105 msgid "Select None" msgstr "Usuń zaznaczenie" #: main/dialogs/actionwithtargetdialog.cpp:131 msgid "Target >>" msgstr "Cel >>" #: main/dialogs/actionwithtargetdialog.cpp:131 #: main/dialogs/actionwithtargetdialog.cpp:149 msgid "Target <<" msgstr "Cel <<" #: main/dialogs/actionwithtargetdialog.cpp:164 msgid "All lines" msgstr "Wszystkie linie" #: main/dialogs/actionwithtargetdialog.cpp:165 main/utils/errorfinder.cpp:48 msgid "Selected lines" msgstr "Wybrane linie" #: main/dialogs/actionwithtargetdialog.cpp:166 msgid "All lines from first selected" msgstr "Wszystkie linie, od pierwszej zaznaczonej" #: main/dialogs/actionwithtargetdialog.cpp:167 msgid "All lines up to last selected" msgstr "Wszystkie linie, do ostatniej zaznaczonej" #: main/dialogs/actionwithtargetdialog.cpp:257 main/utils/finder.cpp:63 #: main/utils/replacer.cpp:61 msgid "Both subtitles" msgstr "Obydwa pliki napisów" #: main/dialogs/actionwithtargetdialog.cpp:260 main/utils/finder.cpp:65 #: main/utils/replacer.cpp:63 msgid "Primary subtitle" msgstr "Napisy podstawowe" #: main/dialogs/actionwithtargetdialog.cpp:263 main/utils/finder.cpp:67 #: main/utils/replacer.cpp:65 msgid "Translation subtitle" msgstr "Tłumaczenie napisów" #: main/dialogs/actionwithtargetdialog.h:78 msgid "Apply To" msgstr "Zastosuj do" # fuzzy #: main/dialogs/adjusttimesdialog.cpp:32 msgid "Adjust" msgstr "Dopasuj linie" #: main/dialogs/adjusttimesdialog.cpp:34 msgctxt "@title:group" msgid "New Times" msgstr "Nowe czasy" #: main/dialogs/adjusttimesdialog.cpp:39 msgid "First spoken line:" msgstr "Pierwsza wypowiedziana linia:" #: main/dialogs/adjusttimesdialog.cpp:45 msgid "Last spoken line:" msgstr "Ostania wypowiedziana linia:" #: main/dialogs/autodurationsdialog.cpp:38 #: main/dialogs/changeframeratedialog.cpp:36 #: main/dialogs/fixoverlappingtimesdialog.cpp:34 #: main/dialogs/fixpunctuationdialog.cpp:33 #: main/dialogs/smarttextsadjustdialog.cpp:34 #: main/dialogs/splitsubtitledialog.cpp:38 main/dialogs/translatedialog.cpp:33 msgctxt "@title:group" msgid "Settings" msgstr "Ustawienia" #: main/dialogs/autodurationsdialog.cpp:46 msgid "Milliseconds per line:" msgstr "Milisekund na linię:" #: main/dialogs/autodurationsdialog.cpp:55 msgid "Milliseconds per word:" msgstr "Milisekund na słowo:" #: main/dialogs/autodurationsdialog.cpp:64 msgid "Milliseconds per character:" msgstr "Milisekund na znak:" #: main/dialogs/autodurationsdialog.cpp:68 #: main/dialogs/durationlimitsdialog.cpp:45 msgid "Prevent overlapping" msgstr "Zapobiegaj nakładaniu" #: main/dialogs/autodurationsdialog.cpp:71 msgctxt "@title:group" msgid "Duration Calculation" msgstr "Obliczanie czasu trwania" #: main/dialogs/autodurationsdialog.cpp:77 msgid "Use primary text" msgstr "Użyj tekstu podstawowego" #: main/dialogs/autodurationsdialog.cpp:78 msgid "Use translation text" msgstr "Użyj tekstu tłumaczenia" #: main/dialogs/autodurationsdialog.cpp:79 msgid "Calculate both and use maximum" msgstr "Oblicz obydwa i użyj maksymalnego" #: main/dialogs/changeframeratedialog.cpp:45 msgid "Current frame rate:" msgstr "Bieżąca liczba klatek na sekundę:" #: main/dialogs/changeframeratedialog.cpp:54 msgid "New frame rate:" msgstr "Nowa liczba klatek na sekundę:" #: main/dialogs/changetextscasedialog.cpp:33 msgid "Change Case" msgstr "Zmień wielkość liter" #: main/dialogs/changetextscasedialog.cpp:35 msgctxt "@title:group" msgid "Change To" msgstr "Zmień na" #: main/dialogs/changetextscasedialog.cpp:39 msgid "Lower case" msgstr "Małe litery" #: main/dialogs/changetextscasedialog.cpp:44 msgid "Upper case" msgstr "Wielkie litery" #: main/dialogs/changetextscasedialog.cpp:48 msgid "Title case" msgstr "Jak tytuł" #: main/dialogs/changetextscasedialog.cpp:52 msgid "Sentence case" msgstr "Jak zdanie" #: main/dialogs/changetextscasedialog.cpp:56 msgid "Convert to lower case first" msgstr "Najpierw zmień na małe litery" #: main/dialogs/checkerrorsdialog.cpp:31 msgid "Check Errors" msgstr "Sprawdź błędy" #: main/dialogs/checkerrorsdialog.cpp:33 msgctxt "@title:group" msgid "Errors to Check" msgstr "Błędy do sprawdzenia" #: main/dialogs/checkerrorsdialog.cpp:36 msgctxt "@title:group Miscellaneous settings" msgid "Miscellaneous" msgstr "Rożne" #: main/dialogs/checkerrorsdialog.cpp:39 msgid "Clear other errors" msgstr "Wyczyść inne błędy" #: main/dialogs/checkerrorsdialog.cpp:43 msgid "Clear user marks" msgstr "Wyczyść znaczniki użytkownika" #: main/dialogs/clearerrorsdialog.cpp:32 msgid "Clear Errors" msgstr "Odznacz błędy" #: main/dialogs/clearerrorsdialog.cpp:34 msgctxt "@title:group" msgid "Errors to Clear" msgstr "Błędy do odznaczenia" #: main/dialogs/durationlimitsdialog.cpp:35 msgctxt "@title:group" msgid "Minimum Duration" msgstr "Minimalny czas trwania" #: main/dialogs/durationlimitsdialog.cpp:41 msgid "Expand duration to:" msgstr "Wydłuż czas trwania do:" #: main/dialogs/durationlimitsdialog.cpp:48 msgctxt "@title:group" msgid "Maximum Duration" msgstr "Maksymalny czas trwania" #: main/dialogs/durationlimitsdialog.cpp:54 msgid "Shrink duration to:" msgstr "Skróć czas trwania do:" #: main/dialogs/fixoverlappingtimesdialog.cpp:43 msgid "Minimum interval between lines:" msgstr "Minimalny interwał pomiędzy liniami:" #: main/dialogs/fixpunctuationdialog.cpp:31 msgid "Fix Punctuation" msgstr "Napraw interpunkcję" #: main/dialogs/fixpunctuationdialog.cpp:36 msgid "Fix and cleanup spaces" msgstr "Popraw i wyczyść białe znaki" #: main/dialogs/fixpunctuationdialog.cpp:40 msgid "Fix quotes and double quotes" msgstr "Popraw cudzysłowy" #: main/dialogs/fixpunctuationdialog.cpp:44 msgid "Fix English 'I' pronoun" msgstr "Popraw angielski zaimek \"I\"" #: main/dialogs/fixpunctuationdialog.cpp:48 msgid "Add ellipisis indicating non finished lines" msgstr "Dodaj wielokropek wskazujący niedokończone linie" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line Before Current" msgstr "Wstaw linię przed bieżącą" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line After Current" msgstr "Wstaw linię po bieżącej" #: main/dialogs/insertlinedialog.cpp:29 msgid "Insert Into" msgstr "Wstaw w" #: main/dialogs/joinsubtitlesdialog.cpp:40 msgid "Shift subtitle forwards before append" msgstr "Przesuń napisy do przodu przed dołączeniem" #: main/dialogs/joinsubtitlesdialog.cpp:47 #: main/dialogs/splitsubtitledialog.cpp:44 msgid "Set from video length" msgstr "Ustal na podstawie długości wideo" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Subtitle" msgstr "Otwórz napisy" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Translation Subtitle" msgstr "Otwórz tłumaczenie napisów" #: main/dialogs/opensubtitledialog.cpp:46 #: main/dialogs/savesubtitledialog.cpp:80 #: main/dialogs/selectablesubtitledialog.cpp:67 msgid "Encoding:" msgstr "Kodowanie:" #: main/dialogs/opensubtitledialog.cpp:73 msgid "All Supported" msgstr "Wszystkie wspierane" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove Selected Lines" msgstr "Usuń wybrane linie" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove From" msgstr "Usuń z" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Subtitle" msgstr "Zapisz napisy" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Translation Subtitle" msgstr "Zapisz tłumaczenie napisów" #: main/dialogs/savesubtitledialog.cpp:69 msgid "EOL:" msgstr "Koniec linii:" #: main/dialogs/savesubtitledialog.cpp:145 msgid "" "A file named \"%1\" already exists. Are you sure you want to overwrite it?" msgstr "Plik \"%1\" już istnieje. Czy na pewno chcesz go zastąpić?" #: main/dialogs/savesubtitledialog.cpp:148 msgid "Overwrite File?" msgstr "Zastąpić plik?" #: main/dialogs/savesubtitledialog.cpp:149 msgid "Overwrite" msgstr "Zastąp" #: main/dialogs/selectablesubtitledialog.cpp:51 msgid "Path:" msgstr "Ścieżka:" #: main/dialogs/selectablesubtitledialog.cpp:56 msgid "Select subtitle" msgstr "Wybierz napisy" #: main/dialogs/selectablesubtitledialog.h:54 msgid "Subtitle" msgstr "Napisy" # fuzzy #: main/dialogs/shifttimesdialog.cpp:32 msgid "Shift" msgstr "Shift" #: main/dialogs/shifttimesdialog.cpp:34 msgctxt "@title:group" msgid "Shifting" msgstr "Przesuwanie" #: main/dialogs/shifttimesdialog.cpp:38 msgid "Forwards (+)" msgstr "Naprzód (+)" #: main/dialogs/shifttimesdialog.cpp:39 msgid "Backwards (–)" msgstr "Wstecz (-)" #: main/dialogs/smarttextsadjustdialog.cpp:43 msgid "Minimum length for line break:" msgstr "Minimalna długość linii do złamania:" #: main/dialogs/splitsubtitledialog.cpp:36 msgid "Split Subtitle" msgstr "Podziel napisy" #: main/dialogs/splitsubtitledialog.cpp:49 msgid "Split time:" msgstr "Czas podziału:" #: main/dialogs/splitsubtitledialog.cpp:53 msgid "Shift new part backwards after split" msgstr "Przesuń nową część wstecz po podziale" #: main/dialogs/syncsubtitlesdialog.cpp:32 msgid "Synchronize with Subtitle" msgstr "Synchronizuj z napisami" #: main/dialogs/syncsubtitlesdialog.cpp:34 msgid "Reference Subtitle" msgstr "Napisy wzorcowe" #: main/dialogs/syncsubtitlesdialog.cpp:36 msgctxt "@title:group" msgid "Synchronization Mode" msgstr "Tryb synchronizacji" #: main/dialogs/syncsubtitlesdialog.cpp:39 msgid "Adjust to reference's first and last lines" msgstr "Dopasuj pierwszą i ostatnią linię do napisów wzorcowych" #: main/dialogs/syncsubtitlesdialog.cpp:43 msgid "Copy timing information from reference line by line" msgstr "Kopiuj informację czasową linia po linii z napisów wzorcowych" #: main/dialogs/translatedialog.cpp:49 #, fuzzy msgid "Input language:" msgstr "Jezyk: " #: main/dialogs/translatedialog.cpp:66 #, fuzzy msgid "Output language:" msgstr "Wyjście język:" #: main/errorsdialog.cpp:42 msgid "Subtitle Errors" msgstr "Błędy napisów" #: main/errorsdialog.cpp:55 msgid "Clear Fixed Errors" msgstr "Odznacz naprawione błędy" #: main/errorsdialog.cpp:65 msgid "Settings..." msgstr "Ustawienia..." #: main/errorsdialog.cpp:121 msgid "Showing 1 line with errors" msgid_plural "Showing %1 lines with errors" msgstr[0] "Wyświetlono 1 linię z błędami" msgstr[1] "Wyświetlono %1 linie z błędami" msgstr[2] "Wyświetlono %1 linii z błędami" #: main/errorsdialog.cpp:124 msgid "1 total error" msgid_plural "%1 total errors" msgstr[0] "1 błąd" msgstr[1] "%1 błędy" msgstr[2] "%1 błędów" #: main/errorsdialog.cpp:125 msgid "1 user mark" msgid_plural "%1 user marks" msgstr[0] "1 znacznik użytkownika" msgstr[1] "%1 znaczniki użytkownika" msgstr[2] "%1 znaczników użytkownika" #: main/errorswidget.cpp:491 msgid "Line Errors" msgstr "Błędy" #: main/errorswidget.cpp:492 msgid "Count" msgstr "Liczba" #: main/errorswidget.cpp:493 msgid "Marked" msgstr "Zaznaczone" #: main/errorswidget.cpp:509 msgid "yes" msgstr "tak" #: main/errorswidget.cpp:510 msgid "no" msgstr "nie" #: main/errorswidget.cpp:517 msgid "Line %1" msgstr "Linia %1" #: main/errorswidget.cpp:717 msgid "Expand All" msgstr "Rozwiń wszystko" #: main/errorswidget.cpp:718 msgid "Collapse All" msgstr "Zwiń wszystko" #: main/errorswidget.cpp:722 msgid "Clear Selected Marks" msgstr "Wyczyść wybrane znaczniki" #: main/errorswidget.cpp:723 msgid "Clear Selected Errors" msgstr "Wyczyść wybrane błędy" #: main/errorswidget.cpp:729 msgid "Clear Fixed Selection" msgstr "Wyczyść poprawione zaznaczenia" #: main/lineswidget.cpp:204 msgid "Observations:" msgstr "Komentarze:" #: main/lineswidget.cpp:232 msgctxt "@title:column Subtitle line number" msgid "Line" msgstr "Linia" #: main/lineswidget.cpp:233 msgctxt "@title:column" msgid "Show Time" msgstr "Wyświetl" #: main/lineswidget.cpp:234 msgctxt "@title:column" msgid "Hide Time" msgstr "Ukryj" #: main/lineswidget.cpp:235 msgctxt "@title:column Subtitle line (primary) text" msgid "Text" msgstr "Tekst" #: main/lineswidget.cpp:236 msgctxt "@title:column Subtitle line translation text" msgid "Translation" msgstr "Tłumaczenie" #: main/lineswidget.cpp:1141 msgid "Texts" msgstr "Tekst" #: main/lineswidget.cpp:1162 msgid "Styles" msgstr "Style" #: main/lineswidget.cpp:1166 widgets/simplerichtextedit.cpp:119 msgctxt "@action:inmenu Toggle bold style" msgid "Bold" msgstr "Pogrubienie" #: main/lineswidget.cpp:1173 widgets/simplerichtextedit.cpp:125 msgctxt "@action:inmenu Toggle italic style" msgid "Italic" msgstr "Kursywa" #: main/lineswidget.cpp:1180 widgets/simplerichtextedit.cpp:131 msgctxt "@action:inmenu Toggle underline style" msgid "Underline" msgstr "Podkreślenie" #: main/lineswidget.cpp:1187 widgets/simplerichtextedit.cpp:137 msgctxt "@action:inmenu Toggle strike through style" msgid "Strike Through" msgstr "Przekreślenie" #: main/lineswidget.cpp:1194 msgid "Times" msgstr "Czasy" # Need plural forms #: main/lineswidget.cpp:1196 msgid "Shift +%1 Milliseconds" msgstr "Przesuń o +%1 milisekund" # Need plural forms #: main/lineswidget.cpp:1197 msgid "Shift -%1 Milliseconds" msgstr "Przesuń o -%1 milisekund" #: main/lineswidget.cpp:1207 msgid "Errors" msgstr "Błędy" #: main/lineswidget.cpp:1208 msgid "Mark" msgstr "Oznacz" #: main/main.cpp:43 msgid "Subtitle Composer" msgstr "Subtitle Composer" #: main/main.cpp:45 msgid "A KDE subtitle editor." msgstr "Edytor napisów dla KDE" #: main/main.cpp:47 msgid "(C) 2007-2009 Sergio Pistone" msgstr "(C) 2007-2009 Sergio Pistone" #: main/main.cpp:51 msgid "Sergio Pistone" msgstr "Sergio Pistone" #: main/main.cpp:52 msgid "Author & maintainer" msgstr "Autor i opiekun" #: main/main.cpp:61 msgid "Open location as primary subtitle" msgstr "Otwórz położenie jako napisy podstawowe" #: main/main.cpp:62 msgid "Open location as translation subtitle" msgstr "Otwiera położenie jako napisy podstawowe" #: main/playerwidget.cpp:103 msgid "Position" msgstr "Pozycja" #: main/playerwidget.cpp:111 msgid "Length" msgstr "Długość" #: main/playerwidget.cpp:116 msgid "FPS" msgstr "FPS" #: main/playerwidget.cpp:704 main/playerwidget.cpp:705 #: main/playerwidget.cpp:706 main/playerwidget.cpp:778 #: main/playerwidget.cpp:795 main/playerwidget.cpp:802 msgid "Unknown" msgstr "Nieznany" #: main/playerwidget.cpp:715 msgid "There was an error opening file
%1
" msgstr "Wystąpił błąd podczas otwierania pliku
%1
" #: main/playerwidget.cpp:741 msgid "Unexpected error while playing file." msgstr "Niespodziewany błąd podczas odtwarzania pliku." #: main/scripting/scriptsmanager.cpp:70 msgid "Installed Scripts" msgstr "Zainstalowane skrypty" #: main/scripting/scriptsmanager.cpp:88 msgid "Information" msgstr "" #: main/scripting/scriptsmanager.cpp:94 msgid "Warning" msgstr "" #: main/scripting/scriptsmanager.cpp:100 #, fuzzy msgid "Error" msgstr "Błędy" #: main/scripting/scriptsmanager.cpp:113 msgid "Scripts Manager" msgstr "Menedżer skryptów" #: main/scripting/scriptsmanager.cpp:129 msgid "Create..." msgstr "Utwórz..." #: main/scripting/scriptsmanager.cpp:130 msgid "Creates a new script file." msgstr "Tworzy nowy skrypt." # fuzzy #: main/scripting/scriptsmanager.cpp:135 msgid "Add..." msgstr "Dodaj..." #: main/scripting/scriptsmanager.cpp:136 msgid "Copies an existing script from a specified location." msgstr "Kopiuje istniejący skrypt ze wskazanej lokalizacji." #: main/scripting/scriptsmanager.cpp:142 msgid "Sends the selected script to the trash." msgstr "Przenosi zaznaczony skrypt do kosza." #: main/scripting/scriptsmanager.cpp:147 msgid "Edit" msgstr "Edytuj" #: main/scripting/scriptsmanager.cpp:148 msgid "Opens the selected script with an external editor." msgstr "Otwiera zaznaczony skrypt w zewnętrznym edytorze." #: main/scripting/scriptsmanager.cpp:154 msgid "Run" msgstr "Uruchom" #: main/scripting/scriptsmanager.cpp:155 msgid "Executes the selected script." msgstr "Wykonuje zaznaczony skrypt." #: main/scripting/scriptsmanager.cpp:160 msgid "Refresh" msgstr "Odśwież" #: main/scripting/scriptsmanager.cpp:161 msgid "Reloads the installed scripts list." msgstr "Wczytuje ponownie listę zainstalowanych skryptów." #: main/scripting/scriptsmanager.cpp:219 main/scripting/scriptsmanager.cpp:301 msgid "" "You must enter an unused name to continue.\n" "Would you like to enter another name?" msgstr "" "Aby kontynuować należy wprowadzić nieużywaną nazwę.\n" "Czy chcesz wprowadzić inną nazwę?" #: main/scripting/scriptsmanager.cpp:220 main/scripting/scriptsmanager.cpp:302 msgid "Name Already Used" msgstr "Nazwa jest już w użyciu" #: main/scripting/scriptsmanager.cpp:226 msgid "Create New Script" msgstr "Utwórz nowy skrypt" #: main/scripting/scriptsmanager.cpp:226 main/scripting/scriptsmanager.cpp:308 msgid "Script name:" msgstr "Nazwa skryptu:" #: main/scripting/scriptsmanager.cpp:239 msgid "There was an error creating the file %1." msgstr "Wystąpił błąd podczas tworzenia pliku %1." #: main/scripting/scriptsmanager.cpp:283 msgid "Select Existing Script" msgstr "Wybierz istniejący skrypt" #: main/scripting/scriptsmanager.cpp:308 msgid "Rename Script" msgstr "Zmień nazwę skryptu" #: main/scripting/scriptsmanager.cpp:322 msgid "There was an error opening the file %1." msgstr "Wystąpił błąd podczas otwierania pliku %1." #: main/scripting/scriptsmanager.cpp:331 msgid "There was an error copying the file to %1." msgstr "Wystąpił błąd podczas kopiowania pliku %1." #: main/scripting/scriptsmanager.cpp:350 msgid "Do you really want to send file %1 to the trash?" msgstr "Czy chcesz przenieść plik %1 do kosza?" #: main/scripting/scriptsmanager.cpp:351 msgid "Move to Trash" msgstr "Przenieś do kosza" #: main/scripting/scriptsmanager.cpp:359 msgid "There was an error removing the file %1." msgstr "Wystąpił błąd podczas usuwania pliku %1." #: main/scripting/scriptsmanager.cpp:377 msgid "Could not launch external editor.\n" msgstr "Nie udało się uruchomić zewnętrznego edytora.\n" #: main/scripting/scriptsmanager.cpp:441 main/scripting/scriptsmanager.cpp:448 msgid "Error Running Script" msgstr "Błąd podczas wykonywania skryptu" #: main/scripting/scriptsmanager.cpp:462 msgid "Tools" msgstr "Narzędzia" #: main/utils/errorfinder.cpp:40 main/utils/errorfinder.cpp:221 #: main/utils/errorfinder.cpp:244 msgid "Find Error" msgstr "Znajdź błąd" #: main/utils/errorfinder.cpp:42 msgid "Errors to Find" msgstr "Wyszukaj błędy" #: main/utils/errorfinder.cpp:45 msgid "Options" msgstr "Opcje" #: main/utils/errorfinder.cpp:51 msgid "From current line" msgstr "Od bieżącej linii" #: main/utils/errorfinder.cpp:55 msgid "Find backwards" msgstr "Wyszukaj wstecz" #: main/utils/errorfinder.cpp:216 main/utils/finder.cpp:298 #: main/utils/replacer.cpp:258 msgid "" "Beginning of selection reached.\n" "Continue from the end?" msgstr "Osiągnięto początek zaznaczenia
Kontynuować od końca?" #: main/utils/errorfinder.cpp:217 main/utils/finder.cpp:299 #: main/utils/replacer.cpp:259 msgid "" "Beginning of subtitle reached.\n" "Continue from the end?" msgstr "Osiągnięto początek napisów.
Kontynuować od końca?" #: main/utils/errorfinder.cpp:219 main/utils/finder.cpp:301 #: main/utils/replacer.cpp:261 msgid "" "End of selection reached.\n" "Continue from the beginning?" msgstr "Osiągnięto koniec zaznaczenia
Kontynuować od początku?" #: main/utils/errorfinder.cpp:220 main/utils/finder.cpp:302 #: main/utils/replacer.cpp:262 main/utils/speller.cpp:143 msgid "" "End of subtitle reached.\n" "Continue from the beginning?" msgstr "Osiągnięto koniec napisów.
Kontynuować od początku?" #: main/utils/errorfinder.cpp:243 msgid "No errors matching given criteria found!" msgstr "Nie odnaleziono elementów pasujących do podanych kryteriów." #: main/utils/finder.cpp:55 msgid "Find In" msgstr "Znajdź w" #: main/utils/finder.cpp:278 main/utils/replacer.cpp:234 msgid "No instances of '%1' found!" msgstr "Brak wystąpień '%1'!" #: main/utils/finder.cpp:279 main/utils/finder.cpp:303 msgid "Find" msgstr "Znajdź" #: main/utils/kreplace.cpp:49 main/utils/kreplace.cpp:53 #: main/utils/replacer.cpp:172 main/utils/replacer.cpp:229 #: main/utils/replacer.cpp:235 main/utils/replacer.cpp:263 msgid "Replace" msgstr "Zastąp" #: main/utils/kreplace.cpp:51 msgid "&All" msgstr "&Wszystko" #: main/utils/kreplace.cpp:52 msgid "&Skip" msgstr "&Pomiń" #: main/utils/kreplace.cpp:63 msgid "Replace '%1' with '%2'?" msgstr "Zamienić '%1' na '%2'?" #: main/utils/kreplace.cpp:139 main/utils/kreplace.cpp:406 msgid "No text was replaced." msgstr "Nie zastąpiono żadnego tekstu." #: main/utils/kreplace.cpp:141 main/utils/kreplace.cpp:408 #: main/utils/replacer.cpp:228 main/utils/replacer.cpp:255 msgid "1 replacement done." msgid_plural "%1 replacements done." msgstr[0] "Wykonano 1 zamianę." msgstr[1] "Wykonano %2 zamiany." msgstr[2] "Wykonano %1 zaman." #: main/utils/kreplace.cpp:413 msgid "Beginning of document reached." msgstr "Osiągnięto początek dokumentu." #: main/utils/kreplace.cpp:415 msgid "End of document reached." msgstr "Osiągnięto koniec dokumentu." #: main/utils/kreplace.cpp:422 msgid "Do you want to restart search from the end?" msgstr "Czy rozpocząć szukanie od końca?" #: main/utils/kreplace.cpp:423 msgid "Do you want to restart search at the beginning?" msgstr "Czy rozpocząć szukanie od początku?" #: main/utils/kreplace.cpp:425 msgid "Restart" msgstr "Uruchom ponownie" #: main/utils/language.cpp:125 msgid "Automatic" msgstr "Automatyczne" #: main/utils/language.cpp:129 msgctxt "Official language of the Philippines, aka Filipino" msgid "Tagalog" msgstr "tagalski" #: main/utils/replacer.cpp:53 msgid "Find/Replace In" msgstr "Znajdź/Zastąp" #: main/utils/speller.cpp:144 msgid "Spell Checking" msgstr "Sprawdzanie pisowni" #: main/utils/translator.cpp:167 msgid "Operation cancelled by user" msgstr "" #: main/utils/translator.cpp:270 main/utils/translator.cpp:280 msgid "Unexpected contents received from translation service" msgstr "Usługa tłumacząca zwróciła nieoczekiwaną treść" #: player/gstreamer/gstreamerbackend.cpp:543 #: player/mplayer/mplayerbackend.cpp:259 player/xine/xinebackend.cpp:278 msgid "Audio Stream #%1" msgstr "Strumień audio #%1" #: player/gstreamer/gstreamerconfigwidget.cpp:34 msgctxt "@title:group GStreamer sinks settings" msgid "Sinks" msgstr "Potoki" #: player/gstreamer/gstreamerconfigwidget.cpp:37 msgid "Audio sink:" msgstr "Wyjście audio:" #: player/gstreamer/gstreamerconfigwidget.cpp:46 msgid "Video sink:" msgstr "Wyjście wideo:" #: player/mplayer/mplayerconfigwidget.cpp:40 msgid "Executable path:" msgstr "Ścieżka do pliku wykonywalnego:" #: player/mplayer/mplayerconfigwidget.cpp:43 msgid "Select the MPlayer executable" msgstr "Wybierz plik wykonywalny programu MPlayer" #: player/mplayer/mplayerconfigwidget.cpp:47 msgctxt "@title:group Video settings" msgid "Video" msgstr "Wideo" #: player/mplayer/mplayerconfigwidget.cpp:50 msgid "Video output driver:" msgstr "Sterownik wyjścia wideo:" #: player/mplayer/mplayerconfigwidget.cpp:58 msgid "Allow frame dropping" msgstr "Dopuść opuszczanie ramek" #: player/mplayer/mplayerconfigwidget.cpp:61 msgid "Allow hard frame dropping" msgstr "Dopuść silne opuszczanie ramek" #: player/mplayer/mplayerconfigwidget.cpp:64 msgctxt "@title:group Audio settings" msgid "Audio" msgstr "Audio" #: player/mplayer/mplayerconfigwidget.cpp:67 msgid "Audio output driver:" msgstr "Sterownik wyjścia audio:" #: player/mplayer/mplayerconfigwidget.cpp:75 msgid "A/V synchronization factor:" msgstr "Współczynnik synchronizacji audio/wideo:" #: player/mplayer/mplayerconfigwidget.cpp:83 msgid "Volume normalization" msgstr "Normalizacja głośności" #: player/xine/xineconfigwidget.cpp:34 msgctxt "@title:group Xine drivers settings" msgid "Drivers" msgstr "Sterowniki" #: player/xine/xineconfigwidget.cpp:37 msgid "Audio driver:" msgstr "Sterownik audio:" #: player/xine/xineconfigwidget.cpp:45 msgid "Video driver:" msgstr "Sterownik wideo:" #: widgets/simplerichtextedit.cpp:84 msgid "Cut" msgstr "Wytnij" #: widgets/simplerichtextedit.cpp:90 msgid "Copy" msgstr "Kopiuj" #: widgets/simplerichtextedit.cpp:96 msgid "Paste" msgstr "Wklej" #: widgets/simplerichtextedit.cpp:102 msgid "Delete" msgstr "Usuń" #: widgets/simplerichtextedit.cpp:108 msgctxt "@action:inmenu Clear all text" msgid "Clear" msgstr "Wyczyść" #: widgets/simplerichtextedit.cpp:143 msgid "Check Spelling..." msgstr "Sprawdzanie pisowni..." #: widgets/simplerichtextedit.cpp:147 msgid "Auto Spell Check" msgstr "Automatyczne sprawdzanie pisowni" #: widgets/simplerichtextedit.cpp:152 msgid "Allow Tabulations" msgstr "Dopuść tabulację" #: widgets/simplerichtextedit.cpp:491 msgid "Suggestions" msgstr "Sugestie" #: widgets/simplerichtextedit.cpp:492 msgid "Ignore" msgstr "Ignoruj" #: widgets/simplerichtextedit.cpp:493 msgid "Add to Dictionary" msgstr "Dodaj do słownika" #: widgets/simplerichtextedit.cpp:497 msgid "No suggestions" msgstr "Brak sugestii" #. i18n: file: main/subtitlecomposerui.rc:5 #. i18n: ectx: Menu (file) #: rc.cpp:3 msgid "&File" msgstr "&Plik" #. i18n: file: main/subtitlecomposerui.rc:16 #. i18n: ectx: Menu (translation) #: rc.cpp:6 msgid "Translation" msgstr "Tłumaczenie" #. i18n: file: main/subtitlecomposerui.rc:28 #. i18n: ectx: Menu (edit) #: rc.cpp:9 msgid "&Edit" msgstr "&Edycja" #. i18n: file: main/subtitlecomposerui.rc:51 #. i18n: ectx: Menu (texts) #: rc.cpp:12 msgid "&Texts" msgstr "&Tekst" #. i18n: file: main/subtitlecomposerui.rc:62 #. i18n: ectx: Menu (styles) #: rc.cpp:15 msgid "St&yles" msgstr "St&yl" #. i18n: file: main/subtitlecomposerui.rc:69 #. i18n: ectx: Menu (times) #: rc.cpp:18 msgid "T&imes" msgstr "&Czas" #. i18n: file: main/subtitlecomposerui.rc:91 #. i18n: ectx: Menu (errors) #: rc.cpp:21 msgid "E&rrors" msgstr "&Błędy" #. i18n: file: main/subtitlecomposerui.rc:104 #. i18n: ectx: Menu (video) #: rc.cpp:24 msgid "&Video" msgstr "&Wídeo" #. i18n: file: main/subtitlecomposerui.rc:132 #. i18n: ectx: Menu (tools) #: rc.cpp:27 msgid "T&ools" msgstr "Narzędzia" #. i18n: file: main/subtitlecomposerui.rc:137 #. i18n: ectx: Menu (audiolevels) #: rc.cpp:30 msgid "&Audio Levels" msgstr "Poziomy &audio" #. i18n: file: main/subtitlecomposerui.rc:153 #. i18n: ectx: ToolBar (mainToolBar) #: rc.cpp:33 msgid "Main Toolbar" msgstr "Główny pasek narzędzi" #. i18n: file: main/subtitlecomposerui.rc:165 #. i18n: ectx: ToolBar (editToolBar) #: rc.cpp:36 msgctxt "The toolbar name" msgid "Edit Toolbar" msgstr "Edytuj pasek narzędzi" #: rc.cpp:37 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Tomek Argasiński" #: rc.cpp:38 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "targasinski@o2.pl" #~ msgid "There was an error opening the audiolevels." #~ msgstr "Wytąpił błąd podczas otwierania pliku poziomów audio." #~ msgid "Save AudioLevels" #~ msgstr "Zapisz plik poziomów audio" #~ msgid "There was an error saving the audiolevels." #~ msgstr "Wystapił błąd podczas zapisywania poziomów audio." #~ msgid "Toggle Line Mark" #~ msgstr "Przełącz znacznik linii" #~ msgctxt "@title:group" #~ msgid "Subtitles font" #~ msgstr "Czionka napisów" #~ msgid "Size:" #~ msgstr "Rozmiar:" #~ msgid "Append to" #~ msgstr "Dołącz do" #~ msgid "1 mark" #~ msgid_plural "%1 marks" #~ msgstr[0] "1 znacznik" #~ msgstr[1] "%1 znaczniki" #~ msgstr[2] "%1 znaczników" #~ msgid "Line Issues" #~ msgstr "Problemy z liniamii" #~ msgid "Marks" #~ msgstr "Znaczniki" #~ msgid "No line with errors found!" #~ msgstr "Nie znaleziono linii z błędami!" #~ msgid "Sort Lines" #~ msgstr "Sortuj linie" #~ msgid "Apply Duration Limits" #~ msgstr "Zastosuj limity czasu trwania" #~ msgid "Smart Lines Adjust" #~ msgstr "Inteligentne dopasowanie linii" # Need plural forms. #~ msgid "Shift selected lines -%1 milliseconds" #~ msgstr "Przesuwa wybrane linie o -%1 milisekund" #~ msgid "Automatic Durations..." #~ msgstr "Automatyczne czasy trwania..." #~ msgid "Smart Lines Adjust..." #~ msgstr "Inteligentne dopasowanie linii..." #~ msgid "Adjust Subtitles" #~ msgstr "Dopasuj napisy" #~ msgid "Shift Subtitles" #~ msgstr "Przesuń napisy" subtitlecomposer-0.5.3/po/de/0000755000175000001440000000000011206423743015341 5ustar sergiouserssubtitlecomposer-0.5.3/po/de/CMakeLists.txt0000644000175000001440000000016611151345073020102 0ustar sergiousersFILE( GLOB _po_files *.po ) GETTEXT_PROCESS_PO_FILES( de ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) subtitlecomposer-0.5.3/po/de/subtitlecomposer.po0000644000175000001440000017210511206411600021277 0ustar sergiousers# translation of subtitlecomposer.po to German # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # Panagiotis Papadopoulos , 2008. msgid "" msgstr "" "Project-Id-Version: subtitlecomposer\n" "Report-Msgid-Bugs-To: https://sourceforge.net/tracker/?" "atid=1005652&group_id=208427&func=browse\n" "POT-Creation-Date: 2009-05-25 00:41-0300\n" "PO-Revision-Date: 2008-12-13 02:35+0100\n" "Last-Translator: Panagiotis Papadopoulos \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Lokalize 0.3\n" #: core/subtitleactions.cpp:62 #, fuzzy msgid "Set Frame Rate" msgstr "Bildwiederholrate einstellen" #: core/subtitleactions.cpp:93 msgid "Insert Lines" msgstr "Zeilen einfügen" #: core/subtitleactions.cpp:177 core/subtitle.cpp:446 core/subtitle.cpp:460 #: core/subtitle.cpp:479 msgid "Remove Lines" msgstr "Zeilen entfernen" #: core/subtitleactions.cpp:268 msgid "Move Line" msgstr "" #: core/subtitleactions.cpp:381 msgid "Swap Texts" msgstr "" #: core/subtitle.cpp:66 msgid "Set Primary Data" msgstr "" #: core/subtitle.cpp:121 msgid "Clear Primary Text Data" msgstr "" #: core/subtitle.cpp:134 msgid "Set Secondary Data" msgstr "" #: core/subtitle.cpp:180 msgid "Clear Secondary Text Data" msgstr "" #: core/subtitle.cpp:265 main/dialogs/changeframeratedialog.cpp:34 msgid "Change Frame Rate" msgstr "Bildwiederholrate ändern" #: core/subtitle.cpp:395 core/subtitle.cpp:412 msgid "Insert Line" msgstr "Zeile einfügen" #: core/subtitle.cpp:533 main/application.cpp:662 main/lineswidget.cpp:1226 msgid "Split Lines" msgstr "Zeilen trennen" #: core/subtitle.cpp:590 main/application.cpp:670 main/lineswidget.cpp:1225 msgid "Join Lines" msgstr "Zeilen zusammenführen" #: core/subtitle.cpp:642 msgid "Shift Lines" msgstr "Zeilen verschieben" #: core/subtitle.cpp:690 msgid "Adjust Lines" msgstr "" #: core/subtitle.cpp:700 main/application.cpp:2377 main/lineswidget.cpp:1200 #, fuzzy msgid "Sort" msgstr "Sortieren" #: core/subtitle.cpp:746 main/dialogs/durationlimitsdialog.cpp:33 msgid "Enforce Duration Limits" msgstr "" #: core/subtitle.cpp:791 main/application.cpp:2462 main/lineswidget.cpp:1203 msgid "Maximize Durations" msgstr "" #: core/subtitle.cpp:816 main/dialogs/autodurationsdialog.cpp:35 msgid "Set Automatic Durations" msgstr "" #: core/subtitle.cpp:856 main/dialogs/fixoverlappingtimesdialog.cpp:32 #: main/lineswidget.cpp:1204 #, fuzzy msgid "Fix Overlapping Times" msgstr "Überlappende Zeiten korrigieren" #: core/subtitle.cpp:890 #, fuzzy msgid "Fix Lines Punctuation" msgstr "Zeichensetzung in den Zeilen korrigieren" #: core/subtitle.cpp:986 msgid "Lower Case" msgstr "Kleinbuchstaben" #: core/subtitle.cpp:1020 msgid "Upper Case" msgstr "Großbuchstaben" #: core/subtitle.cpp:1054 msgid "Title Case" msgstr "" #: core/subtitle.cpp:1091 msgid "Sentence Case" msgstr "" #: core/subtitle.cpp:1142 main/dialogs/smarttextsadjustdialog.cpp:32 msgid "Break Lines" msgstr "" #: core/subtitle.cpp:1150 main/application.cpp:2530 main/lineswidget.cpp:1146 msgid "Unbreak Lines" msgstr "" #: core/subtitle.cpp:1158 main/application.cpp:2544 main/lineswidget.cpp:1152 msgid "Simplify Spaces" msgstr "" #: core/subtitle.cpp:1167 msgid "Synchronize Subtitles" msgstr "" #: core/subtitle.cpp:1190 main/dialogs/joinsubtitlesdialog.cpp:35 msgid "Join Subtitles" msgstr "Untertitel zusammenführen..." #: core/subtitle.cpp:1236 core/subtitle.cpp:1242 msgid "Split Subtitles" msgstr "Untertitel trennen" #: core/subtitle.cpp:1259 core/subtitle.cpp:1274 msgid "Set Lines Style" msgstr "" #: core/subtitle.cpp:1291 msgid "Toggle Lines Style" msgstr "" #: core/subtitle.cpp:1304 msgid "Set Lines Mark" msgstr "" #: core/subtitle.cpp:1304 msgid "Clear Lines Mark" msgstr "" #: core/subtitle.cpp:1318 msgid "Toggle Lines Mark" msgstr "" #: core/subtitle.cpp:1328 main/application.cpp:2261 main/application.cpp:2271 #: main/errorswidget.cpp:854 msgid "Clear Lines Errors" msgstr "" #: core/subtitle.cpp:1338 core/subtitle.cpp:1358 main/application.cpp:2194 #: main/application.cpp:2239 msgid "Check Lines Errors" msgstr "" #: core/subtitlelineactions.cpp:65 msgid "Set Line Text" msgstr "" #: core/subtitlelineactions.cpp:101 msgid "Set Line Secondary Text" msgstr "" #: core/subtitlelineactions.cpp:137 msgid "Set Line Texts" msgstr "" #: core/subtitlelineactions.cpp:218 msgid "Set Line Show Time" msgstr "" #: core/subtitlelineactions.cpp:254 msgid "Set Line Hide Time" msgstr "" #: core/subtitlelineactions.cpp:371 msgid "Set Line Errors" msgstr "" #: core/subtitleline.cpp:72 msgid "Empty text" msgstr "Leere Zeilen" #: core/subtitleline.cpp:74 msgid "Too many characters" msgstr "Zu viele Zeichen" #: core/subtitleline.cpp:76 msgid "Too many lines" msgstr "Zu viele Zeilen" #: core/subtitleline.cpp:78 #, fuzzy msgid "Unnecessary white space" msgstr "Unnötige Leerzeichen" #: core/subtitleline.cpp:80 #, fuzzy msgid "Unnecessary dash" msgstr "Unnötige Schrägstriche" #: core/subtitleline.cpp:82 #, fuzzy msgid "Capital letter after continuation ellipsis" msgstr "Großbuchstaben nach Auslassungspunktzeile" #: core/subtitleline.cpp:84 #, fuzzy msgid "Too long duration per character" msgstr "Zu lange Laufzeit pro Zeichen" #: core/subtitleline.cpp:86 #, fuzzy msgid "Too short duration per character" msgstr "Zu kurze Laufzeit pro Zeichen" #: core/subtitleline.cpp:88 #, fuzzy msgid "Too long duration" msgstr "Zu lange Laufzeit" #: core/subtitleline.cpp:89 #, fuzzy msgid "Too short duration" msgstr "Zu kurze Laufzeit" #: core/subtitleline.cpp:90 msgid "Overlapping times" msgstr "" #: core/subtitleline.cpp:91 msgid "Untranslated text" msgstr "" #: core/subtitleline.cpp:92 msgid "User mark" msgstr "" #: core/subtitleline.cpp:112 msgid "Has no primary text." msgstr "" #: core/subtitleline.cpp:116 msgid "Has no translation text." msgstr "" #: core/subtitleline.cpp:120 msgid "Has too many characters in primary text (1 char)." msgid_plural "Has too many characters in primary text (%1 chars)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:126 msgid "Has too many characters in translation text (1 char)." msgid_plural "Has too many characters in translation text (%1 chars)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:132 msgid "Has too many lines in primary text (1 line)." msgid_plural "Has too many lines in primary text (%1 lines)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:138 msgid "Has too many lines in translation text (1 line)." msgid_plural "Has too many lines in translation text (%1 lines)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:144 msgid "Has unnecessary spaces in primary text." msgstr "" #: core/subtitleline.cpp:148 msgid "Has unnecessary spaces in translation text." msgstr "" #: core/subtitleline.cpp:152 msgid "Has unnecessary dash in primary text." msgstr "" #: core/subtitleline.cpp:156 msgid "Has unnecessary dash in translation text." msgstr "" #: core/subtitleline.cpp:160 msgid "Has capital letter after line continuation ellipsis in primary text." msgstr "" #: core/subtitleline.cpp:164 msgid "" "Has capital letter after line continuation ellipsis in translation text." msgstr "" #: core/subtitleline.cpp:168 msgid "Has too long duration per character in primary text (1 msec/char)." msgid_plural "" "Has too long duration per character in primary text (%1 msecs/char)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:174 msgid "Has too long duration per character in translation text (1 msec/char)." msgid_plural "" "Has too long duration per character in translation text (%1 msecs/char)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:180 msgid "Has too short duration per character in primary text (1 msec/char)." msgid_plural "" "Has too short duration per character in primary text (%1 msecs/char)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:186 msgid "Has too short duration per character in translation text (1 msec/char)." msgid_plural "" "Has too short duration per character in translation text (%1 msecs/char)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:192 msgid "Has too long duration (1 msec)." msgid_plural "Has too long duration (%1 msecs)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:198 msgid "Has too short duration (1 msec)." msgid_plural "Has too short duration (%1 msecs)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:204 msgid "Overlaps with next line." msgstr "" #: core/subtitleline.cpp:208 msgid "Has untranslated text." msgstr "" #: core/subtitleline.cpp:212 msgid "Has user mark." msgstr "" #: core/subtitleline.cpp:680 msgid "Set Line Times" msgstr "" #: core/subtitleline.cpp:691 msgid "Shift Line Times" msgstr "" #: core/subtitleline.cpp:705 msgid "Adjust Line Times" msgstr "" #: main/actions/krecentfilesactionext.cpp:37 msgid "Clear History" msgstr "Verlauf löschen" #: main/application.cpp:415 msgid "Video Files" msgstr "Video-Dateien" #: main/application.cpp:423 msgid "Audio Files" msgstr "Audio-Dateien" #: main/application.cpp:425 msgid "Media Files" msgstr "Medien-Dateien" #: main/application.cpp:426 msgid "All Files" msgstr "Alle Dateien" #: main/application.cpp:442 msgid "Audio Levels Files" msgstr "" #: main/application.cpp:456 msgid "Exit the application" msgstr "Die Anwendung beenden" #: main/application.cpp:460 msgid "Configure Subtitle Composer" msgstr "Subtitle Composer einrichten" #: main/application.cpp:465 msgctxt "@action:inmenu Create a new subtitle" msgid "New" msgstr "Neu" #: main/application.cpp:466 msgid "Create an empty subtitle" msgstr "Einen neuen Untertitel erstellen" #: main/application.cpp:475 msgctxt "@action:inmenu Open subtitle file" msgid "Open..." msgstr "Öffnen..." #: main/application.cpp:476 main/application.cpp:486 msgid "Open subtitle file" msgstr "Eine Untertiteldatei öffnen" #: main/application.cpp:485 msgctxt "@action:inmenu Open rencently used subtitle file" msgid "Open &Recent" msgstr "Zuletzt geöffnet" #: main/application.cpp:493 msgid "Save" msgstr "Speichern" #: main/application.cpp:494 msgid "Save opened subtitle" msgstr "Untertitel speichern" #: main/application.cpp:503 msgid "Save As..." msgstr "Speichern unter..." #: main/application.cpp:504 msgid "Save opened subtitle with different settings" msgstr "Untertitel mit anderen Einstellungen speichern" #: main/application.cpp:512 msgid "Close" msgstr "Schließen" #: main/application.cpp:513 msgid "Close opened subtitle" msgstr "Untertitel schließen" #: main/application.cpp:522 msgid "New Translation" msgstr "Neue Übersetzung" #: main/application.cpp:523 msgid "Create an empty translation subtitle" msgstr "Eine neue Untertitelübersetzung erstellen" #: main/application.cpp:532 msgid "Open Translation..." msgstr "Übersetzung öffnen..." #: main/application.cpp:533 main/application.cpp:543 msgid "Open translation subtitle file" msgstr "Einen Übersetzungsuntertitel öffnen" #: main/application.cpp:542 msgid "Open &Recent Translation" msgstr "Zuletzt geöffnete Übe&rsetzungen" #: main/application.cpp:551 msgid "Save Translation" msgstr "Übersetzung speichern" #: main/application.cpp:552 msgid "Save opened translation subtitle" msgstr "Übersetzungsuntertitel speichern" #: main/application.cpp:561 msgid "Save Translation As..." msgstr "Übersetzung speichern unter..." #: main/application.cpp:562 #, fuzzy msgid "Save opened translation subtitle with different settings" msgstr "Übersetzungsuntertitel mit anderen Einstellungen speichern" #: main/application.cpp:570 msgid "Close Translation" msgstr "Übersetzung schließen" #: main/application.cpp:571 msgid "Close opened translation subtitle" msgstr "Übersetzungsuntertitel schließen" #: main/application.cpp:580 #, fuzzy msgid "Reload As..." msgstr "Erneut laden als..." #: main/application.cpp:581 main/application.cpp:592 msgid "Reload opened file with a different encoding" msgstr "Datei mit einer anderen Kodierung erneut öffnen" #: main/application.cpp:591 msgid "Quick Reload As..." msgstr "" #: main/application.cpp:600 main/application.cpp:601 #: widgets/simplerichtextedit.cpp:72 msgid "Undo" msgstr "Rückgängig" #: main/application.cpp:610 main/application.cpp:611 #: widgets/simplerichtextedit.cpp:78 msgid "Redo" msgstr "Wiederherstellen" #: main/application.cpp:619 msgid "Split Subtitle..." msgstr "Untertitel trennen..." #: main/application.cpp:620 #, fuzzy msgid "Split the opened subtitle in two parts" msgstr "Den Untertitel in zwei Teile trennen" #: main/application.cpp:627 msgid "Join Subtitles..." msgstr "Untertitel zusammenführen..." #: main/application.cpp:628 #, fuzzy msgid "Append to the opened subtitle another one" msgstr "Dem Untertitel einen anderen hinzufügen" #: main/application.cpp:635 main/lineswidget.cpp:1222 msgid "Insert Before" msgstr "Enfügen vor" #: main/application.cpp:636 msgid "Insert empty line before current one" msgstr "Eine leere Zeile vor der ausgewählten Zeile einfügen" #: main/application.cpp:644 main/lineswidget.cpp:1223 msgid "Insert After" msgstr "Einfügen nach" #: main/application.cpp:645 msgid "Insert empty line after current one" msgstr "Eine leere Zeile nach der ausgewählten Zeile einfügen" #: main/application.cpp:653 main/lineswidget.cpp:1221 #: main/scripting/scriptsmanager.cpp:141 msgid "Remove" msgstr "Entfernen" #: main/application.cpp:654 msgid "Remove selected lines" msgstr "Ausgewählte Zeilen entfernen" #: main/application.cpp:663 msgid "Split selected lines" msgstr "Ausgewählte Zeilen trennen" #: main/application.cpp:671 msgid "Join selected lines" msgstr "Ausgewählte Zeilen zusammenführen" #: main/application.cpp:678 main/dialogs/actionwitherrortargetsdialog.cpp:103 #: main/lineswidget.cpp:1219 widgets/simplerichtextedit.cpp:113 msgid "Select All" msgstr "Alles auswählen" #: main/application.cpp:679 msgid "Select all lines" msgstr "Alle Zeilen auswählen" #: main/application.cpp:687 msgid "Go to Line..." msgstr "Gehe zu Zeile..." #: main/application.cpp:688 msgid "Go to specified line" msgstr "Zu einer bestimmten Zeile springen" #: main/application.cpp:697 msgid "Find..." msgstr "Suchen..." #: main/application.cpp:698 #, fuzzy msgid "Find occurrences of strings or regular expressions" msgstr "Vorkommende Strings oder reguläre Ausdrücke suchen" #: main/application.cpp:708 msgid "Find Next" msgstr "Nächstes suchen" #: main/application.cpp:709 #, fuzzy msgid "Find next occurrence of string or regular expression" msgstr "Nächsten vorkommende Strings oder regulären Ausdruck suchen" #: main/application.cpp:719 msgid "Find Previous" msgstr "Vorheriges Suchen" #: main/application.cpp:720 #, fuzzy msgid "Find previous occurrence of string or regular expression" msgstr "Vorherigen vorkommenden String oder regulären Ausdruck suchen" #: main/application.cpp:728 msgid "Replace..." msgstr "Ersetzen..." #: main/application.cpp:729 msgid "Replace occurrences of strings or regular expressions" msgstr "" #: main/application.cpp:738 msgid "Retrocede current line" msgstr "" #: main/application.cpp:739 msgid "Makes the line before the current one active" msgstr "" #: main/application.cpp:748 msgid "Advance current line" msgstr "" #: main/application.cpp:749 msgid "Makes the line after the current one active" msgstr "" #: main/application.cpp:757 main/errorsdialog.cpp:59 main/lineswidget.cpp:1212 msgid "Check Errors..." msgstr "Fehler suchen..." #: main/application.cpp:758 msgid "Check for errors in the current subtitle" msgstr "In dem aktuellem Untertitel nach Fehlern suchen" #: main/application.cpp:766 main/errorsdialog.cpp:62 main/lineswidget.cpp:1213 msgid "Clear Errors..." msgstr "Fehler korrigieren..." #: main/application.cpp:767 msgid "Clear errors from selected lines" msgstr "" #: main/application.cpp:774 main/lineswidget.cpp:1215 msgid "Show Errors..." msgstr "Fehler anzeigen..." #: main/application.cpp:775 msgid "Show errors information for the current subtitle" msgstr "" #: main/application.cpp:784 #, fuzzy msgid "Find Error..." msgstr "Fehler suchen" #: main/application.cpp:785 #, fuzzy msgid "Find lines with specified errors" msgstr "Nächste Zeile mit Fehlern suchen" #: main/application.cpp:795 msgid "Find Next Error" msgstr "Nächsten Fehler suchen" #: main/application.cpp:796 #, fuzzy msgid "Find next line with specified errors" msgstr "Nächste Zeile mit Fehlern suchen" #: main/application.cpp:806 msgid "Find Previous Error" msgstr "Vorherigen Fehler suchen" #: main/application.cpp:807 #, fuzzy msgid "Find previous line with specified errors" msgstr "Vorherige Zeile mit Fehlern suchen" #: main/application.cpp:816 main/lineswidget.cpp:1159 msgid "Spelling..." msgstr "Rechtschreibung..." #: main/application.cpp:817 msgid "Check lines spelling" msgstr "Rechtschreibung in den Zeilen überprüfen" #: main/application.cpp:824 msgid "Toggle Mark" msgstr "Markierung ein-/ausblenden" #: main/application.cpp:825 msgid "Toggle selected lines mark" msgstr "Markierungen der gewählten Zeilen ein-/ausblenden" #: main/application.cpp:834 main/currentlinewidget.cpp:92 msgid "Toggle Bold" msgstr "Fett" #: main/application.cpp:835 msgid "Toggle selected lines bold attribute" msgstr "Die ausgewählten Zeilen fett anzeigen" #: main/application.cpp:844 main/currentlinewidget.cpp:97 msgid "Toggle Italic" msgstr "Kursiv" #: main/application.cpp:845 msgid "Toggle selected lines italic attribute" msgstr "Die ausgewählten Zeilen kursiv anzeigen" #: main/application.cpp:854 main/currentlinewidget.cpp:102 msgid "Toggle Underline" msgstr "Unterstrichen" #: main/application.cpp:855 msgid "Toggle selected lines underline attribute" msgstr "Die ausgewählten Zeilen unterstrichen anzeigen" #: main/application.cpp:864 main/currentlinewidget.cpp:107 #, fuzzy msgid "Toggle Strike Through" msgstr "Durchgestrichen" #: main/application.cpp:865 msgid "Toggle selected lines strike through attribute" msgstr "Die ausgewählten Zeilen durchgestrichen anzeigen" #: main/application.cpp:873 main/lineswidget.cpp:1199 msgid "Shift..." msgstr "Verschieben..." #: main/application.cpp:874 #, fuzzy msgid "Shift lines an specified amount of time" msgstr "Zeilen eine bestimmte Zeit verschieben" #: main/application.cpp:901 msgid "Adjust..." msgstr "" #: main/application.cpp:902 msgid "Linearly adjust all lines to a specified interval" msgstr "" #: main/application.cpp:910 #, fuzzy msgid "Sort..." msgstr "Sortieren..." #: main/application.cpp:911 msgid "Sort lines based on their show time" msgstr "" #: main/application.cpp:918 msgid "Change Frame Rate..." msgstr "Bildwiederholrate ändern..." #: main/application.cpp:919 msgid "Retime subtitle lines by reinterpreting its frame rate" msgstr "" #: main/application.cpp:926 main/lineswidget.cpp:1201 msgid "Enforce Duration Limits..." msgstr "" #: main/application.cpp:927 msgid "Enforce lines minimum and/or maximum duration limits" msgstr "" #: main/application.cpp:935 main/lineswidget.cpp:1202 msgid "Set Automatic Durations..." msgstr "" #: main/application.cpp:936 msgid "Set lines durations based on amount of letters, words and line breaks" msgstr "" #: main/application.cpp:943 #, fuzzy msgid "Maximize Durations..." msgstr "Laufzeiten maximieren..." #: main/application.cpp:944 msgid "Extend lines durations up to their next lines show time" msgstr "" #: main/application.cpp:951 #, fuzzy msgid "Fix Overlapping Times..." msgstr "Überlappende Zeiten korrigieren..." #: main/application.cpp:952 #, fuzzy msgid "Fix lines overlapping times" msgstr "Überlappende Zeiten der Zeilen korrigieren" #: main/application.cpp:959 msgid "Synchronize with Subtitle..." msgstr "" #: main/application.cpp:960 msgid "Copy timing information from another subtitle" msgstr "" #: main/application.cpp:967 main/lineswidget.cpp:1142 msgid "Break Lines..." msgstr "" #: main/application.cpp:968 msgid "Automatically set line breaks" msgstr "" #: main/application.cpp:975 main/lineswidget.cpp:1145 msgid "Unbreak Lines..." msgstr "" #: main/application.cpp:976 msgid "Remove line breaks from lines" msgstr "Zeilenumbrüche aus Zeilen entfernen" #: main/application.cpp:983 main/lineswidget.cpp:1151 msgid "Simplify Spaces..." msgstr "" #: main/application.cpp:984 msgid "Remove unneeded spaces from lines" msgstr "Unnötige Leerzeichen aus Zeilen entfernen" #: main/application.cpp:991 main/lineswidget.cpp:1155 msgid "Change Case..." msgstr "Groß-/Kleinschreibung ä&ndern..." #: main/application.cpp:992 msgid "Change lines text to upper, lower, title or sentence case" msgstr "" #: main/application.cpp:999 main/lineswidget.cpp:1156 msgid "Fix Punctuation..." msgstr "Zeichensetzung korrigieren..." #: main/application.cpp:1000 #, fuzzy msgid "Fix punctuation errors in lines" msgstr "Fehler in der Zeichensetzung der Zeilen korrigieren" #: main/application.cpp:1007 main/lineswidget.cpp:1157 #, fuzzy msgid "Translate..." msgstr "Übersetzung öffnen..." #: main/application.cpp:1008 msgid "Translate lines texts using Google services" msgstr "" #: main/application.cpp:1015 msgid "Edit Line in Place" msgstr "" #: main/application.cpp:1016 msgid "Edit current line text in place" msgstr "" #: main/application.cpp:1025 msgid "Open Video..." msgstr "Video öffnen..." #: main/application.cpp:1026 main/application.cpp:1034 msgid "Open video file" msgstr "Eine Videodatei öffnen" #: main/application.cpp:1033 msgid "Open &Recent Video" msgstr "Zuletzt geöffnete Videos" #: main/application.cpp:1041 msgid "Close Video" msgstr "Video schließen" #: main/application.cpp:1042 msgid "Close video file" msgstr "Videodatei schließen" #: main/application.cpp:1051 msgid "Full Screen Mode" msgstr "Vollbild" #: main/application.cpp:1052 msgid "Toggle full screen mode" msgstr "In den Vollbildmodus umschalten" #: main/application.cpp:1060 main/utils/kreplace.cpp:425 msgid "Stop" msgstr "" #: main/application.cpp:1061 msgid "Stop video playback" msgstr "Videowiedergabe stoppen" #: main/application.cpp:1069 main/application.cpp:3156 #: main/application.cpp:3163 msgid "Play" msgstr "Wiedergabe" #: main/application.cpp:1070 msgid "Toggle video playing/paused" msgstr "Video wiedergeben/anhalten" #: main/application.cpp:1078 msgid "Seek Backwards" msgstr "Zurückspulen" #: main/application.cpp:1087 msgid "Seek Forwards" msgstr "Vorspulen" #: main/application.cpp:1099 msgid "Jump to Previous Line" msgstr "Zur vorherigen Zeile springen" #: main/application.cpp:1100 #, fuzzy msgid "Seek to previous subtitle line show time" msgstr "Zur vorherigen Zeile zurückspulen" #: main/application.cpp:1109 msgid "Jump to Next Line" msgstr "Zur nächsten Zeile springen" #: main/application.cpp:1110 #, fuzzy msgid "Seek to next subtitle line show time" msgstr "Zur nächsten Zeile vorspulen" #: main/application.cpp:1120 msgid "Set Current Line Show Time" msgstr "" #: main/application.cpp:1121 msgid "Set current line show time to video position" msgstr "" #: main/application.cpp:1131 msgid "Set Current Line Hide Time" msgstr "" #: main/application.cpp:1132 msgid "Set current line hide time to video position" msgstr "" #: main/application.cpp:1141 msgid "Current Line Follows Video" msgstr "" #: main/application.cpp:1142 msgid "Make current line follow the playing video position" msgstr "" #: main/application.cpp:1149 msgctxt "@action:inmenu Toggle audio muted" msgid "Mute" msgstr "Stumm" #: main/application.cpp:1151 msgid "Enable/disable playback sound" msgstr "Tonwiedergabe aktivieren/deaktivieren" #: main/application.cpp:1159 msgid "Increase Volume" msgstr "Lautstärke erhöhen" #: main/application.cpp:1160 msgid "Increase volume by 5%" msgstr "Lautstärke um 5% erhöhen" #: main/application.cpp:1168 msgid "Decrease Volume" msgstr "Lautstärke verringern" #: main/application.cpp:1169 msgid "Decrease volume by 5%" msgstr "Lautstärke um 5% verringern" #: main/application.cpp:1177 msgid "Audio Streams" msgstr "Audiospur" #: main/application.cpp:1178 msgid "Select active audio stream" msgstr "Audiospur wählen" #: main/application.cpp:1186 msgid "Increase Font Size" msgstr "Schriftgröße erhöhen" #: main/application.cpp:1187 msgid "Increase subtitles font size by 1 point" msgstr "Schriftgröße des Untertitels um einen Punkt erhöhen" #: main/application.cpp:1195 msgid "Decrease Font Size" msgstr "Schriftgröße verkleinern" #: main/application.cpp:1196 msgid "Decrease subtitles font size by 1 point" msgstr "Schriftgröße des Untertitels um einen Punkt verkleinern" #: main/application.cpp:1204 msgid "Subtitle Streams" msgstr "Untertitelspur" #: main/application.cpp:1205 msgid "Select active subtitle stream" msgstr "Untertitelspur wählen" #: main/application.cpp:1212 msgid "Shift to Video Position" msgstr "" #: main/application.cpp:1213 msgid "" "Set current line show time to video position by equally shifting all lines" msgstr "" #: main/application.cpp:1221 msgid "Adjust to Video Position (Anchor Last Line)" msgstr "" #: main/application.cpp:1222 msgid "" "Set current line to video position by fixing the last line and linearly " "adjusting the other ones" msgstr "" #: main/application.cpp:1230 msgid "Adjust to Video Position (Anchor First Line)" msgstr "" #: main/application.cpp:1231 msgid "" "Set current line to video position by fixing the first line and linearly " "adjusting the other ones" msgstr "" #: main/application.cpp:1240 msgctxt "@action:inmenu Manage user scripts" msgid "Scripts Manager..." msgstr "" #: main/application.cpp:1241 msgid "Manage user scripts" msgstr "" #: main/application.cpp:1365 msgid "" "The requested action would make the subtitle and its translation share the " "same file, possibly resulting in loss of information when saving.\n" "Are you sure you want to continue?" msgstr "" #: main/application.cpp:1366 msgid "Conflicting Subtitle Files" msgstr "" #: main/application.cpp:1488 msgid "" "Could not parse the subtitle file.
This may have been caused by " "usage of the wrong encoding.
" msgstr "" "Die Untertiteldatei kann nicht verarbeitet werden.
Dies kann durch " "eine falsch ausgewählte Kodierung ausgelöst worden sein.
" #: main/application.cpp:1519 #, fuzzy msgid "There was an error saving the subtitle." msgstr "Beim Speichern des Untertitels ist ein Fehler aufgetreten." #: main/application.cpp:1561 main/application.cpp:1770 #, fuzzy msgid "" "Currently opened translation subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Der Übersetzungsuntertitel hat ungespeicherte Änderungen.\n" "Wollen Sie sie speichern?" #: main/application.cpp:1562 main/application.cpp:1771 msgid "Close Translation Subtitle" msgstr "Übersetzungsuntertitel schließen" #: main/application.cpp:1574 msgid "" "Currently opened subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Der derzeit geöffnete Untertitel wurde geändert.\n" "
Wollen Sie die Änderungen speichern?" #: main/application.cpp:1575 msgid "Close Subtitle" msgstr "Untertitel schließen" #: main/application.cpp:1678 msgctxt "@item:inmenu Display primary text in video player" msgid "Primary" msgstr "" #: main/application.cpp:1679 msgctxt "@item:inmenu Display translation text in video player" msgid "Translation" msgstr "Übersetzung" #: main/application.cpp:1689 msgid "Could not parse the subtitle file." msgstr "Der Untertitel kann nicht verarbeitet werden." #: main/application.cpp:1728 #, fuzzy msgid "There was an error saving the translation subtitle." msgstr "Beim Speichern des Übersetzungsuntertitels ist ein Fehler aufgetreten." #: main/application.cpp:1864 msgid "Could not read the subtitle file to append." msgstr "" #: main/application.cpp:1916 msgid "Could not write the splitted subtitle file." msgstr "" #: main/application.cpp:1917 msgid "Could not write the splitted subtitle translation file." msgstr "" #: main/application.cpp:1935 #, fuzzy msgid "The specified time does not split the subtitles." msgstr "Die eingegebene Zeit trennt die Untertitel nicht." #: main/application.cpp:1984 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted part was saved as %1." msgstr "" #: main/application.cpp:1989 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted parts were saved as %1 and %2." msgstr "" #: main/application.cpp:2077 msgid "Go to Line" msgstr "Zu Zeile springen" #: main/application.cpp:2077 msgid "&Go to line:" msgstr "&Springe zu Zeile:" #: main/application.cpp:2389 msgid "Can not perform sort on selection with multiple ranges." msgstr "" #: main/application.cpp:2499 msgid "The reference subtitle must have more than one line to proceed." msgstr "" #: main/application.cpp:2511 msgid "Could not parse the reference subtitle file." msgstr "" #: main/application.cpp:2618 main/dialogs/translatedialog.cpp:31 #, fuzzy msgid "Translate" msgstr "Übersetzung" #: main/application.cpp:2619 msgid "Translating text (%1 to %2)..." msgstr "" #: main/application.cpp:2628 msgid "Translating primary text (%1 to %2)..." msgstr "" #: main/application.cpp:2629 msgid "Translating secondary text (%1 to %2)..." msgstr "" #: main/application.cpp:2661 msgid "" "Unable to perform texts synchronization (sent and received lines count do " "not match)." msgstr "" #: main/application.cpp:2670 msgid "Translate Primary Text" msgstr "" #: main/application.cpp:2671 msgid "Translate Secondary Text" msgstr "" #: main/application.cpp:2687 #, fuzzy msgid "" "There was an error performing the translation:\n" "\n" "%1" msgstr "Beim Speichern des Übersetzungsuntertitels ist ein Fehler aufgetreten." #: main/application.cpp:2740 msgid "Open Video" msgstr "Video öffnen" #: main/application.cpp:2873 main/application.cpp:2911 msgid "" "Continuing would result in loss of timing information for some lines.\n" "Are you sure you want to continue?" msgstr "" #: main/application.cpp:2929 msgid "Open AudioLevels" msgstr "" #: main/application.cpp:3035 msgid "modified" msgstr "geändert" #: main/application.cpp:3039 main/application.cpp:3050 msgid "Untitled" msgstr "Unbennant" #: main/application.cpp:3041 msgid "Untitled Translation" msgstr "Unbennante Übersetzung" #: main/application.cpp:3149 msgid "Pause" msgstr "Pause" #: main/application.cpp:3190 msgid "Seek backwards 1 second" msgid_plural "Seek backwards %1 seconds" msgstr[0] "1 Sekunde zurückspulen" msgstr[1] "%1 Sekunden zurückspulen" #: main/application.cpp:3196 msgid "Seek forwards 1 second" msgid_plural "Seek forwards %1 seconds" msgstr[0] "1 Sekunde vorspulen" msgstr[1] "%1 Sekunden vorspulen" #: main/application.cpp:3211 main/application.cpp:3223 msgid "Shift %21 Millisecond" msgid_plural "Shift %2%1 Milliseconds" msgstr[0] "" msgstr[1] "" #: main/application.cpp:3216 main/application.cpp:3228 msgid "Shift selected lines %21 millisecond" msgid_plural "Shift selected lines %2%1 milliseconds" msgstr[0] "" msgstr[1] "" #: main/configdialog.cpp:46 msgid "Configure" msgstr "Einrichten" #: main/configdialog.cpp:54 msgctxt "@title General settings" msgid "General" msgstr "Allgemeines" #: main/configdialog.cpp:55 msgid "General Settings" msgstr "Allgemeine Einstellungen" #: main/configdialog.cpp:59 msgctxt "@title Error checks settings" msgid "Error Checks" msgstr "Fehlersuche" #: main/configdialog.cpp:60 #, fuzzy msgid "Error Checks Settings" msgstr "Einstellungen der Fehlersuche" #: main/configdialog.cpp:64 msgctxt "@title Spelling settings" msgid "Spelling" msgstr "Rechtschreibung" #: main/configdialog.cpp:65 msgid "Spelling Settings" msgstr "Rechtschreibungseinstellungen" #: main/configdialog.cpp:69 msgctxt "@title Player settings" msgid "Player" msgstr "Wiedergabe" #: main/configdialog.cpp:70 msgid "Player Settings" msgstr "Einstellungen der Wiedergabe" #: main/configdialog.cpp:82 msgctxt "@title Player backend settings" msgid "%1 Backend Settings" msgstr "%1-Einstellungen" #: main/configs/errorsconfigwidget.cpp:37 msgctxt "@title:group" msgid "Texts" msgstr "" #: main/configs/errorsconfigwidget.cpp:40 msgid "Maximum number of characters:" msgstr "Maximale Anzahl an Zeichen:" #: main/configs/errorsconfigwidget.cpp:45 #: main/dialogs/smarttextsadjustdialog.cpp:40 msgid " characters" msgstr " Zeichen" #: main/configs/errorsconfigwidget.cpp:48 msgid "Maximum number of lines:" msgstr "Maximale Anzahl an Zeilen:" #: main/configs/errorsconfigwidget.cpp:53 msgid " lines" msgstr " Zeilen" #: main/configs/errorsconfigwidget.cpp:56 #, fuzzy msgctxt "@title:group" msgid "Absolute Durations" msgstr "Zu kurze Laufzeit" #: main/configs/errorsconfigwidget.cpp:59 #: main/configs/errorsconfigwidget.cpp:78 msgid "Minimum duration:" msgstr "" #: main/configs/errorsconfigwidget.cpp:64 #: main/configs/errorsconfigwidget.cpp:72 #: main/configs/generalconfigwidget.cpp:52 #: main/configs/generalconfigwidget.cpp:66 #: main/configs/generalconfigwidget.cpp:74 #: main/dialogs/fixoverlappingtimesdialog.cpp:37 msgid " msecs" msgstr " ms" #: main/configs/errorsconfigwidget.cpp:67 #: main/configs/errorsconfigwidget.cpp:86 msgid "Maximum duration:" msgstr "" #: main/configs/errorsconfigwidget.cpp:75 #, fuzzy msgctxt "@title:group" msgid "Relative Durations" msgstr "Laufzeiten maximieren..." #: main/configs/errorsconfigwidget.cpp:83 #: main/configs/errorsconfigwidget.cpp:91 msgid " msecs/character" msgstr " ms/Zeichen" #: main/configs/errorsconfigwidget.cpp:93 msgctxt "@title:group" msgid "Behavior" msgstr "Verhalten" #: main/configs/errorsconfigwidget.cpp:96 msgid "Automatically clear fixed errors" msgstr "" #: main/configs/generalconfigwidget.cpp:38 #: main/configs/playerconfigwidget.cpp:44 #: player/mplayer/mplayerconfigwidget.cpp:37 msgctxt "@title:group General settings" msgid "General" msgstr "Allgemeines" #: main/configs/generalconfigwidget.cpp:41 msgid "Default encoding for opening subtitles:" msgstr "" #: main/configs/generalconfigwidget.cpp:47 msgid "On line double click, jump to show time minus:" msgstr "" #: main/configs/generalconfigwidget.cpp:55 msgid "Automatically load video file when opening subtitle" msgstr "Video-Dateien beim Öffnen von Untertiteln automatisch laden" #: main/configs/generalconfigwidget.cpp:58 msgctxt "@title:group" msgid "Quick Actions" msgstr "" #: main/configs/generalconfigwidget.cpp:61 msgid "Time shift for selected lines:" msgstr "" #: main/configs/generalconfigwidget.cpp:69 msgid "Compensation for captured video times:" msgstr "" #: main/configs/playerconfigwidget.cpp:47 msgid "Player backend:" msgstr "" #: main/configs/playerconfigwidget.cpp:53 msgid "Jump length on seek:" msgstr "" #: main/configs/playerconfigwidget.cpp:58 msgid " secs" msgstr " s" #: main/configs/playerconfigwidget.cpp:61 main/playerwidget.cpp:452 msgid "Show editable position control" msgstr "" #: main/configs/playerconfigwidget.cpp:64 #, fuzzy msgctxt "@title:group" msgid "Subtitles" msgstr "Untertitel" #: main/configs/playerconfigwidget.cpp:67 #, fuzzy msgctxt "@label:chooser The font family name" msgid "Font family:" msgstr "Schriftart:" #: main/configs/playerconfigwidget.cpp:72 msgid "Font size:" msgstr "" #: main/configs/playerconfigwidget.cpp:77 msgid " points" msgstr " Punkte" #: main/configs/playerconfigwidget.cpp:80 msgid "Primary color:" msgstr "" #: main/configs/playerconfigwidget.cpp:85 msgid "Outline color:" msgstr "" #: main/configs/playerconfigwidget.cpp:91 msgid "Outline width:" msgstr "" #: main/configs/playerconfigwidget.cpp:96 msgid " pixels" msgstr " Pixel" #: main/configs/playerconfigwidget.cpp:99 #, fuzzy msgctxt "@title:group" msgid "Subtitles Preview" msgstr "Vorschau" #: main/configs/playerconfigwidget.cpp:109 msgctxt "Text for previewing the subtitles font settings" msgid "

The Quick Brown Fox
Jumps Over The Lazy Dog

" msgstr "

Falsches Üben von Xylophonmusik
quält jeden größeren Zwerg

" #: main/currentlinewidget.cpp:65 msgid "Show" msgstr "Einblenden" #: main/currentlinewidget.cpp:70 msgid "Hide" msgstr "Ausblenden" #: main/currentlinewidget.cpp:75 msgid "Duration" msgstr "Laufzeit" #: main/currentlinewidget.cpp:253 main/currentlinewidget.cpp:259 msgid "No current line" msgstr "" #: main/currentlinewidget.cpp:383 msgid "Current line:" msgstr "Aktuelle Zeile:" #: main/currentlinewidget.cpp:408 msgid "1 character" msgid_plural "%1 characters" msgstr[0] "1 Zeichen" msgstr[1] "%1 Zeichen" #: main/dialogs/actionwitherrortargetsdialog.cpp:74 msgid "Available errors" msgstr "" #: main/dialogs/actionwitherrortargetsdialog.cpp:105 msgid "Select None" msgstr "Nichts auswählen" #: main/dialogs/actionwithtargetdialog.cpp:131 msgid "Target >>" msgstr "" #: main/dialogs/actionwithtargetdialog.cpp:131 #: main/dialogs/actionwithtargetdialog.cpp:149 msgid "Target <<" msgstr "" #: main/dialogs/actionwithtargetdialog.cpp:164 msgid "All lines" msgstr "Alle Zeilen" #: main/dialogs/actionwithtargetdialog.cpp:165 main/utils/errorfinder.cpp:48 msgid "Selected lines" msgstr "Ausgewählte Zeilen" #: main/dialogs/actionwithtargetdialog.cpp:166 #, fuzzy msgid "All lines from first selected" msgstr "Alle Zeilen ab dem ausgewählten" #: main/dialogs/actionwithtargetdialog.cpp:167 #, fuzzy msgid "All lines up to last selected" msgstr "Alle Zeilen bis zum ausgewählten" #: main/dialogs/actionwithtargetdialog.cpp:257 main/utils/finder.cpp:63 #: main/utils/replacer.cpp:61 #, fuzzy msgid "Both subtitles" msgstr "Beide Untertitel" #: main/dialogs/actionwithtargetdialog.cpp:260 main/utils/finder.cpp:65 #: main/utils/replacer.cpp:63 msgid "Primary subtitle" msgstr "" #: main/dialogs/actionwithtargetdialog.cpp:263 main/utils/finder.cpp:67 #: main/utils/replacer.cpp:65 msgid "Translation subtitle" msgstr "" #: main/dialogs/actionwithtargetdialog.h:78 #, fuzzy msgid "Apply To" msgstr "Anwenden auf" #: main/dialogs/adjusttimesdialog.cpp:32 msgid "Adjust" msgstr "" #: main/dialogs/adjusttimesdialog.cpp:34 #, fuzzy msgctxt "@title:group" msgid "New Times" msgstr "Einblenden" #: main/dialogs/adjusttimesdialog.cpp:39 msgid "First spoken line:" msgstr "" #: main/dialogs/adjusttimesdialog.cpp:45 msgid "Last spoken line:" msgstr "" #: main/dialogs/autodurationsdialog.cpp:38 #: main/dialogs/changeframeratedialog.cpp:36 #: main/dialogs/fixoverlappingtimesdialog.cpp:34 #: main/dialogs/fixpunctuationdialog.cpp:33 #: main/dialogs/smarttextsadjustdialog.cpp:34 #: main/dialogs/splitsubtitledialog.cpp:38 main/dialogs/translatedialog.cpp:33 msgctxt "@title:group" msgid "Settings" msgstr "Einstellungen:" #: main/dialogs/autodurationsdialog.cpp:46 #, fuzzy msgid "Milliseconds per line:" msgstr "Millisekunden pro Zeile:" #: main/dialogs/autodurationsdialog.cpp:55 #, fuzzy msgid "Milliseconds per word:" msgstr "Millisekunden pro Wort:" #: main/dialogs/autodurationsdialog.cpp:64 msgid "Milliseconds per character:" msgstr "Millisekunden pro Zeichen:" #: main/dialogs/autodurationsdialog.cpp:68 #: main/dialogs/durationlimitsdialog.cpp:45 msgid "Prevent overlapping" msgstr "" #: main/dialogs/autodurationsdialog.cpp:71 #, fuzzy msgctxt "@title:group" msgid "Duration Calculation" msgstr "Laufzeit-Berechnung" #: main/dialogs/autodurationsdialog.cpp:77 msgid "Use primary text" msgstr "" #: main/dialogs/autodurationsdialog.cpp:78 msgid "Use translation text" msgstr "" #: main/dialogs/autodurationsdialog.cpp:79 #, fuzzy msgid "Calculate both and use maximum" msgstr "Beide berechnen und das Maximum benutzen" #: main/dialogs/changeframeratedialog.cpp:45 msgid "Current frame rate:" msgstr "Aktuelle Bildwiederholrate:" #: main/dialogs/changeframeratedialog.cpp:54 msgid "New frame rate:" msgstr "Neue Bildwiederholrate:" #: main/dialogs/changetextscasedialog.cpp:33 msgid "Change Case" msgstr "Groß-/Kleinschreibung ändern" #: main/dialogs/changetextscasedialog.cpp:35 #, fuzzy msgctxt "@title:group" msgid "Change To" msgstr "Ändern zu" #: main/dialogs/changetextscasedialog.cpp:39 msgid "Lower case" msgstr "Kleinbuchstaben" #: main/dialogs/changetextscasedialog.cpp:44 msgid "Upper case" msgstr "Großbuchstaben" #: main/dialogs/changetextscasedialog.cpp:48 msgid "Title case" msgstr "" #: main/dialogs/changetextscasedialog.cpp:52 msgid "Sentence case" msgstr "" #: main/dialogs/changetextscasedialog.cpp:56 #, fuzzy msgid "Convert to lower case first" msgstr "Zuerst in Kleinbuchstaben umwandeln" #: main/dialogs/checkerrorsdialog.cpp:31 msgid "Check Errors" msgstr "Fehler suchen" #: main/dialogs/checkerrorsdialog.cpp:33 #, fuzzy msgctxt "@title:group" msgid "Errors to Check" msgstr "Zu suchende Fehler:" #: main/dialogs/checkerrorsdialog.cpp:36 msgctxt "@title:group Miscellaneous settings" msgid "Miscellaneous" msgstr "Verschiedenes" #: main/dialogs/checkerrorsdialog.cpp:39 msgid "Clear other errors" msgstr "" #: main/dialogs/checkerrorsdialog.cpp:43 msgid "Clear user marks" msgstr "" #: main/dialogs/clearerrorsdialog.cpp:32 msgid "Clear Errors" msgstr "Fehler korrigieren" #: main/dialogs/clearerrorsdialog.cpp:34 #, fuzzy msgctxt "@title:group" msgid "Errors to Clear" msgstr "Zu korrigierende Fehler" #: main/dialogs/durationlimitsdialog.cpp:35 #, fuzzy msgctxt "@title:group" msgid "Minimum Duration" msgstr "Minimale Laufzeit" #: main/dialogs/durationlimitsdialog.cpp:41 #, fuzzy msgid "Expand duration to:" msgstr "Laufzeit erweitern auf:" #: main/dialogs/durationlimitsdialog.cpp:48 #, fuzzy msgctxt "@title:group" msgid "Maximum Duration" msgstr "Maximale Laufzeit" #: main/dialogs/durationlimitsdialog.cpp:54 msgid "Shrink duration to:" msgstr "Laufzeit schrumpfen auf:" #: main/dialogs/fixoverlappingtimesdialog.cpp:43 msgid "Minimum interval between lines:" msgstr "" #: main/dialogs/fixpunctuationdialog.cpp:31 msgid "Fix Punctuation" msgstr "Zeichensetzung korrigieren" #: main/dialogs/fixpunctuationdialog.cpp:36 #, fuzzy msgid "Fix and cleanup spaces" msgstr "Leerzeichen korrigieren und säubern" #: main/dialogs/fixpunctuationdialog.cpp:40 #, fuzzy msgid "Fix quotes and double quotes" msgstr "Anführungszeichen und doppelte Anführungszeichen korrigieren" #: main/dialogs/fixpunctuationdialog.cpp:44 msgid "Fix English 'I' pronoun" msgstr "" #: main/dialogs/fixpunctuationdialog.cpp:48 #, fuzzy msgid "Add ellipisis indicating non finished lines" msgstr "Auslassungspunkte hinzufügen, um unvollendete Sätze anzuzeigen" #: main/dialogs/insertlinedialog.cpp:28 #, fuzzy msgid "Insert Line Before Current" msgstr "Zeile vor aktuellem einfügen" #: main/dialogs/insertlinedialog.cpp:28 #, fuzzy msgid "Insert Line After Current" msgstr "Zeile nach aktuellem einfügen" #: main/dialogs/insertlinedialog.cpp:29 #, fuzzy msgid "Insert Into" msgstr "Einfügen in" #: main/dialogs/joinsubtitlesdialog.cpp:40 msgid "Shift subtitle forwards before append" msgstr "" #: main/dialogs/joinsubtitlesdialog.cpp:47 #: main/dialogs/splitsubtitledialog.cpp:44 msgid "Set from video length" msgstr "" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Subtitle" msgstr "Untertitel öffnen" #: main/dialogs/opensubtitledialog.cpp:34 #, fuzzy msgid "Open Translation Subtitle" msgstr "Übersetzungsuntertitel öffnen" #: main/dialogs/opensubtitledialog.cpp:46 #: main/dialogs/savesubtitledialog.cpp:80 #: main/dialogs/selectablesubtitledialog.cpp:67 msgid "Encoding:" msgstr "Kodierung:" #: main/dialogs/opensubtitledialog.cpp:73 msgid "All Supported" msgstr "Alle unterstützten" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove Selected Lines" msgstr "Ausgewählte Zeilen entfernen" #: main/dialogs/removelinesdialog.cpp:27 #, fuzzy msgid "Remove From" msgstr "Entfernen aus" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Subtitle" msgstr "Untertitel speichern" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Translation Subtitle" msgstr "" #: main/dialogs/savesubtitledialog.cpp:69 msgid "EOL:" msgstr "EOL:" #: main/dialogs/savesubtitledialog.cpp:145 msgid "" "A file named \"%1\" already exists. Are you sure you want to overwrite it?" msgstr "" "Eine Datei mit dem Namen „%1“ existiert bereits. Soll die Datei wirklich " "überschrieben werden?" #: main/dialogs/savesubtitledialog.cpp:148 msgid "Overwrite File?" msgstr "Datei Überschreiben?" #: main/dialogs/savesubtitledialog.cpp:149 msgid "Overwrite" msgstr "Überschreiben" #: main/dialogs/selectablesubtitledialog.cpp:51 msgid "Path:" msgstr "Pfad:" #: main/dialogs/selectablesubtitledialog.cpp:56 msgid "Select subtitle" msgstr "Untertitel auswählen" #: main/dialogs/selectablesubtitledialog.h:54 msgid "Subtitle" msgstr "Untertitel" #: main/dialogs/shifttimesdialog.cpp:32 #, fuzzy msgid "Shift" msgstr "Verschieben" #: main/dialogs/shifttimesdialog.cpp:34 #, fuzzy msgctxt "@title:group" msgid "Shifting" msgstr "Verschieben" #: main/dialogs/shifttimesdialog.cpp:38 #, fuzzy msgid "Forwards (+)" msgstr "+ | Nach vorne" #: main/dialogs/shifttimesdialog.cpp:39 #, fuzzy msgid "Backwards (–)" msgstr "- | Nach hinten" #: main/dialogs/smarttextsadjustdialog.cpp:43 msgid "Minimum length for line break:" msgstr "" #: main/dialogs/splitsubtitledialog.cpp:36 msgid "Split Subtitle" msgstr "Untertitel trennen" #: main/dialogs/splitsubtitledialog.cpp:49 #, fuzzy msgid "Split time:" msgstr "Zeilen trennen" #: main/dialogs/splitsubtitledialog.cpp:53 msgid "Shift new part backwards after split" msgstr "" #: main/dialogs/syncsubtitlesdialog.cpp:32 #, fuzzy msgid "Synchronize with Subtitle" msgstr "Mit Untertitel synchronisieren" #: main/dialogs/syncsubtitlesdialog.cpp:34 #, fuzzy msgid "Reference Subtitle" msgstr "Untertitel öffnen" #: main/dialogs/syncsubtitlesdialog.cpp:36 #, fuzzy msgctxt "@title:group" msgid "Synchronization Mode" msgstr "Synchronisierungsmodus" #: main/dialogs/syncsubtitlesdialog.cpp:39 msgid "Adjust to reference's first and last lines" msgstr "" #: main/dialogs/syncsubtitlesdialog.cpp:43 msgid "Copy timing information from reference line by line" msgstr "" #: main/dialogs/translatedialog.cpp:49 msgid "Input language:" msgstr "" #: main/dialogs/translatedialog.cpp:66 msgid "Output language:" msgstr "" #: main/errorsdialog.cpp:42 #, fuzzy msgid "Subtitle Errors" msgstr "Untertitel-Fehler" #: main/errorsdialog.cpp:55 #, fuzzy msgid "Clear Fixed Errors" msgstr "Korrigierte Fehler entfernen" #: main/errorsdialog.cpp:65 msgid "Settings..." msgstr "Einstellungen..." #: main/errorsdialog.cpp:121 #, fuzzy msgid "Showing 1 line with errors" msgid_plural "Showing %1 lines with errors" msgstr[0] "Nächste Zeile mit Fehlern suchen" msgstr[1] "Nächste Zeile mit Fehlern suchen" #: main/errorsdialog.cpp:124 #, fuzzy msgid "1 total error" msgid_plural "%1 total errors" msgstr[0] "1 Fehler" msgstr[1] "%1 Fehler" #: main/errorsdialog.cpp:125 msgid "1 user mark" msgid_plural "%1 user marks" msgstr[0] "" msgstr[1] "" #: main/errorswidget.cpp:491 #, fuzzy msgid "Line Errors" msgstr "Fehler suchen" #: main/errorswidget.cpp:492 #, fuzzy msgid "Count" msgstr "Auschneiden" #: main/errorswidget.cpp:493 #, fuzzy msgid "Marked" msgstr "Markieren" #: main/errorswidget.cpp:509 msgid "yes" msgstr "" #: main/errorswidget.cpp:510 #, fuzzy msgid "no" msgstr "Rückgängig" #: main/errorswidget.cpp:517 msgid "Line %1" msgstr "Zeile %1" #: main/errorswidget.cpp:717 msgid "Expand All" msgstr "Alle aufklappen" #: main/errorswidget.cpp:718 msgid "Collapse All" msgstr "Alle einklappen" #: main/errorswidget.cpp:722 msgid "Clear Selected Marks" msgstr "Ausgewählte Markierungen entfernen" #: main/errorswidget.cpp:723 msgid "Clear Selected Errors" msgstr "Ausgewählte Fehler beseitigen" #: main/errorswidget.cpp:729 msgid "Clear Fixed Selection" msgstr "" #: main/lineswidget.cpp:204 msgid "Observations:" msgstr "Bemerkungen:" #: main/lineswidget.cpp:232 msgctxt "@title:column Subtitle line number" msgid "Line" msgstr "Zeile" #: main/lineswidget.cpp:233 msgctxt "@title:column" msgid "Show Time" msgstr "Einblenden" #: main/lineswidget.cpp:234 msgctxt "@title:column" msgid "Hide Time" msgstr "Ausblenden" #: main/lineswidget.cpp:235 msgctxt "@title:column Subtitle line (primary) text" msgid "Text" msgstr "Text" #: main/lineswidget.cpp:236 msgctxt "@title:column Subtitle line translation text" msgid "Translation" msgstr "Übersetzung" #: main/lineswidget.cpp:1141 msgid "Texts" msgstr "" #: main/lineswidget.cpp:1162 msgid "Styles" msgstr "" #: main/lineswidget.cpp:1166 widgets/simplerichtextedit.cpp:119 msgctxt "@action:inmenu Toggle bold style" msgid "Bold" msgstr "Fett" #: main/lineswidget.cpp:1173 widgets/simplerichtextedit.cpp:125 msgctxt "@action:inmenu Toggle italic style" msgid "Italic" msgstr "Kursiv" #: main/lineswidget.cpp:1180 widgets/simplerichtextedit.cpp:131 #, fuzzy msgctxt "@action:inmenu Toggle underline style" msgid "Underline" msgstr "Unterstrichen" #: main/lineswidget.cpp:1187 widgets/simplerichtextedit.cpp:137 msgctxt "@action:inmenu Toggle strike through style" msgid "Strike Through" msgstr "Durchgestrichen" #: main/lineswidget.cpp:1194 msgid "Times" msgstr "" #: main/lineswidget.cpp:1196 msgid "Shift +%1 Milliseconds" msgstr "" #: main/lineswidget.cpp:1197 msgid "Shift -%1 Milliseconds" msgstr "" #: main/lineswidget.cpp:1207 #, fuzzy msgid "Errors" msgstr "Fehler" #: main/lineswidget.cpp:1208 msgid "Mark" msgstr "Markieren" #: main/main.cpp:43 msgid "Subtitle Composer" msgstr "Subtitle Composer" #: main/main.cpp:45 msgid "A KDE subtitle editor." msgstr "Ein Untertitel-Editor für KDE." #: main/main.cpp:47 #, fuzzy msgid "(C) 2007-2009 Sergio Pistone" msgstr "(C) 2007-2008 Sergio Pistone" #: main/main.cpp:51 msgid "Sergio Pistone" msgstr "Sergio Pistone" #: main/main.cpp:52 msgid "Author & maintainer" msgstr "" #: main/main.cpp:61 msgid "Open location as primary subtitle" msgstr "" #: main/main.cpp:62 msgid "Open location as translation subtitle" msgstr "" #: main/playerwidget.cpp:103 msgid "Position" msgstr "Position" #: main/playerwidget.cpp:111 msgid "Length" msgstr "Länge" #: main/playerwidget.cpp:116 msgid "FPS" msgstr "FPS" #: main/playerwidget.cpp:704 main/playerwidget.cpp:705 #: main/playerwidget.cpp:706 main/playerwidget.cpp:778 #: main/playerwidget.cpp:795 main/playerwidget.cpp:802 msgid "Unknown" msgstr "Unbekannt" #: main/playerwidget.cpp:715 msgid "There was an error opening file
%1
" msgstr "Es ist ein Fehler beim öffnen der Datei
%1 aufgetreten
" #: main/playerwidget.cpp:741 msgid "Unexpected error while playing file." msgstr "" #: main/scripting/scriptsmanager.cpp:70 msgid "Installed Scripts" msgstr "" #: main/scripting/scriptsmanager.cpp:88 msgid "Information" msgstr "" #: main/scripting/scriptsmanager.cpp:94 msgid "Warning" msgstr "" #: main/scripting/scriptsmanager.cpp:100 #, fuzzy msgid "Error" msgstr "Fehler" #: main/scripting/scriptsmanager.cpp:113 msgid "Scripts Manager" msgstr "" #: main/scripting/scriptsmanager.cpp:129 #, fuzzy msgid "Create..." msgstr "Ersetzen..." #: main/scripting/scriptsmanager.cpp:130 #, fuzzy msgid "Creates a new script file." msgstr "Einen neuen Untertitel erstellen" #: main/scripting/scriptsmanager.cpp:135 #, fuzzy msgid "Add..." msgstr "Suchen..." #: main/scripting/scriptsmanager.cpp:136 msgid "Copies an existing script from a specified location." msgstr "" #: main/scripting/scriptsmanager.cpp:142 msgid "Sends the selected script to the trash." msgstr "" #: main/scripting/scriptsmanager.cpp:147 #, fuzzy msgid "Edit" msgstr "B&earbeiten" #: main/scripting/scriptsmanager.cpp:148 msgid "Opens the selected script with an external editor." msgstr "" #: main/scripting/scriptsmanager.cpp:154 msgid "Run" msgstr "" #: main/scripting/scriptsmanager.cpp:155 msgid "Executes the selected script." msgstr "" #: main/scripting/scriptsmanager.cpp:160 msgid "Refresh" msgstr "" #: main/scripting/scriptsmanager.cpp:161 msgid "Reloads the installed scripts list." msgstr "" #: main/scripting/scriptsmanager.cpp:219 main/scripting/scriptsmanager.cpp:301 msgid "" "You must enter an unused name to continue.\n" "Would you like to enter another name?" msgstr "" #: main/scripting/scriptsmanager.cpp:220 main/scripting/scriptsmanager.cpp:302 msgid "Name Already Used" msgstr "" #: main/scripting/scriptsmanager.cpp:226 msgid "Create New Script" msgstr "" #: main/scripting/scriptsmanager.cpp:226 main/scripting/scriptsmanager.cpp:308 msgid "Script name:" msgstr "" #: main/scripting/scriptsmanager.cpp:239 #, fuzzy msgid "There was an error creating the file %1." msgstr "Es ist ein Fehler beim öffnen der Datei
%1 aufgetreten
" #: main/scripting/scriptsmanager.cpp:283 msgid "Select Existing Script" msgstr "" #: main/scripting/scriptsmanager.cpp:308 msgid "Rename Script" msgstr "" #: main/scripting/scriptsmanager.cpp:322 #, fuzzy msgid "There was an error opening the file %1." msgstr "Es ist ein Fehler beim öffnen der Datei
%1 aufgetreten
" #: main/scripting/scriptsmanager.cpp:331 #, fuzzy msgid "There was an error copying the file to %1." msgstr "Es ist ein Fehler beim öffnen der Datei
%1 aufgetreten
" #: main/scripting/scriptsmanager.cpp:350 msgid "Do you really want to send file %1 to the trash?" msgstr "" #: main/scripting/scriptsmanager.cpp:351 msgid "Move to Trash" msgstr "" #: main/scripting/scriptsmanager.cpp:359 #, fuzzy msgid "There was an error removing the file %1." msgstr "Es ist ein Fehler beim öffnen der Datei
%1 aufgetreten
" #: main/scripting/scriptsmanager.cpp:377 msgid "Could not launch external editor.\n" msgstr "" #: main/scripting/scriptsmanager.cpp:441 main/scripting/scriptsmanager.cpp:448 msgid "Error Running Script" msgstr "" #: main/scripting/scriptsmanager.cpp:462 msgid "Tools" msgstr "" #: main/utils/errorfinder.cpp:40 main/utils/errorfinder.cpp:221 #: main/utils/errorfinder.cpp:244 msgid "Find Error" msgstr "Fehler suchen" #: main/utils/errorfinder.cpp:42 #, fuzzy msgid "Errors to Find" msgstr "Zu suchende Fehler:" #: main/utils/errorfinder.cpp:45 msgid "Options" msgstr "" #: main/utils/errorfinder.cpp:51 #, fuzzy msgid "From current line" msgstr "Aktuelle Zeile:" #: main/utils/errorfinder.cpp:55 #, fuzzy msgid "Find backwards" msgstr "- | Nach hinten" #: main/utils/errorfinder.cpp:216 main/utils/finder.cpp:298 #: main/utils/replacer.cpp:258 msgid "" "Beginning of selection reached.\n" "Continue from the end?" msgstr "" #: main/utils/errorfinder.cpp:217 main/utils/finder.cpp:299 #: main/utils/replacer.cpp:259 msgid "" "Beginning of subtitle reached.\n" "Continue from the end?" msgstr "" #: main/utils/errorfinder.cpp:219 main/utils/finder.cpp:301 #: main/utils/replacer.cpp:261 #, fuzzy msgid "" "End of selection reached.\n" "Continue from the beginning?" msgstr "" "Das Ende der Auswahl ist erreicht worden.\n" "Soll wieder am anfang weitergemacht werden? " #: main/utils/errorfinder.cpp:220 main/utils/finder.cpp:302 #: main/utils/replacer.cpp:262 main/utils/speller.cpp:143 #, fuzzy msgid "" "End of subtitle reached.\n" "Continue from the beginning?" msgstr "" "Das Ende des Untertitels ist erreicht worden.\n" "Soll wieder am anfang weitergemacht werden? " #: main/utils/errorfinder.cpp:243 msgid "No errors matching given criteria found!" msgstr "" #: main/utils/finder.cpp:55 #, fuzzy msgid "Find In" msgstr "Suchen" #: main/utils/finder.cpp:278 main/utils/replacer.cpp:234 #, fuzzy msgid "No instances of '%1' found!" msgstr "„%1“ ist nicht gefunden worden." #: main/utils/finder.cpp:279 main/utils/finder.cpp:303 #, fuzzy msgid "Find" msgstr "Suchen" #: main/utils/kreplace.cpp:49 main/utils/kreplace.cpp:53 #: main/utils/replacer.cpp:172 main/utils/replacer.cpp:229 #: main/utils/replacer.cpp:235 main/utils/replacer.cpp:263 #, fuzzy msgid "Replace" msgstr "Ersetzen" #: main/utils/kreplace.cpp:51 msgid "&All" msgstr "&Alle" #: main/utils/kreplace.cpp:52 msgid "&Skip" msgstr "Über&springen" #: main/utils/kreplace.cpp:63 msgid "Replace '%1' with '%2'?" msgstr "„%1“ durch „%2“ ersetzen?" #: main/utils/kreplace.cpp:139 main/utils/kreplace.cpp:406 #, fuzzy msgid "No text was replaced." msgstr "Es wurde kein Text ersetzt." #: main/utils/kreplace.cpp:141 main/utils/kreplace.cpp:408 #: main/utils/replacer.cpp:228 main/utils/replacer.cpp:255 msgid "1 replacement done." msgid_plural "%1 replacements done." msgstr[0] "1 Ersetzung durchgeführt." msgstr[1] "%1 Ersetzungen durchgeführt." #: main/utils/kreplace.cpp:413 msgid "Beginning of document reached." msgstr "" #: main/utils/kreplace.cpp:415 #, fuzzy msgid "End of document reached." msgstr "Das Ende des Dokuments ist erreicht worden." #: main/utils/kreplace.cpp:422 #, fuzzy msgid "Do you want to restart search from the end?" msgstr "Wollen Sie die Suche nocheinmal " #: main/utils/kreplace.cpp:423 msgid "Do you want to restart search at the beginning?" msgstr "" #: main/utils/kreplace.cpp:425 msgid "Restart" msgstr "" #: main/utils/language.cpp:125 msgid "Automatic" msgstr "" #: main/utils/language.cpp:129 msgctxt "Official language of the Philippines, aka Filipino" msgid "Tagalog" msgstr "" #: main/utils/replacer.cpp:53 #, fuzzy msgid "Find/Replace In" msgstr "Ersetzen" #: main/utils/speller.cpp:144 msgid "Spell Checking" msgstr "Rechtschreibung überprüfen" #: main/utils/translator.cpp:167 msgid "Operation cancelled by user" msgstr "" #: main/utils/translator.cpp:270 main/utils/translator.cpp:280 msgid "Unexpected contents received from translation service" msgstr "" #: player/gstreamer/gstreamerbackend.cpp:543 #: player/mplayer/mplayerbackend.cpp:259 player/xine/xinebackend.cpp:278 msgid "Audio Stream #%1" msgstr "Audiospur #%1" #: player/gstreamer/gstreamerconfigwidget.cpp:34 #, fuzzy msgctxt "@title:group GStreamer sinks settings" msgid "Sinks" msgstr "Einstellungen:" #: player/gstreamer/gstreamerconfigwidget.cpp:37 msgid "Audio sink:" msgstr "" #: player/gstreamer/gstreamerconfigwidget.cpp:46 msgid "Video sink:" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:40 msgid "Executable path:" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:43 msgid "Select the MPlayer executable" msgstr "Wählen Sie die ausführbare MPlayer-Datei aus" #: player/mplayer/mplayerconfigwidget.cpp:47 msgctxt "@title:group Video settings" msgid "Video" msgstr "Video" #: player/mplayer/mplayerconfigwidget.cpp:50 msgid "Video output driver:" msgstr "Videoausgabe-Modul:" #: player/mplayer/mplayerconfigwidget.cpp:58 msgid "Allow frame dropping" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:61 msgid "Allow hard frame dropping" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:64 msgctxt "@title:group Audio settings" msgid "Audio" msgstr "Audio" #: player/mplayer/mplayerconfigwidget.cpp:67 msgid "Audio output driver:" msgstr "Audioausgabe-Modul:" #: player/mplayer/mplayerconfigwidget.cpp:75 msgid "A/V synchronization factor:" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:83 msgid "Volume normalization" msgstr "Normalisierung der Lautstärke" #: player/xine/xineconfigwidget.cpp:34 msgctxt "@title:group Xine drivers settings" msgid "Drivers" msgstr "" #: player/xine/xineconfigwidget.cpp:37 msgid "Audio driver:" msgstr "Audio-Modul:" #: player/xine/xineconfigwidget.cpp:45 msgid "Video driver:" msgstr "Video-Modul:" #: widgets/simplerichtextedit.cpp:84 msgid "Cut" msgstr "Auschneiden" #: widgets/simplerichtextedit.cpp:90 msgid "Copy" msgstr "Kopieren" #: widgets/simplerichtextedit.cpp:96 msgid "Paste" msgstr "Einfügen" #: widgets/simplerichtextedit.cpp:102 msgid "Delete" msgstr "Löschen" #: widgets/simplerichtextedit.cpp:108 msgctxt "@action:inmenu Clear all text" msgid "Clear" msgstr "" #: widgets/simplerichtextedit.cpp:143 msgid "Check Spelling..." msgstr "Rechtschreibprüfung..." #: widgets/simplerichtextedit.cpp:147 msgid "Auto Spell Check" msgstr "Automatische Rechtschreibprüfung" #: widgets/simplerichtextedit.cpp:152 msgid "Allow Tabulations" msgstr "" #: widgets/simplerichtextedit.cpp:491 #, fuzzy msgid "Suggestions" msgstr "Vorschläge" #: widgets/simplerichtextedit.cpp:492 #, fuzzy msgid "Ignore" msgstr "Ignorieren" #: widgets/simplerichtextedit.cpp:493 msgid "Add to Dictionary" msgstr "Zum Wörterbuch hinzufügen" #: widgets/simplerichtextedit.cpp:497 #, fuzzy msgid "No suggestions" msgstr "Keine Vorschläge" #. i18n: file: main/subtitlecomposerui.rc:5 #. i18n: ectx: Menu (file) #: rc.cpp:3 msgid "&File" msgstr "Datei" #. i18n: file: main/subtitlecomposerui.rc:16 #. i18n: ectx: Menu (translation) #: rc.cpp:6 msgid "Translation" msgstr "Übersetzung" #. i18n: file: main/subtitlecomposerui.rc:28 #. i18n: ectx: Menu (edit) #: rc.cpp:9 #, fuzzy msgid "&Edit" msgstr "B&earbeiten" #. i18n: file: main/subtitlecomposerui.rc:51 #. i18n: ectx: Menu (texts) #: rc.cpp:12 msgid "&Texts" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:62 #. i18n: ectx: Menu (styles) #: rc.cpp:15 msgid "St&yles" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:69 #. i18n: ectx: Menu (times) #: rc.cpp:18 msgid "T&imes" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:91 #. i18n: ectx: Menu (errors) #: rc.cpp:21 msgid "E&rrors" msgstr "Fehle&r" #. i18n: file: main/subtitlecomposerui.rc:104 #. i18n: ectx: Menu (video) #: rc.cpp:24 msgid "&Video" msgstr "&Video" #. i18n: file: main/subtitlecomposerui.rc:132 #. i18n: ectx: Menu (tools) #: rc.cpp:27 msgid "T&ools" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:137 #. i18n: ectx: Menu (audiolevels) #: rc.cpp:30 msgid "&Audio Levels" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:153 #. i18n: ectx: ToolBar (mainToolBar) #: rc.cpp:33 msgid "Main Toolbar" msgstr "Haupt-Werkzeugleiste" #. i18n: file: main/subtitlecomposerui.rc:165 #. i18n: ectx: ToolBar (editToolBar) #: rc.cpp:36 msgctxt "The toolbar name" msgid "Edit Toolbar" msgstr "Bearbeitungswerkzeugleiste" #: rc.cpp:37 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Panagiotis Papadopoulos" #: rc.cpp:38 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "pano_90@gmx.de" #~ msgctxt "@title:group" #~ msgid "Subtitles font" #~ msgstr "Schriftart für Untertitel" #~ msgid "Size:" #~ msgstr "Schriftgröße:" #, fuzzy #~ msgid "Append to" #~ msgstr "Anhängen an" #, fuzzy #~ msgid "Marks" #~ msgstr "Markierungen" subtitlecomposer-0.5.3/po/subtitlecomposer.pot0000644000175000001440000014667711206411600021112 0ustar sergiousers# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://sourceforge.net/tracker/?" "atid=1005652&group_id=208427&func=browse\n" "POT-Creation-Date: 2009-05-25 00:41-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" #: core/subtitleactions.cpp:62 msgid "Set Frame Rate" msgstr "" #: core/subtitleactions.cpp:93 msgid "Insert Lines" msgstr "" #: core/subtitleactions.cpp:177 core/subtitle.cpp:446 core/subtitle.cpp:460 #: core/subtitle.cpp:479 msgid "Remove Lines" msgstr "" #: core/subtitleactions.cpp:268 msgid "Move Line" msgstr "" #: core/subtitleactions.cpp:381 msgid "Swap Texts" msgstr "" #: core/subtitle.cpp:66 msgid "Set Primary Data" msgstr "" #: core/subtitle.cpp:121 msgid "Clear Primary Text Data" msgstr "" #: core/subtitle.cpp:134 msgid "Set Secondary Data" msgstr "" #: core/subtitle.cpp:180 msgid "Clear Secondary Text Data" msgstr "" #: core/subtitle.cpp:265 main/dialogs/changeframeratedialog.cpp:34 msgid "Change Frame Rate" msgstr "" #: core/subtitle.cpp:395 core/subtitle.cpp:412 msgid "Insert Line" msgstr "" #: core/subtitle.cpp:533 main/application.cpp:662 main/lineswidget.cpp:1226 msgid "Split Lines" msgstr "" #: core/subtitle.cpp:590 main/application.cpp:670 main/lineswidget.cpp:1225 msgid "Join Lines" msgstr "" #: core/subtitle.cpp:642 msgid "Shift Lines" msgstr "" #: core/subtitle.cpp:690 msgid "Adjust Lines" msgstr "" #: core/subtitle.cpp:700 main/application.cpp:2377 main/lineswidget.cpp:1200 msgid "Sort" msgstr "" #: core/subtitle.cpp:746 main/dialogs/durationlimitsdialog.cpp:33 msgid "Enforce Duration Limits" msgstr "" #: core/subtitle.cpp:791 main/application.cpp:2462 main/lineswidget.cpp:1203 msgid "Maximize Durations" msgstr "" #: core/subtitle.cpp:816 main/dialogs/autodurationsdialog.cpp:35 msgid "Set Automatic Durations" msgstr "" #: core/subtitle.cpp:856 main/dialogs/fixoverlappingtimesdialog.cpp:32 #: main/lineswidget.cpp:1204 msgid "Fix Overlapping Times" msgstr "" #: core/subtitle.cpp:890 msgid "Fix Lines Punctuation" msgstr "" #: core/subtitle.cpp:986 msgid "Lower Case" msgstr "" #: core/subtitle.cpp:1020 msgid "Upper Case" msgstr "" #: core/subtitle.cpp:1054 msgid "Title Case" msgstr "" #: core/subtitle.cpp:1091 msgid "Sentence Case" msgstr "" #: core/subtitle.cpp:1142 main/dialogs/smarttextsadjustdialog.cpp:32 msgid "Break Lines" msgstr "" #: core/subtitle.cpp:1150 main/application.cpp:2530 main/lineswidget.cpp:1146 msgid "Unbreak Lines" msgstr "" #: core/subtitle.cpp:1158 main/application.cpp:2544 main/lineswidget.cpp:1152 msgid "Simplify Spaces" msgstr "" #: core/subtitle.cpp:1167 msgid "Synchronize Subtitles" msgstr "" #: core/subtitle.cpp:1190 main/dialogs/joinsubtitlesdialog.cpp:35 msgid "Join Subtitles" msgstr "" #: core/subtitle.cpp:1236 core/subtitle.cpp:1242 msgid "Split Subtitles" msgstr "" #: core/subtitle.cpp:1259 core/subtitle.cpp:1274 msgid "Set Lines Style" msgstr "" #: core/subtitle.cpp:1291 msgid "Toggle Lines Style" msgstr "" #: core/subtitle.cpp:1304 msgid "Set Lines Mark" msgstr "" #: core/subtitle.cpp:1304 msgid "Clear Lines Mark" msgstr "" #: core/subtitle.cpp:1318 msgid "Toggle Lines Mark" msgstr "" #: core/subtitle.cpp:1328 main/application.cpp:2261 main/application.cpp:2271 #: main/errorswidget.cpp:854 msgid "Clear Lines Errors" msgstr "" #: core/subtitle.cpp:1338 core/subtitle.cpp:1358 main/application.cpp:2194 #: main/application.cpp:2239 msgid "Check Lines Errors" msgstr "" #: core/subtitlelineactions.cpp:65 msgid "Set Line Text" msgstr "" #: core/subtitlelineactions.cpp:101 msgid "Set Line Secondary Text" msgstr "" #: core/subtitlelineactions.cpp:137 msgid "Set Line Texts" msgstr "" #: core/subtitlelineactions.cpp:218 msgid "Set Line Show Time" msgstr "" #: core/subtitlelineactions.cpp:254 msgid "Set Line Hide Time" msgstr "" #: core/subtitlelineactions.cpp:371 msgid "Set Line Errors" msgstr "" #: core/subtitleline.cpp:72 msgid "Empty text" msgstr "" #: core/subtitleline.cpp:74 msgid "Too many characters" msgstr "" #: core/subtitleline.cpp:76 msgid "Too many lines" msgstr "" #: core/subtitleline.cpp:78 msgid "Unnecessary white space" msgstr "" #: core/subtitleline.cpp:80 msgid "Unnecessary dash" msgstr "" #: core/subtitleline.cpp:82 msgid "Capital letter after continuation ellipsis" msgstr "" #: core/subtitleline.cpp:84 msgid "Too long duration per character" msgstr "" #: core/subtitleline.cpp:86 msgid "Too short duration per character" msgstr "" #: core/subtitleline.cpp:88 msgid "Too long duration" msgstr "" #: core/subtitleline.cpp:89 msgid "Too short duration" msgstr "" #: core/subtitleline.cpp:90 msgid "Overlapping times" msgstr "" #: core/subtitleline.cpp:91 msgid "Untranslated text" msgstr "" #: core/subtitleline.cpp:92 msgid "User mark" msgstr "" #: core/subtitleline.cpp:112 msgid "Has no primary text." msgstr "" #: core/subtitleline.cpp:116 msgid "Has no translation text." msgstr "" #: core/subtitleline.cpp:120 msgid "Has too many characters in primary text (1 char)." msgid_plural "Has too many characters in primary text (%1 chars)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:126 msgid "Has too many characters in translation text (1 char)." msgid_plural "Has too many characters in translation text (%1 chars)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:132 msgid "Has too many lines in primary text (1 line)." msgid_plural "Has too many lines in primary text (%1 lines)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:138 msgid "Has too many lines in translation text (1 line)." msgid_plural "Has too many lines in translation text (%1 lines)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:144 msgid "Has unnecessary spaces in primary text." msgstr "" #: core/subtitleline.cpp:148 msgid "Has unnecessary spaces in translation text." msgstr "" #: core/subtitleline.cpp:152 msgid "Has unnecessary dash in primary text." msgstr "" #: core/subtitleline.cpp:156 msgid "Has unnecessary dash in translation text." msgstr "" #: core/subtitleline.cpp:160 msgid "Has capital letter after line continuation ellipsis in primary text." msgstr "" #: core/subtitleline.cpp:164 msgid "" "Has capital letter after line continuation ellipsis in translation text." msgstr "" #: core/subtitleline.cpp:168 msgid "Has too long duration per character in primary text (1 msec/char)." msgid_plural "" "Has too long duration per character in primary text (%1 msecs/char)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:174 msgid "Has too long duration per character in translation text (1 msec/char)." msgid_plural "" "Has too long duration per character in translation text (%1 msecs/char)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:180 msgid "Has too short duration per character in primary text (1 msec/char)." msgid_plural "" "Has too short duration per character in primary text (%1 msecs/char)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:186 msgid "Has too short duration per character in translation text (1 msec/char)." msgid_plural "" "Has too short duration per character in translation text (%1 msecs/char)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:192 msgid "Has too long duration (1 msec)." msgid_plural "Has too long duration (%1 msecs)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:198 msgid "Has too short duration (1 msec)." msgid_plural "Has too short duration (%1 msecs)." msgstr[0] "" msgstr[1] "" #: core/subtitleline.cpp:204 msgid "Overlaps with next line." msgstr "" #: core/subtitleline.cpp:208 msgid "Has untranslated text." msgstr "" #: core/subtitleline.cpp:212 msgid "Has user mark." msgstr "" #: core/subtitleline.cpp:680 msgid "Set Line Times" msgstr "" #: core/subtitleline.cpp:691 msgid "Shift Line Times" msgstr "" #: core/subtitleline.cpp:705 msgid "Adjust Line Times" msgstr "" #: main/actions/krecentfilesactionext.cpp:37 msgid "Clear History" msgstr "" #: main/application.cpp:415 msgid "Video Files" msgstr "" #: main/application.cpp:423 msgid "Audio Files" msgstr "" #: main/application.cpp:425 msgid "Media Files" msgstr "" #: main/application.cpp:426 msgid "All Files" msgstr "" #: main/application.cpp:442 msgid "Audio Levels Files" msgstr "" #: main/application.cpp:456 msgid "Exit the application" msgstr "" #: main/application.cpp:460 msgid "Configure Subtitle Composer" msgstr "" #: main/application.cpp:465 msgctxt "@action:inmenu Create a new subtitle" msgid "New" msgstr "" #: main/application.cpp:466 msgid "Create an empty subtitle" msgstr "" #: main/application.cpp:475 msgctxt "@action:inmenu Open subtitle file" msgid "Open..." msgstr "" #: main/application.cpp:476 main/application.cpp:486 msgid "Open subtitle file" msgstr "" #: main/application.cpp:485 msgctxt "@action:inmenu Open rencently used subtitle file" msgid "Open &Recent" msgstr "" #: main/application.cpp:493 msgid "Save" msgstr "" #: main/application.cpp:494 msgid "Save opened subtitle" msgstr "" #: main/application.cpp:503 msgid "Save As..." msgstr "" #: main/application.cpp:504 msgid "Save opened subtitle with different settings" msgstr "" #: main/application.cpp:512 msgid "Close" msgstr "" #: main/application.cpp:513 msgid "Close opened subtitle" msgstr "" #: main/application.cpp:522 msgid "New Translation" msgstr "" #: main/application.cpp:523 msgid "Create an empty translation subtitle" msgstr "" #: main/application.cpp:532 msgid "Open Translation..." msgstr "" #: main/application.cpp:533 main/application.cpp:543 msgid "Open translation subtitle file" msgstr "" #: main/application.cpp:542 msgid "Open &Recent Translation" msgstr "" #: main/application.cpp:551 msgid "Save Translation" msgstr "" #: main/application.cpp:552 msgid "Save opened translation subtitle" msgstr "" #: main/application.cpp:561 msgid "Save Translation As..." msgstr "" #: main/application.cpp:562 msgid "Save opened translation subtitle with different settings" msgstr "" #: main/application.cpp:570 msgid "Close Translation" msgstr "" #: main/application.cpp:571 msgid "Close opened translation subtitle" msgstr "" #: main/application.cpp:580 msgid "Reload As..." msgstr "" #: main/application.cpp:581 main/application.cpp:592 msgid "Reload opened file with a different encoding" msgstr "" #: main/application.cpp:591 msgid "Quick Reload As..." msgstr "" #: main/application.cpp:600 main/application.cpp:601 #: widgets/simplerichtextedit.cpp:72 msgid "Undo" msgstr "" #: main/application.cpp:610 main/application.cpp:611 #: widgets/simplerichtextedit.cpp:78 msgid "Redo" msgstr "" #: main/application.cpp:619 msgid "Split Subtitle..." msgstr "" #: main/application.cpp:620 msgid "Split the opened subtitle in two parts" msgstr "" #: main/application.cpp:627 msgid "Join Subtitles..." msgstr "" #: main/application.cpp:628 msgid "Append to the opened subtitle another one" msgstr "" #: main/application.cpp:635 main/lineswidget.cpp:1222 msgid "Insert Before" msgstr "" #: main/application.cpp:636 msgid "Insert empty line before current one" msgstr "" #: main/application.cpp:644 main/lineswidget.cpp:1223 msgid "Insert After" msgstr "" #: main/application.cpp:645 msgid "Insert empty line after current one" msgstr "" #: main/application.cpp:653 main/lineswidget.cpp:1221 #: main/scripting/scriptsmanager.cpp:141 msgid "Remove" msgstr "" #: main/application.cpp:654 msgid "Remove selected lines" msgstr "" #: main/application.cpp:663 msgid "Split selected lines" msgstr "" #: main/application.cpp:671 msgid "Join selected lines" msgstr "" #: main/application.cpp:678 main/dialogs/actionwitherrortargetsdialog.cpp:103 #: main/lineswidget.cpp:1219 widgets/simplerichtextedit.cpp:113 msgid "Select All" msgstr "" #: main/application.cpp:679 msgid "Select all lines" msgstr "" #: main/application.cpp:687 msgid "Go to Line..." msgstr "" #: main/application.cpp:688 msgid "Go to specified line" msgstr "" #: main/application.cpp:697 msgid "Find..." msgstr "" #: main/application.cpp:698 msgid "Find occurrences of strings or regular expressions" msgstr "" #: main/application.cpp:708 msgid "Find Next" msgstr "" #: main/application.cpp:709 msgid "Find next occurrence of string or regular expression" msgstr "" #: main/application.cpp:719 msgid "Find Previous" msgstr "" #: main/application.cpp:720 msgid "Find previous occurrence of string or regular expression" msgstr "" #: main/application.cpp:728 msgid "Replace..." msgstr "" #: main/application.cpp:729 msgid "Replace occurrences of strings or regular expressions" msgstr "" #: main/application.cpp:738 msgid "Retrocede current line" msgstr "" #: main/application.cpp:739 msgid "Makes the line before the current one active" msgstr "" #: main/application.cpp:748 msgid "Advance current line" msgstr "" #: main/application.cpp:749 msgid "Makes the line after the current one active" msgstr "" #: main/application.cpp:757 main/errorsdialog.cpp:59 main/lineswidget.cpp:1212 msgid "Check Errors..." msgstr "" #: main/application.cpp:758 msgid "Check for errors in the current subtitle" msgstr "" #: main/application.cpp:766 main/errorsdialog.cpp:62 main/lineswidget.cpp:1213 msgid "Clear Errors..." msgstr "" #: main/application.cpp:767 msgid "Clear errors from selected lines" msgstr "" #: main/application.cpp:774 main/lineswidget.cpp:1215 msgid "Show Errors..." msgstr "" #: main/application.cpp:775 msgid "Show errors information for the current subtitle" msgstr "" #: main/application.cpp:784 msgid "Find Error..." msgstr "" #: main/application.cpp:785 msgid "Find lines with specified errors" msgstr "" #: main/application.cpp:795 msgid "Find Next Error" msgstr "" #: main/application.cpp:796 msgid "Find next line with specified errors" msgstr "" #: main/application.cpp:806 msgid "Find Previous Error" msgstr "" #: main/application.cpp:807 msgid "Find previous line with specified errors" msgstr "" #: main/application.cpp:816 main/lineswidget.cpp:1159 msgid "Spelling..." msgstr "" #: main/application.cpp:817 msgid "Check lines spelling" msgstr "" #: main/application.cpp:824 msgid "Toggle Mark" msgstr "" #: main/application.cpp:825 msgid "Toggle selected lines mark" msgstr "" #: main/application.cpp:834 main/currentlinewidget.cpp:92 msgid "Toggle Bold" msgstr "" #: main/application.cpp:835 msgid "Toggle selected lines bold attribute" msgstr "" #: main/application.cpp:844 main/currentlinewidget.cpp:97 msgid "Toggle Italic" msgstr "" #: main/application.cpp:845 msgid "Toggle selected lines italic attribute" msgstr "" #: main/application.cpp:854 main/currentlinewidget.cpp:102 msgid "Toggle Underline" msgstr "" #: main/application.cpp:855 msgid "Toggle selected lines underline attribute" msgstr "" #: main/application.cpp:864 main/currentlinewidget.cpp:107 msgid "Toggle Strike Through" msgstr "" #: main/application.cpp:865 msgid "Toggle selected lines strike through attribute" msgstr "" #: main/application.cpp:873 main/lineswidget.cpp:1199 msgid "Shift..." msgstr "" #: main/application.cpp:874 msgid "Shift lines an specified amount of time" msgstr "" #: main/application.cpp:901 msgid "Adjust..." msgstr "" #: main/application.cpp:902 msgid "Linearly adjust all lines to a specified interval" msgstr "" #: main/application.cpp:910 msgid "Sort..." msgstr "" #: main/application.cpp:911 msgid "Sort lines based on their show time" msgstr "" #: main/application.cpp:918 msgid "Change Frame Rate..." msgstr "" #: main/application.cpp:919 msgid "Retime subtitle lines by reinterpreting its frame rate" msgstr "" #: main/application.cpp:926 main/lineswidget.cpp:1201 msgid "Enforce Duration Limits..." msgstr "" #: main/application.cpp:927 msgid "Enforce lines minimum and/or maximum duration limits" msgstr "" #: main/application.cpp:935 main/lineswidget.cpp:1202 msgid "Set Automatic Durations..." msgstr "" #: main/application.cpp:936 msgid "Set lines durations based on amount of letters, words and line breaks" msgstr "" #: main/application.cpp:943 msgid "Maximize Durations..." msgstr "" #: main/application.cpp:944 msgid "Extend lines durations up to their next lines show time" msgstr "" #: main/application.cpp:951 msgid "Fix Overlapping Times..." msgstr "" #: main/application.cpp:952 msgid "Fix lines overlapping times" msgstr "" #: main/application.cpp:959 msgid "Synchronize with Subtitle..." msgstr "" #: main/application.cpp:960 msgid "Copy timing information from another subtitle" msgstr "" #: main/application.cpp:967 main/lineswidget.cpp:1142 msgid "Break Lines..." msgstr "" #: main/application.cpp:968 msgid "Automatically set line breaks" msgstr "" #: main/application.cpp:975 main/lineswidget.cpp:1145 msgid "Unbreak Lines..." msgstr "" #: main/application.cpp:976 msgid "Remove line breaks from lines" msgstr "" #: main/application.cpp:983 main/lineswidget.cpp:1151 msgid "Simplify Spaces..." msgstr "" #: main/application.cpp:984 msgid "Remove unneeded spaces from lines" msgstr "" #: main/application.cpp:991 main/lineswidget.cpp:1155 msgid "Change Case..." msgstr "" #: main/application.cpp:992 msgid "Change lines text to upper, lower, title or sentence case" msgstr "" #: main/application.cpp:999 main/lineswidget.cpp:1156 msgid "Fix Punctuation..." msgstr "" #: main/application.cpp:1000 msgid "Fix punctuation errors in lines" msgstr "" #: main/application.cpp:1007 main/lineswidget.cpp:1157 msgid "Translate..." msgstr "" #: main/application.cpp:1008 msgid "Translate lines texts using Google services" msgstr "" #: main/application.cpp:1015 msgid "Edit Line in Place" msgstr "" #: main/application.cpp:1016 msgid "Edit current line text in place" msgstr "" #: main/application.cpp:1025 msgid "Open Video..." msgstr "" #: main/application.cpp:1026 main/application.cpp:1034 msgid "Open video file" msgstr "" #: main/application.cpp:1033 msgid "Open &Recent Video" msgstr "" #: main/application.cpp:1041 msgid "Close Video" msgstr "" #: main/application.cpp:1042 msgid "Close video file" msgstr "" #: main/application.cpp:1051 msgid "Full Screen Mode" msgstr "" #: main/application.cpp:1052 msgid "Toggle full screen mode" msgstr "" #: main/application.cpp:1060 main/utils/kreplace.cpp:425 msgid "Stop" msgstr "" #: main/application.cpp:1061 msgid "Stop video playback" msgstr "" #: main/application.cpp:1069 main/application.cpp:3156 #: main/application.cpp:3163 msgid "Play" msgstr "" #: main/application.cpp:1070 msgid "Toggle video playing/paused" msgstr "" #: main/application.cpp:1078 msgid "Seek Backwards" msgstr "" #: main/application.cpp:1087 msgid "Seek Forwards" msgstr "" #: main/application.cpp:1099 msgid "Jump to Previous Line" msgstr "" #: main/application.cpp:1100 msgid "Seek to previous subtitle line show time" msgstr "" #: main/application.cpp:1109 msgid "Jump to Next Line" msgstr "" #: main/application.cpp:1110 msgid "Seek to next subtitle line show time" msgstr "" #: main/application.cpp:1120 msgid "Set Current Line Show Time" msgstr "" #: main/application.cpp:1121 msgid "Set current line show time to video position" msgstr "" #: main/application.cpp:1131 msgid "Set Current Line Hide Time" msgstr "" #: main/application.cpp:1132 msgid "Set current line hide time to video position" msgstr "" #: main/application.cpp:1141 msgid "Current Line Follows Video" msgstr "" #: main/application.cpp:1142 msgid "Make current line follow the playing video position" msgstr "" #: main/application.cpp:1149 msgctxt "@action:inmenu Toggle audio muted" msgid "Mute" msgstr "" #: main/application.cpp:1151 msgid "Enable/disable playback sound" msgstr "" #: main/application.cpp:1159 msgid "Increase Volume" msgstr "" #: main/application.cpp:1160 msgid "Increase volume by 5%" msgstr "" #: main/application.cpp:1168 msgid "Decrease Volume" msgstr "" #: main/application.cpp:1169 msgid "Decrease volume by 5%" msgstr "" #: main/application.cpp:1177 msgid "Audio Streams" msgstr "" #: main/application.cpp:1178 msgid "Select active audio stream" msgstr "" #: main/application.cpp:1186 msgid "Increase Font Size" msgstr "" #: main/application.cpp:1187 msgid "Increase subtitles font size by 1 point" msgstr "" #: main/application.cpp:1195 msgid "Decrease Font Size" msgstr "" #: main/application.cpp:1196 msgid "Decrease subtitles font size by 1 point" msgstr "" #: main/application.cpp:1204 msgid "Subtitle Streams" msgstr "" #: main/application.cpp:1205 msgid "Select active subtitle stream" msgstr "" #: main/application.cpp:1212 msgid "Shift to Video Position" msgstr "" #: main/application.cpp:1213 msgid "" "Set current line show time to video position by equally shifting all lines" msgstr "" #: main/application.cpp:1221 msgid "Adjust to Video Position (Anchor Last Line)" msgstr "" #: main/application.cpp:1222 msgid "" "Set current line to video position by fixing the last line and linearly " "adjusting the other ones" msgstr "" #: main/application.cpp:1230 msgid "Adjust to Video Position (Anchor First Line)" msgstr "" #: main/application.cpp:1231 msgid "" "Set current line to video position by fixing the first line and linearly " "adjusting the other ones" msgstr "" #: main/application.cpp:1240 msgctxt "@action:inmenu Manage user scripts" msgid "Scripts Manager..." msgstr "" #: main/application.cpp:1241 msgid "Manage user scripts" msgstr "" #: main/application.cpp:1365 msgid "" "The requested action would make the subtitle and its translation share the " "same file, possibly resulting in loss of information when saving.\n" "Are you sure you want to continue?" msgstr "" #: main/application.cpp:1366 msgid "Conflicting Subtitle Files" msgstr "" #: main/application.cpp:1488 msgid "" "Could not parse the subtitle file.
This may have been caused by " "usage of the wrong encoding.
" msgstr "" #: main/application.cpp:1519 msgid "There was an error saving the subtitle." msgstr "" #: main/application.cpp:1561 main/application.cpp:1770 msgid "" "Currently opened translation subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" #: main/application.cpp:1562 main/application.cpp:1771 msgid "Close Translation Subtitle" msgstr "" #: main/application.cpp:1574 msgid "" "Currently opened subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" #: main/application.cpp:1575 msgid "Close Subtitle" msgstr "" #: main/application.cpp:1678 msgctxt "@item:inmenu Display primary text in video player" msgid "Primary" msgstr "" #: main/application.cpp:1679 msgctxt "@item:inmenu Display translation text in video player" msgid "Translation" msgstr "" #: main/application.cpp:1689 msgid "Could not parse the subtitle file." msgstr "" #: main/application.cpp:1728 msgid "There was an error saving the translation subtitle." msgstr "" #: main/application.cpp:1864 msgid "Could not read the subtitle file to append." msgstr "" #: main/application.cpp:1916 msgid "Could not write the splitted subtitle file." msgstr "" #: main/application.cpp:1917 msgid "Could not write the splitted subtitle translation file." msgstr "" #: main/application.cpp:1935 msgid "The specified time does not split the subtitles." msgstr "" #: main/application.cpp:1984 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted part was saved as %1." msgstr "" #: main/application.cpp:1989 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted parts were saved as %1 and %2." msgstr "" #: main/application.cpp:2077 msgid "Go to Line" msgstr "" #: main/application.cpp:2077 msgid "&Go to line:" msgstr "" #: main/application.cpp:2389 msgid "Can not perform sort on selection with multiple ranges." msgstr "" #: main/application.cpp:2499 msgid "The reference subtitle must have more than one line to proceed." msgstr "" #: main/application.cpp:2511 msgid "Could not parse the reference subtitle file." msgstr "" #: main/application.cpp:2618 main/dialogs/translatedialog.cpp:31 msgid "Translate" msgstr "" #: main/application.cpp:2619 msgid "Translating text (%1 to %2)..." msgstr "" #: main/application.cpp:2628 msgid "Translating primary text (%1 to %2)..." msgstr "" #: main/application.cpp:2629 msgid "Translating secondary text (%1 to %2)..." msgstr "" #: main/application.cpp:2661 msgid "" "Unable to perform texts synchronization (sent and received lines count do " "not match)." msgstr "" #: main/application.cpp:2670 msgid "Translate Primary Text" msgstr "" #: main/application.cpp:2671 msgid "Translate Secondary Text" msgstr "" #: main/application.cpp:2687 msgid "" "There was an error performing the translation:\n" "\n" "%1" msgstr "" #: main/application.cpp:2740 msgid "Open Video" msgstr "" #: main/application.cpp:2873 main/application.cpp:2911 msgid "" "Continuing would result in loss of timing information for some lines.\n" "Are you sure you want to continue?" msgstr "" #: main/application.cpp:2929 msgid "Open AudioLevels" msgstr "" #: main/application.cpp:3035 msgid "modified" msgstr "" #: main/application.cpp:3039 main/application.cpp:3050 msgid "Untitled" msgstr "" #: main/application.cpp:3041 msgid "Untitled Translation" msgstr "" #: main/application.cpp:3149 msgid "Pause" msgstr "" #: main/application.cpp:3190 msgid "Seek backwards 1 second" msgid_plural "Seek backwards %1 seconds" msgstr[0] "" msgstr[1] "" #: main/application.cpp:3196 msgid "Seek forwards 1 second" msgid_plural "Seek forwards %1 seconds" msgstr[0] "" msgstr[1] "" #: main/application.cpp:3211 main/application.cpp:3223 msgid "Shift %21 Millisecond" msgid_plural "Shift %2%1 Milliseconds" msgstr[0] "" msgstr[1] "" #: main/application.cpp:3216 main/application.cpp:3228 msgid "Shift selected lines %21 millisecond" msgid_plural "Shift selected lines %2%1 milliseconds" msgstr[0] "" msgstr[1] "" #: main/configdialog.cpp:46 msgid "Configure" msgstr "" #: main/configdialog.cpp:54 msgctxt "@title General settings" msgid "General" msgstr "" #: main/configdialog.cpp:55 msgid "General Settings" msgstr "" #: main/configdialog.cpp:59 msgctxt "@title Error checks settings" msgid "Error Checks" msgstr "" #: main/configdialog.cpp:60 msgid "Error Checks Settings" msgstr "" #: main/configdialog.cpp:64 msgctxt "@title Spelling settings" msgid "Spelling" msgstr "" #: main/configdialog.cpp:65 msgid "Spelling Settings" msgstr "" #: main/configdialog.cpp:69 msgctxt "@title Player settings" msgid "Player" msgstr "" #: main/configdialog.cpp:70 msgid "Player Settings" msgstr "" #: main/configdialog.cpp:82 msgctxt "@title Player backend settings" msgid "%1 Backend Settings" msgstr "" #: main/configs/errorsconfigwidget.cpp:37 msgctxt "@title:group" msgid "Texts" msgstr "" #: main/configs/errorsconfigwidget.cpp:40 msgid "Maximum number of characters:" msgstr "" #: main/configs/errorsconfigwidget.cpp:45 #: main/dialogs/smarttextsadjustdialog.cpp:40 msgid " characters" msgstr "" #: main/configs/errorsconfigwidget.cpp:48 msgid "Maximum number of lines:" msgstr "" #: main/configs/errorsconfigwidget.cpp:53 msgid " lines" msgstr "" #: main/configs/errorsconfigwidget.cpp:56 msgctxt "@title:group" msgid "Absolute Durations" msgstr "" #: main/configs/errorsconfigwidget.cpp:59 #: main/configs/errorsconfigwidget.cpp:78 msgid "Minimum duration:" msgstr "" #: main/configs/errorsconfigwidget.cpp:64 #: main/configs/errorsconfigwidget.cpp:72 #: main/configs/generalconfigwidget.cpp:52 #: main/configs/generalconfigwidget.cpp:66 #: main/configs/generalconfigwidget.cpp:74 #: main/dialogs/fixoverlappingtimesdialog.cpp:37 msgid " msecs" msgstr "" #: main/configs/errorsconfigwidget.cpp:67 #: main/configs/errorsconfigwidget.cpp:86 msgid "Maximum duration:" msgstr "" #: main/configs/errorsconfigwidget.cpp:75 msgctxt "@title:group" msgid "Relative Durations" msgstr "" #: main/configs/errorsconfigwidget.cpp:83 #: main/configs/errorsconfigwidget.cpp:91 msgid " msecs/character" msgstr "" #: main/configs/errorsconfigwidget.cpp:93 msgctxt "@title:group" msgid "Behavior" msgstr "" #: main/configs/errorsconfigwidget.cpp:96 msgid "Automatically clear fixed errors" msgstr "" #: main/configs/generalconfigwidget.cpp:38 #: main/configs/playerconfigwidget.cpp:44 #: player/mplayer/mplayerconfigwidget.cpp:37 msgctxt "@title:group General settings" msgid "General" msgstr "" #: main/configs/generalconfigwidget.cpp:41 msgid "Default encoding for opening subtitles:" msgstr "" #: main/configs/generalconfigwidget.cpp:47 msgid "On line double click, jump to show time minus:" msgstr "" #: main/configs/generalconfigwidget.cpp:55 msgid "Automatically load video file when opening subtitle" msgstr "" #: main/configs/generalconfigwidget.cpp:58 msgctxt "@title:group" msgid "Quick Actions" msgstr "" #: main/configs/generalconfigwidget.cpp:61 msgid "Time shift for selected lines:" msgstr "" #: main/configs/generalconfigwidget.cpp:69 msgid "Compensation for captured video times:" msgstr "" #: main/configs/playerconfigwidget.cpp:47 msgid "Player backend:" msgstr "" #: main/configs/playerconfigwidget.cpp:53 msgid "Jump length on seek:" msgstr "" #: main/configs/playerconfigwidget.cpp:58 msgid " secs" msgstr "" #: main/configs/playerconfigwidget.cpp:61 main/playerwidget.cpp:452 msgid "Show editable position control" msgstr "" #: main/configs/playerconfigwidget.cpp:64 msgctxt "@title:group" msgid "Subtitles" msgstr "" #: main/configs/playerconfigwidget.cpp:67 msgctxt "@label:chooser The font family name" msgid "Font family:" msgstr "" #: main/configs/playerconfigwidget.cpp:72 msgid "Font size:" msgstr "" #: main/configs/playerconfigwidget.cpp:77 msgid " points" msgstr "" #: main/configs/playerconfigwidget.cpp:80 msgid "Primary color:" msgstr "" #: main/configs/playerconfigwidget.cpp:85 msgid "Outline color:" msgstr "" #: main/configs/playerconfigwidget.cpp:91 msgid "Outline width:" msgstr "" #: main/configs/playerconfigwidget.cpp:96 msgid " pixels" msgstr "" #: main/configs/playerconfigwidget.cpp:99 msgctxt "@title:group" msgid "Subtitles Preview" msgstr "" #: main/configs/playerconfigwidget.cpp:109 msgctxt "Text for previewing the subtitles font settings" msgid "

The Quick Brown Fox
Jumps Over The Lazy Dog

" msgstr "" #: main/currentlinewidget.cpp:65 msgid "Show" msgstr "" #: main/currentlinewidget.cpp:70 msgid "Hide" msgstr "" #: main/currentlinewidget.cpp:75 msgid "Duration" msgstr "" #: main/currentlinewidget.cpp:253 main/currentlinewidget.cpp:259 msgid "No current line" msgstr "" #: main/currentlinewidget.cpp:383 msgid "Current line:" msgstr "" #: main/currentlinewidget.cpp:408 msgid "1 character" msgid_plural "%1 characters" msgstr[0] "" msgstr[1] "" #: main/dialogs/actionwitherrortargetsdialog.cpp:74 msgid "Available errors" msgstr "" #: main/dialogs/actionwitherrortargetsdialog.cpp:105 msgid "Select None" msgstr "" #: main/dialogs/actionwithtargetdialog.cpp:131 msgid "Target >>" msgstr "" #: main/dialogs/actionwithtargetdialog.cpp:131 #: main/dialogs/actionwithtargetdialog.cpp:149 msgid "Target <<" msgstr "" #: main/dialogs/actionwithtargetdialog.cpp:164 msgid "All lines" msgstr "" #: main/dialogs/actionwithtargetdialog.cpp:165 main/utils/errorfinder.cpp:48 msgid "Selected lines" msgstr "" #: main/dialogs/actionwithtargetdialog.cpp:166 msgid "All lines from first selected" msgstr "" #: main/dialogs/actionwithtargetdialog.cpp:167 msgid "All lines up to last selected" msgstr "" #: main/dialogs/actionwithtargetdialog.cpp:257 main/utils/finder.cpp:63 #: main/utils/replacer.cpp:61 msgid "Both subtitles" msgstr "" #: main/dialogs/actionwithtargetdialog.cpp:260 main/utils/finder.cpp:65 #: main/utils/replacer.cpp:63 msgid "Primary subtitle" msgstr "" #: main/dialogs/actionwithtargetdialog.cpp:263 main/utils/finder.cpp:67 #: main/utils/replacer.cpp:65 msgid "Translation subtitle" msgstr "" #: main/dialogs/actionwithtargetdialog.h:78 msgid "Apply To" msgstr "" #: main/dialogs/adjusttimesdialog.cpp:32 msgid "Adjust" msgstr "" #: main/dialogs/adjusttimesdialog.cpp:34 msgctxt "@title:group" msgid "New Times" msgstr "" #: main/dialogs/adjusttimesdialog.cpp:39 msgid "First spoken line:" msgstr "" #: main/dialogs/adjusttimesdialog.cpp:45 msgid "Last spoken line:" msgstr "" #: main/dialogs/autodurationsdialog.cpp:38 #: main/dialogs/changeframeratedialog.cpp:36 #: main/dialogs/fixoverlappingtimesdialog.cpp:34 #: main/dialogs/fixpunctuationdialog.cpp:33 #: main/dialogs/smarttextsadjustdialog.cpp:34 #: main/dialogs/splitsubtitledialog.cpp:38 main/dialogs/translatedialog.cpp:33 msgctxt "@title:group" msgid "Settings" msgstr "" #: main/dialogs/autodurationsdialog.cpp:46 msgid "Milliseconds per line:" msgstr "" #: main/dialogs/autodurationsdialog.cpp:55 msgid "Milliseconds per word:" msgstr "" #: main/dialogs/autodurationsdialog.cpp:64 msgid "Milliseconds per character:" msgstr "" #: main/dialogs/autodurationsdialog.cpp:68 #: main/dialogs/durationlimitsdialog.cpp:45 msgid "Prevent overlapping" msgstr "" #: main/dialogs/autodurationsdialog.cpp:71 msgctxt "@title:group" msgid "Duration Calculation" msgstr "" #: main/dialogs/autodurationsdialog.cpp:77 msgid "Use primary text" msgstr "" #: main/dialogs/autodurationsdialog.cpp:78 msgid "Use translation text" msgstr "" #: main/dialogs/autodurationsdialog.cpp:79 msgid "Calculate both and use maximum" msgstr "" #: main/dialogs/changeframeratedialog.cpp:45 msgid "Current frame rate:" msgstr "" #: main/dialogs/changeframeratedialog.cpp:54 msgid "New frame rate:" msgstr "" #: main/dialogs/changetextscasedialog.cpp:33 msgid "Change Case" msgstr "" #: main/dialogs/changetextscasedialog.cpp:35 msgctxt "@title:group" msgid "Change To" msgstr "" #: main/dialogs/changetextscasedialog.cpp:39 msgid "Lower case" msgstr "" #: main/dialogs/changetextscasedialog.cpp:44 msgid "Upper case" msgstr "" #: main/dialogs/changetextscasedialog.cpp:48 msgid "Title case" msgstr "" #: main/dialogs/changetextscasedialog.cpp:52 msgid "Sentence case" msgstr "" #: main/dialogs/changetextscasedialog.cpp:56 msgid "Convert to lower case first" msgstr "" #: main/dialogs/checkerrorsdialog.cpp:31 msgid "Check Errors" msgstr "" #: main/dialogs/checkerrorsdialog.cpp:33 msgctxt "@title:group" msgid "Errors to Check" msgstr "" #: main/dialogs/checkerrorsdialog.cpp:36 msgctxt "@title:group Miscellaneous settings" msgid "Miscellaneous" msgstr "" #: main/dialogs/checkerrorsdialog.cpp:39 msgid "Clear other errors" msgstr "" #: main/dialogs/checkerrorsdialog.cpp:43 msgid "Clear user marks" msgstr "" #: main/dialogs/clearerrorsdialog.cpp:32 msgid "Clear Errors" msgstr "" #: main/dialogs/clearerrorsdialog.cpp:34 msgctxt "@title:group" msgid "Errors to Clear" msgstr "" #: main/dialogs/durationlimitsdialog.cpp:35 msgctxt "@title:group" msgid "Minimum Duration" msgstr "" #: main/dialogs/durationlimitsdialog.cpp:41 msgid "Expand duration to:" msgstr "" #: main/dialogs/durationlimitsdialog.cpp:48 msgctxt "@title:group" msgid "Maximum Duration" msgstr "" #: main/dialogs/durationlimitsdialog.cpp:54 msgid "Shrink duration to:" msgstr "" #: main/dialogs/fixoverlappingtimesdialog.cpp:43 msgid "Minimum interval between lines:" msgstr "" #: main/dialogs/fixpunctuationdialog.cpp:31 msgid "Fix Punctuation" msgstr "" #: main/dialogs/fixpunctuationdialog.cpp:36 msgid "Fix and cleanup spaces" msgstr "" #: main/dialogs/fixpunctuationdialog.cpp:40 msgid "Fix quotes and double quotes" msgstr "" #: main/dialogs/fixpunctuationdialog.cpp:44 msgid "Fix English 'I' pronoun" msgstr "" #: main/dialogs/fixpunctuationdialog.cpp:48 msgid "Add ellipisis indicating non finished lines" msgstr "" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line Before Current" msgstr "" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line After Current" msgstr "" #: main/dialogs/insertlinedialog.cpp:29 msgid "Insert Into" msgstr "" #: main/dialogs/joinsubtitlesdialog.cpp:40 msgid "Shift subtitle forwards before append" msgstr "" #: main/dialogs/joinsubtitlesdialog.cpp:47 #: main/dialogs/splitsubtitledialog.cpp:44 msgid "Set from video length" msgstr "" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Subtitle" msgstr "" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Translation Subtitle" msgstr "" #: main/dialogs/opensubtitledialog.cpp:46 #: main/dialogs/savesubtitledialog.cpp:80 #: main/dialogs/selectablesubtitledialog.cpp:67 msgid "Encoding:" msgstr "" #: main/dialogs/opensubtitledialog.cpp:73 msgid "All Supported" msgstr "" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove Selected Lines" msgstr "" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove From" msgstr "" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Subtitle" msgstr "" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Translation Subtitle" msgstr "" #: main/dialogs/savesubtitledialog.cpp:69 msgid "EOL:" msgstr "" #: main/dialogs/savesubtitledialog.cpp:145 msgid "" "A file named \"%1\" already exists. Are you sure you want to overwrite it?" msgstr "" #: main/dialogs/savesubtitledialog.cpp:148 msgid "Overwrite File?" msgstr "" #: main/dialogs/savesubtitledialog.cpp:149 msgid "Overwrite" msgstr "" #: main/dialogs/selectablesubtitledialog.cpp:51 msgid "Path:" msgstr "" #: main/dialogs/selectablesubtitledialog.cpp:56 msgid "Select subtitle" msgstr "" #: main/dialogs/selectablesubtitledialog.h:54 msgid "Subtitle" msgstr "" #: main/dialogs/shifttimesdialog.cpp:32 msgid "Shift" msgstr "" #: main/dialogs/shifttimesdialog.cpp:34 msgctxt "@title:group" msgid "Shifting" msgstr "" #: main/dialogs/shifttimesdialog.cpp:38 msgid "Forwards (+)" msgstr "" #: main/dialogs/shifttimesdialog.cpp:39 msgid "Backwards (–)" msgstr "" #: main/dialogs/smarttextsadjustdialog.cpp:43 msgid "Minimum length for line break:" msgstr "" #: main/dialogs/splitsubtitledialog.cpp:36 msgid "Split Subtitle" msgstr "" #: main/dialogs/splitsubtitledialog.cpp:49 msgid "Split time:" msgstr "" #: main/dialogs/splitsubtitledialog.cpp:53 msgid "Shift new part backwards after split" msgstr "" #: main/dialogs/syncsubtitlesdialog.cpp:32 msgid "Synchronize with Subtitle" msgstr "" #: main/dialogs/syncsubtitlesdialog.cpp:34 msgid "Reference Subtitle" msgstr "" #: main/dialogs/syncsubtitlesdialog.cpp:36 msgctxt "@title:group" msgid "Synchronization Mode" msgstr "" #: main/dialogs/syncsubtitlesdialog.cpp:39 msgid "Adjust to reference's first and last lines" msgstr "" #: main/dialogs/syncsubtitlesdialog.cpp:43 msgid "Copy timing information from reference line by line" msgstr "" #: main/dialogs/translatedialog.cpp:49 msgid "Input language:" msgstr "" #: main/dialogs/translatedialog.cpp:66 msgid "Output language:" msgstr "" #: main/errorsdialog.cpp:42 msgid "Subtitle Errors" msgstr "" #: main/errorsdialog.cpp:55 msgid "Clear Fixed Errors" msgstr "" #: main/errorsdialog.cpp:65 msgid "Settings..." msgstr "" #: main/errorsdialog.cpp:121 msgid "Showing 1 line with errors" msgid_plural "Showing %1 lines with errors" msgstr[0] "" msgstr[1] "" #: main/errorsdialog.cpp:124 msgid "1 total error" msgid_plural "%1 total errors" msgstr[0] "" msgstr[1] "" #: main/errorsdialog.cpp:125 msgid "1 user mark" msgid_plural "%1 user marks" msgstr[0] "" msgstr[1] "" #: main/errorswidget.cpp:491 msgid "Line Errors" msgstr "" #: main/errorswidget.cpp:492 msgid "Count" msgstr "" #: main/errorswidget.cpp:493 msgid "Marked" msgstr "" #: main/errorswidget.cpp:509 msgid "yes" msgstr "" #: main/errorswidget.cpp:510 msgid "no" msgstr "" #: main/errorswidget.cpp:517 msgid "Line %1" msgstr "" #: main/errorswidget.cpp:717 msgid "Expand All" msgstr "" #: main/errorswidget.cpp:718 msgid "Collapse All" msgstr "" #: main/errorswidget.cpp:722 msgid "Clear Selected Marks" msgstr "" #: main/errorswidget.cpp:723 msgid "Clear Selected Errors" msgstr "" #: main/errorswidget.cpp:729 msgid "Clear Fixed Selection" msgstr "" #: main/lineswidget.cpp:204 msgid "Observations:" msgstr "" #: main/lineswidget.cpp:232 msgctxt "@title:column Subtitle line number" msgid "Line" msgstr "" #: main/lineswidget.cpp:233 msgctxt "@title:column" msgid "Show Time" msgstr "" #: main/lineswidget.cpp:234 msgctxt "@title:column" msgid "Hide Time" msgstr "" #: main/lineswidget.cpp:235 msgctxt "@title:column Subtitle line (primary) text" msgid "Text" msgstr "" #: main/lineswidget.cpp:236 msgctxt "@title:column Subtitle line translation text" msgid "Translation" msgstr "" #: main/lineswidget.cpp:1141 msgid "Texts" msgstr "" #: main/lineswidget.cpp:1162 msgid "Styles" msgstr "" #: main/lineswidget.cpp:1166 widgets/simplerichtextedit.cpp:119 msgctxt "@action:inmenu Toggle bold style" msgid "Bold" msgstr "" #: main/lineswidget.cpp:1173 widgets/simplerichtextedit.cpp:125 msgctxt "@action:inmenu Toggle italic style" msgid "Italic" msgstr "" #: main/lineswidget.cpp:1180 widgets/simplerichtextedit.cpp:131 msgctxt "@action:inmenu Toggle underline style" msgid "Underline" msgstr "" #: main/lineswidget.cpp:1187 widgets/simplerichtextedit.cpp:137 msgctxt "@action:inmenu Toggle strike through style" msgid "Strike Through" msgstr "" #: main/lineswidget.cpp:1194 msgid "Times" msgstr "" #: main/lineswidget.cpp:1196 msgid "Shift +%1 Milliseconds" msgstr "" #: main/lineswidget.cpp:1197 msgid "Shift -%1 Milliseconds" msgstr "" #: main/lineswidget.cpp:1207 msgid "Errors" msgstr "" #: main/lineswidget.cpp:1208 msgid "Mark" msgstr "" #: main/main.cpp:43 msgid "Subtitle Composer" msgstr "" #: main/main.cpp:45 msgid "A KDE subtitle editor." msgstr "" #: main/main.cpp:47 msgid "(C) 2007-2009 Sergio Pistone" msgstr "" #: main/main.cpp:51 msgid "Sergio Pistone" msgstr "" #: main/main.cpp:52 msgid "Author & maintainer" msgstr "" #: main/main.cpp:61 msgid "Open location as primary subtitle" msgstr "" #: main/main.cpp:62 msgid "Open location as translation subtitle" msgstr "" #: main/playerwidget.cpp:103 msgid "Position" msgstr "" #: main/playerwidget.cpp:111 msgid "Length" msgstr "" #: main/playerwidget.cpp:116 msgid "FPS" msgstr "" #: main/playerwidget.cpp:704 main/playerwidget.cpp:705 #: main/playerwidget.cpp:706 main/playerwidget.cpp:778 #: main/playerwidget.cpp:795 main/playerwidget.cpp:802 msgid "Unknown" msgstr "" #: main/playerwidget.cpp:715 msgid "There was an error opening file
%1
" msgstr "" #: main/playerwidget.cpp:741 msgid "Unexpected error while playing file." msgstr "" #: main/scripting/scriptsmanager.cpp:70 msgid "Installed Scripts" msgstr "" #: main/scripting/scriptsmanager.cpp:88 msgid "Information" msgstr "" #: main/scripting/scriptsmanager.cpp:94 msgid "Warning" msgstr "" #: main/scripting/scriptsmanager.cpp:100 msgid "Error" msgstr "" #: main/scripting/scriptsmanager.cpp:113 msgid "Scripts Manager" msgstr "" #: main/scripting/scriptsmanager.cpp:129 msgid "Create..." msgstr "" #: main/scripting/scriptsmanager.cpp:130 msgid "Creates a new script file." msgstr "" #: main/scripting/scriptsmanager.cpp:135 msgid "Add..." msgstr "" #: main/scripting/scriptsmanager.cpp:136 msgid "Copies an existing script from a specified location." msgstr "" #: main/scripting/scriptsmanager.cpp:142 msgid "Sends the selected script to the trash." msgstr "" #: main/scripting/scriptsmanager.cpp:147 msgid "Edit" msgstr "" #: main/scripting/scriptsmanager.cpp:148 msgid "Opens the selected script with an external editor." msgstr "" #: main/scripting/scriptsmanager.cpp:154 msgid "Run" msgstr "" #: main/scripting/scriptsmanager.cpp:155 msgid "Executes the selected script." msgstr "" #: main/scripting/scriptsmanager.cpp:160 msgid "Refresh" msgstr "" #: main/scripting/scriptsmanager.cpp:161 msgid "Reloads the installed scripts list." msgstr "" #: main/scripting/scriptsmanager.cpp:219 main/scripting/scriptsmanager.cpp:301 msgid "" "You must enter an unused name to continue.\n" "Would you like to enter another name?" msgstr "" #: main/scripting/scriptsmanager.cpp:220 main/scripting/scriptsmanager.cpp:302 msgid "Name Already Used" msgstr "" #: main/scripting/scriptsmanager.cpp:226 msgid "Create New Script" msgstr "" #: main/scripting/scriptsmanager.cpp:226 main/scripting/scriptsmanager.cpp:308 msgid "Script name:" msgstr "" #: main/scripting/scriptsmanager.cpp:239 msgid "There was an error creating the file %1." msgstr "" #: main/scripting/scriptsmanager.cpp:283 msgid "Select Existing Script" msgstr "" #: main/scripting/scriptsmanager.cpp:308 msgid "Rename Script" msgstr "" #: main/scripting/scriptsmanager.cpp:322 msgid "There was an error opening the file %1." msgstr "" #: main/scripting/scriptsmanager.cpp:331 msgid "There was an error copying the file to %1." msgstr "" #: main/scripting/scriptsmanager.cpp:350 msgid "Do you really want to send file %1 to the trash?" msgstr "" #: main/scripting/scriptsmanager.cpp:351 msgid "Move to Trash" msgstr "" #: main/scripting/scriptsmanager.cpp:359 msgid "There was an error removing the file %1." msgstr "" #: main/scripting/scriptsmanager.cpp:377 msgid "Could not launch external editor.\n" msgstr "" #: main/scripting/scriptsmanager.cpp:441 main/scripting/scriptsmanager.cpp:448 msgid "Error Running Script" msgstr "" #: main/scripting/scriptsmanager.cpp:462 msgid "Tools" msgstr "" #: main/utils/errorfinder.cpp:40 main/utils/errorfinder.cpp:221 #: main/utils/errorfinder.cpp:244 msgid "Find Error" msgstr "" #: main/utils/errorfinder.cpp:42 msgid "Errors to Find" msgstr "" #: main/utils/errorfinder.cpp:45 msgid "Options" msgstr "" #: main/utils/errorfinder.cpp:51 msgid "From current line" msgstr "" #: main/utils/errorfinder.cpp:55 msgid "Find backwards" msgstr "" #: main/utils/errorfinder.cpp:216 main/utils/finder.cpp:298 #: main/utils/replacer.cpp:258 msgid "" "Beginning of selection reached.\n" "Continue from the end?" msgstr "" #: main/utils/errorfinder.cpp:217 main/utils/finder.cpp:299 #: main/utils/replacer.cpp:259 msgid "" "Beginning of subtitle reached.\n" "Continue from the end?" msgstr "" #: main/utils/errorfinder.cpp:219 main/utils/finder.cpp:301 #: main/utils/replacer.cpp:261 msgid "" "End of selection reached.\n" "Continue from the beginning?" msgstr "" #: main/utils/errorfinder.cpp:220 main/utils/finder.cpp:302 #: main/utils/replacer.cpp:262 main/utils/speller.cpp:143 msgid "" "End of subtitle reached.\n" "Continue from the beginning?" msgstr "" #: main/utils/errorfinder.cpp:243 msgid "No errors matching given criteria found!" msgstr "" #: main/utils/finder.cpp:55 msgid "Find In" msgstr "" #: main/utils/finder.cpp:278 main/utils/replacer.cpp:234 msgid "No instances of '%1' found!" msgstr "" #: main/utils/finder.cpp:279 main/utils/finder.cpp:303 msgid "Find" msgstr "" #: main/utils/kreplace.cpp:49 main/utils/kreplace.cpp:53 #: main/utils/replacer.cpp:172 main/utils/replacer.cpp:229 #: main/utils/replacer.cpp:235 main/utils/replacer.cpp:263 msgid "Replace" msgstr "" #: main/utils/kreplace.cpp:51 msgid "&All" msgstr "" #: main/utils/kreplace.cpp:52 msgid "&Skip" msgstr "" #: main/utils/kreplace.cpp:63 msgid "Replace '%1' with '%2'?" msgstr "" #: main/utils/kreplace.cpp:139 main/utils/kreplace.cpp:406 msgid "No text was replaced." msgstr "" #: main/utils/kreplace.cpp:141 main/utils/kreplace.cpp:408 #: main/utils/replacer.cpp:228 main/utils/replacer.cpp:255 msgid "1 replacement done." msgid_plural "%1 replacements done." msgstr[0] "" msgstr[1] "" #: main/utils/kreplace.cpp:413 msgid "Beginning of document reached." msgstr "" #: main/utils/kreplace.cpp:415 msgid "End of document reached." msgstr "" #: main/utils/kreplace.cpp:422 msgid "Do you want to restart search from the end?" msgstr "" #: main/utils/kreplace.cpp:423 msgid "Do you want to restart search at the beginning?" msgstr "" #: main/utils/kreplace.cpp:425 msgid "Restart" msgstr "" #: main/utils/language.cpp:125 msgid "Automatic" msgstr "" #: main/utils/language.cpp:129 msgctxt "Official language of the Philippines, aka Filipino" msgid "Tagalog" msgstr "" #: main/utils/replacer.cpp:53 msgid "Find/Replace In" msgstr "" #: main/utils/speller.cpp:144 msgid "Spell Checking" msgstr "" #: main/utils/translator.cpp:167 msgid "Operation cancelled by user" msgstr "" #: main/utils/translator.cpp:270 main/utils/translator.cpp:280 msgid "Unexpected contents received from translation service" msgstr "" #: player/gstreamer/gstreamerbackend.cpp:543 #: player/mplayer/mplayerbackend.cpp:259 player/xine/xinebackend.cpp:278 msgid "Audio Stream #%1" msgstr "" #: player/gstreamer/gstreamerconfigwidget.cpp:34 msgctxt "@title:group GStreamer sinks settings" msgid "Sinks" msgstr "" #: player/gstreamer/gstreamerconfigwidget.cpp:37 msgid "Audio sink:" msgstr "" #: player/gstreamer/gstreamerconfigwidget.cpp:46 msgid "Video sink:" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:40 msgid "Executable path:" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:43 msgid "Select the MPlayer executable" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:47 msgctxt "@title:group Video settings" msgid "Video" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:50 msgid "Video output driver:" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:58 msgid "Allow frame dropping" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:61 msgid "Allow hard frame dropping" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:64 msgctxt "@title:group Audio settings" msgid "Audio" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:67 msgid "Audio output driver:" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:75 msgid "A/V synchronization factor:" msgstr "" #: player/mplayer/mplayerconfigwidget.cpp:83 msgid "Volume normalization" msgstr "" #: player/xine/xineconfigwidget.cpp:34 msgctxt "@title:group Xine drivers settings" msgid "Drivers" msgstr "" #: player/xine/xineconfigwidget.cpp:37 msgid "Audio driver:" msgstr "" #: player/xine/xineconfigwidget.cpp:45 msgid "Video driver:" msgstr "" #: widgets/simplerichtextedit.cpp:84 msgid "Cut" msgstr "" #: widgets/simplerichtextedit.cpp:90 msgid "Copy" msgstr "" #: widgets/simplerichtextedit.cpp:96 msgid "Paste" msgstr "" #: widgets/simplerichtextedit.cpp:102 msgid "Delete" msgstr "" #: widgets/simplerichtextedit.cpp:108 msgctxt "@action:inmenu Clear all text" msgid "Clear" msgstr "" #: widgets/simplerichtextedit.cpp:143 msgid "Check Spelling..." msgstr "" #: widgets/simplerichtextedit.cpp:147 msgid "Auto Spell Check" msgstr "" #: widgets/simplerichtextedit.cpp:152 msgid "Allow Tabulations" msgstr "" #: widgets/simplerichtextedit.cpp:491 msgid "Suggestions" msgstr "" #: widgets/simplerichtextedit.cpp:492 msgid "Ignore" msgstr "" #: widgets/simplerichtextedit.cpp:493 msgid "Add to Dictionary" msgstr "" #: widgets/simplerichtextedit.cpp:497 msgid "No suggestions" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:5 #. i18n: ectx: Menu (file) #: rc.cpp:3 msgid "&File" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:16 #. i18n: ectx: Menu (translation) #: rc.cpp:6 msgid "Translation" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:28 #. i18n: ectx: Menu (edit) #: rc.cpp:9 msgid "&Edit" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:51 #. i18n: ectx: Menu (texts) #: rc.cpp:12 msgid "&Texts" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:62 #. i18n: ectx: Menu (styles) #: rc.cpp:15 msgid "St&yles" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:69 #. i18n: ectx: Menu (times) #: rc.cpp:18 msgid "T&imes" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:91 #. i18n: ectx: Menu (errors) #: rc.cpp:21 msgid "E&rrors" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:104 #. i18n: ectx: Menu (video) #: rc.cpp:24 msgid "&Video" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:132 #. i18n: ectx: Menu (tools) #: rc.cpp:27 msgid "T&ools" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:137 #. i18n: ectx: Menu (audiolevels) #: rc.cpp:30 msgid "&Audio Levels" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:153 #. i18n: ectx: ToolBar (mainToolBar) #: rc.cpp:33 msgid "Main Toolbar" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:165 #. i18n: ectx: ToolBar (editToolBar) #: rc.cpp:36 msgctxt "The toolbar name" msgid "Edit Toolbar" msgstr "" #: rc.cpp:37 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "" #: rc.cpp:38 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "" subtitlecomposer-0.5.3/po/sr@latin/0000755000175000001440000000000011206423743016525 5ustar sergiouserssubtitlecomposer-0.5.3/po/sr@latin/CMakeLists.txt0000644000175000001440000000017411151345073021265 0ustar sergiousersFILE( GLOB _po_files *.po ) GETTEXT_PROCESS_PO_FILES( sr@latin ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) subtitlecomposer-0.5.3/po/sr@latin/subtitlecomposer.po0000644000175000001440000021217411206411600022464 0ustar sergiousers# translation of subtitlecomposer.po to Serbian # This file is put in the public domain. # # Slobodan Simic , 2008, 2009. # Sergio Pistone , 2009. msgid "" msgstr "" "Project-Id-Version: subtitlecomposer\n" "Report-Msgid-Bugs-To: https://sourceforge.net/tracker/?" "atid=1005652&group_id=208427&func=browse\n" "POT-Creation-Date: 2009-05-25 00:41-0300\n" "PO-Revision-Date: 2009-05-24 17:03-0300\n" "Last-Translator: Sergio Pistone \n" "Language-Team: American English \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 0.3\n" "Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 : n%" "10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #: core/subtitleactions.cpp:62 msgid "Set Frame Rate" msgstr "Postavi brzinu kadrova" #: core/subtitleactions.cpp:93 msgid "Insert Lines" msgstr "Ubaci redove" #: core/subtitleactions.cpp:177 core/subtitle.cpp:446 core/subtitle.cpp:460 #: core/subtitle.cpp:479 msgid "Remove Lines" msgstr "Ukloni redove" #: core/subtitleactions.cpp:268 msgid "Move Line" msgstr "Pomeri red" #: core/subtitleactions.cpp:381 msgid "Swap Texts" msgstr "Zameni tekstove" #: core/subtitle.cpp:66 msgid "Set Primary Data" msgstr "Postavi glavni tekst" #: core/subtitle.cpp:121 msgid "Clear Primary Text Data" msgstr "Očisti podatke glavnog teksta" #: core/subtitle.cpp:134 msgid "Set Secondary Data" msgstr "Postavi sekundarne podatke" #: core/subtitle.cpp:180 msgid "Clear Secondary Text Data" msgstr "Očisti podatke sekundarnog teksta" #: core/subtitle.cpp:265 main/dialogs/changeframeratedialog.cpp:34 msgid "Change Frame Rate" msgstr "Izmeni broj kadrova" #: core/subtitle.cpp:395 core/subtitle.cpp:412 msgid "Insert Line" msgstr "Ubaci red" #: core/subtitle.cpp:533 main/application.cpp:662 main/lineswidget.cpp:1226 msgid "Split Lines" msgstr "Razdvoji redove" #: core/subtitle.cpp:590 main/application.cpp:670 main/lineswidget.cpp:1225 msgid "Join Lines" msgstr "Spoji redove" #: core/subtitle.cpp:642 msgid "Shift Lines" msgstr "Pomeri redove" #: core/subtitle.cpp:690 msgid "Adjust Lines" msgstr "Podesi redove" #: core/subtitle.cpp:700 main/application.cpp:2377 main/lineswidget.cpp:1200 msgid "Sort" msgstr "Poređaj" #: core/subtitle.cpp:746 main/dialogs/durationlimitsdialog.cpp:33 msgid "Enforce Duration Limits" msgstr "Prisili ograničenja trajanja" #: core/subtitle.cpp:791 main/application.cpp:2462 main/lineswidget.cpp:1203 msgid "Maximize Durations" msgstr "Maksimizuj trajanja" #: core/subtitle.cpp:816 main/dialogs/autodurationsdialog.cpp:35 msgid "Set Automatic Durations" msgstr "Postavi automatska trajanja" #: core/subtitle.cpp:856 main/dialogs/fixoverlappingtimesdialog.cpp:32 #: main/lineswidget.cpp:1204 msgid "Fix Overlapping Times" msgstr "Sredi preklapajuća vremena" #: core/subtitle.cpp:890 msgid "Fix Lines Punctuation" msgstr "Sredi interpunkciju reda" #: core/subtitle.cpp:986 msgid "Lower Case" msgstr "Mala slova" #: core/subtitle.cpp:1020 msgid "Upper Case" msgstr "Velika slova" #: core/subtitle.cpp:1054 msgid "Title Case" msgstr "Veličina naslova" #: core/subtitle.cpp:1091 msgid "Sentence Case" msgstr "Veličina rečenica" #: core/subtitle.cpp:1142 main/dialogs/smarttextsadjustdialog.cpp:32 msgid "Break Lines" msgstr "Prelomi redove" #: core/subtitle.cpp:1150 main/application.cpp:2530 main/lineswidget.cpp:1146 msgid "Unbreak Lines" msgstr "Vrati prelomljene redove" #: core/subtitle.cpp:1158 main/application.cpp:2544 main/lineswidget.cpp:1152 msgid "Simplify Spaces" msgstr "Pojednostavi razmake" #: core/subtitle.cpp:1167 msgid "Synchronize Subtitles" msgstr "Sinhronizuj titlove" #: core/subtitle.cpp:1190 main/dialogs/joinsubtitlesdialog.cpp:35 msgid "Join Subtitles" msgstr "Sastavi titlove" #: core/subtitle.cpp:1236 core/subtitle.cpp:1242 msgid "Split Subtitles" msgstr "Razdvoji titlove" #: core/subtitle.cpp:1259 core/subtitle.cpp:1274 msgid "Set Lines Style" msgstr "Postavi stil redova" #: core/subtitle.cpp:1291 msgid "Toggle Lines Style" msgstr "Uklj/isklj. stil reda" #: core/subtitle.cpp:1304 msgid "Set Lines Mark" msgstr "Postavi marker redova" #: core/subtitle.cpp:1304 msgid "Clear Lines Mark" msgstr "Očisti marker redova" #: core/subtitle.cpp:1318 msgid "Toggle Lines Mark" msgstr "Menjaj markaciju redova" #: core/subtitle.cpp:1328 main/application.cpp:2261 main/application.cpp:2271 #: main/errorswidget.cpp:854 msgid "Clear Lines Errors" msgstr "Očisti greške redova" #: core/subtitle.cpp:1338 core/subtitle.cpp:1358 main/application.cpp:2194 #: main/application.cpp:2239 msgid "Check Lines Errors" msgstr "Proveri greške redova" #: core/subtitlelineactions.cpp:65 msgid "Set Line Text" msgstr "Postavi tekst reda" #: core/subtitlelineactions.cpp:101 msgid "Set Line Secondary Text" msgstr "Postavi sekundarni tekst reda" #: core/subtitlelineactions.cpp:137 msgid "Set Line Texts" msgstr "Postavi tekst reda" #: core/subtitlelineactions.cpp:218 msgid "Set Line Show Time" msgstr "Postavi vreme prikazivanja reda" #: core/subtitlelineactions.cpp:254 msgid "Set Line Hide Time" msgstr "Postavi vreme nestajanja reda" #: core/subtitlelineactions.cpp:371 msgid "Set Line Errors" msgstr "Postavi greške reda" #: core/subtitleline.cpp:72 msgid "Empty text" msgstr "Prazan tekst" #: core/subtitleline.cpp:74 msgid "Too many characters" msgstr "Previše znakova" #: core/subtitleline.cpp:76 msgid "Too many lines" msgstr "Previše redova" #: core/subtitleline.cpp:78 msgid "Unnecessary white space" msgstr "Nepotrebni razmaci" #: core/subtitleline.cpp:80 msgid "Unnecessary dash" msgstr "Nepotrebna crtica" #: core/subtitleline.cpp:82 msgid "Capital letter after continuation ellipsis" msgstr "Veliko slovo nakon crtice za novi red" #: core/subtitleline.cpp:84 msgid "Too long duration per character" msgstr "Predugo trajanje po znaku" #: core/subtitleline.cpp:86 msgid "Too short duration per character" msgstr "Prekratko trajanje po karakteru" #: core/subtitleline.cpp:88 msgid "Too long duration" msgstr "Predugo trajanje" #: core/subtitleline.cpp:89 msgid "Too short duration" msgstr "Prekratko trajanje" #: core/subtitleline.cpp:90 msgid "Overlapping times" msgstr "Preklapanje vremena" #: core/subtitleline.cpp:91 msgid "Untranslated text" msgstr "Neprevedeni tekst" #: core/subtitleline.cpp:92 msgid "User mark" msgstr "Korisnički markeri" #: core/subtitleline.cpp:112 msgid "Has no primary text." msgstr "Nema glavnog teksta." #: core/subtitleline.cpp:116 msgid "Has no translation text." msgstr "Nema prevedenog teksta." #: core/subtitleline.cpp:120 msgid "Has too many characters in primary text (1 char)." msgid_plural "Has too many characters in primary text (%1 chars)." msgstr[0] "Ima previše znakova u glavnom tekstu (%1 znak)." msgstr[1] "Ima previše znakova u glavnom tekstu (%1 znaka)." msgstr[2] "Ima previše znakova u glavnom tekstu (%1 znakova)." msgstr[3] "Ima previše znakova u glavnom tekstu (1 znak)." #: core/subtitleline.cpp:126 msgid "Has too many characters in translation text (1 char)." msgid_plural "Has too many characters in translation text (%1 chars)." msgstr[0] "Ima previše znakova u prevedenom tekstu (%1 znak)." msgstr[1] "Ima previše znakova u prevedenom tekstu (%1 znaka)." msgstr[2] "Ima previše znakova u prevedenom tekstu (%1 znakova)." msgstr[3] "Ima previše znakova u prevedenom tekstu (1 znak)." #: core/subtitleline.cpp:132 msgid "Has too many lines in primary text (1 line)." msgid_plural "Has too many lines in primary text (%1 lines)." msgstr[0] "Ima previše redova u glavnom tekstu (%1 red)." msgstr[1] "Ima previše redova u glavnom tekstu (%1 reda)." msgstr[2] "Ima previše redova u glavnom tekstu (%1 redova)." msgstr[3] "Ima previše redova u glavnom tekstu (1 red)." #: core/subtitleline.cpp:138 msgid "Has too many lines in translation text (1 line)." msgid_plural "Has too many lines in translation text (%1 lines)." msgstr[0] "Ima previše redova u prevedenom tekstu (%1 red)." msgstr[1] "Ima previše redova u prevedenom tekstu (%1 reda)." msgstr[2] "Ima previše redova u prevedenom tekstu (%1 redova)." msgstr[3] "Ima previše redova u prevedenom tekstu (1 red)." #: core/subtitleline.cpp:144 msgid "Has unnecessary spaces in primary text." msgstr "Ima nepotrebne razmake u glavnom tekstu." #: core/subtitleline.cpp:148 msgid "Has unnecessary spaces in translation text." msgstr "Ima nepotrebne razmake u prevedenom tekstu." #: core/subtitleline.cpp:152 msgid "Has unnecessary dash in primary text." msgstr "Ima nepotrebne crtice u glavnom tekstu." #: core/subtitleline.cpp:156 msgid "Has unnecessary dash in translation text." msgstr "Ima nepotrebne crtice u prevedenom tekstu." #: core/subtitleline.cpp:160 msgid "Has capital letter after line continuation ellipsis in primary text." msgstr "Ima veliko slovo nakon crtice za novi red u glavnom tekstu." #: core/subtitleline.cpp:164 msgid "" "Has capital letter after line continuation ellipsis in translation text." msgstr "Ima veliko slovo nakon crtice za novi red u prevedenom tekstu." #: core/subtitleline.cpp:168 msgid "Has too long duration per character in primary text (1 msec/char)." msgid_plural "" "Has too long duration per character in primary text (%1 msecs/char)." msgstr[0] "Ima predugo trajanje po znaku u glavnom tekstu (%1 ms/znaku)." msgstr[1] "Ima predugo trajanje po znaku u glavnom tekstu (%1 ms/znaku)." msgstr[2] "Ima predugo trajanje po znaku u glavnom tekstu (%1 ms/znaku)." msgstr[3] "Ima predugo trajanje po znaku u glavnom tekstu (1 ms/znaku)." #: core/subtitleline.cpp:174 msgid "Has too long duration per character in translation text (1 msec/char)." msgid_plural "" "Has too long duration per character in translation text (%1 msecs/char)." msgstr[0] "Ima predugo trajanje po znaku u prevedenom tekstu (%1 ms/znaku)." msgstr[1] "Ima predugo trajanje po znaku u prevedenom tekstu (%1 ms/znaku)." msgstr[2] "Ima predugo trajanje po znaku u prevedenom tekstu (%1 ms/znaku)." msgstr[3] "Ima predugo trajanje po znaku u prevedenom tekstu (1 ms/znaku)." #: core/subtitleline.cpp:180 msgid "Has too short duration per character in primary text (1 msec/char)." msgid_plural "" "Has too short duration per character in primary text (%1 msecs/char)." msgstr[0] "Ima prekratko trajanje po znaku u glavnom tekstu (%1 ms/znaku)." msgstr[1] "Ima prekratko trajanje po znaku u glavnom tekstu (%1 ms/znaku)." msgstr[2] "Ima prekratko trajanje po znaku u glavnom tekstu (%1 ms/znaku)." msgstr[3] "Ima prekratko trajanje po znaku u glavnom tekstu (1 ms/znaku)." #: core/subtitleline.cpp:186 msgid "Has too short duration per character in translation text (1 msec/char)." msgid_plural "" "Has too short duration per character in translation text (%1 msecs/char)." msgstr[0] "Ima prekratko trajanje po znaku u prevedenom tekstu (%1 ms/znaku)." msgstr[1] "Ima prekratko trajanje po znaku u prevedenom tekstu (%1 ms/znaku)." msgstr[2] "Ima prekratko trajanje po znaku u prevedenom tekstu (%1 ms/znaku)." msgstr[3] "Ima prekratko trajanje po znaku u prevedenom tekstu (1 ms/znaku)." #: core/subtitleline.cpp:192 msgid "Has too long duration (1 msec)." msgid_plural "Has too long duration (%1 msecs)." msgstr[0] "Ima predugo trajanje (%1 ms)." msgstr[1] "Ima predugo trajanje (%1 ms)." msgstr[2] "Ima predugo trajanje (%1 ms)." msgstr[3] "Ima predugo trajanje (1 ms)." #: core/subtitleline.cpp:198 msgid "Has too short duration (1 msec)." msgid_plural "Has too short duration (%1 msecs)." msgstr[0] "Ima prekratko trajanje (%1 ms)." msgstr[1] "Ima prekratko trajanje (%1 ms)." msgstr[2] "Ima prekratko trajanje (%1 ms)." msgstr[3] "Ima prekratko trajanje (1 ms)." #: core/subtitleline.cpp:204 msgid "Overlaps with next line." msgstr "Preklapa se sa narednim redom." #: core/subtitleline.cpp:208 msgid "Has untranslated text." msgstr "Ima neprevedeni tekst." #: core/subtitleline.cpp:212 msgid "Has user mark." msgstr "Ima korisnički marker." #: core/subtitleline.cpp:680 msgid "Set Line Times" msgstr "Postavi vremena reda" #: core/subtitleline.cpp:691 msgid "Shift Line Times" msgstr "Pomeri vremena reda" #: core/subtitleline.cpp:705 msgid "Adjust Line Times" msgstr "Podesi vremena reda" #: main/actions/krecentfilesactionext.cpp:37 msgid "Clear History" msgstr "Očisti istorijat" #: main/application.cpp:415 msgid "Video Files" msgstr "Video fajlovi" #: main/application.cpp:423 msgid "Audio Files" msgstr "Audio fajlovi" #: main/application.cpp:425 msgid "Media Files" msgstr "Medija fajlovi" #: main/application.cpp:426 msgid "All Files" msgstr "Svi fajlovi" #: main/application.cpp:442 msgid "Audio Levels Files" msgstr "Fajlovi audio nivoa" #: main/application.cpp:456 msgid "Exit the application" msgstr "Izađi iz programa" #: main/application.cpp:460 msgid "Configure Subtitle Composer" msgstr "Podesi „Sastavljača titlova“" #: main/application.cpp:465 msgctxt "@action:inmenu Create a new subtitle" msgid "New" msgstr "Novi" #: main/application.cpp:466 msgid "Create an empty subtitle" msgstr "Napravi prazan titl" #: main/application.cpp:475 msgctxt "@action:inmenu Open subtitle file" msgid "Open..." msgstr "Otvori..." #: main/application.cpp:476 main/application.cpp:486 msgid "Open subtitle file" msgstr "Otvori fajl titla" #: main/application.cpp:485 msgctxt "@action:inmenu Open rencently used subtitle file" msgid "Open &Recent" msgstr "Otvori sko&rašnji" #: main/application.cpp:493 msgid "Save" msgstr "Sačuvaj" #: main/application.cpp:494 msgid "Save opened subtitle" msgstr "Sačuvaj otvoreni titl" #: main/application.cpp:503 msgid "Save As..." msgstr "Sačuvaj kao..." #: main/application.cpp:504 msgid "Save opened subtitle with different settings" msgstr "Sačuvaj otvoreni titl sa drugačijim postavkama" #: main/application.cpp:512 msgid "Close" msgstr "Zatvori" #: main/application.cpp:513 msgid "Close opened subtitle" msgstr "Zatvori otvoreni titl" #: main/application.cpp:522 msgid "New Translation" msgstr "Novi prevod" #: main/application.cpp:523 msgid "Create an empty translation subtitle" msgstr "Napravi prazan prevedeni titl" #: main/application.cpp:532 msgid "Open Translation..." msgstr "Otvori prevod..." #: main/application.cpp:533 main/application.cpp:543 msgid "Open translation subtitle file" msgstr "Otvori fajl prevedenog titla" #: main/application.cpp:542 msgid "Open &Recent Translation" msgstr "Otvori sko&rašnji prevod" #: main/application.cpp:551 msgid "Save Translation" msgstr "Sačuvaj prevod" #: main/application.cpp:552 msgid "Save opened translation subtitle" msgstr "Sačuvaj otvoreni prevedeni titl" #: main/application.cpp:561 msgid "Save Translation As..." msgstr "Sačuvaj prevod kao..." #: main/application.cpp:562 msgid "Save opened translation subtitle with different settings" msgstr "Sačuvaj otvoreni prevedeni titl sa drugačijim postavkama" #: main/application.cpp:570 msgid "Close Translation" msgstr "Zatvori prevod" #: main/application.cpp:571 msgid "Close opened translation subtitle" msgstr "Zatvori otvoreni prevedeni titl" #: main/application.cpp:580 msgid "Reload As..." msgstr "Učitaj kao..." #: main/application.cpp:581 main/application.cpp:592 msgid "Reload opened file with a different encoding" msgstr "Ponovo učitaj otvoreni titl sa drugačijim kodiranjem" #: main/application.cpp:591 msgid "Quick Reload As..." msgstr "Brzo učitaj kao..." #: main/application.cpp:600 main/application.cpp:601 #: widgets/simplerichtextedit.cpp:72 msgid "Undo" msgstr "Opozovi" #: main/application.cpp:610 main/application.cpp:611 #: widgets/simplerichtextedit.cpp:78 msgid "Redo" msgstr "Ponovi" #: main/application.cpp:619 msgid "Split Subtitle..." msgstr "Razdvoji titl..." #: main/application.cpp:620 msgid "Split the opened subtitle in two parts" msgstr "Razdvoji otvoreni titl na dva dela" #: main/application.cpp:627 msgid "Join Subtitles..." msgstr "Združi titlove..." #: main/application.cpp:628 msgid "Append to the opened subtitle another one" msgstr "Dodavanje drugog titla otvorenom" #: main/application.cpp:635 main/lineswidget.cpp:1222 msgid "Insert Before" msgstr "Umetni pre" #: main/application.cpp:636 msgid "Insert empty line before current one" msgstr "Umetni prazan red pre tekućeg" #: main/application.cpp:644 main/lineswidget.cpp:1223 msgid "Insert After" msgstr "Umetni nakon" #: main/application.cpp:645 msgid "Insert empty line after current one" msgstr "Umetni prazan red nakon tekućeg" #: main/application.cpp:653 main/lineswidget.cpp:1221 #: main/scripting/scriptsmanager.cpp:141 msgid "Remove" msgstr "Ukloni" #: main/application.cpp:654 msgid "Remove selected lines" msgstr "Ukloni izabrane redove" #: main/application.cpp:663 msgid "Split selected lines" msgstr "Razdvoji izabrane redove" #: main/application.cpp:671 msgid "Join selected lines" msgstr "Združi izabrane redove" #: main/application.cpp:678 main/dialogs/actionwitherrortargetsdialog.cpp:103 #: main/lineswidget.cpp:1219 widgets/simplerichtextedit.cpp:113 msgid "Select All" msgstr "Izaberi sve" #: main/application.cpp:679 msgid "Select all lines" msgstr "Izaberi sve redove" #: main/application.cpp:687 msgid "Go to Line..." msgstr "Idi na red..." #: main/application.cpp:688 msgid "Go to specified line" msgstr "Idi na određeni red" #: main/application.cpp:697 msgid "Find..." msgstr "Nađi..." #: main/application.cpp:698 msgid "Find occurrences of strings or regular expressions" msgstr "Pronalazi znakovne nizove ili regularne izraze" #: main/application.cpp:708 msgid "Find Next" msgstr "Nađi sledeće" #: main/application.cpp:709 msgid "Find next occurrence of string or regular expression" msgstr "Nalazi sledeću pojavu znakovnog niza ili regularnog izraza" #: main/application.cpp:719 msgid "Find Previous" msgstr "Nađi prethodno" #: main/application.cpp:720 msgid "Find previous occurrence of string or regular expression" msgstr "Nalazi prethodnu pojavu znakovnog niza ili regularnog izraza" #: main/application.cpp:728 msgid "Replace..." msgstr "Zameni..." #: main/application.cpp:729 msgid "Replace occurrences of strings or regular expressions" msgstr "Vrši zamenu znakovnih nizova ili regularnih izraza" #: main/application.cpp:738 msgid "Retrocede current line" msgstr "Preteča tekućeg reda" #: main/application.cpp:739 msgid "Makes the line before the current one active" msgstr "Čini da red pre tekućeg bude aktivan" #: main/application.cpp:748 msgid "Advance current line" msgstr "Sledbenik tekućeg reda" #: main/application.cpp:749 msgid "Makes the line after the current one active" msgstr "Čini da red nakon tekućeg bude aktivan" #: main/application.cpp:757 main/errorsdialog.cpp:59 main/lineswidget.cpp:1212 msgid "Check Errors..." msgstr "Proveri greške..." #: main/application.cpp:758 msgid "Check for errors in the current subtitle" msgstr "Proveri greške u tekućem titlu" #: main/application.cpp:766 main/errorsdialog.cpp:62 main/lineswidget.cpp:1213 msgid "Clear Errors..." msgstr "Očisti greške..." #: main/application.cpp:767 msgid "Clear errors from selected lines" msgstr "Očisti greške iz izabranih redova" #: main/application.cpp:774 main/lineswidget.cpp:1215 msgid "Show Errors..." msgstr "Prikaži greške..." #: main/application.cpp:775 msgid "Show errors information for the current subtitle" msgstr "Prikaži podatke o greškama za tekući titl" #: main/application.cpp:784 msgid "Find Error..." msgstr "Nađi grešku..." #: main/application.cpp:785 msgid "Find lines with specified errors" msgstr "Nađi redove sa navedenim greškama" #: main/application.cpp:795 msgid "Find Next Error" msgstr "Nađi sledeću grešku" #: main/application.cpp:796 msgid "Find next line with specified errors" msgstr "Nađi sledeći red sa navedenim greškama" #: main/application.cpp:806 msgid "Find Previous Error" msgstr "Nađi prethodnu grešku" #: main/application.cpp:807 msgid "Find previous line with specified errors" msgstr "Nađi prethodni red sa navedenim greškama" #: main/application.cpp:816 main/lineswidget.cpp:1159 msgid "Spelling..." msgstr "Pravopis..." #: main/application.cpp:817 msgid "Check lines spelling" msgstr "Proveri pravopis u redovima" #: main/application.cpp:824 msgid "Toggle Mark" msgstr "Markirano" #: main/application.cpp:825 msgid "Toggle selected lines mark" msgstr "Menja stanje markiranosti izabranih redova" #: main/application.cpp:834 main/currentlinewidget.cpp:92 msgid "Toggle Bold" msgstr "Podebljano" #: main/application.cpp:835 msgid "Toggle selected lines bold attribute" msgstr "Uključuje ili isključuje podebljani ispis izabranih redova" #: main/application.cpp:844 main/currentlinewidget.cpp:97 msgid "Toggle Italic" msgstr "Kurziv" #: main/application.cpp:845 msgid "Toggle selected lines italic attribute" msgstr "Uključuje ili isključuje kurzivni ispis izabranih redova" #: main/application.cpp:854 main/currentlinewidget.cpp:102 msgid "Toggle Underline" msgstr "Podvučeno" #: main/application.cpp:855 msgid "Toggle selected lines underline attribute" msgstr "Uključuje ili isključuje podvučeni ispis izabranih redova" #: main/application.cpp:864 main/currentlinewidget.cpp:107 msgid "Toggle Strike Through" msgstr "Precrtano" #: main/application.cpp:865 msgid "Toggle selected lines strike through attribute" msgstr "Uključuje ili isključuje precrtani ispis izabranih redova" #: main/application.cpp:873 main/lineswidget.cpp:1199 msgid "Shift..." msgstr "Pomeraj..." #: main/application.cpp:874 msgid "Shift lines an specified amount of time" msgstr "Pomeraj redova za određeno vreme" #: main/application.cpp:901 msgid "Adjust..." msgstr "Podesi..." #: main/application.cpp:902 msgid "Linearly adjust all lines to a specified interval" msgstr "Linearno podesi sve redove na određeni interval" #: main/application.cpp:910 msgid "Sort..." msgstr "Poređaj..." #: main/application.cpp:911 msgid "Sort lines based on their show time" msgstr "Poređaj redove na osnovu vremena pojavljivanja" #: main/application.cpp:918 msgid "Change Frame Rate..." msgstr "Izmeni brzinu kadrova..." #: main/application.cpp:919 msgid "Retime subtitle lines by reinterpreting its frame rate" msgstr "Prilagodi vremena redova preračunavajući brzinu kadrova" #: main/application.cpp:926 main/lineswidget.cpp:1201 msgid "Enforce Duration Limits..." msgstr "Prisili ograničenja trajanja..." #: main/application.cpp:927 msgid "Enforce lines minimum and/or maximum duration limits" msgstr "Forsiraj ograničenja maksimalnog i/ili minimalnog trajanja" #: main/application.cpp:935 main/lineswidget.cpp:1202 msgid "Set Automatic Durations..." msgstr "Postavi automatska trajanja..." #: main/application.cpp:936 msgid "Set lines durations based on amount of letters, words and line breaks" msgstr "Postavi trajanje redova na osnovu broja slova, reči i preloma redova" #: main/application.cpp:943 msgid "Maximize Durations..." msgstr "Maksimizuj trajanja..." #: main/application.cpp:944 msgid "Extend lines durations up to their next lines show time" msgstr "Produži trajanja redova do vremena pojavljivanja narednog reda" #: main/application.cpp:951 msgid "Fix Overlapping Times..." msgstr "Sredi preklapajuća vremena..." #: main/application.cpp:952 msgid "Fix lines overlapping times" msgstr "Sredi vremena preklopljenih redova" #: main/application.cpp:959 msgid "Synchronize with Subtitle..." msgstr "Sinhronizuj sa titlom..." #: main/application.cpp:960 msgid "Copy timing information from another subtitle" msgstr "Kopiraj podatke o vremenima iz drugog titla" #: main/application.cpp:967 main/lineswidget.cpp:1142 msgid "Break Lines..." msgstr "Prelomi redove..." #: main/application.cpp:968 msgid "Automatically set line breaks" msgstr "Automatski podesi prelom reda" #: main/application.cpp:975 main/lineswidget.cpp:1145 msgid "Unbreak Lines..." msgstr "Vrati prelomljene redove..." #: main/application.cpp:976 msgid "Remove line breaks from lines" msgstr "Ukloni prelom reda iz redova" #: main/application.cpp:983 main/lineswidget.cpp:1151 msgid "Simplify Spaces..." msgstr "Pojednostavi razmake..." #: main/application.cpp:984 msgid "Remove unneeded spaces from lines" msgstr "Ukloni nepotrebne razmake iz redova" #: main/application.cpp:991 main/lineswidget.cpp:1155 msgid "Change Case..." msgstr "Izmeni velika/mala slova..." #: main/application.cpp:992 msgid "Change lines text to upper, lower, title or sentence case" msgstr "Promeni tekst u velika ili mala slova, naslov ili veličinu za rečenicu" #: main/application.cpp:999 main/lineswidget.cpp:1156 msgid "Fix Punctuation..." msgstr "Sredi interpunkciju..." #: main/application.cpp:1000 msgid "Fix punctuation errors in lines" msgstr "Sredi greške interpunkcije u redovima" #: main/application.cpp:1007 main/lineswidget.cpp:1157 msgid "Translate..." msgstr "Prevedi..." #: main/application.cpp:1008 msgid "Translate lines texts using Google services" msgstr "Prevedi tekst redova pomoću Gugl usluga" #: main/application.cpp:1015 msgid "Edit Line in Place" msgstr "Uredi tekst na mestu" #: main/application.cpp:1016 msgid "Edit current line text in place" msgstr "Uredi tekst tekućeg reda na mestu" #: main/application.cpp:1025 msgid "Open Video..." msgstr "Otvori video..." #: main/application.cpp:1026 main/application.cpp:1034 msgid "Open video file" msgstr "Otvori video fajl" #: main/application.cpp:1033 msgid "Open &Recent Video" msgstr "Otvori sko&rašnji video" #: main/application.cpp:1041 msgid "Close Video" msgstr "Zatvori video" #: main/application.cpp:1042 msgid "Close video file" msgstr "Zatvori video fajl" #: main/application.cpp:1051 msgid "Full Screen Mode" msgstr "Preko celog ekrana" #: main/application.cpp:1052 msgid "Toggle full screen mode" msgstr "Uklj/isklj. prikaz preko celog ekrana" #: main/application.cpp:1060 main/utils/kreplace.cpp:425 msgid "Stop" msgstr "Zaustavi" #: main/application.cpp:1061 msgid "Stop video playback" msgstr "Zaustavi puštanje videa" #: main/application.cpp:1069 main/application.cpp:3156 #: main/application.cpp:3163 msgid "Play" msgstr "Pusti" #: main/application.cpp:1070 msgid "Toggle video playing/paused" msgstr "Puštam/Pauzirano" #: main/application.cpp:1078 msgid "Seek Backwards" msgstr "Traži unazad" #: main/application.cpp:1087 msgid "Seek Forwards" msgstr "Traži unapred" #: main/application.cpp:1099 msgid "Jump to Previous Line" msgstr "Skoči na prethodni red" #: main/application.cpp:1100 msgid "Seek to previous subtitle line show time" msgstr "Idi na vreme prikaza prethodnog reda" #: main/application.cpp:1109 msgid "Jump to Next Line" msgstr "Skoči na sledeći red" #: main/application.cpp:1110 msgid "Seek to next subtitle line show time" msgstr "Idi na vreme prikaza sledećeg reda" #: main/application.cpp:1120 msgid "Set Current Line Show Time" msgstr "Postavi vreme prikaza tekućeg reda" #: main/application.cpp:1121 msgid "Set current line show time to video position" msgstr "Postavi vreme prikaza tekućeg reda na poziciju videa" #: main/application.cpp:1131 msgid "Set Current Line Hide Time" msgstr "Postavi vreme nestajanja tekućeg reda" #: main/application.cpp:1132 msgid "Set current line hide time to video position" msgstr "Postavi vreme nestajanja tekućeg reda na poziciju videa" #: main/application.cpp:1141 msgid "Current Line Follows Video" msgstr "Tekući red prati video" #: main/application.cpp:1142 msgid "Make current line follow the playing video position" msgstr "Tekući red prati poziciju puštenog videa" #: main/application.cpp:1149 msgctxt "@action:inmenu Toggle audio muted" msgid "Mute" msgstr "Umukni" #: main/application.cpp:1151 msgid "Enable/disable playback sound" msgstr "Uključuje ili isključuje zvuk" #: main/application.cpp:1159 msgid "Increase Volume" msgstr "Povećaj jačinu" #: main/application.cpp:1160 msgid "Increase volume by 5%" msgstr "Povećaj jačinu za 5%" #: main/application.cpp:1168 msgid "Decrease Volume" msgstr "Smanji jačinu" #: main/application.cpp:1169 msgid "Decrease volume by 5%" msgstr "Smanji jačinu za 5%" #: main/application.cpp:1177 msgid "Audio Streams" msgstr "Audio tokovi" #: main/application.cpp:1178 msgid "Select active audio stream" msgstr "Izaberi aktivni audio tok" #: main/application.cpp:1186 msgid "Increase Font Size" msgstr "Povećaj veličinu fonta" #: main/application.cpp:1187 msgid "Increase subtitles font size by 1 point" msgstr "Povećaj veličinu fonta titla za 1 tačku" #: main/application.cpp:1195 msgid "Decrease Font Size" msgstr "Smanji veličinu fonta" #: main/application.cpp:1196 msgid "Decrease subtitles font size by 1 point" msgstr "Smanji veličinu fonta titla za 1 tačku" #: main/application.cpp:1204 msgid "Subtitle Streams" msgstr "Tokovi titla" #: main/application.cpp:1205 msgid "Select active subtitle stream" msgstr "Izaberi aktivni tok titla" #: main/application.cpp:1212 msgid "Shift to Video Position" msgstr "Pomeraj na poziciju videa" #: main/application.cpp:1213 msgid "" "Set current line show time to video position by equally shifting all lines" msgstr "" "Postavlja vreme prikaza tekućeg reda na poziciju videa jednako pomerajući " "sve linije" #: main/application.cpp:1221 msgid "Adjust to Video Position (Anchor Last Line)" msgstr "Podesi na poziciju videa (usidri poslednji red)" #: main/application.cpp:1222 msgid "" "Set current line to video position by fixing the last line and linearly " "adjusting the other ones" msgstr "" "Postavlja tekući red na poziciju videa fiksirajući poslednji red i linearno " "podešavajući ostale" #: main/application.cpp:1230 msgid "Adjust to Video Position (Anchor First Line)" msgstr "Podesi na poziciju videa (usidri prvi red)" #: main/application.cpp:1231 msgid "" "Set current line to video position by fixing the first line and linearly " "adjusting the other ones" msgstr "" "Postavlja tekući red na poziciju videa fiksirajući prvi red i linearno " "podešavajući ostale" #: main/application.cpp:1240 msgctxt "@action:inmenu Manage user scripts" msgid "Scripts Manager..." msgstr "Menadžer skripti..." #: main/application.cpp:1241 msgid "Manage user scripts" msgstr "Upravljanje korisničkim skriptama" #: main/application.cpp:1365 msgid "" "The requested action would make the subtitle and its translation share the " "same file, possibly resulting in loss of information when saving.\n" "Are you sure you want to continue?" msgstr "" "Tražena radnja će učiniti da titl i njegov prevod dele isti fajl, što može " "dovesti do gubitka podataka pri snimanju.\n" "Želite li da nastavite?" #: main/application.cpp:1366 msgid "Conflicting Subtitle Files" msgstr "Konfliktni fajlovi titla" #: main/application.cpp:1488 msgid "" "Could not parse the subtitle file.
This may have been caused by " "usage of the wrong encoding.
" msgstr "" "Ne mogu da raščlanim fajl titla.
To može biti prouzrokovano " "korišćenjem pogrešnog kodiranja.
" #: main/application.cpp:1519 msgid "There was an error saving the subtitle." msgstr "Došlo je do greške pri snimanju titla." #: main/application.cpp:1561 main/application.cpp:1770 msgid "" "Currently opened translation subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Trenutno otvoreni prevedeni titl ima nesačuvane izmene.\n" "Želite li da ih sačuvate?" #: main/application.cpp:1562 main/application.cpp:1771 msgid "Close Translation Subtitle" msgstr "Zatvori prevedeni titl" #: main/application.cpp:1574 msgid "" "Currently opened subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Trenutno otvoreni titl ima nesačuvane izmene.\n" "Želite li da ih sačuvate?" #: main/application.cpp:1575 msgid "Close Subtitle" msgstr "Zatvori titl" #: main/application.cpp:1678 msgctxt "@item:inmenu Display primary text in video player" msgid "Primary" msgstr "Glavni" #: main/application.cpp:1679 msgctxt "@item:inmenu Display translation text in video player" msgid "Translation" msgstr "Prevod" #: main/application.cpp:1689 msgid "Could not parse the subtitle file." msgstr "Ne mogu da raščlanim fajl titla." #: main/application.cpp:1728 msgid "There was an error saving the translation subtitle." msgstr "Došlo je do greške pri snimanju prevedenog titla." #: main/application.cpp:1864 msgid "Could not read the subtitle file to append." msgstr "Ne mogu da pročitam fajl titla za dodavanje." #: main/application.cpp:1916 msgid "Could not write the splitted subtitle file." msgstr "Ne mogu da upišem podeljeni fajl titla." #: main/application.cpp:1917 msgid "Could not write the splitted subtitle translation file." msgstr "Ne mogu da upišem podeljeni fajl prevedenog titla." #: main/application.cpp:1935 msgid "The specified time does not split the subtitles." msgstr "Navedeno vreme ne deli titlove." #: main/application.cpp:1984 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted part was saved as %1." msgstr "" "Ne mogu da otvorim novi prozor „Uređivača titla“.\n" "Podeljeni deo je sačuvan kao %1." #: main/application.cpp:1989 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted parts were saved as %1 and %2." msgstr "" "Ne mogu da otvorim novi prozor „Uređivača titla“.\n" "Podeljeni delovi su sačuvani kao %1 i %2." #: main/application.cpp:2077 msgid "Go to Line" msgstr "Idi na red" #: main/application.cpp:2077 msgid "&Go to line:" msgstr "&Idi na red:" #: main/application.cpp:2389 msgid "Can not perform sort on selection with multiple ranges." msgstr "Ne mogu da uradim razvrstavanje izbora sa višestrukim opsezima." #: main/application.cpp:2499 msgid "The reference subtitle must have more than one line to proceed." msgstr "Referentni titl mora imati više od jednog reda da bi radio." #: main/application.cpp:2511 msgid "Could not parse the reference subtitle file." msgstr "Ne mogu da raščlanim fajl referentnog titla." #: main/application.cpp:2618 main/dialogs/translatedialog.cpp:31 msgid "Translate" msgstr "Prevedi" #: main/application.cpp:2619 msgid "Translating text (%1 to %2)..." msgstr "Prevodim tekst (%1 u %2)..." #: main/application.cpp:2628 msgid "Translating primary text (%1 to %2)..." msgstr "Prevodim glavni tekst (%1 u %2)..." #: main/application.cpp:2629 msgid "Translating secondary text (%1 to %2)..." msgstr "Prevodim sekundarni tekst (%1 u %2)..." #: main/application.cpp:2661 msgid "" "Unable to perform texts synchronization (sent and received lines count do " "not match)." msgstr "" "Ne mogu da uradim usklađivanje tekstova (broj poslatih i primljenih redova " "nije isti)." #: main/application.cpp:2670 msgid "Translate Primary Text" msgstr "Prevedi glavni tekst" #: main/application.cpp:2671 msgid "Translate Secondary Text" msgstr "Prevedi sekundarni tekst" #: main/application.cpp:2687 msgid "" "There was an error performing the translation:\n" "\n" "%1" msgstr "" "Greška tokom prevođenja:\n" "\n" "%1" #: main/application.cpp:2740 msgid "Open Video" msgstr "Otvori video" #: main/application.cpp:2873 main/application.cpp:2911 msgid "" "Continuing would result in loss of timing information for some lines.\n" "Are you sure you want to continue?" msgstr "" "Nastavljanje će dovesti do gubitka vremena na nekim redovima.\n" "Želite li da nastavite?" #: main/application.cpp:2929 msgid "Open AudioLevels" msgstr "Otvori audio nivoe" #: main/application.cpp:3035 msgid "modified" msgstr "izmenjen" #: main/application.cpp:3039 main/application.cpp:3050 msgid "Untitled" msgstr "Bezimeni" #: main/application.cpp:3041 msgid "Untitled Translation" msgstr "Bezimeni prevod" #: main/application.cpp:3149 msgid "Pause" msgstr "Pauziraj" #: main/application.cpp:3190 msgid "Seek backwards 1 second" msgid_plural "Seek backwards %1 seconds" msgstr[0] "Traži unazad %1 sekundu" msgstr[1] "Traži unazad %1 sekunde" msgstr[2] "Traži unazad %1 sekundi" msgstr[3] "Traži unazad 1 sekundu" #: main/application.cpp:3196 msgid "Seek forwards 1 second" msgid_plural "Seek forwards %1 seconds" msgstr[0] "Traži unapred %1 sekundu" msgstr[1] "Traži unapred %1 sekunde" msgstr[2] "Traži unapred %1 sekundi" msgstr[3] "Traži unapred 1 sekundu" #: main/application.cpp:3211 main/application.cpp:3223 msgid "Shift %21 Millisecond" msgid_plural "Shift %2%1 Milliseconds" msgstr[0] "Pomeri %21 milisekundu" msgstr[1] "Pomeri %2%1 milisekunde" msgstr[2] "Pomeri %2%1 milisekundi" msgstr[3] "Pomeri %2%1 milisekundu" #: main/application.cpp:3216 main/application.cpp:3228 msgid "Shift selected lines %21 millisecond" msgid_plural "Shift selected lines %2%1 milliseconds" msgstr[0] "Pomeraj izabranih redova %21 milisekundu" msgstr[1] "Pomeraj izabranih redova %2%1 milisekunde" msgstr[2] "Pomeraj izabranih redova %2%1 milisekundi" msgstr[3] "Pomeraj izabranih redova %2%1 milisekundu" #: main/configdialog.cpp:46 msgid "Configure" msgstr "Podešavanja" #: main/configdialog.cpp:54 msgctxt "@title General settings" msgid "General" msgstr "Opšta" #: main/configdialog.cpp:55 msgid "General Settings" msgstr "Opšte postavke" #: main/configdialog.cpp:59 msgctxt "@title Error checks settings" msgid "Error Checks" msgstr "Provere grešaka" #: main/configdialog.cpp:60 msgid "Error Checks Settings" msgstr "Postavke provere grešaka" #: main/configdialog.cpp:64 msgctxt "@title Spelling settings" msgid "Spelling" msgstr "Pravopis" #: main/configdialog.cpp:65 msgid "Spelling Settings" msgstr "Postavke pravopisa" #: main/configdialog.cpp:69 msgctxt "@title Player settings" msgid "Player" msgstr "Plejer" #: main/configdialog.cpp:70 msgid "Player Settings" msgstr "Postavke plejera" #: main/configdialog.cpp:82 msgctxt "@title Player backend settings" msgid "%1 Backend Settings" msgstr "%1 postavke" #: main/configs/errorsconfigwidget.cpp:37 msgctxt "@title:group" msgid "Texts" msgstr "Tekstovi" #: main/configs/errorsconfigwidget.cpp:40 msgid "Maximum number of characters:" msgstr "Maksimalan broj znakova:" #: main/configs/errorsconfigwidget.cpp:45 #: main/dialogs/smarttextsadjustdialog.cpp:40 msgid " characters" msgstr " znakova" #: main/configs/errorsconfigwidget.cpp:48 msgid "Maximum number of lines:" msgstr "Maksimalan broj redova:" #: main/configs/errorsconfigwidget.cpp:53 msgid " lines" msgstr " redova" #: main/configs/errorsconfigwidget.cpp:56 msgctxt "@title:group" msgid "Absolute Durations" msgstr "Apsolutna trajanja" #: main/configs/errorsconfigwidget.cpp:59 #: main/configs/errorsconfigwidget.cpp:78 msgid "Minimum duration:" msgstr "Minimalno trajanje:" #: main/configs/errorsconfigwidget.cpp:64 #: main/configs/errorsconfigwidget.cpp:72 #: main/configs/generalconfigwidget.cpp:52 #: main/configs/generalconfigwidget.cpp:66 #: main/configs/generalconfigwidget.cpp:74 #: main/dialogs/fixoverlappingtimesdialog.cpp:37 msgid " msecs" msgstr " ms" #: main/configs/errorsconfigwidget.cpp:67 #: main/configs/errorsconfigwidget.cpp:86 msgid "Maximum duration:" msgstr "Maksimalno trajanje:" #: main/configs/errorsconfigwidget.cpp:75 msgctxt "@title:group" msgid "Relative Durations" msgstr "Relativna trajanja" #: main/configs/errorsconfigwidget.cpp:83 #: main/configs/errorsconfigwidget.cpp:91 msgid " msecs/character" msgstr " ms/znaku" #: main/configs/errorsconfigwidget.cpp:93 msgctxt "@title:group" msgid "Behavior" msgstr "Ponašanje" #: main/configs/errorsconfigwidget.cpp:96 msgid "Automatically clear fixed errors" msgstr "Automatski očisti sređene greške" #: main/configs/generalconfigwidget.cpp:38 #: main/configs/playerconfigwidget.cpp:44 #: player/mplayer/mplayerconfigwidget.cpp:37 msgctxt "@title:group General settings" msgid "General" msgstr "Opšte" #: main/configs/generalconfigwidget.cpp:41 msgid "Default encoding for opening subtitles:" msgstr "Podrazumevano kodiranje kod otvaranja titla:" #: main/configs/generalconfigwidget.cpp:47 msgid "On line double click, jump to show time minus:" msgstr "Pri dvokliku na red, skoči na vreme prikaza minus:" #: main/configs/generalconfigwidget.cpp:55 msgid "Automatically load video file when opening subtitle" msgstr "Automatski učitaj video fajl pri otvaranju titla" #: main/configs/generalconfigwidget.cpp:58 msgctxt "@title:group" msgid "Quick Actions" msgstr "Brze radnje" #: main/configs/generalconfigwidget.cpp:61 msgid "Time shift for selected lines:" msgstr "Pomeraj vremena za izabrane redove:" #: main/configs/generalconfigwidget.cpp:69 msgid "Compensation for captured video times:" msgstr "Kompenzacija za uhvaćena vremena videa:" #: main/configs/playerconfigwidget.cpp:47 msgid "Player backend:" msgstr "Program plejera:" #: main/configs/playerconfigwidget.cpp:53 msgid "Jump length on seek:" msgstr "Skok pri premotavanju:" #: main/configs/playerconfigwidget.cpp:58 msgid " secs" msgstr " sekundi" #: main/configs/playerconfigwidget.cpp:61 main/playerwidget.cpp:452 msgid "Show editable position control" msgstr "Prikaži izmenjivu kontrolu pozicije" #: main/configs/playerconfigwidget.cpp:64 msgctxt "@title:group" msgid "Subtitles" msgstr "Titlovi" #: main/configs/playerconfigwidget.cpp:67 msgctxt "@label:chooser The font family name" msgid "Font family:" msgstr "Font:" #: main/configs/playerconfigwidget.cpp:72 msgid "Font size:" msgstr "Veličina:" #: main/configs/playerconfigwidget.cpp:77 msgid " points" msgstr " tačaka" #: main/configs/playerconfigwidget.cpp:80 msgid "Primary color:" msgstr "Glavna boja:" #: main/configs/playerconfigwidget.cpp:85 msgid "Outline color:" msgstr "Boja oivičenja:" #: main/configs/playerconfigwidget.cpp:91 msgid "Outline width:" msgstr "Širina oivičenja:" #: main/configs/playerconfigwidget.cpp:96 msgid " pixels" msgstr " tačaka" #: main/configs/playerconfigwidget.cpp:99 msgctxt "@title:group" msgid "Subtitles Preview" msgstr "Pregled titlova" #: main/configs/playerconfigwidget.cpp:109 msgctxt "Text for previewing the subtitles font settings" msgid "

The Quick Brown Fox
Jumps Over The Lazy Dog

" msgstr "

Ljubazni fenjerdžija čađavog
lica hoće da mi pokaže štos

" #: main/currentlinewidget.cpp:65 msgid "Show" msgstr "Pojavljivanje" #: main/currentlinewidget.cpp:70 msgid "Hide" msgstr "Nestajanje" #: main/currentlinewidget.cpp:75 msgid "Duration" msgstr "Trajanje" #: main/currentlinewidget.cpp:253 main/currentlinewidget.cpp:259 msgid "No current line" msgstr "Nema tekućeg reda" #: main/currentlinewidget.cpp:383 msgid "Current line:" msgstr "Tekući red:" #: main/currentlinewidget.cpp:408 msgid "1 character" msgid_plural "%1 characters" msgstr[0] "%1 znak" msgstr[1] "%1 znaka" msgstr[2] "%1 znakova" msgstr[3] "1 znak" #: main/dialogs/actionwitherrortargetsdialog.cpp:74 msgid "Available errors" msgstr "Dostupne greške" #: main/dialogs/actionwitherrortargetsdialog.cpp:105 msgid "Select None" msgstr "Ništa izabrano" #: main/dialogs/actionwithtargetdialog.cpp:131 msgid "Target >>" msgstr "Odredište >>" #: main/dialogs/actionwithtargetdialog.cpp:131 #: main/dialogs/actionwithtargetdialog.cpp:149 msgid "Target <<" msgstr "Odredište <<" #: main/dialogs/actionwithtargetdialog.cpp:164 msgid "All lines" msgstr "Svi redovi" #: main/dialogs/actionwithtargetdialog.cpp:165 main/utils/errorfinder.cpp:48 msgid "Selected lines" msgstr "Izabrani redovi" #: main/dialogs/actionwithtargetdialog.cpp:166 msgid "All lines from first selected" msgstr "Svi redovi od prvog označenog" #: main/dialogs/actionwithtargetdialog.cpp:167 msgid "All lines up to last selected" msgstr "Svi redovi do poslednjeg označenog" #: main/dialogs/actionwithtargetdialog.cpp:257 main/utils/finder.cpp:63 #: main/utils/replacer.cpp:61 msgid "Both subtitles" msgstr "Oba titla" #: main/dialogs/actionwithtargetdialog.cpp:260 main/utils/finder.cpp:65 #: main/utils/replacer.cpp:63 msgid "Primary subtitle" msgstr "Glavni titl" #: main/dialogs/actionwithtargetdialog.cpp:263 main/utils/finder.cpp:67 #: main/utils/replacer.cpp:65 msgid "Translation subtitle" msgstr "Prevedeni titl" #: main/dialogs/actionwithtargetdialog.h:78 msgid "Apply To" msgstr "Primeni na" #: main/dialogs/adjusttimesdialog.cpp:32 msgid "Adjust" msgstr "Podesi" #: main/dialogs/adjusttimesdialog.cpp:34 msgctxt "@title:group" msgid "New Times" msgstr "Nova vremena" #: main/dialogs/adjusttimesdialog.cpp:39 msgid "First spoken line:" msgstr "Prvi izgovoreni red:" #: main/dialogs/adjusttimesdialog.cpp:45 msgid "Last spoken line:" msgstr "Poslednji izgovoreni red:" #: main/dialogs/autodurationsdialog.cpp:38 #: main/dialogs/changeframeratedialog.cpp:36 #: main/dialogs/fixoverlappingtimesdialog.cpp:34 #: main/dialogs/fixpunctuationdialog.cpp:33 #: main/dialogs/smarttextsadjustdialog.cpp:34 #: main/dialogs/splitsubtitledialog.cpp:38 main/dialogs/translatedialog.cpp:33 msgctxt "@title:group" msgid "Settings" msgstr "Postavke" #: main/dialogs/autodurationsdialog.cpp:46 msgid "Milliseconds per line:" msgstr "Milisekundi po redu:" #: main/dialogs/autodurationsdialog.cpp:55 msgid "Milliseconds per word:" msgstr "Milisekundi po reči:" #: main/dialogs/autodurationsdialog.cpp:64 msgid "Milliseconds per character:" msgstr "Milisekundi po znaku:" #: main/dialogs/autodurationsdialog.cpp:68 #: main/dialogs/durationlimitsdialog.cpp:45 msgid "Prevent overlapping" msgstr "Spreči preklapanje" #: main/dialogs/autodurationsdialog.cpp:71 msgctxt "@title:group" msgid "Duration Calculation" msgstr "Proračun trajanja" #: main/dialogs/autodurationsdialog.cpp:77 msgid "Use primary text" msgstr "Koristi glavni tekst" #: main/dialogs/autodurationsdialog.cpp:78 msgid "Use translation text" msgstr "Koristi prevedeni tekst" #: main/dialogs/autodurationsdialog.cpp:79 msgid "Calculate both and use maximum" msgstr "Izračunaj oba i koristi maksimum" #: main/dialogs/changeframeratedialog.cpp:45 msgid "Current frame rate:" msgstr "Trenutna brzina kadrova:" #: main/dialogs/changeframeratedialog.cpp:54 msgid "New frame rate:" msgstr "Nova brzina kadrova:" #: main/dialogs/changetextscasedialog.cpp:33 msgid "Change Case" msgstr "Promeni veličinu slova" #: main/dialogs/changetextscasedialog.cpp:35 msgctxt "@title:group" msgid "Change To" msgstr "Promeni u" #: main/dialogs/changetextscasedialog.cpp:39 msgid "Lower case" msgstr "Mala slova" #: main/dialogs/changetextscasedialog.cpp:44 msgid "Upper case" msgstr "Velika slova" #: main/dialogs/changetextscasedialog.cpp:48 msgid "Title case" msgstr "Veličina naslova" #: main/dialogs/changetextscasedialog.cpp:52 msgid "Sentence case" msgstr "Veličina rečenice" #: main/dialogs/changetextscasedialog.cpp:56 msgid "Convert to lower case first" msgstr "Prvo prebaci u mala slova" #: main/dialogs/checkerrorsdialog.cpp:31 msgid "Check Errors" msgstr "Proveri greške" #: main/dialogs/checkerrorsdialog.cpp:33 msgctxt "@title:group" msgid "Errors to Check" msgstr "Greške za proveru" #: main/dialogs/checkerrorsdialog.cpp:36 msgctxt "@title:group Miscellaneous settings" msgid "Miscellaneous" msgstr "Razno" #: main/dialogs/checkerrorsdialog.cpp:39 msgid "Clear other errors" msgstr "Očisti ostale greške" #: main/dialogs/checkerrorsdialog.cpp:43 msgid "Clear user marks" msgstr "Očisti korisničke markere" #: main/dialogs/clearerrorsdialog.cpp:32 msgid "Clear Errors" msgstr "Očisti greške" #: main/dialogs/clearerrorsdialog.cpp:34 msgctxt "@title:group" msgid "Errors to Clear" msgstr "Greške za čišćenje" #: main/dialogs/durationlimitsdialog.cpp:35 msgctxt "@title:group" msgid "Minimum Duration" msgstr "Minimalno trajanje" #: main/dialogs/durationlimitsdialog.cpp:41 msgid "Expand duration to:" msgstr "Produži trajanje na:" #: main/dialogs/durationlimitsdialog.cpp:48 msgctxt "@title:group" msgid "Maximum Duration" msgstr "Maksimalno trajanje" #: main/dialogs/durationlimitsdialog.cpp:54 msgid "Shrink duration to:" msgstr "Skrati trajanje na:" #: main/dialogs/fixoverlappingtimesdialog.cpp:43 msgid "Minimum interval between lines:" msgstr "Najmanji razmak između redova:" #: main/dialogs/fixpunctuationdialog.cpp:31 msgid "Fix Punctuation" msgstr "Sredi interpunkciju" #: main/dialogs/fixpunctuationdialog.cpp:36 msgid "Fix and cleanup spaces" msgstr "Sredi i očisti razmake" #: main/dialogs/fixpunctuationdialog.cpp:40 msgid "Fix quotes and double quotes" msgstr "Sredi navode i dvostruke navode" #: main/dialogs/fixpunctuationdialog.cpp:44 msgid "Fix English 'I' pronoun" msgstr "Sredi englesko „I“" #: main/dialogs/fixpunctuationdialog.cpp:48 msgid "Add ellipisis indicating non finished lines" msgstr "Dodaj tri tačke za obeležavanje nedovršenih redova" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line Before Current" msgstr "Umetni red pre tekućeg" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line After Current" msgstr "Umetni red posle tekućeg" #: main/dialogs/insertlinedialog.cpp:29 msgid "Insert Into" msgstr "Ubaci u" #: main/dialogs/joinsubtitlesdialog.cpp:40 msgid "Shift subtitle forwards before append" msgstr "Pomeraj titla unapred pre dodavanja" #: main/dialogs/joinsubtitlesdialog.cpp:47 #: main/dialogs/splitsubtitledialog.cpp:44 msgid "Set from video length" msgstr "Postavi iz dužine videa" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Subtitle" msgstr "Otvori titl" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Translation Subtitle" msgstr "Otvori prevedeni titl" #: main/dialogs/opensubtitledialog.cpp:46 #: main/dialogs/savesubtitledialog.cpp:80 #: main/dialogs/selectablesubtitledialog.cpp:67 msgid "Encoding:" msgstr "Kodiranje:" #: main/dialogs/opensubtitledialog.cpp:73 msgid "All Supported" msgstr "Sve podržano" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove Selected Lines" msgstr "Ukloni izabrane redove" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove From" msgstr "Ukloni iz" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Subtitle" msgstr "Sačuvaj titl" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Translation Subtitle" msgstr "Sačuvaj prevedeni titl" #: main/dialogs/savesubtitledialog.cpp:69 msgid "EOL:" msgstr "KrLin:" #: main/dialogs/savesubtitledialog.cpp:145 msgid "" "A file named \"%1\" already exists. Are you sure you want to overwrite it?" msgstr "Fajl po imenu „%1“ već postoji. Želite li zaista da ga prebrišete?" #: main/dialogs/savesubtitledialog.cpp:148 msgid "Overwrite File?" msgstr "Prebrisati fajl?" #: main/dialogs/savesubtitledialog.cpp:149 msgid "Overwrite" msgstr "Prebriši" #: main/dialogs/selectablesubtitledialog.cpp:51 msgid "Path:" msgstr "Putanja:" #: main/dialogs/selectablesubtitledialog.cpp:56 msgid "Select subtitle" msgstr "Izaberi titl" #: main/dialogs/selectablesubtitledialog.h:54 msgid "Subtitle" msgstr "Titl" #: main/dialogs/shifttimesdialog.cpp:32 msgid "Shift" msgstr "Pomeraj" #: main/dialogs/shifttimesdialog.cpp:34 msgctxt "@title:group" msgid "Shifting" msgstr "Pomeraj" #: main/dialogs/shifttimesdialog.cpp:38 msgid "Forwards (+)" msgstr "Unapred (+)" #: main/dialogs/shifttimesdialog.cpp:39 msgid "Backwards (–)" msgstr "Unazad (-)" #: main/dialogs/smarttextsadjustdialog.cpp:43 msgid "Minimum length for line break:" msgstr "Minimalna dužina za prelom reda:" #: main/dialogs/splitsubtitledialog.cpp:36 msgid "Split Subtitle" msgstr "Razdvoji titl" #: main/dialogs/splitsubtitledialog.cpp:49 msgid "Split time:" msgstr "Vreme razdvajanja:" #: main/dialogs/splitsubtitledialog.cpp:53 msgid "Shift new part backwards after split" msgstr "Pomeri novi deo unazad nakon razdvajanja" #: main/dialogs/syncsubtitlesdialog.cpp:32 msgid "Synchronize with Subtitle" msgstr "Sinhronizuj sa titlom" #: main/dialogs/syncsubtitlesdialog.cpp:34 msgid "Reference Subtitle" msgstr "Referentni titl" #: main/dialogs/syncsubtitlesdialog.cpp:36 msgctxt "@title:group" msgid "Synchronization Mode" msgstr "Režim sinhronizacije" #: main/dialogs/syncsubtitlesdialog.cpp:39 msgid "Adjust to reference's first and last lines" msgstr "Podesi prema prvom i poslednjem redu referentnog titla" #: main/dialogs/syncsubtitlesdialog.cpp:43 msgid "Copy timing information from reference line by line" msgstr "Kopiraj podatke o vremenima iz referentnog titla red po red" #: main/dialogs/translatedialog.cpp:49 msgid "Input language:" msgstr "Ulazni jezik:" #: main/dialogs/translatedialog.cpp:66 msgid "Output language:" msgstr "Izlazni jezik:" #: main/errorsdialog.cpp:42 msgid "Subtitle Errors" msgstr "Greške titla" #: main/errorsdialog.cpp:55 msgid "Clear Fixed Errors" msgstr "Očisti sređene greške" #: main/errorsdialog.cpp:65 msgid "Settings..." msgstr "Postavke..." #: main/errorsdialog.cpp:121 msgid "Showing 1 line with errors" msgid_plural "Showing %1 lines with errors" msgstr[0] "Prikazujem %1 red sa greškama" msgstr[1] "Prikazujem %1 reda sa greškama" msgstr[2] "Prikazujem %1 redova sa greškama" msgstr[3] "Prikazujem red sa greškama" #: main/errorsdialog.cpp:124 msgid "1 total error" msgid_plural "%1 total errors" msgstr[0] "%1 greška" msgstr[1] "%1 greške" msgstr[2] "%1 grešaka" msgstr[3] "1 greška" #: main/errorsdialog.cpp:125 msgid "1 user mark" msgid_plural "%1 user marks" msgstr[0] "%1 korisnički marker" msgstr[1] "%1 korisnička markera" msgstr[2] "%1 korisničkih markera" msgstr[3] "1 korisnički marker" #: main/errorswidget.cpp:491 msgid "Line Errors" msgstr "Greške reda" #: main/errorswidget.cpp:492 msgid "Count" msgstr "Broj" #: main/errorswidget.cpp:493 msgid "Marked" msgstr "Markirano" #: main/errorswidget.cpp:509 msgid "yes" msgstr "da" #: main/errorswidget.cpp:510 msgid "no" msgstr "ne" #: main/errorswidget.cpp:517 msgid "Line %1" msgstr "Red %1" #: main/errorswidget.cpp:717 msgid "Expand All" msgstr "Raširi sve" #: main/errorswidget.cpp:718 msgid "Collapse All" msgstr "Sažmi sve" #: main/errorswidget.cpp:722 msgid "Clear Selected Marks" msgstr "Očisti izabrane markere" #: main/errorswidget.cpp:723 msgid "Clear Selected Errors" msgstr "Očisti izabrane greške" #: main/errorswidget.cpp:729 msgid "Clear Fixed Selection" msgstr "Očisti sređeni izbor" #: main/lineswidget.cpp:204 msgid "Observations:" msgstr "Zapažanja:" #: main/lineswidget.cpp:232 msgctxt "@title:column Subtitle line number" msgid "Line" msgstr "Red" #: main/lineswidget.cpp:233 msgctxt "@title:column" msgid "Show Time" msgstr "Vreme pojavljivanja" #: main/lineswidget.cpp:234 msgctxt "@title:column" msgid "Hide Time" msgstr "Vreme nestajanja" #: main/lineswidget.cpp:235 msgctxt "@title:column Subtitle line (primary) text" msgid "Text" msgstr "Tekst" #: main/lineswidget.cpp:236 msgctxt "@title:column Subtitle line translation text" msgid "Translation" msgstr "Prevod" #: main/lineswidget.cpp:1141 msgid "Texts" msgstr "Tekstovi" #: main/lineswidget.cpp:1162 msgid "Styles" msgstr "Stilovi" #: main/lineswidget.cpp:1166 widgets/simplerichtextedit.cpp:119 msgctxt "@action:inmenu Toggle bold style" msgid "Bold" msgstr "Podebljano" #: main/lineswidget.cpp:1173 widgets/simplerichtextedit.cpp:125 msgctxt "@action:inmenu Toggle italic style" msgid "Italic" msgstr "Kurziv" #: main/lineswidget.cpp:1180 widgets/simplerichtextedit.cpp:131 msgctxt "@action:inmenu Toggle underline style" msgid "Underline" msgstr "Podvučeno" #: main/lineswidget.cpp:1187 widgets/simplerichtextedit.cpp:137 msgctxt "@action:inmenu Toggle strike through style" msgid "Strike Through" msgstr "Precrtano" #: main/lineswidget.cpp:1194 msgid "Times" msgstr "Vremena" #: main/lineswidget.cpp:1196 msgid "Shift +%1 Milliseconds" msgstr "Pomeri +%1 milisekundi" #: main/lineswidget.cpp:1197 msgid "Shift -%1 Milliseconds" msgstr "Pomeri -%1 milisekundi" #: main/lineswidget.cpp:1207 msgid "Errors" msgstr "Greške" #: main/lineswidget.cpp:1208 msgid "Mark" msgstr "Markiraj" #: main/main.cpp:43 msgid "Subtitle Composer" msgstr "Sastavljač titla (Subtitle Composer)" #: main/main.cpp:45 msgid "A KDE subtitle editor." msgstr "Uređivač titlova za KDE." #: main/main.cpp:47 msgid "(C) 2007-2009 Sergio Pistone" msgstr "© 2007-2009 Serđo Pistone (Sergio Pistone)" #: main/main.cpp:51 msgid "Sergio Pistone" msgstr "Serđo Pistone (Sergio Pistone)" #: main/main.cpp:52 msgid "Author & maintainer" msgstr "Autor i održavalac" #: main/main.cpp:61 msgid "Open location as primary subtitle" msgstr "Otvori lokaciju kao glavni titl" #: main/main.cpp:62 msgid "Open location as translation subtitle" msgstr "Otvori lokaciju kao prevedeni titl" #: main/playerwidget.cpp:103 msgid "Position" msgstr "Pozicija" #: main/playerwidget.cpp:111 msgid "Length" msgstr "Dužina" #: main/playerwidget.cpp:116 msgid "FPS" msgstr "Kadrova u sek." #: main/playerwidget.cpp:704 main/playerwidget.cpp:705 #: main/playerwidget.cpp:706 main/playerwidget.cpp:778 #: main/playerwidget.cpp:795 main/playerwidget.cpp:802 msgid "Unknown" msgstr "Nepoznat" #: main/playerwidget.cpp:715 msgid "There was an error opening file
%1
" msgstr "Došlo je do greške pri otvaranju fajla
%1
" #: main/playerwidget.cpp:741 msgid "Unexpected error while playing file." msgstr "Neočekivana greška pri puštanju fajla." #: main/scripting/scriptsmanager.cpp:70 msgid "Installed Scripts" msgstr "Instalirane skripte" #: main/scripting/scriptsmanager.cpp:88 msgid "Information" msgstr "" #: main/scripting/scriptsmanager.cpp:94 msgid "Warning" msgstr "" #: main/scripting/scriptsmanager.cpp:100 #, fuzzy msgid "Error" msgstr "Greške" #: main/scripting/scriptsmanager.cpp:113 msgid "Scripts Manager" msgstr "Menadžer skripti" #: main/scripting/scriptsmanager.cpp:129 msgid "Create..." msgstr "Napravi..." #: main/scripting/scriptsmanager.cpp:130 msgid "Creates a new script file." msgstr "Pravi novi fajl skripte." #: main/scripting/scriptsmanager.cpp:135 msgid "Add..." msgstr "Dodaj..." #: main/scripting/scriptsmanager.cpp:136 msgid "Copies an existing script from a specified location." msgstr "Kopira postojeću skriptu sa navedene lokacije." #: main/scripting/scriptsmanager.cpp:142 msgid "Sends the selected script to the trash." msgstr "Šalje izabranu skriptu u smeće." #: main/scripting/scriptsmanager.cpp:147 msgid "Edit" msgstr "Uredi" #: main/scripting/scriptsmanager.cpp:148 msgid "Opens the selected script with an external editor." msgstr "Otvara izabranu skriptu u spoljašnjem uređivaču." #: main/scripting/scriptsmanager.cpp:154 msgid "Run" msgstr "Pokreni" #: main/scripting/scriptsmanager.cpp:155 msgid "Executes the selected script." msgstr "Izvršava izabranu skriptu." #: main/scripting/scriptsmanager.cpp:160 msgid "Refresh" msgstr "Osveži" #: main/scripting/scriptsmanager.cpp:161 msgid "Reloads the installed scripts list." msgstr "Osvežava spisak instaliranih skripti." #: main/scripting/scriptsmanager.cpp:219 main/scripting/scriptsmanager.cpp:301 msgid "" "You must enter an unused name to continue.\n" "Would you like to enter another name?" msgstr "" "Morate uneti ime koje nije već u upotrebi.\n" "Želite li da unesete drugo ime?" #: main/scripting/scriptsmanager.cpp:220 main/scripting/scriptsmanager.cpp:302 msgid "Name Already Used" msgstr "Ime se već koristi" #: main/scripting/scriptsmanager.cpp:226 msgid "Create New Script" msgstr "Napravi novu skriptu" #: main/scripting/scriptsmanager.cpp:226 main/scripting/scriptsmanager.cpp:308 msgid "Script name:" msgstr "Ime skripte:" #: main/scripting/scriptsmanager.cpp:239 msgid "There was an error creating the file %1." msgstr "Greška pri stvaranju fajla %1." #: main/scripting/scriptsmanager.cpp:283 msgid "Select Existing Script" msgstr "Izaberi postojeću skriptu" #: main/scripting/scriptsmanager.cpp:308 msgid "Rename Script" msgstr "Preimenuj skriptu" #: main/scripting/scriptsmanager.cpp:322 msgid "There was an error opening the file %1." msgstr "Greška pri otvaranju fajla %1." #: main/scripting/scriptsmanager.cpp:331 msgid "There was an error copying the file to %1." msgstr "Greška pri kopiranju fajla u %1." #: main/scripting/scriptsmanager.cpp:350 msgid "Do you really want to send file %1 to the trash?" msgstr "Zaista želite da fajl %1 pošaljete u smeće?" #: main/scripting/scriptsmanager.cpp:351 msgid "Move to Trash" msgstr "Premesti u smeće" #: main/scripting/scriptsmanager.cpp:359 msgid "There was an error removing the file %1." msgstr "Greška pri uklanjanju fajla %1." #: main/scripting/scriptsmanager.cpp:377 msgid "Could not launch external editor.\n" msgstr "Ne mogu da pokrenem spoljašnji uređivač.\n" #: main/scripting/scriptsmanager.cpp:441 main/scripting/scriptsmanager.cpp:448 msgid "Error Running Script" msgstr "Greška pri pokretanju skripte" #: main/scripting/scriptsmanager.cpp:462 msgid "Tools" msgstr "Alatke" #: main/utils/errorfinder.cpp:40 main/utils/errorfinder.cpp:221 #: main/utils/errorfinder.cpp:244 msgid "Find Error" msgstr "Nađi grešku" #: main/utils/errorfinder.cpp:42 msgid "Errors to Find" msgstr "Greške za nalaženje" #: main/utils/errorfinder.cpp:45 msgid "Options" msgstr "Opcije" #: main/utils/errorfinder.cpp:51 msgid "From current line" msgstr "Od tekućeg reda" #: main/utils/errorfinder.cpp:55 msgid "Find backwards" msgstr "Traži unazad" #: main/utils/errorfinder.cpp:216 main/utils/finder.cpp:298 #: main/utils/replacer.cpp:258 msgid "" "Beginning of selection reached.\n" "Continue from the end?" msgstr "" "Došao sam do početka izbora.\n" "Da nastavim od kraja?" #: main/utils/errorfinder.cpp:217 main/utils/finder.cpp:299 #: main/utils/replacer.cpp:259 msgid "" "Beginning of subtitle reached.\n" "Continue from the end?" msgstr "" "Došao sam do početka titla.\n" "Da nastavim od kraja?" #: main/utils/errorfinder.cpp:219 main/utils/finder.cpp:301 #: main/utils/replacer.cpp:261 msgid "" "End of selection reached.\n" "Continue from the beginning?" msgstr "" "Došao sam do kraja izbora.\n" "Da nastavim od početka?" #: main/utils/errorfinder.cpp:220 main/utils/finder.cpp:302 #: main/utils/replacer.cpp:262 main/utils/speller.cpp:143 msgid "" "End of subtitle reached.\n" "Continue from the beginning?" msgstr "" "Došao sam do kraja titla.\n" "Da nastavim od početka?" #: main/utils/errorfinder.cpp:243 msgid "No errors matching given criteria found!" msgstr "Za zadate uslove nema odgovarajućih grešaka!" #: main/utils/finder.cpp:55 msgid "Find In" msgstr "Nađi u" #: main/utils/finder.cpp:278 main/utils/replacer.cpp:234 msgid "No instances of '%1' found!" msgstr "„%1“ se nigde ne pojavljuje!" #: main/utils/finder.cpp:279 main/utils/finder.cpp:303 msgid "Find" msgstr "Nađi" #: main/utils/kreplace.cpp:49 main/utils/kreplace.cpp:53 #: main/utils/replacer.cpp:172 main/utils/replacer.cpp:229 #: main/utils/replacer.cpp:235 main/utils/replacer.cpp:263 msgid "Replace" msgstr "Zameni" #: main/utils/kreplace.cpp:51 msgid "&All" msgstr "&Sve" #: main/utils/kreplace.cpp:52 msgid "&Skip" msgstr "&Preskoči" #: main/utils/kreplace.cpp:63 msgid "Replace '%1' with '%2'?" msgstr "Zameniti „%1“ sa „%2“?" #: main/utils/kreplace.cpp:139 main/utils/kreplace.cpp:406 msgid "No text was replaced." msgstr "Ništa nije zamenjeno." #: main/utils/kreplace.cpp:141 main/utils/kreplace.cpp:408 #: main/utils/replacer.cpp:228 main/utils/replacer.cpp:255 msgid "1 replacement done." msgid_plural "%1 replacements done." msgstr[0] "Učinjena je %1 zamena." msgstr[1] "Učinjene su %1 zamene." msgstr[2] "Učinjeno je %1 zamena." msgstr[3] "Učinjena je jedna zamena." #: main/utils/kreplace.cpp:413 msgid "Beginning of document reached." msgstr "Došao sam do početka dokumenta." #: main/utils/kreplace.cpp:415 msgid "End of document reached." msgstr "Došao sam do kraja dokumenta." #: main/utils/kreplace.cpp:422 msgid "Do you want to restart search from the end?" msgstr "Želite li da ponovite traženje sa kraja?" #: main/utils/kreplace.cpp:423 msgid "Do you want to restart search at the beginning?" msgstr "Želite li da ponovite traženje od početka?" #: main/utils/kreplace.cpp:425 msgid "Restart" msgstr "Ponovo pokreni" #: main/utils/language.cpp:125 msgid "Automatic" msgstr "Automatski" #: main/utils/language.cpp:129 msgctxt "Official language of the Philippines, aka Filipino" msgid "Tagalog" msgstr "Tagalog" #: main/utils/replacer.cpp:53 msgid "Find/Replace In" msgstr "Nađi/Zameni u" #: main/utils/speller.cpp:144 msgid "Spell Checking" msgstr "Provera pravopisa" #: main/utils/translator.cpp:167 msgid "Operation cancelled by user" msgstr "" #: main/utils/translator.cpp:270 main/utils/translator.cpp:280 msgid "Unexpected contents received from translation service" msgstr "Neočekivan sadržaj je primljen od servisa za prevođenje" #: player/gstreamer/gstreamerbackend.cpp:543 #: player/mplayer/mplayerbackend.cpp:259 player/xine/xinebackend.cpp:278 msgid "Audio Stream #%1" msgstr "Audio tok #%1" #: player/gstreamer/gstreamerconfigwidget.cpp:34 msgctxt "@title:group GStreamer sinks settings" msgid "Sinks" msgstr "Slivnici" #: player/gstreamer/gstreamerconfigwidget.cpp:37 msgid "Audio sink:" msgstr "Audio slivnik:" #: player/gstreamer/gstreamerconfigwidget.cpp:46 msgid "Video sink:" msgstr "Video slivnik:" #: player/mplayer/mplayerconfigwidget.cpp:40 msgid "Executable path:" msgstr "Izvršna putanja:" #: player/mplayer/mplayerconfigwidget.cpp:43 msgid "Select the MPlayer executable" msgstr "Izaberite MPlayer program" #: player/mplayer/mplayerconfigwidget.cpp:47 msgctxt "@title:group Video settings" msgid "Video" msgstr "Video" #: player/mplayer/mplayerconfigwidget.cpp:50 msgid "Video output driver:" msgstr "Drajver video izlaza:" #: player/mplayer/mplayerconfigwidget.cpp:58 msgid "Allow frame dropping" msgstr "Dozvoli ispuštanje kadrova" #: player/mplayer/mplayerconfigwidget.cpp:61 msgid "Allow hard frame dropping" msgstr "Dozvoli jako ispuštanje kadrova" #: player/mplayer/mplayerconfigwidget.cpp:64 msgctxt "@title:group Audio settings" msgid "Audio" msgstr "Audio" #: player/mplayer/mplayerconfigwidget.cpp:67 msgid "Audio output driver:" msgstr "Drajver audio izlaza:" #: player/mplayer/mplayerconfigwidget.cpp:75 msgid "A/V synchronization factor:" msgstr "Faktor A/V sinhronizacije:" #: player/mplayer/mplayerconfigwidget.cpp:83 msgid "Volume normalization" msgstr "Normalizacija jačine" #: player/xine/xineconfigwidget.cpp:34 msgctxt "@title:group Xine drivers settings" msgid "Drivers" msgstr "Drajveri" #: player/xine/xineconfigwidget.cpp:37 msgid "Audio driver:" msgstr "Audio drajver:" #: player/xine/xineconfigwidget.cpp:45 msgid "Video driver:" msgstr "Video drajver:" #: widgets/simplerichtextedit.cpp:84 msgid "Cut" msgstr "Iseci" #: widgets/simplerichtextedit.cpp:90 msgid "Copy" msgstr "Kopiraj" #: widgets/simplerichtextedit.cpp:96 msgid "Paste" msgstr "Nalepi" #: widgets/simplerichtextedit.cpp:102 msgid "Delete" msgstr "Obriši" #: widgets/simplerichtextedit.cpp:108 msgctxt "@action:inmenu Clear all text" msgid "Clear" msgstr "Očisti" #: widgets/simplerichtextedit.cpp:143 msgid "Check Spelling..." msgstr "Proveri pravopis..." #: widgets/simplerichtextedit.cpp:147 msgid "Auto Spell Check" msgstr "Automatska provera pravopisa" #: widgets/simplerichtextedit.cpp:152 msgid "Allow Tabulations" msgstr "Dozvoli tabulacije" #: widgets/simplerichtextedit.cpp:491 msgid "Suggestions" msgstr "Predlozi" #: widgets/simplerichtextedit.cpp:492 msgid "Ignore" msgstr "Ignoriši" #: widgets/simplerichtextedit.cpp:493 msgid "Add to Dictionary" msgstr "Dodaj u rečnik" #: widgets/simplerichtextedit.cpp:497 msgid "No suggestions" msgstr "Nema predloga" #. i18n: file: main/subtitlecomposerui.rc:5 #. i18n: ectx: Menu (file) #: rc.cpp:3 msgid "&File" msgstr "&Fajl" #. i18n: file: main/subtitlecomposerui.rc:16 #. i18n: ectx: Menu (translation) #: rc.cpp:6 msgid "Translation" msgstr "Prevod" #. i18n: file: main/subtitlecomposerui.rc:28 #. i18n: ectx: Menu (edit) #: rc.cpp:9 msgid "&Edit" msgstr "&Uređivanje" #. i18n: file: main/subtitlecomposerui.rc:51 #. i18n: ectx: Menu (texts) #: rc.cpp:12 msgid "&Texts" msgstr "&Tekstovi" #. i18n: file: main/subtitlecomposerui.rc:62 #. i18n: ectx: Menu (styles) #: rc.cpp:15 msgid "St&yles" msgstr "&Stilovi" #. i18n: file: main/subtitlecomposerui.rc:69 #. i18n: ectx: Menu (times) #: rc.cpp:18 msgid "T&imes" msgstr "V&remena" #. i18n: file: main/subtitlecomposerui.rc:91 #. i18n: ectx: Menu (errors) #: rc.cpp:21 msgid "E&rrors" msgstr "&Greške" #. i18n: file: main/subtitlecomposerui.rc:104 #. i18n: ectx: Menu (video) #: rc.cpp:24 msgid "&Video" msgstr "&Video" #. i18n: file: main/subtitlecomposerui.rc:132 #. i18n: ectx: Menu (tools) #: rc.cpp:27 msgid "T&ools" msgstr "A&latke" #. i18n: file: main/subtitlecomposerui.rc:137 #. i18n: ectx: Menu (audiolevels) #: rc.cpp:30 msgid "&Audio Levels" msgstr "&Audio nivoi" #. i18n: file: main/subtitlecomposerui.rc:153 #. i18n: ectx: ToolBar (mainToolBar) #: rc.cpp:33 msgid "Main Toolbar" msgstr "Glavna traka alatki" #. i18n: file: main/subtitlecomposerui.rc:165 #. i18n: ectx: ToolBar (editToolBar) #: rc.cpp:36 msgctxt "The toolbar name" msgid "Edit Toolbar" msgstr "Traka za uređivanje" #: rc.cpp:37 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Slobodan Simić" #: rc.cpp:38 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "simicsl@verat.net" #~ msgid "There was an error opening the audiolevels." #~ msgstr "Došlo je do greške pri otvaranju audio nivoa." #~ msgid "Save AudioLevels" #~ msgstr "Sačuvaj audio nivoe" #~ msgid "There was an error saving the audiolevels." #~ msgstr "Došlo je do greške pri snimanju audio nivoa." #~ msgid "Toggle Line Mark" #~ msgstr "Menjaj označenost linije" #~ msgctxt "@title:group" #~ msgid "Subtitles font" #~ msgstr "Font titlova" #~ msgid "Size:" #~ msgstr "Veličina:" #~ msgid "Append to" #~ msgstr "Dodaj u" #~ msgid "1 mark" #~ msgid_plural "%1 marks" #~ msgstr[0] "%1 marker" #~ msgstr[1] "%1 markera" #~ msgstr[2] "%1 markera" #~ msgstr[3] "1 marker" #~ msgid "Line Issues" #~ msgstr "Problemi sa redom" #~ msgid "Marks" #~ msgstr "Markeri" #~ msgid "No line with errors found!" #~ msgstr "Nema linija sa greškama!" #~ msgid "Sort Lines" #~ msgstr "Poređaj linije" #~ msgid "Apply Duration Limits" #~ msgstr "Primeni ograničenja trajanja" #~ msgid "Smart Lines Adjust" #~ msgstr "Pametno podešavanje linija" #~ msgid "Shift selected lines -%1 milliseconds" #~ msgstr "Pomeraj izabranih linija -%1 milisekundi" #~ msgid "Automatic Durations..." #~ msgstr "Automatska trajanja..." #~ msgid "Smart Lines Adjust..." #~ msgstr "Pametno podešavanje linije..." #~ msgid "Adjust Subtitles" #~ msgstr "Podesi titlove" #~ msgid "Shift Subtitles" #~ msgstr "Pomeraj titlova" subtitlecomposer-0.5.3/po/pt_BR/0000755000175000001440000000000011206423743015757 5ustar sergiouserssubtitlecomposer-0.5.3/po/pt_BR/CMakeLists.txt0000644000175000001440000000017111151345072020513 0ustar sergiousersFILE( GLOB _po_files *.po ) GETTEXT_PROCESS_PO_FILES( pt_BR ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) subtitlecomposer-0.5.3/po/pt_BR/subtitlecomposer.po0000644000175000001440000020661211206411600021716 0ustar sergiousers# translation of subtitlecomposer.po to Brazilian Portuguese # This file is put in the public domain. # # Marcio P. Moraes , 2008. # Sergio Pistone , 2009. msgid "" msgstr "" "Project-Id-Version: subtitlecomposer\n" "Report-Msgid-Bugs-To: https://sourceforge.net/tracker/?" "atid=1005652&group_id=208427&func=browse\n" "POT-Creation-Date: 2009-05-25 00:41-0300\n" "PO-Revision-Date: 2009-05-24 17:11-0300\n" "Last-Translator: Sergio Pistone \n" "Language-Team: American English \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 0.3\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: core/subtitleactions.cpp:62 msgid "Set Frame Rate" msgstr "Difinir Velocidade do Frame" #: core/subtitleactions.cpp:93 msgid "Insert Lines" msgstr "Inserir Linhas" #: core/subtitleactions.cpp:177 core/subtitle.cpp:446 core/subtitle.cpp:460 #: core/subtitle.cpp:479 msgid "Remove Lines" msgstr "Remover Linhas" #: core/subtitleactions.cpp:268 msgid "Move Line" msgstr "Mover Linha" #: core/subtitleactions.cpp:381 msgid "Swap Texts" msgstr "Trocar Textos" #: core/subtitle.cpp:66 msgid "Set Primary Data" msgstr "Definir Dados Primários" #: core/subtitle.cpp:121 msgid "Clear Primary Text Data" msgstr "Limpar Texto de Dados Primários" #: core/subtitle.cpp:134 msgid "Set Secondary Data" msgstr "Definir Dados Secundários" #: core/subtitle.cpp:180 msgid "Clear Secondary Text Data" msgstr "Limpar Texto de Dados Secundários" #: core/subtitle.cpp:265 main/dialogs/changeframeratedialog.cpp:34 msgid "Change Frame Rate" msgstr "Mudar Velocidade do Frame" #: core/subtitle.cpp:395 core/subtitle.cpp:412 msgid "Insert Line" msgstr "Inserir Linha" #: core/subtitle.cpp:533 main/application.cpp:662 main/lineswidget.cpp:1226 msgid "Split Lines" msgstr "Dividir Linhas" #: core/subtitle.cpp:590 main/application.cpp:670 main/lineswidget.cpp:1225 msgid "Join Lines" msgstr "Unir Linhas" #: core/subtitle.cpp:642 msgid "Shift Lines" msgstr "Mover Linhas" #: core/subtitle.cpp:690 msgid "Adjust Lines" msgstr "Ajustar Linhas" #: core/subtitle.cpp:700 main/application.cpp:2377 main/lineswidget.cpp:1200 msgid "Sort" msgstr "Ordenar" #: core/subtitle.cpp:746 main/dialogs/durationlimitsdialog.cpp:33 msgid "Enforce Duration Limits" msgstr "Forçar Limites de Duração" #: core/subtitle.cpp:791 main/application.cpp:2462 main/lineswidget.cpp:1203 msgid "Maximize Durations" msgstr "Maximizar Durações" #: core/subtitle.cpp:816 main/dialogs/autodurationsdialog.cpp:35 msgid "Set Automatic Durations" msgstr "Definir Durações Automáticas" #: core/subtitle.cpp:856 main/dialogs/fixoverlappingtimesdialog.cpp:32 #: main/lineswidget.cpp:1204 msgid "Fix Overlapping Times" msgstr "Corrigir Tempos Sobrepostos" #: core/subtitle.cpp:890 msgid "Fix Lines Punctuation" msgstr "Corrigir Pontuação de Linhas" #: core/subtitle.cpp:986 msgid "Lower Case" msgstr "Minúsculas" #: core/subtitle.cpp:1020 msgid "Upper Case" msgstr "Maiúsculas" #: core/subtitle.cpp:1054 msgid "Title Case" msgstr "Título" #: core/subtitle.cpp:1091 msgid "Sentence Case" msgstr "Muda Iniciais" #: core/subtitle.cpp:1142 main/dialogs/smarttextsadjustdialog.cpp:32 msgid "Break Lines" msgstr "Inserir Quebra de Linhas" #: core/subtitle.cpp:1150 main/application.cpp:2530 main/lineswidget.cpp:1146 msgid "Unbreak Lines" msgstr "Remover Quebra de Linhas" #: core/subtitle.cpp:1158 main/application.cpp:2544 main/lineswidget.cpp:1152 msgid "Simplify Spaces" msgstr "Simplificar Espaços" #: core/subtitle.cpp:1167 msgid "Synchronize Subtitles" msgstr "Sincronizar Legendas" #: core/subtitle.cpp:1190 main/dialogs/joinsubtitlesdialog.cpp:35 msgid "Join Subtitles" msgstr "Unir Legendas" #: core/subtitle.cpp:1236 core/subtitle.cpp:1242 msgid "Split Subtitles" msgstr "Dividir Legendas" #: core/subtitle.cpp:1259 core/subtitle.cpp:1274 msgid "Set Lines Style" msgstr "Modificar Estilo de Linhas" #: core/subtitle.cpp:1291 msgid "Toggle Lines Style" msgstr "Alternar Estilo de Linhas" #: core/subtitle.cpp:1304 msgid "Set Lines Mark" msgstr "Defnir Marca de Linhas" #: core/subtitle.cpp:1304 msgid "Clear Lines Mark" msgstr "Limpar Marca de Linhas" #: core/subtitle.cpp:1318 msgid "Toggle Lines Mark" msgstr "Alternar Marca de Linhas" #: core/subtitle.cpp:1328 main/application.cpp:2261 main/application.cpp:2271 #: main/errorswidget.cpp:854 msgid "Clear Lines Errors" msgstr "Limpar Erros de Linhas" #: core/subtitle.cpp:1338 core/subtitle.cpp:1358 main/application.cpp:2194 #: main/application.cpp:2239 msgid "Check Lines Errors" msgstr "Verificar Erros de Linhas" #: core/subtitlelineactions.cpp:65 msgid "Set Line Text" msgstr "Definir Texto da Linha" #: core/subtitlelineactions.cpp:101 msgid "Set Line Secondary Text" msgstr "Definir Texto da Linha Secundária" #: core/subtitlelineactions.cpp:137 msgid "Set Line Texts" msgstr "Definir Textos da Linha" #: core/subtitlelineactions.cpp:218 msgid "Set Line Show Time" msgstr "Definir Tempo de Exibição da Linha" #: core/subtitlelineactions.cpp:254 msgid "Set Line Hide Time" msgstr "Definir Tempo de Ocultamento da Linha" #: core/subtitlelineactions.cpp:371 msgid "Set Line Errors" msgstr "Definir Erros de Linha" #: core/subtitleline.cpp:72 msgid "Empty text" msgstr "Texto Vazio" #: core/subtitleline.cpp:74 msgid "Too many characters" msgstr "Excesso de caracteres" #: core/subtitleline.cpp:76 msgid "Too many lines" msgstr "Execesso de linhas" #: core/subtitleline.cpp:78 msgid "Unnecessary white space" msgstr "Espaços desnecessários" #: core/subtitleline.cpp:80 msgid "Unnecessary dash" msgstr "Traço desnecessário" #: core/subtitleline.cpp:82 msgid "Capital letter after continuation ellipsis" msgstr "Maiúscula depois da elipse da continuação da linha" #: core/subtitleline.cpp:84 msgid "Too long duration per character" msgstr "Duração excessivamente longo por caracter" #: core/subtitleline.cpp:86 msgid "Too short duration per character" msgstr "Duração excessivamente curto por caracter" #: core/subtitleline.cpp:88 msgid "Too long duration" msgstr "Duração excessivamente longo" #: core/subtitleline.cpp:89 msgid "Too short duration" msgstr "Duração excessivamente curto" #: core/subtitleline.cpp:90 msgid "Overlapping times" msgstr "Tempos sobrepostos" #: core/subtitleline.cpp:91 msgid "Untranslated text" msgstr "Texto não traduzido" #: core/subtitleline.cpp:92 msgid "User mark" msgstr "Marcas do usuário" #: core/subtitleline.cpp:112 msgid "Has no primary text." msgstr "Não há texto primário." #: core/subtitleline.cpp:116 msgid "Has no translation text." msgstr "Não há tradução do texto." #: core/subtitleline.cpp:120 msgid "Has too many characters in primary text (1 char)." msgid_plural "Has too many characters in primary text (%1 chars)." msgstr[0] "Há caracteres excessivos no texto primário (1 caracter)." msgstr[1] "Há caracteres excessivos no texto primário (%1 caracteres)." #: core/subtitleline.cpp:126 msgid "Has too many characters in translation text (1 char)." msgid_plural "Has too many characters in translation text (%1 chars)." msgstr[0] "Há caracteres excessivos no texto traduzido (1 caracter)." msgstr[1] "Há caracteres excessivos no texto traduzido (%1 caracteres)." #: core/subtitleline.cpp:132 msgid "Has too many lines in primary text (1 line)." msgid_plural "Has too many lines in primary text (%1 lines)." msgstr[0] "Há linhas excessivas no texto primário (1 linha)." msgstr[1] "Há linhas excessivas no texto primário (%1 linhas)." #: core/subtitleline.cpp:138 msgid "Has too many lines in translation text (1 line)." msgid_plural "Has too many lines in translation text (%1 lines)." msgstr[0] "Há linhas excessivas no texto traduzido (1 linha)." msgstr[1] "Há linhas excessivas no texto traduzido (%1 linhas)." #: core/subtitleline.cpp:144 msgid "Has unnecessary spaces in primary text." msgstr "Há espaços desnecessários no texto primário." #: core/subtitleline.cpp:148 msgid "Has unnecessary spaces in translation text." msgstr "Há espaços desnecessários no texto traduzido." #: core/subtitleline.cpp:152 msgid "Has unnecessary dash in primary text." msgstr "Há um traço desnecessário no texto primário." #: core/subtitleline.cpp:156 msgid "Has unnecessary dash in translation text." msgstr "Há um traço desnecessário no texto traduzido." #: core/subtitleline.cpp:160 msgid "Has capital letter after line continuation ellipsis in primary text." msgstr "" "Há uma letra maiúscula depois da elipse da continuação dalinha no texto " "primário." #: core/subtitleline.cpp:164 msgid "" "Has capital letter after line continuation ellipsis in translation text." msgstr "" "Há uma letra maiúscula depois da elipse da continuação dalinha no texto " "traduzido." #: core/subtitleline.cpp:168 msgid "Has too long duration per character in primary text (1 msec/char)." msgid_plural "" "Has too long duration per character in primary text (%1 msecs/char)." msgstr[0] "" "Duração excessivamente longo por caracter no texto primário(1 mseg/caracter)." msgstr[1] "" "Duração excessivamente longo por caracter no texto primário(%1 msegs/" "caracter)." #: core/subtitleline.cpp:174 msgid "Has too long duration per character in translation text (1 msec/char)." msgid_plural "" "Has too long duration per character in translation text (%1 msecs/char)." msgstr[0] "" "Duração excessivamente longo por caracter no texto traduzido(1 mseg/" "caracter)." msgstr[1] "" "Duração excessivamente longo por caracter no texto traduzido(%1 msegs/" "caracter)." #: core/subtitleline.cpp:180 msgid "Has too short duration per character in primary text (1 msec/char)." msgid_plural "" "Has too short duration per character in primary text (%1 msecs/char)." msgstr[0] "" "Duração excessivamente curto por caracter no texto primário(1 mseg/caracter)." msgstr[1] "" "Duração excessivamente curto por caracter no texto primário(%1 msegs/" "caracter)." #: core/subtitleline.cpp:186 msgid "Has too short duration per character in translation text (1 msec/char)." msgid_plural "" "Has too short duration per character in translation text (%1 msecs/char)." msgstr[0] "" "Duração excessivamente curto por caracter no texto traduzido(1 mseg/" "caracter)." msgstr[1] "" "Duração excessivamente curto por caracter no texto traduzido(%1 msegs/" "caracter)." #: core/subtitleline.cpp:192 msgid "Has too long duration (1 msec)." msgid_plural "Has too long duration (%1 msecs)." msgstr[0] "Tens uma duração muito longa (1 mseg)." msgstr[1] "Tens uma duração muito longa (%1 msegs)." #: core/subtitleline.cpp:198 msgid "Has too short duration (1 msec)." msgid_plural "Has too short duration (%1 msecs)." msgstr[0] "Tens uma duração muito curta (1 mseg)." msgstr[1] "Tens uma duração muito curta (%1 msegs)." #: core/subtitleline.cpp:204 msgid "Overlaps with next line." msgstr "Sobrepor com a próxima linha." #: core/subtitleline.cpp:208 msgid "Has untranslated text." msgstr "Tem texto não traduzido." #: core/subtitleline.cpp:212 msgid "Has user mark." msgstr "Há uma marca do usuário." #: core/subtitleline.cpp:680 msgid "Set Line Times" msgstr "Definir Tempos de Linha" #: core/subtitleline.cpp:691 msgid "Shift Line Times" msgstr "Mover Tempos de Linha" #: core/subtitleline.cpp:705 msgid "Adjust Line Times" msgstr "Ajustar Tempos de Linha" #: main/actions/krecentfilesactionext.cpp:37 msgid "Clear History" msgstr "Limpar Histórico" #: main/application.cpp:415 msgid "Video Files" msgstr "Arquivos de Vídeo" #: main/application.cpp:423 msgid "Audio Files" msgstr "Arquivos de Áudio" #: main/application.cpp:425 msgid "Media Files" msgstr "Arquivos de Áudio e Vídeo" #: main/application.cpp:426 msgid "All Files" msgstr "Todos os Arquivos" #: main/application.cpp:442 msgid "Audio Levels Files" msgstr "Arquivos de Níveis de Á&udio" #: main/application.cpp:456 msgid "Exit the application" msgstr "Sair da aplicação" #: main/application.cpp:460 msgid "Configure Subtitle Composer" msgstr "Configurar Criador de Legenda" #: main/application.cpp:465 msgctxt "@action:inmenu Create a new subtitle" msgid "New" msgstr "Novo" #: main/application.cpp:466 msgid "Create an empty subtitle" msgstr "Criar uma legenda vazia" #: main/application.cpp:475 msgctxt "@action:inmenu Open subtitle file" msgid "Open..." msgstr "Abrir..." #: main/application.cpp:476 main/application.cpp:486 msgid "Open subtitle file" msgstr "Abrir arquivo de legenda" #: main/application.cpp:485 msgctxt "@action:inmenu Open rencently used subtitle file" msgid "Open &Recent" msgstr "Abrir &Recente" #: main/application.cpp:493 msgid "Save" msgstr "Salvar" #: main/application.cpp:494 msgid "Save opened subtitle" msgstr "Salvar legenda aberta" #: main/application.cpp:503 msgid "Save As..." msgstr "Salvar Como..." #: main/application.cpp:504 msgid "Save opened subtitle with different settings" msgstr "Salvar legenda aberta com configurações diferentes" #: main/application.cpp:512 msgid "Close" msgstr "Fechar" #: main/application.cpp:513 msgid "Close opened subtitle" msgstr "Fechar legenda aberta" #: main/application.cpp:522 msgid "New Translation" msgstr "Nova Tradução" #: main/application.cpp:523 msgid "Create an empty translation subtitle" msgstr "Criar uma tradução da legenda vazia" #: main/application.cpp:532 msgid "Open Translation..." msgstr "Abrir Tradução..." #: main/application.cpp:533 main/application.cpp:543 msgid "Open translation subtitle file" msgstr "Abrir arquivo de tradução da legenda" #: main/application.cpp:542 msgid "Open &Recent Translation" msgstr "Abrir Tradução &Recente" #: main/application.cpp:551 msgid "Save Translation" msgstr "Salvar Tradução" #: main/application.cpp:552 msgid "Save opened translation subtitle" msgstr "Salvar tradução aberta da legenda" #: main/application.cpp:561 msgid "Save Translation As..." msgstr "Salvar Tradução Como..." #: main/application.cpp:562 msgid "Save opened translation subtitle with different settings" msgstr "Salvar tradução aberta da legenda com configurações diferentes" #: main/application.cpp:570 msgid "Close Translation" msgstr "Fechar Tradução" #: main/application.cpp:571 msgid "Close opened translation subtitle" msgstr "Fechar tradução aberta da legenda aberta" #: main/application.cpp:580 msgid "Reload As..." msgstr "Recarregar Como..." #: main/application.cpp:581 main/application.cpp:592 msgid "Reload opened file with a different encoding" msgstr "Recarregar arquivo abeto com uma codificação diferente" #: main/application.cpp:591 msgid "Quick Reload As..." msgstr "Rápida Recarga Como..." #: main/application.cpp:600 main/application.cpp:601 #: widgets/simplerichtextedit.cpp:72 msgid "Undo" msgstr "Defazer" #: main/application.cpp:610 main/application.cpp:611 #: widgets/simplerichtextedit.cpp:78 msgid "Redo" msgstr "Refazer" #: main/application.cpp:619 msgid "Split Subtitle..." msgstr "Dividir Legenda..." #: main/application.cpp:620 msgid "Split the opened subtitle in two parts" msgstr "Dividir a legenda aberta em duas partes" #: main/application.cpp:627 msgid "Join Subtitles..." msgstr "Unir Legendas..." #: main/application.cpp:628 msgid "Append to the opened subtitle another one" msgstr "Anexar ao abrir outra legenda" #: main/application.cpp:635 main/lineswidget.cpp:1222 msgid "Insert Before" msgstr "Inserir Antes" #: main/application.cpp:636 msgid "Insert empty line before current one" msgstr "Inserir uma linha vazia antes da linha atual" #: main/application.cpp:644 main/lineswidget.cpp:1223 msgid "Insert After" msgstr "Inserir Depois" #: main/application.cpp:645 msgid "Insert empty line after current one" msgstr "Inserir uma linha vazia depois da linha atual" #: main/application.cpp:653 main/lineswidget.cpp:1221 #: main/scripting/scriptsmanager.cpp:141 msgid "Remove" msgstr "Remover" #: main/application.cpp:654 msgid "Remove selected lines" msgstr "Remover linhas selecionadas" #: main/application.cpp:663 msgid "Split selected lines" msgstr "Dividir linhas selecionadas" #: main/application.cpp:671 msgid "Join selected lines" msgstr "Unir linhas selecionadas" #: main/application.cpp:678 main/dialogs/actionwitherrortargetsdialog.cpp:103 #: main/lineswidget.cpp:1219 widgets/simplerichtextedit.cpp:113 msgid "Select All" msgstr "Selecionar Tudo" #: main/application.cpp:679 msgid "Select all lines" msgstr "Selecionar todas as linhas" #: main/application.cpp:687 msgid "Go to Line..." msgstr "Ir para a Linha..." #: main/application.cpp:688 msgid "Go to specified line" msgstr "Ir para a linha especificada" #: main/application.cpp:697 msgid "Find..." msgstr "Localizar..." #: main/application.cpp:698 msgid "Find occurrences of strings or regular expressions" msgstr "Localizar ocorrências de palavras ou expressões regulares" #: main/application.cpp:708 msgid "Find Next" msgstr "Localizar Próxima" #: main/application.cpp:709 msgid "Find next occurrence of string or regular expression" msgstr "Localizar próxima ocorrência da palavra ou expressão regular" #: main/application.cpp:719 msgid "Find Previous" msgstr "Localizar Anterior" #: main/application.cpp:720 msgid "Find previous occurrence of string or regular expression" msgstr "Localizar ocorrência anterior da palavra ou expressão regular" #: main/application.cpp:728 msgid "Replace..." msgstr "Substituir..." #: main/application.cpp:729 msgid "Replace occurrences of strings or regular expressions" msgstr "Substituir ocurrências das palavras ou expressões regulares" #: main/application.cpp:738 msgid "Retrocede current line" msgstr "Retroceder linha atual" #: main/application.cpp:739 msgid "Makes the line before the current one active" msgstr "Torna ativa a linha anterior a atual" #: main/application.cpp:748 msgid "Advance current line" msgstr "Adiantar linha atual" #: main/application.cpp:749 msgid "Makes the line after the current one active" msgstr "Torna ativa a próxima linha a atual" #: main/application.cpp:757 main/errorsdialog.cpp:59 main/lineswidget.cpp:1212 msgid "Check Errors..." msgstr "Verificar Erros..." #: main/application.cpp:758 msgid "Check for errors in the current subtitle" msgstr "Verificar erros na legenda atual" #: main/application.cpp:766 main/errorsdialog.cpp:62 main/lineswidget.cpp:1213 msgid "Clear Errors..." msgstr "Limpar Erros..." #: main/application.cpp:767 msgid "Clear errors from selected lines" msgstr "Limpar erros das linhas selecionadas" #: main/application.cpp:774 main/lineswidget.cpp:1215 msgid "Show Errors..." msgstr "Mostrar Erros..." #: main/application.cpp:775 msgid "Show errors information for the current subtitle" msgstr "Mostrar informações dos erros da legenda atual" #: main/application.cpp:784 msgid "Find Error..." msgstr "Localizar Erro..." #: main/application.cpp:785 msgid "Find lines with specified errors" msgstr "Localizar linhas com erros especificados" #: main/application.cpp:795 msgid "Find Next Error" msgstr "Localizar Próximo Erro" #: main/application.cpp:796 msgid "Find next line with specified errors" msgstr "Localizar próxima linha com erros especificados" #: main/application.cpp:806 msgid "Find Previous Error" msgstr "Localizar Erro Anterior" #: main/application.cpp:807 msgid "Find previous line with specified errors" msgstr "Localizar linha anterior com erros especificados" #: main/application.cpp:816 main/lineswidget.cpp:1159 msgid "Spelling..." msgstr "Ortografia..." #: main/application.cpp:817 msgid "Check lines spelling" msgstr "Verificar ortografia de linhas" #: main/application.cpp:824 msgid "Toggle Mark" msgstr "Marcar" #: main/application.cpp:825 msgid "Toggle selected lines mark" msgstr "Marcar linhas selecionadas" #: main/application.cpp:834 main/currentlinewidget.cpp:92 msgid "Toggle Bold" msgstr "Negrito" #: main/application.cpp:835 msgid "Toggle selected lines bold attribute" msgstr "Negrito nas linhas selecionadas" #: main/application.cpp:844 main/currentlinewidget.cpp:97 msgid "Toggle Italic" msgstr "Itálico" #: main/application.cpp:845 msgid "Toggle selected lines italic attribute" msgstr "Itálico nas linhas selecionadas" #: main/application.cpp:854 main/currentlinewidget.cpp:102 msgid "Toggle Underline" msgstr "Sublinhado" #: main/application.cpp:855 msgid "Toggle selected lines underline attribute" msgstr "Sublinhado nas linhas selecionadas" #: main/application.cpp:864 main/currentlinewidget.cpp:107 msgid "Toggle Strike Through" msgstr "Tachado" #: main/application.cpp:865 msgid "Toggle selected lines strike through attribute" msgstr "Tachado nas linhas selecionadas" #: main/application.cpp:873 main/lineswidget.cpp:1199 msgid "Shift..." msgstr "Mover..." #: main/application.cpp:874 msgid "Shift lines an specified amount of time" msgstr "Mover linhas uma certa quantidade de tempo" #: main/application.cpp:901 msgid "Adjust..." msgstr "Ajustar..." #: main/application.cpp:902 msgid "Linearly adjust all lines to a specified interval" msgstr "Ajustar linearmente todas as linhas a um determinado intervalo" #: main/application.cpp:910 msgid "Sort..." msgstr "Ordenar..." #: main/application.cpp:911 msgid "Sort lines based on their show time" msgstr "Ordenar linhas baseadas nos seus tempos de exibição" #: main/application.cpp:918 msgid "Change Frame Rate..." msgstr "Mudar Velocidade do Frame..." #: main/application.cpp:919 msgid "Retime subtitle lines by reinterpreting its frame rate" msgstr "" "Voltar a temporizar as linhas da legenda pela reinterpretação das " "velocidades do frame" #: main/application.cpp:926 main/lineswidget.cpp:1201 msgid "Enforce Duration Limits..." msgstr "Forçar Limites de Duração..." #: main/application.cpp:927 msgid "Enforce lines minimum and/or maximum duration limits" msgstr "Forçar limites mínimo e/ou máximo de duração das linhas" #: main/application.cpp:935 main/lineswidget.cpp:1202 msgid "Set Automatic Durations..." msgstr "Definir Durações Automáticas..." #: main/application.cpp:936 msgid "Set lines durations based on amount of letters, words and line breaks" msgstr "" "Definir duração das linhas baseadas na quantidade de letras, palavras e " "quebras de linha" #: main/application.cpp:943 msgid "Maximize Durations..." msgstr "Maximizar Durações..." #: main/application.cpp:944 msgid "Extend lines durations up to their next lines show time" msgstr "Extender durações das linhas até o tempo da próxma exibição de linhas" #: main/application.cpp:951 msgid "Fix Overlapping Times..." msgstr "Corrigir Tempos Sobrepostos..." #: main/application.cpp:952 msgid "Fix lines overlapping times" msgstr "Corrigir tempos sobrepostos de linhas" #: main/application.cpp:959 msgid "Synchronize with Subtitle..." msgstr "Sincronizar com a legenda..." #: main/application.cpp:960 msgid "Copy timing information from another subtitle" msgstr "Copiar informação temporizada de outra legenda" #: main/application.cpp:967 main/lineswidget.cpp:1142 msgid "Break Lines..." msgstr "Quebrar Linhas..." #: main/application.cpp:968 msgid "Automatically set line breaks" msgstr "Automaticamente ajustar quebras de linha" #: main/application.cpp:975 main/lineswidget.cpp:1145 msgid "Unbreak Lines..." msgstr "Sem Quebrar Linhas..." #: main/application.cpp:976 msgid "Remove line breaks from lines" msgstr "Remover quebras de linha das linhas" #: main/application.cpp:983 main/lineswidget.cpp:1151 msgid "Simplify Spaces..." msgstr "Simplificar Espaços..." #: main/application.cpp:984 msgid "Remove unneeded spaces from lines" msgstr "Remover espaços desnecessário das linhas" #: main/application.cpp:991 main/lineswidget.cpp:1155 msgid "Change Case..." msgstr "Mudar maiúsculas/minúsculas..." #: main/application.cpp:992 msgid "Change lines text to upper, lower, title or sentence case" msgstr "" "Mudar linhas do texto para maiúsculas, minúsculas, título ou mudar iniciais." #: main/application.cpp:999 main/lineswidget.cpp:1156 msgid "Fix Punctuation..." msgstr "Corrigir Pontuação..." #: main/application.cpp:1000 msgid "Fix punctuation errors in lines" msgstr "Corrigir erros de pontuação nas linhas" #: main/application.cpp:1007 main/lineswidget.cpp:1157 msgid "Translate..." msgstr "Traduzir..." #: main/application.cpp:1008 msgid "Translate lines texts using Google services" msgstr "" #: main/application.cpp:1015 msgid "Edit Line in Place" msgstr "Editar Linha no Lugar" #: main/application.cpp:1016 msgid "Edit current line text in place" msgstr "Editar texto da linha atual no lugar" #: main/application.cpp:1025 msgid "Open Video..." msgstr "Abrir Vídeo..." #: main/application.cpp:1026 main/application.cpp:1034 msgid "Open video file" msgstr "Abrir arquivo de vídeo" #: main/application.cpp:1033 msgid "Open &Recent Video" msgstr "Abrir Vídeo &Recente" #: main/application.cpp:1041 msgid "Close Video" msgstr "Fechar Vídeo" #: main/application.cpp:1042 msgid "Close video file" msgstr "Fechar arquivo de vídeo" #: main/application.cpp:1051 msgid "Full Screen Mode" msgstr "Modo Tela Cheia" #: main/application.cpp:1052 msgid "Toggle full screen mode" msgstr "Modo tela cheia" #: main/application.cpp:1060 main/utils/kreplace.cpp:425 msgid "Stop" msgstr "Parar" #: main/application.cpp:1061 msgid "Stop video playback" msgstr "Parar reprodução de vídeo" #: main/application.cpp:1069 main/application.cpp:3156 #: main/application.cpp:3163 msgid "Play" msgstr "Reproduzir" #: main/application.cpp:1070 msgid "Toggle video playing/paused" msgstr "Reproduzir/pausar vídeo" #: main/application.cpp:1078 msgid "Seek Backwards" msgstr "Voltar" #: main/application.cpp:1087 msgid "Seek Forwards" msgstr "Avançar" #: main/application.cpp:1099 msgid "Jump to Previous Line" msgstr "Pular para a Linha Anterior" #: main/application.cpp:1100 msgid "Seek to previous subtitle line show time" msgstr "Buscar o tempo de exibição da linha anterior" #: main/application.cpp:1109 msgid "Jump to Next Line" msgstr "Pular para a Próxima Linha" #: main/application.cpp:1110 msgid "Seek to next subtitle line show time" msgstr "Pular o tempo de exibição da próxima linha" #: main/application.cpp:1120 msgid "Set Current Line Show Time" msgstr "Definir Tempo de Exibição da Linha Atual" #: main/application.cpp:1121 msgid "Set current line show time to video position" msgstr "" "Definir o tempo de exibição da linha atual a partir da posição do vídeo" #: main/application.cpp:1131 msgid "Set Current Line Hide Time" msgstr "Definir Tempo de Ocultamento da Linha Atual" #: main/application.cpp:1132 msgid "Set current line hide time to video position" msgstr "" "Definir o tempo de ocultamento da linha atual a partir da posição do vídeo" #: main/application.cpp:1141 msgid "Current Line Follows Video" msgstr "Vincular Linha Atual a Posição do Vídeo" #: main/application.cpp:1142 msgid "Make current line follow the playing video position" msgstr "Vincular linha atual a posição do vídeo em reprodução" #: main/application.cpp:1149 msgctxt "@action:inmenu Toggle audio muted" msgid "Mute" msgstr "Sem áudio" #: main/application.cpp:1151 msgid "Enable/disable playback sound" msgstr "Ativar/desativar som" #: main/application.cpp:1159 msgid "Increase Volume" msgstr "Aumentar Volume" #: main/application.cpp:1160 msgid "Increase volume by 5%" msgstr "Aumentar volume em 5%" #: main/application.cpp:1168 msgid "Decrease Volume" msgstr "Diminuir Volume" #: main/application.cpp:1169 msgid "Decrease volume by 5%" msgstr "Diminuir volume em 5%" #: main/application.cpp:1177 msgid "Audio Streams" msgstr "Fluxos do Áudio" #: main/application.cpp:1178 msgid "Select active audio stream" msgstr "Selecionar fluxo do áudio ativo" #: main/application.cpp:1186 msgid "Increase Font Size" msgstr "Aumentar Tamanho da Fonte" #: main/application.cpp:1187 msgid "Increase subtitles font size by 1 point" msgstr "Aumentar 1 ponto o tamanho da fonte das legendas" #: main/application.cpp:1195 msgid "Decrease Font Size" msgstr "Diminuir Tamanho da Fonte" #: main/application.cpp:1196 msgid "Decrease subtitles font size by 1 point" msgstr "Diminuir 1 ponto o tamanho da fonte das legendas" #: main/application.cpp:1204 msgid "Subtitle Streams" msgstr "Fluxos da Legenda" #: main/application.cpp:1205 msgid "Select active subtitle stream" msgstr "Selecionar fluxo da legenda atual" #: main/application.cpp:1212 msgid "Shift to Video Position" msgstr "Mover a Posição do Vídeo" #: main/application.cpp:1213 msgid "" "Set current line show time to video position by equally shifting all lines" msgstr "Definir o tempo de exibição da linha para a posição do vídeo 
igualmente passando para todas as linhas" #: main/application.cpp:1221 msgid "Adjust to Video Position (Anchor Last Line)" msgstr "Ajustar a Posição do Vídeo (Ancorar Última Linha)" #: main/application.cpp:1222 msgid "" "Set current line to video position by fixing the last line and linearly " "adjusting the other ones" msgstr "" "Definir a linha atual para a posição do vídeo corrigindo a última linha e 
ajustando linearmente as outras" #: main/application.cpp:1230 msgid "Adjust to Video Position (Anchor First Line)" msgstr "Ajustar a Posição do Vídeo (Ancorar Primera Linha)" #: main/application.cpp:1231 msgid "" "Set current line to video position by fixing the first line and linearly " "adjusting the other ones" msgstr "" "Definir a linha atual para a posição do vídeo corrigindo a primeira linha e 
ajustando linearmente as demais" #: main/application.cpp:1240 msgctxt "@action:inmenu Manage user scripts" msgid "Scripts Manager..." msgstr "" #: main/application.cpp:1241 msgid "Manage user scripts" msgstr "" #: main/application.cpp:1365 msgid "" "The requested action would make the subtitle and its translation share the " "same file, possibly resulting in loss of information when saving.\n" "Are you sure you want to continue?" msgstr "" "A ação solicitada faria a legenda e sua tradução compartilharem o memos " "arquivo mismo fichero, possivelmente resultando perda de informação ao " "salvar.\n" "Tem certeza de que deseja continuar?" #: main/application.cpp:1366 msgid "Conflicting Subtitle Files" msgstr "Conflitando Arquivos de Legendas" #: main/application.cpp:1488 msgid "" "Could not parse the subtitle file.
This may have been caused by " "usage of the wrong encoding.
" msgstr "" "Não foi possível analizar o arquivo da legenda.
Isto pode ser devido " "à utilização incorrecta de uma codificação de caracteres.
" #: main/application.cpp:1519 msgid "There was an error saving the subtitle." msgstr "Ocorreu um erro ao salvar a legenda." #: main/application.cpp:1561 main/application.cpp:1770 msgid "" "Currently opened translation subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Atualmente a tradução da legenda aberta tem alterações não salvas.\n" "Deseja salvá-las?" #: main/application.cpp:1562 main/application.cpp:1771 msgid "Close Translation Subtitle" msgstr "Fechar Tradução" #: main/application.cpp:1574 msgid "" "Currently opened subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Atualmente a legenda aberta tem alterações não salvas.\n" "Deseja salvá-las?" #: main/application.cpp:1575 msgid "Close Subtitle" msgstr "Fechar Legenda" #: main/application.cpp:1678 msgctxt "@item:inmenu Display primary text in video player" msgid "Primary" msgstr "Texto Primário" #: main/application.cpp:1679 msgctxt "@item:inmenu Display translation text in video player" msgid "Translation" msgstr "Tradução" #: main/application.cpp:1689 msgid "Could not parse the subtitle file." msgstr "Não foi possível analizar o arquivo da legenda." #: main/application.cpp:1728 msgid "There was an error saving the translation subtitle." msgstr "Ocorreu um erro ao salvar a tradução da legenda." #: main/application.cpp:1864 msgid "Could not read the subtitle file to append." msgstr "Não foi possível ler o arquivo da legenda adicionado." #: main/application.cpp:1916 msgid "Could not write the splitted subtitle file." msgstr "Não foi possível escrever o arquivo da legenda dividido." #: main/application.cpp:1917 msgid "Could not write the splitted subtitle translation file." msgstr "Não foi possível escrever o arquivo dividido da tradução da legenda." #: main/application.cpp:1935 msgid "The specified time does not split the subtitles." msgstr "O tempo especificado não divide as legendas." #: main/application.cpp:1984 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted part was saved as %1." msgstr "" "Não foi possível abrir uma nova janela do Criador de Legendas.\n" "A parte dividida foi salva como %1." #: main/application.cpp:1989 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted parts were saved as %1 and %2." msgstr "" "Não foi possível abrir uma nova janela do Criador de Legendas.\n" "As partes divididas foram salvas com %1 e %2." #: main/application.cpp:2077 msgid "Go to Line" msgstr "Ir para a Linha" #: main/application.cpp:2077 msgid "&Go to line:" msgstr "&Ir para a linha:" #: main/application.cpp:2389 msgid "Can not perform sort on selection with multiple ranges." msgstr "Não foi possível ordenar uma seleção com múltiplas faixas." #: main/application.cpp:2499 msgid "The reference subtitle must have more than one line to proceed." msgstr "A legenda de referência deve ter mais de uma linha para proceder." #: main/application.cpp:2511 msgid "Could not parse the reference subtitle file." msgstr "Não foi possível analizar o arquivo da legenda de referência." #: main/application.cpp:2618 main/dialogs/translatedialog.cpp:31 msgid "Translate" msgstr "Traduzir" #: main/application.cpp:2619 msgid "Translating text (%1 to %2)..." msgstr "" #: main/application.cpp:2628 msgid "Translating primary text (%1 to %2)..." msgstr "" #: main/application.cpp:2629 msgid "Translating secondary text (%1 to %2)..." msgstr "" #: main/application.cpp:2661 msgid "" "Unable to perform texts synchronization (sent and received lines count do " "not match)." msgstr "" #: main/application.cpp:2670 msgid "Translate Primary Text" msgstr "Traduzir texto primário" #: main/application.cpp:2671 msgid "Translate Secondary Text" msgstr "Traduzir Texto da Linha Secundária" #: main/application.cpp:2687 msgid "" "There was an error performing the translation:\n" "\n" "%1" msgstr "" "Ocorreu um erro ao realizar a tradução:\n" "\n" "%1" #: main/application.cpp:2740 msgid "Open Video" msgstr "Abrir Vídeo" #: main/application.cpp:2873 main/application.cpp:2911 msgid "" "Continuing would result in loss of timing information for some lines.\n" "Are you sure you want to continue?" msgstr "" "Continuar pode resultar em perda de informação de temporização de algumas " "linhas.\n" "Tem certeza de que deseja continuar?" #: main/application.cpp:2929 msgid "Open AudioLevels" msgstr "Abrir Níveis de Áudio" #: main/application.cpp:3035 msgid "modified" msgstr "modificado" #: main/application.cpp:3039 main/application.cpp:3050 msgid "Untitled" msgstr "Sem Título" #: main/application.cpp:3041 msgid "Untitled Translation" msgstr "Tradução sem Título" #: main/application.cpp:3149 msgid "Pause" msgstr "Pausar" #: main/application.cpp:3190 msgid "Seek backwards 1 second" msgid_plural "Seek backwards %1 seconds" msgstr[0] "Voltar 1 segundo" msgstr[1] "Voltar %1 segundos" #: main/application.cpp:3196 msgid "Seek forwards 1 second" msgid_plural "Seek forwards %1 seconds" msgstr[0] "Avançar 1 segundo" msgstr[1] "Avançar %1 segundos" #: main/application.cpp:3211 main/application.cpp:3223 msgid "Shift %21 Millisecond" msgid_plural "Shift %2%1 Milliseconds" msgstr[0] "Mover %21 milisegundo" msgstr[1] "Mover %2%1 milisegundos" #: main/application.cpp:3216 main/application.cpp:3228 msgid "Shift selected lines %21 millisecond" msgid_plural "Shift selected lines %2%1 milliseconds" msgstr[0] "Mover linhas selecionadas %21 milisegundo" msgstr[1] "Mover linhas selecionadas %2%1 milisegundos" #: main/configdialog.cpp:46 msgid "Configure" msgstr "Configurar" #: main/configdialog.cpp:54 msgctxt "@title General settings" msgid "General" msgstr "Geral" #: main/configdialog.cpp:55 msgid "General Settings" msgstr "Configurações Gerais" #: main/configdialog.cpp:59 msgctxt "@title Error checks settings" msgid "Error Checks" msgstr "Verificar Erros" #: main/configdialog.cpp:60 msgid "Error Checks Settings" msgstr "Configurações das Verificações de Erros" #: main/configdialog.cpp:64 msgctxt "@title Spelling settings" msgid "Spelling" msgstr "Ortografia" #: main/configdialog.cpp:65 msgid "Spelling Settings" msgstr "Configurações de Ortografia" #: main/configdialog.cpp:69 msgctxt "@title Player settings" msgid "Player" msgstr "Reprodutor" #: main/configdialog.cpp:70 msgid "Player Settings" msgstr "Configurações do Reprodutor" #: main/configdialog.cpp:82 msgctxt "@title Player backend settings" msgid "%1 Backend Settings" msgstr "Configurações de %1" #: main/configs/errorsconfigwidget.cpp:37 msgctxt "@title:group" msgid "Texts" msgstr "Textos" #: main/configs/errorsconfigwidget.cpp:40 msgid "Maximum number of characters:" msgstr "Número máximo de caracteres:" #: main/configs/errorsconfigwidget.cpp:45 #: main/dialogs/smarttextsadjustdialog.cpp:40 msgid " characters" msgstr " caracteres" #: main/configs/errorsconfigwidget.cpp:48 msgid "Maximum number of lines:" msgstr "Número máximo de linhas:" #: main/configs/errorsconfigwidget.cpp:53 msgid " lines" msgstr " linhas" #: main/configs/errorsconfigwidget.cpp:56 msgctxt "@title:group" msgid "Absolute Durations" msgstr "Durações absolutas" #: main/configs/errorsconfigwidget.cpp:59 #: main/configs/errorsconfigwidget.cpp:78 msgid "Minimum duration:" msgstr "Duração mínima:" #: main/configs/errorsconfigwidget.cpp:64 #: main/configs/errorsconfigwidget.cpp:72 #: main/configs/generalconfigwidget.cpp:52 #: main/configs/generalconfigwidget.cpp:66 #: main/configs/generalconfigwidget.cpp:74 #: main/dialogs/fixoverlappingtimesdialog.cpp:37 msgid " msecs" msgstr " msegs" #: main/configs/errorsconfigwidget.cpp:67 #: main/configs/errorsconfigwidget.cpp:86 msgid "Maximum duration:" msgstr "Duração máxima:" #: main/configs/errorsconfigwidget.cpp:75 msgctxt "@title:group" msgid "Relative Durations" msgstr "Durações relativas" #: main/configs/errorsconfigwidget.cpp:83 #: main/configs/errorsconfigwidget.cpp:91 msgid " msecs/character" msgstr " msegs/caracter" #: main/configs/errorsconfigwidget.cpp:93 msgctxt "@title:group" msgid "Behavior" msgstr "Comportamento" #: main/configs/errorsconfigwidget.cpp:96 msgid "Automatically clear fixed errors" msgstr "Limpar automaticamente os erros corrigidos" #: main/configs/generalconfigwidget.cpp:38 #: main/configs/playerconfigwidget.cpp:44 #: player/mplayer/mplayerconfigwidget.cpp:37 msgctxt "@title:group General settings" msgid "General" msgstr "Geral" #: main/configs/generalconfigwidget.cpp:41 msgid "Default encoding for opening subtitles:" msgstr "Codificação padrão ao abrir legendas:" #: main/configs/generalconfigwidget.cpp:47 msgid "On line double click, jump to show time minus:" msgstr "Duplo clique na linha, pula o tempo de exibição menos:" #: main/configs/generalconfigwidget.cpp:55 msgid "Automatically load video file when opening subtitle" msgstr "Carregar vídeo automaticamente ao abrir legenda" #: main/configs/generalconfigwidget.cpp:58 msgctxt "@title:group" msgid "Quick Actions" msgstr "Ações rápidas" #: main/configs/generalconfigwidget.cpp:61 msgid "Time shift for selected lines:" msgstr "Mover tempo para linhas selecionadas:" #: main/configs/generalconfigwidget.cpp:69 msgid "Compensation for captured video times:" msgstr "Compensação de tempo para os tempos de vídeo capturado" #: main/configs/playerconfigwidget.cpp:47 msgid "Player backend:" msgstr "Backend de reprodução:" #: main/configs/playerconfigwidget.cpp:53 msgid "Jump length on seek:" msgstr "Pular comprimento ao avançar ou voltar:" #: main/configs/playerconfigwidget.cpp:58 msgid " secs" msgstr " segs" #: main/configs/playerconfigwidget.cpp:61 main/playerwidget.cpp:452 msgid "Show editable position control" msgstr "Mostrar controle para edição de posição" #: main/configs/playerconfigwidget.cpp:64 msgctxt "@title:group" msgid "Subtitles" msgstr "Legenda" #: main/configs/playerconfigwidget.cpp:67 msgctxt "@label:chooser The font family name" msgid "Font family:" msgstr "Família da fonte:" #: main/configs/playerconfigwidget.cpp:72 msgid "Font size:" msgstr "Tamanho da fonte:" #: main/configs/playerconfigwidget.cpp:77 msgid " points" msgstr " pontos" #: main/configs/playerconfigwidget.cpp:80 msgid "Primary color:" msgstr "Cor primária:" #: main/configs/playerconfigwidget.cpp:85 msgid "Outline color:" msgstr "Cor delineado:" #: main/configs/playerconfigwidget.cpp:91 msgid "Outline width:" msgstr "Largura delineado:" #: main/configs/playerconfigwidget.cpp:96 msgid " pixels" msgstr " pixels" #: main/configs/playerconfigwidget.cpp:99 msgctxt "@title:group" msgid "Subtitles Preview" msgstr "Vista prévia das legendas" #: main/configs/playerconfigwidget.cpp:109 msgctxt "Text for previewing the subtitles font settings" msgid "

The Quick Brown Fox
Jumps Over The Lazy Dog

" msgstr "

Um pequeno jabuti xereta
viu dez cegonhas felizes

" #: main/currentlinewidget.cpp:65 msgid "Show" msgstr "Mostrar" #: main/currentlinewidget.cpp:70 msgid "Hide" msgstr "Ocultar" #: main/currentlinewidget.cpp:75 msgid "Duration" msgstr "Duração" #: main/currentlinewidget.cpp:253 main/currentlinewidget.cpp:259 msgid "No current line" msgstr "Nenhuma linha selecionada" #: main/currentlinewidget.cpp:383 msgid "Current line:" msgstr "Linha atual:" #: main/currentlinewidget.cpp:408 msgid "1 character" msgid_plural "%1 characters" msgstr[0] "1 caracter" msgstr[1] "%1 caracteres" #: main/dialogs/actionwitherrortargetsdialog.cpp:74 msgid "Available errors" msgstr "" #: main/dialogs/actionwitherrortargetsdialog.cpp:105 msgid "Select None" msgstr "Selecionar nenhum" #: main/dialogs/actionwithtargetdialog.cpp:131 msgid "Target >>" msgstr "Alvo >>" #: main/dialogs/actionwithtargetdialog.cpp:131 #: main/dialogs/actionwithtargetdialog.cpp:149 msgid "Target <<" msgstr "Alvo <<" #: main/dialogs/actionwithtargetdialog.cpp:164 msgid "All lines" msgstr "Todas as linhas" #: main/dialogs/actionwithtargetdialog.cpp:165 main/utils/errorfinder.cpp:48 msgid "Selected lines" msgstr "Linhas selecionadas" #: main/dialogs/actionwithtargetdialog.cpp:166 msgid "All lines from first selected" msgstr "Todas as linhas desde a primeira selecionada" #: main/dialogs/actionwithtargetdialog.cpp:167 msgid "All lines up to last selected" msgstr "Todas as linhas até a última selecionada" #: main/dialogs/actionwithtargetdialog.cpp:257 main/utils/finder.cpp:63 #: main/utils/replacer.cpp:61 msgid "Both subtitles" msgstr "Ambas as legendas" #: main/dialogs/actionwithtargetdialog.cpp:260 main/utils/finder.cpp:65 #: main/utils/replacer.cpp:63 msgid "Primary subtitle" msgstr "Legenda primária" #: main/dialogs/actionwithtargetdialog.cpp:263 main/utils/finder.cpp:67 #: main/utils/replacer.cpp:65 msgid "Translation subtitle" msgstr "Tradução da legenda" #: main/dialogs/actionwithtargetdialog.h:78 msgid "Apply To" msgstr "Aplicar a" #: main/dialogs/adjusttimesdialog.cpp:32 msgid "Adjust" msgstr "Ajustar" #: main/dialogs/adjusttimesdialog.cpp:34 msgctxt "@title:group" msgid "New Times" msgstr "Novos tempos" #: main/dialogs/adjusttimesdialog.cpp:39 msgid "First spoken line:" msgstr "Primera linha falada:" #: main/dialogs/adjusttimesdialog.cpp:45 msgid "Last spoken line:" msgstr "Última linha falada:" #: main/dialogs/autodurationsdialog.cpp:38 #: main/dialogs/changeframeratedialog.cpp:36 #: main/dialogs/fixoverlappingtimesdialog.cpp:34 #: main/dialogs/fixpunctuationdialog.cpp:33 #: main/dialogs/smarttextsadjustdialog.cpp:34 #: main/dialogs/splitsubtitledialog.cpp:38 main/dialogs/translatedialog.cpp:33 msgctxt "@title:group" msgid "Settings" msgstr "Configurações" #: main/dialogs/autodurationsdialog.cpp:46 msgid "Milliseconds per line:" msgstr "Milisegundos por linha:" #: main/dialogs/autodurationsdialog.cpp:55 msgid "Milliseconds per word:" msgstr "Milisegundos por palavra:" #: main/dialogs/autodurationsdialog.cpp:64 msgid "Milliseconds per character:" msgstr "Milisegundos por caracter:" #: main/dialogs/autodurationsdialog.cpp:68 #: main/dialogs/durationlimitsdialog.cpp:45 msgid "Prevent overlapping" msgstr "Prevenir sobreposição" #: main/dialogs/autodurationsdialog.cpp:71 msgctxt "@title:group" msgid "Duration Calculation" msgstr "Cálculo da duração" #: main/dialogs/autodurationsdialog.cpp:77 msgid "Use primary text" msgstr "Usar texto primário" #: main/dialogs/autodurationsdialog.cpp:78 msgid "Use translation text" msgstr "Usar texto traduzido" #: main/dialogs/autodurationsdialog.cpp:79 msgid "Calculate both and use maximum" msgstr "Calcular ambos e usar o máximo" #: main/dialogs/changeframeratedialog.cpp:45 msgid "Current frame rate:" msgstr "Velocidade do frame atual:" #: main/dialogs/changeframeratedialog.cpp:54 msgid "New frame rate:" msgstr "Velocidade do novo frame:" #: main/dialogs/changetextscasedialog.cpp:33 msgid "Change Case" msgstr "Mudar maiúsculas/minúsculas" #: main/dialogs/changetextscasedialog.cpp:35 msgctxt "@title:group" msgid "Change To" msgstr "Mudar para" #: main/dialogs/changetextscasedialog.cpp:39 msgid "Lower case" msgstr "Minúsculas" #: main/dialogs/changetextscasedialog.cpp:44 msgid "Upper case" msgstr "Maiúsculas" #: main/dialogs/changetextscasedialog.cpp:48 msgid "Title case" msgstr "Título" #: main/dialogs/changetextscasedialog.cpp:52 msgid "Sentence case" msgstr "Iniciais" #: main/dialogs/changetextscasedialog.cpp:56 msgid "Convert to lower case first" msgstr "Converter para minúsculas primeiro" #: main/dialogs/checkerrorsdialog.cpp:31 msgid "Check Errors" msgstr "Verificar Erros" #: main/dialogs/checkerrorsdialog.cpp:33 msgctxt "@title:group" msgid "Errors to Check" msgstr "Erros a verificar" #: main/dialogs/checkerrorsdialog.cpp:36 msgctxt "@title:group Miscellaneous settings" msgid "Miscellaneous" msgstr "Miscelâneos" #: main/dialogs/checkerrorsdialog.cpp:39 msgid "Clear other errors" msgstr "Limpar outros erros" #: main/dialogs/checkerrorsdialog.cpp:43 msgid "Clear user marks" msgstr "Limpar marcas do usuário" #: main/dialogs/clearerrorsdialog.cpp:32 msgid "Clear Errors" msgstr "Limpar Erros" #: main/dialogs/clearerrorsdialog.cpp:34 msgctxt "@title:group" msgid "Errors to Clear" msgstr "Erros a limpar" #: main/dialogs/durationlimitsdialog.cpp:35 msgctxt "@title:group" msgid "Minimum Duration" msgstr "Duração mínima" #: main/dialogs/durationlimitsdialog.cpp:41 msgid "Expand duration to:" msgstr "Expandir duração a:" #: main/dialogs/durationlimitsdialog.cpp:48 msgctxt "@title:group" msgid "Maximum Duration" msgstr "Duração máxima" #: main/dialogs/durationlimitsdialog.cpp:54 msgid "Shrink duration to:" msgstr "Encolher duração a:" #: main/dialogs/fixoverlappingtimesdialog.cpp:43 msgid "Minimum interval between lines:" msgstr "Intervalo mínimo entre linhas:" #: main/dialogs/fixpunctuationdialog.cpp:31 msgid "Fix Punctuation" msgstr "Corrigir Pontuação" #: main/dialogs/fixpunctuationdialog.cpp:36 msgid "Fix and cleanup spaces" msgstr "Corrigir e limpar espaços" #: main/dialogs/fixpunctuationdialog.cpp:40 msgid "Fix quotes and double quotes" msgstr "Corrigir aspas e aspas duplas" #: main/dialogs/fixpunctuationdialog.cpp:44 msgid "Fix English 'I' pronoun" msgstr "Corrigir pronome inglês \"I\"" #: main/dialogs/fixpunctuationdialog.cpp:48 msgid "Add ellipisis indicating non finished lines" msgstr "Adicionar elipses indicando linhas não finalizadas" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line Before Current" msgstr "Inserir Linha Antes da Atual" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line After Current" msgstr "Inserir Linha Depois da Atual" #: main/dialogs/insertlinedialog.cpp:29 msgid "Insert Into" msgstr "Inserir em" #: main/dialogs/joinsubtitlesdialog.cpp:40 msgid "Shift subtitle forwards before append" msgstr "Mover legendas encaminhadas antes de anexar" #: main/dialogs/joinsubtitlesdialog.cpp:47 #: main/dialogs/splitsubtitledialog.cpp:44 msgid "Set from video length" msgstr "Definir comprimento do vídeo" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Subtitle" msgstr "Abrir Legenda" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Translation Subtitle" msgstr "Abrir Tradução da Legenda" #: main/dialogs/opensubtitledialog.cpp:46 #: main/dialogs/savesubtitledialog.cpp:80 #: main/dialogs/selectablesubtitledialog.cpp:67 msgid "Encoding:" msgstr "Codificação:" #: main/dialogs/opensubtitledialog.cpp:73 msgid "All Supported" msgstr "Todos os Arquivos Suportados" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove Selected Lines" msgstr "Remover Linhas Selecionadas" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove From" msgstr "Remover de" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Subtitle" msgstr "Salvar Legenda" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Translation Subtitle" msgstr "Salvar Tradução da Legenda" #: main/dialogs/savesubtitledialog.cpp:69 msgid "EOL:" msgstr "Fim da Linha:" #: main/dialogs/savesubtitledialog.cpp:145 msgid "" "A file named \"%1\" already exists. Are you sure you want to overwrite it?" msgstr "" "Já existe um arquivo chamado \"%1\". Tem certeza que deseja sobrescrevê-lo?" #: main/dialogs/savesubtitledialog.cpp:148 msgid "Overwrite File?" msgstr "Sobrescrever Arquivo?" #: main/dialogs/savesubtitledialog.cpp:149 msgid "Overwrite" msgstr "Sobrescrever" #: main/dialogs/selectablesubtitledialog.cpp:51 msgid "Path:" msgstr "Caminho:" #: main/dialogs/selectablesubtitledialog.cpp:56 msgid "Select subtitle" msgstr "Selecionar legenda" #: main/dialogs/selectablesubtitledialog.h:54 msgid "Subtitle" msgstr "Legenda" #: main/dialogs/shifttimesdialog.cpp:32 msgid "Shift" msgstr "Mover" #: main/dialogs/shifttimesdialog.cpp:34 msgctxt "@title:group" msgid "Shifting" msgstr "Deslocamento" #: main/dialogs/shifttimesdialog.cpp:38 msgid "Forwards (+)" msgstr "Para frente (+)" #: main/dialogs/shifttimesdialog.cpp:39 msgid "Backwards (–)" msgstr "Para atrás (-)" #: main/dialogs/smarttextsadjustdialog.cpp:43 msgid "Minimum length for line break:" msgstr "Comprimento mínimo para quebra de linha:" #: main/dialogs/splitsubtitledialog.cpp:36 msgid "Split Subtitle" msgstr "Dividir Legenda" #: main/dialogs/splitsubtitledialog.cpp:49 msgid "Split time:" msgstr "Dividir tempo:" #: main/dialogs/splitsubtitledialog.cpp:53 msgid "Shift new part backwards after split" msgstr "Mover parte distinta depois de dividir" #: main/dialogs/syncsubtitlesdialog.cpp:32 msgid "Synchronize with Subtitle" msgstr "Sincronizar com a legenda" #: main/dialogs/syncsubtitlesdialog.cpp:34 msgid "Reference Subtitle" msgstr "Legenda de referência" #: main/dialogs/syncsubtitlesdialog.cpp:36 msgctxt "@title:group" msgid "Synchronization Mode" msgstr "Modo de sincronização" #: main/dialogs/syncsubtitlesdialog.cpp:39 msgid "Adjust to reference's first and last lines" msgstr "Ajustar o primeiro e último tempo da referência" #: main/dialogs/syncsubtitlesdialog.cpp:43 msgid "Copy timing information from reference line by line" msgstr "Copiar informação de temporização da referência linha a linha" #: main/dialogs/translatedialog.cpp:49 msgid "Input language:" msgstr "" #: main/dialogs/translatedialog.cpp:66 msgid "Output language:" msgstr "" #: main/errorsdialog.cpp:42 msgid "Subtitle Errors" msgstr "Erros de Legendas" #: main/errorsdialog.cpp:55 msgid "Clear Fixed Errors" msgstr "Limpar Erros Corrigidos" #: main/errorsdialog.cpp:65 msgid "Settings..." msgstr "Configurações..." #: main/errorsdialog.cpp:121 msgid "Showing 1 line with errors" msgid_plural "Showing %1 lines with errors" msgstr[0] "Mostrando 1 linha com erros" msgstr[1] "Mostrando %1 linhas" #: main/errorsdialog.cpp:124 msgid "1 total error" msgid_plural "%1 total errors" msgstr[0] "1 erro total" msgstr[1] "%1 erros" #: main/errorsdialog.cpp:125 msgid "1 user mark" msgid_plural "%1 user marks" msgstr[0] "1 marca do usuário" msgstr[1] "Há uma marca do usuário." #: main/errorswidget.cpp:491 msgid "Line Errors" msgstr "Erros de Linha" #: main/errorswidget.cpp:492 msgid "Count" msgstr "Conta" #: main/errorswidget.cpp:493 msgid "Marked" msgstr "Marcado" #: main/errorswidget.cpp:509 msgid "yes" msgstr "sim" #: main/errorswidget.cpp:510 msgid "no" msgstr "não" #: main/errorswidget.cpp:517 msgid "Line %1" msgstr "Linha %1" #: main/errorswidget.cpp:717 msgid "Expand All" msgstr "Expandir tudo" #: main/errorswidget.cpp:718 msgid "Collapse All" msgstr "Colapsar tudo" #: main/errorswidget.cpp:722 msgid "Clear Selected Marks" msgstr "Limpar Marcas Selecionadas" #: main/errorswidget.cpp:723 msgid "Clear Selected Errors" msgstr "Limpar Erros Selecionados" #: main/errorswidget.cpp:729 msgid "Clear Fixed Selection" msgstr "Limpar Erros Corrigidos" #: main/lineswidget.cpp:204 msgid "Observations:" msgstr "Observações:" #: main/lineswidget.cpp:232 msgctxt "@title:column Subtitle line number" msgid "Line" msgstr "Linha" #: main/lineswidget.cpp:233 msgctxt "@title:column" msgid "Show Time" msgstr "Mostrar" #: main/lineswidget.cpp:234 msgctxt "@title:column" msgid "Hide Time" msgstr "Ocultar" #: main/lineswidget.cpp:235 msgctxt "@title:column Subtitle line (primary) text" msgid "Text" msgstr "Texto" #: main/lineswidget.cpp:236 msgctxt "@title:column Subtitle line translation text" msgid "Translation" msgstr "Tradução" #: main/lineswidget.cpp:1141 msgid "Texts" msgstr "Textos" #: main/lineswidget.cpp:1162 msgid "Styles" msgstr "Estilos" #: main/lineswidget.cpp:1166 widgets/simplerichtextedit.cpp:119 msgctxt "@action:inmenu Toggle bold style" msgid "Bold" msgstr "Negrito" #: main/lineswidget.cpp:1173 widgets/simplerichtextedit.cpp:125 msgctxt "@action:inmenu Toggle italic style" msgid "Italic" msgstr "Itálico" #: main/lineswidget.cpp:1180 widgets/simplerichtextedit.cpp:131 msgctxt "@action:inmenu Toggle underline style" msgid "Underline" msgstr "Sublinhado" #: main/lineswidget.cpp:1187 widgets/simplerichtextedit.cpp:137 msgctxt "@action:inmenu Toggle strike through style" msgid "Strike Through" msgstr "Tachado" #: main/lineswidget.cpp:1194 msgid "Times" msgstr "Tempos" #: main/lineswidget.cpp:1196 msgid "Shift +%1 Milliseconds" msgstr "Deslocar +%1 milisegundos" #: main/lineswidget.cpp:1197 msgid "Shift -%1 Milliseconds" msgstr "Deslocar -%1 milisegundos" #: main/lineswidget.cpp:1207 msgid "Errors" msgstr "Erros" #: main/lineswidget.cpp:1208 msgid "Mark" msgstr "Marcar" #: main/main.cpp:43 msgid "Subtitle Composer" msgstr "Criador de Legenda" #: main/main.cpp:45 msgid "A KDE subtitle editor." msgstr "Um editor de legenda para KDE" #: main/main.cpp:47 msgid "(C) 2007-2009 Sergio Pistone" msgstr "(C) 2007-2009 Sergio Pistone" #: main/main.cpp:51 msgid "Sergio Pistone" msgstr "Sergio Pistone" #: main/main.cpp:52 msgid "Author & maintainer" msgstr "Autor e mantenedor" #: main/main.cpp:61 msgid "Open location as primary subtitle" msgstr "Abrir localização da legenda primária" #: main/main.cpp:62 msgid "Open location as translation subtitle" msgstr "Abrir localização da legenda traduzida" #: main/playerwidget.cpp:103 msgid "Position" msgstr "Posição" #: main/playerwidget.cpp:111 msgid "Length" msgstr "Comprimento" #: main/playerwidget.cpp:116 msgid "FPS" msgstr "FPS" #: main/playerwidget.cpp:704 main/playerwidget.cpp:705 #: main/playerwidget.cpp:706 main/playerwidget.cpp:778 #: main/playerwidget.cpp:795 main/playerwidget.cpp:802 msgid "Unknown" msgstr "Desconhecido" #: main/playerwidget.cpp:715 msgid "There was an error opening file
%1
" msgstr "Ocorreu um erro ao abrir o arquivo
%1
" #: main/playerwidget.cpp:741 msgid "Unexpected error while playing file." msgstr "Erro inesperado ao reproduzir o arquivo." #: main/scripting/scriptsmanager.cpp:70 msgid "Installed Scripts" msgstr "" #: main/scripting/scriptsmanager.cpp:88 msgid "Information" msgstr "" #: main/scripting/scriptsmanager.cpp:94 msgid "Warning" msgstr "" #: main/scripting/scriptsmanager.cpp:100 #, fuzzy msgid "Error" msgstr "Erros" #: main/scripting/scriptsmanager.cpp:113 msgid "Scripts Manager" msgstr "" #: main/scripting/scriptsmanager.cpp:129 msgid "Create..." msgstr "Criar..." #: main/scripting/scriptsmanager.cpp:130 msgid "Creates a new script file." msgstr "Cria um novo arquivo script." #: main/scripting/scriptsmanager.cpp:135 msgid "Add..." msgstr "Adicionar..." #: main/scripting/scriptsmanager.cpp:136 msgid "Copies an existing script from a specified location." msgstr "" #: main/scripting/scriptsmanager.cpp:142 msgid "Sends the selected script to the trash." msgstr "" #: main/scripting/scriptsmanager.cpp:147 msgid "Edit" msgstr "Editar" #: main/scripting/scriptsmanager.cpp:148 msgid "Opens the selected script with an external editor." msgstr "" #: main/scripting/scriptsmanager.cpp:154 msgid "Run" msgstr "" #: main/scripting/scriptsmanager.cpp:155 msgid "Executes the selected script." msgstr "" #: main/scripting/scriptsmanager.cpp:160 msgid "Refresh" msgstr "" #: main/scripting/scriptsmanager.cpp:161 msgid "Reloads the installed scripts list." msgstr "" #: main/scripting/scriptsmanager.cpp:219 main/scripting/scriptsmanager.cpp:301 msgid "" "You must enter an unused name to continue.\n" "Would you like to enter another name?" msgstr "" #: main/scripting/scriptsmanager.cpp:220 main/scripting/scriptsmanager.cpp:302 msgid "Name Already Used" msgstr "" #: main/scripting/scriptsmanager.cpp:226 msgid "Create New Script" msgstr "" #: main/scripting/scriptsmanager.cpp:226 main/scripting/scriptsmanager.cpp:308 msgid "Script name:" msgstr "" #: main/scripting/scriptsmanager.cpp:239 msgid "There was an error creating the file %1." msgstr "Ocorreu um erro ao criar o arquivo %1. " #: main/scripting/scriptsmanager.cpp:283 msgid "Select Existing Script" msgstr "" #: main/scripting/scriptsmanager.cpp:308 msgid "Rename Script" msgstr "" #: main/scripting/scriptsmanager.cpp:322 msgid "There was an error opening the file %1." msgstr "Ocorreu um erro ao abrir o arquivo %1." #: main/scripting/scriptsmanager.cpp:331 msgid "There was an error copying the file to %1." msgstr "Ocorreu um erro ao copiar o arquivo para %1. " #: main/scripting/scriptsmanager.cpp:350 msgid "Do you really want to send file %1 to the trash?" msgstr "" #: main/scripting/scriptsmanager.cpp:351 msgid "Move to Trash" msgstr "" #: main/scripting/scriptsmanager.cpp:359 msgid "There was an error removing the file %1." msgstr "Ocorreu um erro ao remover o arquivo %1." #: main/scripting/scriptsmanager.cpp:377 msgid "Could not launch external editor.\n" msgstr "" #: main/scripting/scriptsmanager.cpp:441 main/scripting/scriptsmanager.cpp:448 msgid "Error Running Script" msgstr "" #: main/scripting/scriptsmanager.cpp:462 msgid "Tools" msgstr "Ferramentas" #: main/utils/errorfinder.cpp:40 main/utils/errorfinder.cpp:221 #: main/utils/errorfinder.cpp:244 msgid "Find Error" msgstr "Localizar Erro" #: main/utils/errorfinder.cpp:42 msgid "Errors to Find" msgstr "Erros a localizar" #: main/utils/errorfinder.cpp:45 msgid "Options" msgstr "Opções" #: main/utils/errorfinder.cpp:51 msgid "From current line" msgstr "A partir de linha atual" #: main/utils/errorfinder.cpp:55 msgid "Find backwards" msgstr "Localizar para trás" #: main/utils/errorfinder.cpp:216 main/utils/finder.cpp:298 #: main/utils/replacer.cpp:258 msgid "" "Beginning of selection reached.\n" "Continue from the end?" msgstr "" "Início da seleção alcançada.\n" "Continuar do final?" #: main/utils/errorfinder.cpp:217 main/utils/finder.cpp:299 #: main/utils/replacer.cpp:259 msgid "" "Beginning of subtitle reached.\n" "Continue from the end?" msgstr "" "Início da legenda alcançada.\n" "Continuar do final?" #: main/utils/errorfinder.cpp:219 main/utils/finder.cpp:301 #: main/utils/replacer.cpp:261 msgid "" "End of selection reached.\n" "Continue from the beginning?" msgstr "" "Fim da seleção alcançada.\n" "Continuar do início?" #: main/utils/errorfinder.cpp:220 main/utils/finder.cpp:302 #: main/utils/replacer.cpp:262 main/utils/speller.cpp:143 msgid "" "End of subtitle reached.\n" "Continue from the beginning?" msgstr "" "Fim da legenda alcançada.\n" "Continuar do início?" #: main/utils/errorfinder.cpp:243 msgid "No errors matching given criteria found!" msgstr "" #: main/utils/finder.cpp:55 msgid "Find In" msgstr "Localizar no" #: main/utils/finder.cpp:278 main/utils/replacer.cpp:234 msgid "No instances of '%1' found!" msgstr "Nenhuma ocorrrência de '%1' encontrado!" #: main/utils/finder.cpp:279 main/utils/finder.cpp:303 msgid "Find" msgstr "Localizar" #: main/utils/kreplace.cpp:49 main/utils/kreplace.cpp:53 #: main/utils/replacer.cpp:172 main/utils/replacer.cpp:229 #: main/utils/replacer.cpp:235 main/utils/replacer.cpp:263 msgid "Replace" msgstr "Substituir" #: main/utils/kreplace.cpp:51 msgid "&All" msgstr "&Todos" #: main/utils/kreplace.cpp:52 msgid "&Skip" msgstr "&Pular" #: main/utils/kreplace.cpp:63 msgid "Replace '%1' with '%2'?" msgstr "Substituir '%1' com '%2'?" #: main/utils/kreplace.cpp:139 main/utils/kreplace.cpp:406 msgid "No text was replaced." msgstr "Nenhum texto foi substituído." #: main/utils/kreplace.cpp:141 main/utils/kreplace.cpp:408 #: main/utils/replacer.cpp:228 main/utils/replacer.cpp:255 msgid "1 replacement done." msgid_plural "%1 replacements done." msgstr[0] "1 substituição feita." msgstr[1] "%1 substituições feitas." #: main/utils/kreplace.cpp:413 msgid "Beginning of document reached." msgstr "Início do documento alcançado." #: main/utils/kreplace.cpp:415 msgid "End of document reached." msgstr "Fim do documento alcançado." #: main/utils/kreplace.cpp:422 msgid "Do you want to restart search from the end?" msgstr "Deseja reiniciar procura do fim?" #: main/utils/kreplace.cpp:423 msgid "Do you want to restart search at the beginning?" msgstr "Deseja reiniciar procura do início?" #: main/utils/kreplace.cpp:425 msgid "Restart" msgstr "Reiniciar" #: main/utils/language.cpp:125 msgid "Automatic" msgstr "Automático" #: main/utils/language.cpp:129 msgctxt "Official language of the Philippines, aka Filipino" msgid "Tagalog" msgstr "Tagalo" #: main/utils/replacer.cpp:53 msgid "Find/Replace In" msgstr "Localizar/substituir no" #: main/utils/speller.cpp:144 msgid "Spell Checking" msgstr "Verficação Ortográfica" #: main/utils/translator.cpp:167 msgid "Operation cancelled by user" msgstr "" #: main/utils/translator.cpp:270 main/utils/translator.cpp:280 msgid "Unexpected contents received from translation service" msgstr "" #: player/gstreamer/gstreamerbackend.cpp:543 #: player/mplayer/mplayerbackend.cpp:259 player/xine/xinebackend.cpp:278 msgid "Audio Stream #%1" msgstr "Fluxo de áudio #%1" #: player/gstreamer/gstreamerconfigwidget.cpp:34 msgctxt "@title:group GStreamer sinks settings" msgid "Sinks" msgstr "Pias" #: player/gstreamer/gstreamerconfigwidget.cpp:37 msgid "Audio sink:" msgstr "Saída de áudio:" #: player/gstreamer/gstreamerconfigwidget.cpp:46 msgid "Video sink:" msgstr "Saída de vídeo:" #: player/mplayer/mplayerconfigwidget.cpp:40 msgid "Executable path:" msgstr "Caminho do arquivo executável:" #: player/mplayer/mplayerconfigwidget.cpp:43 msgid "Select the MPlayer executable" msgstr "Selecionar executável do MPlayer" #: player/mplayer/mplayerconfigwidget.cpp:47 msgctxt "@title:group Video settings" msgid "Video" msgstr "Vídeo" #: player/mplayer/mplayerconfigwidget.cpp:50 msgid "Video output driver:" msgstr "Driver de saída de vídeo:" #: player/mplayer/mplayerconfigwidget.cpp:58 msgid "Allow frame dropping" msgstr "Permitir perda de quadros" #: player/mplayer/mplayerconfigwidget.cpp:61 msgid "Allow hard frame dropping" msgstr "Permitir perda de quadros pronunciada" #: player/mplayer/mplayerconfigwidget.cpp:64 msgctxt "@title:group Audio settings" msgid "Audio" msgstr "Áudio" #: player/mplayer/mplayerconfigwidget.cpp:67 msgid "Audio output driver:" msgstr "Driver de saída de áudio:" #: player/mplayer/mplayerconfigwidget.cpp:75 msgid "A/V synchronization factor:" msgstr "Fator de sincronização A/V:" #: player/mplayer/mplayerconfigwidget.cpp:83 msgid "Volume normalization" msgstr "Normalização de volume" #: player/xine/xineconfigwidget.cpp:34 msgctxt "@title:group Xine drivers settings" msgid "Drivers" msgstr "" #: player/xine/xineconfigwidget.cpp:37 msgid "Audio driver:" msgstr "Driver de Áudio:" #: player/xine/xineconfigwidget.cpp:45 msgid "Video driver:" msgstr "Driver de Vídeo:" #: widgets/simplerichtextedit.cpp:84 msgid "Cut" msgstr "Cortar" #: widgets/simplerichtextedit.cpp:90 msgid "Copy" msgstr "Copiar" #: widgets/simplerichtextedit.cpp:96 msgid "Paste" msgstr "Colar" #: widgets/simplerichtextedit.cpp:102 msgid "Delete" msgstr "Excluir" #: widgets/simplerichtextedit.cpp:108 msgctxt "@action:inmenu Clear all text" msgid "Clear" msgstr "Limpar" #: widgets/simplerichtextedit.cpp:143 msgid "Check Spelling..." msgstr "Verificar Ortografia..." #: widgets/simplerichtextedit.cpp:147 msgid "Auto Spell Check" msgstr "Verificar Ortografia Automaticamente" #: widgets/simplerichtextedit.cpp:152 msgid "Allow Tabulations" msgstr "Permitir Tabulações" #: widgets/simplerichtextedit.cpp:491 msgid "Suggestions" msgstr "Sugestões" #: widgets/simplerichtextedit.cpp:492 msgid "Ignore" msgstr "Ignorar" #: widgets/simplerichtextedit.cpp:493 msgid "Add to Dictionary" msgstr "Adicionar para o Dicionário" #: widgets/simplerichtextedit.cpp:497 msgid "No suggestions" msgstr "Sem sugestões" #. i18n: file: main/subtitlecomposerui.rc:5 #. i18n: ectx: Menu (file) #: rc.cpp:3 msgid "&File" msgstr "&Arquivo" #. i18n: file: main/subtitlecomposerui.rc:16 #. i18n: ectx: Menu (translation) #: rc.cpp:6 msgid "Translation" msgstr "Tradução" #. i18n: file: main/subtitlecomposerui.rc:28 #. i18n: ectx: Menu (edit) #: rc.cpp:9 msgid "&Edit" msgstr "&Edição" #. i18n: file: main/subtitlecomposerui.rc:51 #. i18n: ectx: Menu (texts) #: rc.cpp:12 msgid "&Texts" msgstr "&Textos" #. i18n: file: main/subtitlecomposerui.rc:62 #. i18n: ectx: Menu (styles) #: rc.cpp:15 msgid "St&yles" msgstr "E&stilos" #. i18n: file: main/subtitlecomposerui.rc:69 #. i18n: ectx: Menu (times) #: rc.cpp:18 msgid "T&imes" msgstr "T&empos" #. i18n: file: main/subtitlecomposerui.rc:91 #. i18n: ectx: Menu (errors) #: rc.cpp:21 msgid "E&rrors" msgstr "E&rros" #. i18n: file: main/subtitlecomposerui.rc:104 #. i18n: ectx: Menu (video) #: rc.cpp:24 msgid "&Video" msgstr "&Vídeo" #. i18n: file: main/subtitlecomposerui.rc:132 #. i18n: ectx: Menu (tools) #: rc.cpp:27 msgid "T&ools" msgstr "&Ferramentas" #. i18n: file: main/subtitlecomposerui.rc:137 #. i18n: ectx: Menu (audiolevels) #: rc.cpp:30 msgid "&Audio Levels" msgstr "Níveis de Á&udio" #. i18n: file: main/subtitlecomposerui.rc:153 #. i18n: ectx: ToolBar (mainToolBar) #: rc.cpp:33 msgid "Main Toolbar" msgstr "Barra de Ferramentas Principal" #. i18n: file: main/subtitlecomposerui.rc:165 #. i18n: ectx: ToolBar (editToolBar) #: rc.cpp:36 msgctxt "The toolbar name" msgid "Edit Toolbar" msgstr "Editar Barra de Ferramentas" #: rc.cpp:37 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Márcio P. Moraes" #: rc.cpp:38 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "marciopanto@gmail.com" #~ msgid "There was an error opening the audiolevels." #~ msgstr "Ocorreu um erro ao abrir os níveis de áudio." #~ msgid "Save AudioLevels" #~ msgstr "Salvar Níveis de Áudio" #~ msgid "There was an error saving the audiolevels." #~ msgstr "Ocorreu um erro ao salvar os níveis de áudio." #~ msgid "Toggle Line Mark" #~ msgstr "Alternar Marca de Linha" #~ msgctxt "@title:group" #~ msgid "Subtitles font" #~ msgstr "Fonte das legendas" #~ msgid "Size:" #~ msgstr "Tamanho:" #~ msgid "Append to" #~ msgstr "Anexar para" #~ msgid "1 mark" #~ msgid_plural "%1 marks" #~ msgstr[0] "1 marca" #~ msgstr[1] "%1 marcas" #~ msgid "Line Issues" #~ msgstr "Observações" #~ msgid "Marks" #~ msgstr "Marcas" #~ msgid "No line with errors found!" #~ msgstr "Nenhuma linha com erros encontrada!" subtitlecomposer-0.5.3/po/cs/0000755000175000001440000000000011206423743015356 5ustar sergiouserssubtitlecomposer-0.5.3/po/cs/CMakeLists.txt0000644000175000001440000000016611151345072020116 0ustar sergiousersFILE( GLOB _po_files *.po ) GETTEXT_PROCESS_PO_FILES( cs ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) subtitlecomposer-0.5.3/po/cs/subtitlecomposer.po0000644000175000001440000020501411206411600021310 0ustar sergiousers# translation of subtitlecomposer.po to Czech # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # Petr Gadula , 2009. # Goliash , 2009. # Sergio Pistone , 2009. msgid "" msgstr "" "Project-Id-Version: subtitlecomposer\n" "Report-Msgid-Bugs-To: https://sourceforge.net/tracker/?" "atid=1005652&group_id=208427&func=browse\n" "POT-Creation-Date: 2009-05-25 00:41-0300\n" "PO-Revision-Date: 2009-05-24 17:01-0300\n" "Last-Translator: Sergio Pistone \n" "Language-Team: American English \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Lokalize 0.3\n" #: core/subtitleactions.cpp:62 msgid "Set Frame Rate" msgstr "Nastav snímky za sekundu" #: core/subtitleactions.cpp:93 msgid "Insert Lines" msgstr "Vlož řádky" #: core/subtitleactions.cpp:177 core/subtitle.cpp:446 core/subtitle.cpp:460 #: core/subtitle.cpp:479 msgid "Remove Lines" msgstr "Odstraň řádky" #: core/subtitleactions.cpp:268 msgid "Move Line" msgstr "Přesuň řádky" #: core/subtitleactions.cpp:381 msgid "Swap Texts" msgstr "Vyměň texty" #: core/subtitle.cpp:66 msgid "Set Primary Data" msgstr "Nastav primární data" #: core/subtitle.cpp:121 msgid "Clear Primary Text Data" msgstr "Vymaž primární data" #: core/subtitle.cpp:134 msgid "Set Secondary Data" msgstr "Nastav sekundární data" #: core/subtitle.cpp:180 msgid "Clear Secondary Text Data" msgstr "Vymaž sekundární data" #: core/subtitle.cpp:265 main/dialogs/changeframeratedialog.cpp:34 msgid "Change Frame Rate" msgstr "Změň snímky za sekundu" #: core/subtitle.cpp:395 core/subtitle.cpp:412 msgid "Insert Line" msgstr "Vlož řádek" #: core/subtitle.cpp:533 main/application.cpp:662 main/lineswidget.cpp:1226 msgid "Split Lines" msgstr "Rozděl řádky" #: core/subtitle.cpp:590 main/application.cpp:670 main/lineswidget.cpp:1225 msgid "Join Lines" msgstr "Spoj řádky" #: core/subtitle.cpp:642 msgid "Shift Lines" msgstr "Posuň řádky" #: core/subtitle.cpp:690 msgid "Adjust Lines" msgstr "Přizpůsob řádky" #: core/subtitle.cpp:700 main/application.cpp:2377 main/lineswidget.cpp:1200 msgid "Sort" msgstr "Třídit" #: core/subtitle.cpp:746 main/dialogs/durationlimitsdialog.cpp:33 msgid "Enforce Duration Limits" msgstr "Vnutit limity trvání" #: core/subtitle.cpp:791 main/application.cpp:2462 main/lineswidget.cpp:1203 msgid "Maximize Durations" msgstr "Maximalizuj trvání" #: core/subtitle.cpp:816 main/dialogs/autodurationsdialog.cpp:35 msgid "Set Automatic Durations" msgstr "Nastav automatické trvání" #: core/subtitle.cpp:856 main/dialogs/fixoverlappingtimesdialog.cpp:32 #: main/lineswidget.cpp:1204 msgid "Fix Overlapping Times" msgstr "Oprav překrývající se časy" #: core/subtitle.cpp:890 msgid "Fix Lines Punctuation" msgstr "Oprav interpunkci řádků" #: core/subtitle.cpp:986 msgid "Lower Case" msgstr "Malá písmena" #: core/subtitle.cpp:1020 msgid "Upper Case" msgstr "Velká písmena" #: core/subtitle.cpp:1054 msgid "Title Case" msgstr "Nadpis" #: core/subtitle.cpp:1091 msgid "Sentence Case" msgstr "Věty" #: core/subtitle.cpp:1142 main/dialogs/smarttextsadjustdialog.cpp:32 msgid "Break Lines" msgstr "Zalom řádky" #: core/subtitle.cpp:1150 main/application.cpp:2530 main/lineswidget.cpp:1146 msgid "Unbreak Lines" msgstr "Spoj řádky" #: core/subtitle.cpp:1158 main/application.cpp:2544 main/lineswidget.cpp:1152 msgid "Simplify Spaces" msgstr "Zjednoduš mezery" #: core/subtitle.cpp:1167 msgid "Synchronize Subtitles" msgstr "Synchronizuj titulky" #: core/subtitle.cpp:1190 main/dialogs/joinsubtitlesdialog.cpp:35 msgid "Join Subtitles" msgstr "Spoj titulky" #: core/subtitle.cpp:1236 core/subtitle.cpp:1242 msgid "Split Subtitles" msgstr "Rozděl titulky" #: core/subtitle.cpp:1259 core/subtitle.cpp:1274 msgid "Set Lines Style" msgstr "Nastav styl řádků" #: core/subtitle.cpp:1291 msgid "Toggle Lines Style" msgstr "Přepni styl řádků" #: core/subtitle.cpp:1304 msgid "Set Lines Mark" msgstr "Nastav značku" #: core/subtitle.cpp:1304 msgid "Clear Lines Mark" msgstr "Smaž značku" #: core/subtitle.cpp:1318 msgid "Toggle Lines Mark" msgstr "Přepni značku" #: core/subtitle.cpp:1328 main/application.cpp:2261 main/application.cpp:2271 #: main/errorswidget.cpp:854 msgid "Clear Lines Errors" msgstr "Vymaž chyby řádků" #: core/subtitle.cpp:1338 core/subtitle.cpp:1358 main/application.cpp:2194 #: main/application.cpp:2239 msgid "Check Lines Errors" msgstr "Zkontroluj chyby na řádcích" #: core/subtitlelineactions.cpp:65 msgid "Set Line Text" msgstr "Zapiš text" #: core/subtitlelineactions.cpp:101 msgid "Set Line Secondary Text" msgstr "Zapiš druhotný text" #: core/subtitlelineactions.cpp:137 msgid "Set Line Texts" msgstr "Zapiš texty" #: core/subtitlelineactions.cpp:218 msgid "Set Line Show Time" msgstr "Nastav čas zobrazení" #: core/subtitlelineactions.cpp:254 msgid "Set Line Hide Time" msgstr "Nastav čas skrytí" #: core/subtitlelineactions.cpp:371 msgid "Set Line Errors" msgstr "Nastav chyby" #: core/subtitleline.cpp:72 msgid "Empty text" msgstr "Prázdný" #: core/subtitleline.cpp:74 msgid "Too many characters" msgstr "Příliš mnoho znaků" #: core/subtitleline.cpp:76 msgid "Too many lines" msgstr "Příliš mnoho řádků" #: core/subtitleline.cpp:78 msgid "Unnecessary white space" msgstr "Mezery navíc" #: core/subtitleline.cpp:80 msgid "Unnecessary dash" msgstr "Nadbytečná pomlčka" #: core/subtitleline.cpp:82 msgid "Capital letter after continuation ellipsis" msgstr "Chybí velké písmeno po konci řádku" #: core/subtitleline.cpp:84 msgid "Too long duration per character" msgstr "Příliš dlouhé trvání na počet písmen" #: core/subtitleline.cpp:86 msgid "Too short duration per character" msgstr "Příliš krátké trvání na počet písmen " #: core/subtitleline.cpp:88 msgid "Too long duration" msgstr "Příliš dlouhé trvání" #: core/subtitleline.cpp:89 msgid "Too short duration" msgstr "Příliš krátké trvání" #: core/subtitleline.cpp:90 msgid "Overlapping times" msgstr "Překrývající se časování" #: core/subtitleline.cpp:91 msgid "Untranslated text" msgstr "Nepřeložený text" #: core/subtitleline.cpp:92 msgid "User mark" msgstr "Uživatelské značky" #: core/subtitleline.cpp:112 msgid "Has no primary text." msgstr "Nemá primární text." #: core/subtitleline.cpp:116 msgid "Has no translation text." msgstr "Nemá přeložený text." #: core/subtitleline.cpp:120 msgid "Has too many characters in primary text (1 char)." msgid_plural "Has too many characters in primary text (%1 chars)." msgstr[0] "Má příliš mnoho znaků v primárním textu (1 znak)." msgstr[1] "Má příliš mnoho znaků v primárním textu (%1 znaků)." #: core/subtitleline.cpp:126 msgid "Has too many characters in translation text (1 char)." msgid_plural "Has too many characters in translation text (%1 chars)." msgstr[0] "Má příliš mnoho znaků v přeloženém textu (1 znak)." msgstr[1] "Má příliš mnoho znaků v přeloženém textu (%1 znak)." #: core/subtitleline.cpp:132 msgid "Has too many lines in primary text (1 line)." msgid_plural "Has too many lines in primary text (%1 lines)." msgstr[0] "Má příliš mnoho řádků v primárním textu (1 řádek)." msgstr[1] "Má příliš mnoho řádků v primárním textu (%1 řádků)." #: core/subtitleline.cpp:138 msgid "Has too many lines in translation text (1 line)." msgid_plural "Has too many lines in translation text (%1 lines)." msgstr[0] "Má přiliš mnoho řádků v překladu (1 řádek)." msgstr[1] "Má přiliš mnoho řádků v překladu (%1 řádků)." #: core/subtitleline.cpp:144 msgid "Has unnecessary spaces in primary text." msgstr "Má nadbytečné mezery v primárním textu." #: core/subtitleline.cpp:148 msgid "Has unnecessary spaces in translation text." msgstr "Má nadbytečné mezery v překladu." #: core/subtitleline.cpp:152 msgid "Has unnecessary dash in primary text." msgstr "Obsahuje nadbytečné pomlčky v primárním textu." #: core/subtitleline.cpp:156 msgid "Has unnecessary dash in translation text." msgstr "Obsahuje nadbytečné pomlčky v překladu." #: core/subtitleline.cpp:160 msgid "Has capital letter after line continuation ellipsis in primary text." msgstr "Has capital letter after line continuation ellipsis in primary text." #: core/subtitleline.cpp:164 msgid "" "Has capital letter after line continuation ellipsis in translation text." msgstr "" "Has capital letter after line continuation ellipsis in translation text." #: core/subtitleline.cpp:168 msgid "Has too long duration per character in primary text (1 msec/char)." msgid_plural "" "Has too long duration per character in primary text (%1 msecs/char)." msgstr[0] "Trvá příliš dlouho na počet znaků v primárním textu (1 ms/znak)." msgstr[1] "Trvá příliš dlouho na počet znaků v primárním textu (%1 ms/znak)." #: core/subtitleline.cpp:174 msgid "Has too long duration per character in translation text (1 msec/char)." msgid_plural "" "Has too long duration per character in translation text (%1 msecs/char)." msgstr[0] "Trvá příliš dlouho na počet znaků v překladu (1 ms/znak)." msgstr[1] "Trvá příliš dlouho na počet znaků v překladu (%1 ms/znak)." #: core/subtitleline.cpp:180 msgid "Has too short duration per character in primary text (1 msec/char)." msgid_plural "" "Has too short duration per character in primary text (%1 msecs/char)." msgstr[0] "" "Zobrazuje se příliš krátce na počet znaků v primárním textu (1 ms/znak)." msgstr[1] "" "Zobrazuje se příliš krátce na počet znaků v primárním textu (%1 ms/znak)." #: core/subtitleline.cpp:186 msgid "Has too short duration per character in translation text (1 msec/char)." msgid_plural "" "Has too short duration per character in translation text (%1 msecs/char)." msgstr[0] "Zobrazuje se příliš krátce na počet znaků v překladu (1 ms/znak)." msgstr[1] "Zobrazuje se příliš krátce na počet znaků v překladu (%1 ms/znak)." #: core/subtitleline.cpp:192 msgid "Has too long duration (1 msec)." msgid_plural "Has too long duration (%1 msecs)." msgstr[0] "Trvá příliš dlouze (1 ms)." msgstr[1] "Trvá příliš dlouze (%1 ms)." #: core/subtitleline.cpp:198 msgid "Has too short duration (1 msec)." msgid_plural "Has too short duration (%1 msecs)." msgstr[0] "Zobrazuje se příliš krátce (1 ms)." msgstr[1] "Zobrazuje se příliš krátce (%1 ms)." #: core/subtitleline.cpp:204 msgid "Overlaps with next line." msgstr "Překrývá se s dalším řádkem." #: core/subtitleline.cpp:208 msgid "Has untranslated text." msgstr "Nemá přeložený text." #: core/subtitleline.cpp:212 msgid "Has user mark." msgstr "Obsahuje uživatelskou značku." #: core/subtitleline.cpp:680 msgid "Set Line Times" msgstr "Nastav časování řádku" #: core/subtitleline.cpp:691 msgid "Shift Line Times" msgstr "Posuň časování řádku" #: core/subtitleline.cpp:705 msgid "Adjust Line Times" msgstr "Přizpůsob časování řádku" #: main/actions/krecentfilesactionext.cpp:37 msgid "Clear History" msgstr "Vymaž historii" #: main/application.cpp:415 msgid "Video Files" msgstr "Video soubory" #: main/application.cpp:423 msgid "Audio Files" msgstr "Zvukové soubory" #: main/application.cpp:425 msgid "Media Files" msgstr "Mediální soubory" #: main/application.cpp:426 msgid "All Files" msgstr "Všechny soubory" #: main/application.cpp:442 msgid "Audio Levels Files" msgstr "Audio levels soubory" #: main/application.cpp:456 msgid "Exit the application" msgstr "Ukonči program" #: main/application.cpp:460 msgid "Configure Subtitle Composer" msgstr "Nastavení Subtitle Composeru" #: main/application.cpp:465 msgctxt "@action:inmenu Create a new subtitle" msgid "New" msgstr "Nový" #: main/application.cpp:466 msgid "Create an empty subtitle" msgstr "Vytvoř prázdné titulky" #: main/application.cpp:475 msgctxt "@action:inmenu Open subtitle file" msgid "Open..." msgstr "Otevři..." #: main/application.cpp:476 main/application.cpp:486 msgid "Open subtitle file" msgstr "Otevři soubor s titulky" #: main/application.cpp:485 msgctxt "@action:inmenu Open rencently used subtitle file" msgid "Open &Recent" msgstr "Otevři &nedávný" #: main/application.cpp:493 msgid "Save" msgstr "Ulož" #: main/application.cpp:494 msgid "Save opened subtitle" msgstr "Ulož otevřené titulky" #: main/application.cpp:503 msgid "Save As..." msgstr "Ulož jako..." #: main/application.cpp:504 msgid "Save opened subtitle with different settings" msgstr "Ulož otevřené titulky s jiným nastavením" #: main/application.cpp:512 msgid "Close" msgstr "Zavři" #: main/application.cpp:513 msgid "Close opened subtitle" msgstr "Zavři otevřené titulky" #: main/application.cpp:522 msgid "New Translation" msgstr "Nový překlad" #: main/application.cpp:523 msgid "Create an empty translation subtitle" msgstr "Vytvoř prázdný překlad" #: main/application.cpp:532 msgid "Open Translation..." msgstr "Otevři překlad..." #: main/application.cpp:533 main/application.cpp:543 msgid "Open translation subtitle file" msgstr "Otevři soubor s překladem" #: main/application.cpp:542 msgid "Open &Recent Translation" msgstr "Otevři &nedávný překlad" #: main/application.cpp:551 msgid "Save Translation" msgstr "Ulož překlad" #: main/application.cpp:552 msgid "Save opened translation subtitle" msgstr "Ulož otevřený překlad" #: main/application.cpp:561 msgid "Save Translation As..." msgstr "Ulož překlad jako..." #: main/application.cpp:562 msgid "Save opened translation subtitle with different settings" msgstr "Ulož otevřený překlad s jiným nastavením" #: main/application.cpp:570 msgid "Close Translation" msgstr "Zavři překlad" #: main/application.cpp:571 msgid "Close opened translation subtitle" msgstr "Zavři otevřený překlad" #: main/application.cpp:580 msgid "Reload As..." msgstr "Znovu otevři jako..." #: main/application.cpp:581 main/application.cpp:592 msgid "Reload opened file with a different encoding" msgstr "Znovu otevři s jiným kódováním" #: main/application.cpp:591 msgid "Quick Reload As..." msgstr "Rychle znovuotevři jako..." #: main/application.cpp:600 main/application.cpp:601 #: widgets/simplerichtextedit.cpp:72 msgid "Undo" msgstr "Zpět" #: main/application.cpp:610 main/application.cpp:611 #: widgets/simplerichtextedit.cpp:78 msgid "Redo" msgstr "Vpřed" #: main/application.cpp:619 msgid "Split Subtitle..." msgstr "Rozděl titulky..." #: main/application.cpp:620 msgid "Split the opened subtitle in two parts" msgstr "Rozděl otevřené titulky na dvě části" #: main/application.cpp:627 msgid "Join Subtitles..." msgstr "Spoj titulky..." #: main/application.cpp:628 msgid "Append to the opened subtitle another one" msgstr "Připoj k otevřeným další" #: main/application.cpp:635 main/lineswidget.cpp:1222 msgid "Insert Before" msgstr "Vlož před" #: main/application.cpp:636 msgid "Insert empty line before current one" msgstr "Vlož prázdný řádek před současný" #: main/application.cpp:644 main/lineswidget.cpp:1223 msgid "Insert After" msgstr "Vlož za" #: main/application.cpp:645 msgid "Insert empty line after current one" msgstr "Vlož prázdný řádek za současný" #: main/application.cpp:653 main/lineswidget.cpp:1221 #: main/scripting/scriptsmanager.cpp:141 msgid "Remove" msgstr "Odstraň" #: main/application.cpp:654 msgid "Remove selected lines" msgstr "Odstraň označené řádky" #: main/application.cpp:663 msgid "Split selected lines" msgstr "Rozděl označené řádky" #: main/application.cpp:671 msgid "Join selected lines" msgstr "Spoj označené řádky" #: main/application.cpp:678 main/dialogs/actionwitherrortargetsdialog.cpp:103 #: main/lineswidget.cpp:1219 widgets/simplerichtextedit.cpp:113 msgid "Select All" msgstr "Označ všechno" #: main/application.cpp:679 msgid "Select all lines" msgstr "Označ všechny řádky" #: main/application.cpp:687 msgid "Go to Line..." msgstr "Jdi na řádek..." #: main/application.cpp:688 msgid "Go to specified line" msgstr "Jdi na vybraný řádek" #: main/application.cpp:697 msgid "Find..." msgstr "Najdi..." #: main/application.cpp:698 msgid "Find occurrences of strings or regular expressions" msgstr "Najdi výskyt řetězce nebo regulárního výrazu" #: main/application.cpp:708 msgid "Find Next" msgstr "Najdi další" #: main/application.cpp:709 msgid "Find next occurrence of string or regular expression" msgstr "Najdi další výskyt řetězce nebo reg. výrazu" #: main/application.cpp:719 msgid "Find Previous" msgstr "Najdi předchozí" #: main/application.cpp:720 msgid "Find previous occurrence of string or regular expression" msgstr "Najdi předchozí výskyt řetězce nebo reg. výrazu" #: main/application.cpp:728 msgid "Replace..." msgstr "Nahraď" #: main/application.cpp:729 msgid "Replace occurrences of strings or regular expressions" msgstr "Nahraď výskyty řetězců nebo reg. výrazů" #: main/application.cpp:738 msgid "Retrocede current line" msgstr "Posuň zpět současný řádek" #: main/application.cpp:739 msgid "Makes the line before the current one active" msgstr "Označ předchozí řádek jako aktivní" #: main/application.cpp:748 msgid "Advance current line" msgstr "Posuň vpřed současný řádek" #: main/application.cpp:749 msgid "Makes the line after the current one active" msgstr "Označ následující řádek jako aktivní" #: main/application.cpp:757 main/errorsdialog.cpp:59 main/lineswidget.cpp:1212 msgid "Check Errors..." msgstr "Zkontroluj chyby..." #: main/application.cpp:758 msgid "Check for errors in the current subtitle" msgstr "Zkontroluj chyby v současných titulkách" #: main/application.cpp:766 main/errorsdialog.cpp:62 main/lineswidget.cpp:1213 msgid "Clear Errors..." msgstr "Vymaž chyby..." #: main/application.cpp:767 msgid "Clear errors from selected lines" msgstr "Vymaž chyby v označených řádcích" #: main/application.cpp:774 main/lineswidget.cpp:1215 msgid "Show Errors..." msgstr "Ukaž chyby..." #: main/application.cpp:775 msgid "Show errors information for the current subtitle" msgstr "Ukaž informace o chybách v současných titulkách" #: main/application.cpp:784 msgid "Find Error..." msgstr "Najdi chybu" #: main/application.cpp:785 msgid "Find lines with specified errors" msgstr "Najdi další řádek s chybami" #: main/application.cpp:795 msgid "Find Next Error" msgstr "Najdi další chybu" #: main/application.cpp:796 msgid "Find next line with specified errors" msgstr "Najdi další řádek s chybami" #: main/application.cpp:806 msgid "Find Previous Error" msgstr "Najdi předchozí chybu" #: main/application.cpp:807 msgid "Find previous line with specified errors" msgstr "Najdi předchozí řádek s chybami" #: main/application.cpp:816 main/lineswidget.cpp:1159 msgid "Spelling..." msgstr "Pravopis..." #: main/application.cpp:817 msgid "Check lines spelling" msgstr "Zkontroluj pravopis" #: main/application.cpp:824 msgid "Toggle Mark" msgstr "Přepni značku" #: main/application.cpp:825 msgid "Toggle selected lines mark" msgstr "Přepni značku na označených řádcích" #: main/application.cpp:834 main/currentlinewidget.cpp:92 msgid "Toggle Bold" msgstr "Přepni tučné" #: main/application.cpp:835 msgid "Toggle selected lines bold attribute" msgstr "Přepni tučný atribut na označených" #: main/application.cpp:844 main/currentlinewidget.cpp:97 msgid "Toggle Italic" msgstr "Přepni kurzívu" #: main/application.cpp:845 msgid "Toggle selected lines italic attribute" msgstr "Přepni kurzívu na označených" #: main/application.cpp:854 main/currentlinewidget.cpp:102 msgid "Toggle Underline" msgstr "Přepni podtržení" #: main/application.cpp:855 msgid "Toggle selected lines underline attribute" msgstr "Přepni podtržení na označených" #: main/application.cpp:864 main/currentlinewidget.cpp:107 msgid "Toggle Strike Through" msgstr "Přepni strike through" #: main/application.cpp:865 msgid "Toggle selected lines strike through attribute" msgstr "Přepni strike through na označených" #: main/application.cpp:873 main/lineswidget.cpp:1199 msgid "Shift..." msgstr "Posuň..." #: main/application.cpp:874 msgid "Shift lines an specified amount of time" msgstr "Posuň řádky o určitý čas" #: main/application.cpp:901 msgid "Adjust..." msgstr "Přizpůsob..." #: main/application.cpp:902 msgid "Linearly adjust all lines to a specified interval" msgstr "Přizpůsob všechny řádky lineárně podle zadaného intervalu" #: main/application.cpp:910 msgid "Sort..." msgstr "Třídit..." #: main/application.cpp:911 msgid "Sort lines based on their show time" msgstr "Seřaď řádky podle jejich zobrazení" #: main/application.cpp:918 msgid "Change Frame Rate..." msgstr "Změň počet snímku za sekundu" #: main/application.cpp:919 msgid "Retime subtitle lines by reinterpreting its frame rate" msgstr "Přečasuj titulky změnou FPS" #: main/application.cpp:926 main/lineswidget.cpp:1201 msgid "Enforce Duration Limits..." msgstr "Vnutit limity trvání..." #: main/application.cpp:927 msgid "Enforce lines minimum and/or maximum duration limits" msgstr "Vnuť maximální/minimální trvání řádků" #: main/application.cpp:935 main/lineswidget.cpp:1202 msgid "Set Automatic Durations..." msgstr "Nastav automatické trvání..." #: main/application.cpp:936 msgid "Set lines durations based on amount of letters, words and line breaks" msgstr "Nastav trvání podle počtu písmen, slov a zalomení řádků" #: main/application.cpp:943 msgid "Maximize Durations..." msgstr "Maximalizuj trvání..." #: main/application.cpp:944 msgid "Extend lines durations up to their next lines show time" msgstr "Rozšiř délku trvání až k zobrazení dalšího" #: main/application.cpp:951 msgid "Fix Overlapping Times..." msgstr "Oprav překrývající se časy" #: main/application.cpp:952 msgid "Fix lines overlapping times" msgstr "Oprav překrývající se časování" #: main/application.cpp:959 msgid "Synchronize with Subtitle..." msgstr "Synchronizuj s titulky..." #: main/application.cpp:960 msgid "Copy timing information from another subtitle" msgstr "Zkopíruj informaci o časování z jiných titulků" #: main/application.cpp:967 main/lineswidget.cpp:1142 msgid "Break Lines..." msgstr "Zalom řádky..." #: main/application.cpp:968 msgid "Automatically set line breaks" msgstr "Automaticky nastav zalomení" #: main/application.cpp:975 main/lineswidget.cpp:1145 msgid "Unbreak Lines..." msgstr "Spoj řádky..." #: main/application.cpp:976 msgid "Remove line breaks from lines" msgstr "Odstraň zalomení z řádků" #: main/application.cpp:983 main/lineswidget.cpp:1151 msgid "Simplify Spaces..." msgstr "Zjednoduš mezery..." #: main/application.cpp:984 msgid "Remove unneeded spaces from lines" msgstr "Odstraň nepotřebné mezery" #: main/application.cpp:991 main/lineswidget.cpp:1155 msgid "Change Case..." msgstr "Změň velikost..." #: main/application.cpp:992 msgid "Change lines text to upper, lower, title or sentence case" msgstr "Změň znaky na velká, malá, nadpis nebo věty" #: main/application.cpp:999 main/lineswidget.cpp:1156 msgid "Fix Punctuation..." msgstr "Oprav interpunkci..." #: main/application.cpp:1000 msgid "Fix punctuation errors in lines" msgstr "Oprav interpunkční chyby v řádcích" #: main/application.cpp:1007 main/lineswidget.cpp:1157 msgid "Translate..." msgstr "Otevři překlad..." #: main/application.cpp:1008 msgid "Translate lines texts using Google services" msgstr "Přelož řádky textu použitím Google služeb" #: main/application.cpp:1015 msgid "Edit Line in Place" msgstr "Uprav řádek" #: main/application.cpp:1016 msgid "Edit current line text in place" msgstr "Uprav současný řádek" #: main/application.cpp:1025 msgid "Open Video..." msgstr "Otevři video..." #: main/application.cpp:1026 main/application.cpp:1034 msgid "Open video file" msgstr "Otevři video soubor" #: main/application.cpp:1033 msgid "Open &Recent Video" msgstr "Otevři nedavné video" #: main/application.cpp:1041 msgid "Close Video" msgstr "Zavři video" #: main/application.cpp:1042 msgid "Close video file" msgstr "Zavři video soubor" #: main/application.cpp:1051 msgid "Full Screen Mode" msgstr "Celá obrazovka" #: main/application.cpp:1052 msgid "Toggle full screen mode" msgstr "Přepni na celou obrazovku" #: main/application.cpp:1060 main/utils/kreplace.cpp:425 msgid "Stop" msgstr "Zastav" #: main/application.cpp:1061 msgid "Stop video playback" msgstr "Zastav přehrávání videa" #: main/application.cpp:1069 main/application.cpp:3156 #: main/application.cpp:3163 msgid "Play" msgstr "Přehraj" #: main/application.cpp:1070 msgid "Toggle video playing/paused" msgstr "Přehrávání/pauza videa" #: main/application.cpp:1078 msgid "Seek Backwards" msgstr "Hledej nazpět" #: main/application.cpp:1087 msgid "Seek Forwards" msgstr "Hledej dopředu" #: main/application.cpp:1099 msgid "Jump to Previous Line" msgstr "Skoč na předchozí řádek" #: main/application.cpp:1100 msgid "Seek to previous subtitle line show time" msgstr "Hledej do zobrazení předchozícho titulku" #: main/application.cpp:1109 msgid "Jump to Next Line" msgstr "Skoč na další řádek" #: main/application.cpp:1110 msgid "Seek to next subtitle line show time" msgstr "Hledej do zobrazení následujícího titulku" #: main/application.cpp:1120 msgid "Set Current Line Show Time" msgstr "Nastav na řádek současný čas zobrazení z videa" #: main/application.cpp:1121 msgid "Set current line show time to video position" msgstr "Nastav na řádek současný čas zobrazení z videa" #: main/application.cpp:1131 msgid "Set Current Line Hide Time" msgstr "Nastav na řádek současný čas skrytí titulku" #: main/application.cpp:1132 msgid "Set current line hide time to video position" msgstr "Nastav na řádek současný čas skrytí z videa" #: main/application.cpp:1141 msgid "Current Line Follows Video" msgstr "Současný řádek následuje video" #: main/application.cpp:1142 msgid "Make current line follow the playing video position" msgstr "Současný řádek bude následovat pozici přehrávaného videa" #: main/application.cpp:1149 msgctxt "@action:inmenu Toggle audio muted" msgid "Mute" msgstr "Umlčet" #: main/application.cpp:1151 msgid "Enable/disable playback sound" msgstr "Zapnout/vypnout zvuk" #: main/application.cpp:1159 msgid "Increase Volume" msgstr "Zvýšit hlasitost" #: main/application.cpp:1160 msgid "Increase volume by 5%" msgstr "Snížit hlasitost o 5%" #: main/application.cpp:1168 msgid "Decrease Volume" msgstr "Snížit hlasitost" #: main/application.cpp:1169 msgid "Decrease volume by 5%" msgstr "Snížit hlasitost o 5%" #: main/application.cpp:1177 msgid "Audio Streams" msgstr "Zvukové stopy" #: main/application.cpp:1178 msgid "Select active audio stream" msgstr "Vyber aktivní zvukovou stopu" #: main/application.cpp:1186 msgid "Increase Font Size" msgstr "Zvětšit velikost písma" #: main/application.cpp:1187 msgid "Increase subtitles font size by 1 point" msgstr "Zvětšit velikost písma o 1 bod" #: main/application.cpp:1195 msgid "Decrease Font Size" msgstr "Snížit velikost písma" #: main/application.cpp:1196 msgid "Decrease subtitles font size by 1 point" msgstr "Snížit velikost písma o 1 bod" #: main/application.cpp:1204 msgid "Subtitle Streams" msgstr "Titulkové stopy" #: main/application.cpp:1205 msgid "Select active subtitle stream" msgstr "Vyber aktivní titulky" #: main/application.cpp:1212 msgid "Shift to Video Position" msgstr "Posuň na video pozici" #: main/application.cpp:1213 msgid "" "Set current line show time to video position by equally shifting all lines" msgstr "Nastav zobrazení řádku na současnou video pozici posunutím všech řádků" #: main/application.cpp:1221 msgid "Adjust to Video Position (Anchor Last Line)" msgstr "Přiřaď k pozici videa (ukotvi poslední řádek)" #: main/application.cpp:1222 msgid "" "Set current line to video position by fixing the last line and linearly " "adjusting the other ones" msgstr "" "Přiřaď současný řádek k video pozici upevněním posledního řádku a lineárním " "seřízením ostatních" #: main/application.cpp:1230 msgid "Adjust to Video Position (Anchor First Line)" msgstr "Přiřaď k pozici videa (ukotvi první řádek)" #: main/application.cpp:1231 msgid "" "Set current line to video position by fixing the first line and linearly " "adjusting the other ones" msgstr "" "Přiřaď současný řádek k video pozici upevněním prvního řádku a lineárním " "seřízením ostatních" #: main/application.cpp:1240 msgctxt "@action:inmenu Manage user scripts" msgid "Scripts Manager..." msgstr "Správce skriptů..." #: main/application.cpp:1241 msgid "Manage user scripts" msgstr "Spravuj uživatelské skripty" #: main/application.cpp:1365 msgid "" "The requested action would make the subtitle and its translation share the " "same file, possibly resulting in loss of information when saving.\n" "Are you sure you want to continue?" msgstr "" "Požadovaná akce by mohla způsobit, že titulkový soubor a překlad by " "používaly ten samý soubor. Je možné, že by se ztratila data, pokud budete " "trvat na uložení. Opravdu chcete pokračovat?" #: main/application.cpp:1366 msgid "Conflicting Subtitle Files" msgstr "Konflikt v titulkových souborech" #: main/application.cpp:1488 msgid "" "Could not parse the subtitle file.
This may have been caused by " "usage of the wrong encoding.
" msgstr "" "Nebylo možné přečíst titulkový soubor.
Mohlo to být způsobeno " "použitím špatného kódování.
" #: main/application.cpp:1519 msgid "There was an error saving the subtitle." msgstr "Vyskytla se chyba při ukládání titulků." #: main/application.cpp:1561 main/application.cpp:1770 msgid "" "Currently opened translation subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Současně otevřený překlad má neuložené změny.\n" "Chcete jej uložit?" #: main/application.cpp:1562 main/application.cpp:1771 msgid "Close Translation Subtitle" msgstr "Zavři překlad" #: main/application.cpp:1574 msgid "" "Currently opened subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Současně otevřené titulky mají neuložené změny.\n" "Chcete je uložit?" #: main/application.cpp:1575 msgid "Close Subtitle" msgstr "Zavři titulky" #: main/application.cpp:1678 msgctxt "@item:inmenu Display primary text in video player" msgid "Primary" msgstr "Primární" #: main/application.cpp:1679 msgctxt "@item:inmenu Display translation text in video player" msgid "Translation" msgstr "Překlad" #: main/application.cpp:1689 msgid "Could not parse the subtitle file." msgstr "Nebylo možné načíst titulky." #: main/application.cpp:1728 msgid "There was an error saving the translation subtitle." msgstr "Vyskytla se chyba při ukládání překladu." #: main/application.cpp:1864 msgid "Could not read the subtitle file to append." msgstr "Nebylo možné načíst titulky k připojení." #: main/application.cpp:1916 msgid "Could not write the splitted subtitle file." msgstr "Nebylo možné zapsat rozdělené titulky." #: main/application.cpp:1917 msgid "Could not write the splitted subtitle translation file." msgstr "Nebylo možné zapsat rozdělený překlad." #: main/application.cpp:1935 msgid "The specified time does not split the subtitles." msgstr "Požadovaný čas nerozdělil titulky." #: main/application.cpp:1984 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted part was saved as %1." msgstr "" "Nebylo možné otevřít nové okno Subtitle Composeru.\n" "Rozdělená část byla uložena jako %1." #: main/application.cpp:1989 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted parts were saved as %1 and %2." msgstr "" "Nebylo možné otevřít nové okno Subtitle Composeru.\n" "Rozdělené části byly uloženy jako %1 a %2." #: main/application.cpp:2077 msgid "Go to Line" msgstr "Jdi na řádek" #: main/application.cpp:2077 msgid "&Go to line:" msgstr "&Jdi na řádek:" #: main/application.cpp:2389 msgid "Can not perform sort on selection with multiple ranges." msgstr "Nebylo možné provést třídění s více rozsahy." #: main/application.cpp:2499 msgid "The reference subtitle must have more than one line to proceed." msgstr "Odkazované titulky musely mít více než jeden řádek." #: main/application.cpp:2511 msgid "Could not parse the reference subtitle file." msgstr "Nebylo možné načíst odkazované titulky." #: main/application.cpp:2618 main/dialogs/translatedialog.cpp:31 msgid "Translate" msgstr "Překlad" #: main/application.cpp:2619 msgid "Translating text (%1 to %2)..." msgstr "Překládám text (%1 do %2)..." #: main/application.cpp:2628 msgid "Translating primary text (%1 to %2)..." msgstr "Překládám primární text (%1 do %2)..." #: main/application.cpp:2629 msgid "Translating secondary text (%1 to %2)..." msgstr "Překládám sekundární text (%1 do %2)..." #: main/application.cpp:2661 msgid "" "Unable to perform texts synchronization (sent and received lines count do " "not match)." msgstr "" "Není možné provést synchronizaci textu (neshodují se počty poslaných a " "přijatých řádků)." #: main/application.cpp:2670 msgid "Translate Primary Text" msgstr "Přelož primární text" #: main/application.cpp:2671 msgid "Translate Secondary Text" msgstr "Přelož druhotný text" #: main/application.cpp:2687 msgid "" "There was an error performing the translation:\n" "\n" "%1" msgstr "" "Vyskytla se chyba při ukládání překladu:\n" "%1" #: main/application.cpp:2740 msgid "Open Video" msgstr "Otevři video" #: main/application.cpp:2873 main/application.cpp:2911 msgid "" "Continuing would result in loss of timing information for some lines.\n" "Are you sure you want to continue?" msgstr "" "Pokračovaní by mohlo způsobit ztrátu časovaní u některých řádků.\n" "Opravdu chcete pokračovat?" #: main/application.cpp:2929 msgid "Open AudioLevels" msgstr "Otevři AudioLevels" #: main/application.cpp:3035 msgid "modified" msgstr "změněn" #: main/application.cpp:3039 main/application.cpp:3050 msgid "Untitled" msgstr "Nepojmenovaný" #: main/application.cpp:3041 msgid "Untitled Translation" msgstr "Nepojmenovaný překlad" #: main/application.cpp:3149 msgid "Pause" msgstr "Pauza" #: main/application.cpp:3190 msgid "Seek backwards 1 second" msgid_plural "Seek backwards %1 seconds" msgstr[0] "Hledej zpětně 1 vteřinu." msgstr[1] "Hledej zpětně %1 vteřin." #: main/application.cpp:3196 msgid "Seek forwards 1 second" msgid_plural "Seek forwards %1 seconds" msgstr[0] "Hledej dopředu 1 vteřinu." msgstr[1] "Hledej dopředu %1 vteřin." #: main/application.cpp:3211 main/application.cpp:3223 msgid "Shift %21 Millisecond" msgid_plural "Shift %2%1 Milliseconds" msgstr[0] "Posuň %21 milisekundu" msgstr[1] "Posuň %2%1 milisekund" #: main/application.cpp:3216 main/application.cpp:3228 msgid "Shift selected lines %21 millisecond" msgid_plural "Shift selected lines %2%1 milliseconds" msgstr[0] "Posuň vybrané řádky %21 milisekundu" msgstr[1] "Posuň vybrané řádky %2%1 milisekund" #: main/configdialog.cpp:46 msgid "Configure" msgstr "Nastavení" #: main/configdialog.cpp:54 msgctxt "@title General settings" msgid "General" msgstr "Obecné" #: main/configdialog.cpp:55 msgid "General Settings" msgstr "Obecné nastavení" #: main/configdialog.cpp:59 msgctxt "@title Error checks settings" msgid "Error Checks" msgstr "Kontroly chyb" #: main/configdialog.cpp:60 msgid "Error Checks Settings" msgstr "Nastavení kontroly chyb" #: main/configdialog.cpp:64 msgctxt "@title Spelling settings" msgid "Spelling" msgstr "Pravopis" #: main/configdialog.cpp:65 msgid "Spelling Settings" msgstr "Nastavení pravopisu" #: main/configdialog.cpp:69 msgctxt "@title Player settings" msgid "Player" msgstr "Přehrávač" #: main/configdialog.cpp:70 msgid "Player Settings" msgstr "Nastavení přehrávače" #: main/configdialog.cpp:82 msgctxt "@title Player backend settings" msgid "%1 Backend Settings" msgstr "%1 nastavení backendu" #: main/configs/errorsconfigwidget.cpp:37 msgctxt "@title:group" msgid "Texts" msgstr "Texty" #: main/configs/errorsconfigwidget.cpp:40 msgid "Maximum number of characters:" msgstr "Maximální počet znaků:" #: main/configs/errorsconfigwidget.cpp:45 #: main/dialogs/smarttextsadjustdialog.cpp:40 msgid " characters" msgstr "znaky" #: main/configs/errorsconfigwidget.cpp:48 msgid "Maximum number of lines:" msgstr "Maximální počet řádků:" #: main/configs/errorsconfigwidget.cpp:53 msgid " lines" msgstr "řádky" #: main/configs/errorsconfigwidget.cpp:56 msgctxt "@title:group" msgid "Absolute Durations" msgstr "Absolutní délka trvání" #: main/configs/errorsconfigwidget.cpp:59 #: main/configs/errorsconfigwidget.cpp:78 msgid "Minimum duration:" msgstr "Minimální délka trvání:" #: main/configs/errorsconfigwidget.cpp:64 #: main/configs/errorsconfigwidget.cpp:72 #: main/configs/generalconfigwidget.cpp:52 #: main/configs/generalconfigwidget.cpp:66 #: main/configs/generalconfigwidget.cpp:74 #: main/dialogs/fixoverlappingtimesdialog.cpp:37 msgid " msecs" msgstr "ms" #: main/configs/errorsconfigwidget.cpp:67 #: main/configs/errorsconfigwidget.cpp:86 msgid "Maximum duration:" msgstr "Maximální délka trvání:" #: main/configs/errorsconfigwidget.cpp:75 msgctxt "@title:group" msgid "Relative Durations" msgstr "Relativní trvání" #: main/configs/errorsconfigwidget.cpp:83 #: main/configs/errorsconfigwidget.cpp:91 msgid " msecs/character" msgstr "ms/znak" #: main/configs/errorsconfigwidget.cpp:93 msgctxt "@title:group" msgid "Behavior" msgstr "Chování" #: main/configs/errorsconfigwidget.cpp:96 msgid "Automatically clear fixed errors" msgstr "Automaticky vymaž opravené chyby" #: main/configs/generalconfigwidget.cpp:38 #: main/configs/playerconfigwidget.cpp:44 #: player/mplayer/mplayerconfigwidget.cpp:37 msgctxt "@title:group General settings" msgid "General" msgstr "Obecné" #: main/configs/generalconfigwidget.cpp:41 msgid "Default encoding for opening subtitles:" msgstr "Defaultní kódování pro otevírané titulky:" #: main/configs/generalconfigwidget.cpp:47 msgid "On line double click, jump to show time minus:" msgstr "Při dvojkliku na titulek skoč na čas zobrazení mínus:" #: main/configs/generalconfigwidget.cpp:55 msgid "Automatically load video file when opening subtitle" msgstr "Automaticky zapni video při otevírání titulků" #: main/configs/generalconfigwidget.cpp:58 msgctxt "@title:group" msgid "Quick Actions" msgstr "Rychlé akce" #: main/configs/generalconfigwidget.cpp:61 msgid "Time shift for selected lines:" msgstr "Časový posun pro vybrané řádky:" #: main/configs/generalconfigwidget.cpp:69 msgid "Compensation for captured video times:" msgstr "Časová náhrada za nahrané video:" #: main/configs/playerconfigwidget.cpp:47 msgid "Player backend:" msgstr "Backend přehrávače:" #: main/configs/playerconfigwidget.cpp:53 msgid "Jump length on seek:" msgstr "Skoč o čas při hledání:" #: main/configs/playerconfigwidget.cpp:58 msgid " secs" msgstr "s" #: main/configs/playerconfigwidget.cpp:61 main/playerwidget.cpp:452 msgid "Show editable position control" msgstr "Zobraz prvek pro nastavení pozice" #: main/configs/playerconfigwidget.cpp:64 msgctxt "@title:group" msgid "Subtitles" msgstr "Titulky" #: main/configs/playerconfigwidget.cpp:67 msgctxt "@label:chooser The font family name" msgid "Font family:" msgstr "Typ písma:" #: main/configs/playerconfigwidget.cpp:72 msgid "Font size:" msgstr "Velikost písma:" #: main/configs/playerconfigwidget.cpp:77 msgid " points" msgstr "body" #: main/configs/playerconfigwidget.cpp:80 msgid "Primary color:" msgstr "Primární barva:" #: main/configs/playerconfigwidget.cpp:85 msgid "Outline color:" msgstr "Obrysová barva:" #: main/configs/playerconfigwidget.cpp:91 msgid "Outline width:" msgstr "Obrysová šířka:" #: main/configs/playerconfigwidget.cpp:96 msgid " pixels" msgstr "pixelů" #: main/configs/playerconfigwidget.cpp:99 msgctxt "@title:group" msgid "Subtitles Preview" msgstr "Náhled titulků" #: main/configs/playerconfigwidget.cpp:109 msgctxt "Text for previewing the subtitles font settings" msgid "

The Quick Brown Fox
Jumps Over The Lazy Dog

" msgstr "

Příliš žluťoučký kůň
úpěl ďábelské ódy

" #: main/currentlinewidget.cpp:65 msgid "Show" msgstr "Ukaž" #: main/currentlinewidget.cpp:70 msgid "Hide" msgstr "Skryj" #: main/currentlinewidget.cpp:75 msgid "Duration" msgstr "Trvání" #: main/currentlinewidget.cpp:253 main/currentlinewidget.cpp:259 msgid "No current line" msgstr "Žádný současný řádek" #: main/currentlinewidget.cpp:383 msgid "Current line:" msgstr "Současný řádek:" #: main/currentlinewidget.cpp:408 msgid "1 character" msgid_plural "%1 characters" msgstr[0] "1 znak" msgstr[1] "%1 znaků" #: main/dialogs/actionwitherrortargetsdialog.cpp:74 msgid "Available errors" msgstr "Dostupné chyby" #: main/dialogs/actionwitherrortargetsdialog.cpp:105 msgid "Select None" msgstr "Neoznač žádné" #: main/dialogs/actionwithtargetdialog.cpp:131 msgid "Target >>" msgstr "Cíl >>" #: main/dialogs/actionwithtargetdialog.cpp:131 #: main/dialogs/actionwithtargetdialog.cpp:149 msgid "Target <<" msgstr "Cíl <<" #: main/dialogs/actionwithtargetdialog.cpp:164 msgid "All lines" msgstr "Všechny řádky" #: main/dialogs/actionwithtargetdialog.cpp:165 main/utils/errorfinder.cpp:48 msgid "Selected lines" msgstr "Označené řádky" #: main/dialogs/actionwithtargetdialog.cpp:166 msgid "All lines from first selected" msgstr "Všechny řádky od prvního vybraného" #: main/dialogs/actionwithtargetdialog.cpp:167 msgid "All lines up to last selected" msgstr "Všechny řádky k poslednímu vybranému" #: main/dialogs/actionwithtargetdialog.cpp:257 main/utils/finder.cpp:63 #: main/utils/replacer.cpp:61 msgid "Both subtitles" msgstr "Obojí titulky" #: main/dialogs/actionwithtargetdialog.cpp:260 main/utils/finder.cpp:65 #: main/utils/replacer.cpp:63 msgid "Primary subtitle" msgstr "Primární titulky" #: main/dialogs/actionwithtargetdialog.cpp:263 main/utils/finder.cpp:67 #: main/utils/replacer.cpp:65 msgid "Translation subtitle" msgstr "Překlad" #: main/dialogs/actionwithtargetdialog.h:78 msgid "Apply To" msgstr "Použij" #: main/dialogs/adjusttimesdialog.cpp:32 msgid "Adjust" msgstr "Přizpůsob" #: main/dialogs/adjusttimesdialog.cpp:34 msgctxt "@title:group" msgid "New Times" msgstr "Nové časy" #: main/dialogs/adjusttimesdialog.cpp:39 msgid "First spoken line:" msgstr "První mluvený řádek:" #: main/dialogs/adjusttimesdialog.cpp:45 msgid "Last spoken line:" msgstr "Poslední mluvený řádek:" #: main/dialogs/autodurationsdialog.cpp:38 #: main/dialogs/changeframeratedialog.cpp:36 #: main/dialogs/fixoverlappingtimesdialog.cpp:34 #: main/dialogs/fixpunctuationdialog.cpp:33 #: main/dialogs/smarttextsadjustdialog.cpp:34 #: main/dialogs/splitsubtitledialog.cpp:38 main/dialogs/translatedialog.cpp:33 msgctxt "@title:group" msgid "Settings" msgstr "Nastavení" #: main/dialogs/autodurationsdialog.cpp:46 msgid "Milliseconds per line:" msgstr "Milisekund na řádek:" #: main/dialogs/autodurationsdialog.cpp:55 msgid "Milliseconds per word:" msgstr "Milisekund na slovo:" #: main/dialogs/autodurationsdialog.cpp:64 msgid "Milliseconds per character:" msgstr "Milisekund na znak:" #: main/dialogs/autodurationsdialog.cpp:68 #: main/dialogs/durationlimitsdialog.cpp:45 msgid "Prevent overlapping" msgstr "Předcházej překrývání" #: main/dialogs/autodurationsdialog.cpp:71 msgctxt "@title:group" msgid "Duration Calculation" msgstr "Výpočet trvání" #: main/dialogs/autodurationsdialog.cpp:77 msgid "Use primary text" msgstr "Použij primární text" #: main/dialogs/autodurationsdialog.cpp:78 msgid "Use translation text" msgstr "Použij překlad" #: main/dialogs/autodurationsdialog.cpp:79 msgid "Calculate both and use maximum" msgstr "Vypočítej obojí a použij maximum" #: main/dialogs/changeframeratedialog.cpp:45 msgid "Current frame rate:" msgstr "Současný počet snímků za vteřinu:" #: main/dialogs/changeframeratedialog.cpp:54 msgid "New frame rate:" msgstr "Nový počet snímků za vteřinu:" #: main/dialogs/changetextscasedialog.cpp:33 msgid "Change Case" msgstr "Změň písmo" #: main/dialogs/changetextscasedialog.cpp:35 msgctxt "@title:group" msgid "Change To" msgstr "Změň na" #: main/dialogs/changetextscasedialog.cpp:39 msgid "Lower case" msgstr "Malá písmena" #: main/dialogs/changetextscasedialog.cpp:44 msgid "Upper case" msgstr "Velká písmena" #: main/dialogs/changetextscasedialog.cpp:48 msgid "Title case" msgstr "Nadpis" #: main/dialogs/changetextscasedialog.cpp:52 msgid "Sentence case" msgstr "Věty" #: main/dialogs/changetextscasedialog.cpp:56 msgid "Convert to lower case first" msgstr "Nejdříve předělej na malá" #: main/dialogs/checkerrorsdialog.cpp:31 msgid "Check Errors" msgstr "Zkontroluj chyby" #: main/dialogs/checkerrorsdialog.cpp:33 msgctxt "@title:group" msgid "Errors to Check" msgstr "Chyby ke zkontrolování" #: main/dialogs/checkerrorsdialog.cpp:36 msgctxt "@title:group Miscellaneous settings" msgid "Miscellaneous" msgstr "Různé" #: main/dialogs/checkerrorsdialog.cpp:39 msgid "Clear other errors" msgstr "Vymaž ostatní chyby" #: main/dialogs/checkerrorsdialog.cpp:43 msgid "Clear user marks" msgstr "Vymaž uživatelské značky" #: main/dialogs/clearerrorsdialog.cpp:32 msgid "Clear Errors" msgstr "Vymaž chyby" #: main/dialogs/clearerrorsdialog.cpp:34 msgctxt "@title:group" msgid "Errors to Clear" msgstr "Chyby k vymazání" #: main/dialogs/durationlimitsdialog.cpp:35 msgctxt "@title:group" msgid "Minimum Duration" msgstr "Minimální trvání" #: main/dialogs/durationlimitsdialog.cpp:41 msgid "Expand duration to:" msgstr "Rozšiř trvání na:" #: main/dialogs/durationlimitsdialog.cpp:48 msgctxt "@title:group" msgid "Maximum Duration" msgstr "Maximální trvání" #: main/dialogs/durationlimitsdialog.cpp:54 msgid "Shrink duration to:" msgstr "Zmenši trvání na:" #: main/dialogs/fixoverlappingtimesdialog.cpp:43 msgid "Minimum interval between lines:" msgstr "Minimální interval mezi řádky:" #: main/dialogs/fixpunctuationdialog.cpp:31 msgid "Fix Punctuation" msgstr "Oprav interpunkci" #: main/dialogs/fixpunctuationdialog.cpp:36 msgid "Fix and cleanup spaces" msgstr "Oprav a smaž mezery" #: main/dialogs/fixpunctuationdialog.cpp:40 msgid "Fix quotes and double quotes" msgstr "Oprav uvozovky" #: main/dialogs/fixpunctuationdialog.cpp:44 msgid "Fix English 'I' pronoun" msgstr "Oprav anglické zájmeno 'I'" #: main/dialogs/fixpunctuationdialog.cpp:48 msgid "Add ellipisis indicating non finished lines" msgstr "Přidej znak označující nedokončený řádek" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line Before Current" msgstr "Vlož řádek před současný" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line After Current" msgstr "Vlož řádek za současný" #: main/dialogs/insertlinedialog.cpp:29 msgid "Insert Into" msgstr "Vlož do" #: main/dialogs/joinsubtitlesdialog.cpp:40 msgid "Shift subtitle forwards before append" msgstr "Posuň titulky dopředu před připojením" #: main/dialogs/joinsubtitlesdialog.cpp:47 #: main/dialogs/splitsubtitledialog.cpp:44 msgid "Set from video length" msgstr "Nastav z délky videa" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Subtitle" msgstr "Otevři titulky" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Translation Subtitle" msgstr "Otevři překlad" #: main/dialogs/opensubtitledialog.cpp:46 #: main/dialogs/savesubtitledialog.cpp:80 #: main/dialogs/selectablesubtitledialog.cpp:67 msgid "Encoding:" msgstr "Kódování:" #: main/dialogs/opensubtitledialog.cpp:73 msgid "All Supported" msgstr "Všechny podporované" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove Selected Lines" msgstr "Odstraň označené řádky" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove From" msgstr "Odstraň z" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Subtitle" msgstr "Ulož titulky" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Translation Subtitle" msgstr "Ulož překlad" #: main/dialogs/savesubtitledialog.cpp:69 msgid "EOL:" msgstr "Konec řádku:" #: main/dialogs/savesubtitledialog.cpp:145 msgid "" "A file named \"%1\" already exists. Are you sure you want to overwrite it?" msgstr "Již existuje soubor se jménem \"%1\". Opravdu si ho přejete přepsat?" #: main/dialogs/savesubtitledialog.cpp:148 msgid "Overwrite File?" msgstr "Přepsat soubor?" #: main/dialogs/savesubtitledialog.cpp:149 msgid "Overwrite" msgstr "Přepsat" #: main/dialogs/selectablesubtitledialog.cpp:51 msgid "Path:" msgstr "Cesta:" #: main/dialogs/selectablesubtitledialog.cpp:56 msgid "Select subtitle" msgstr "Vyber titulky" #: main/dialogs/selectablesubtitledialog.h:54 msgid "Subtitle" msgstr "Titulky" #: main/dialogs/shifttimesdialog.cpp:32 msgid "Shift" msgstr "Shift" #: main/dialogs/shifttimesdialog.cpp:34 msgctxt "@title:group" msgid "Shifting" msgstr "Posunování" #: main/dialogs/shifttimesdialog.cpp:38 msgid "Forwards (+)" msgstr "Dopředu (+)" #: main/dialogs/shifttimesdialog.cpp:39 msgid "Backwards (–)" msgstr "Dozadu (–)" #: main/dialogs/smarttextsadjustdialog.cpp:43 msgid "Minimum length for line break:" msgstr "Minimální délka pro zalomení řádku:" #: main/dialogs/splitsubtitledialog.cpp:36 msgid "Split Subtitle" msgstr "Rozděl titulky" #: main/dialogs/splitsubtitledialog.cpp:49 msgid "Split time:" msgstr "Čas rozdělení:" #: main/dialogs/splitsubtitledialog.cpp:53 msgid "Shift new part backwards after split" msgstr "Posuň novou část zpět po rozdělení" #: main/dialogs/syncsubtitlesdialog.cpp:32 msgid "Synchronize with Subtitle" msgstr "Synchronizuj s titulky" #: main/dialogs/syncsubtitlesdialog.cpp:34 msgid "Reference Subtitle" msgstr "Odkazované titulky" #: main/dialogs/syncsubtitlesdialog.cpp:36 msgctxt "@title:group" msgid "Synchronization Mode" msgstr "Synchronizační mód" #: main/dialogs/syncsubtitlesdialog.cpp:39 msgid "Adjust to reference's first and last lines" msgstr "Přizpůsob k odkazovaným titulkům první a poslední řádek" #: main/dialogs/syncsubtitlesdialog.cpp:43 msgid "Copy timing information from reference line by line" msgstr "Zkopíruj časování z odkazovaných titulků řádek po řádku" #: main/dialogs/translatedialog.cpp:49 msgid "Input language:" msgstr "Vstupní jazyk:" #: main/dialogs/translatedialog.cpp:66 msgid "Output language:" msgstr "Výstupní jazyk:" #: main/errorsdialog.cpp:42 msgid "Subtitle Errors" msgstr "Chyby v titulkách" #: main/errorsdialog.cpp:55 msgid "Clear Fixed Errors" msgstr "Vymaž opravené chyby" #: main/errorsdialog.cpp:65 msgid "Settings..." msgstr "Nastavení..." #: main/errorsdialog.cpp:121 msgid "Showing 1 line with errors" msgid_plural "Showing %1 lines with errors" msgstr[0] "Zobrazuji 1 řádek s problémy" msgstr[1] "Zobrazuji %1 řádků s problémy" #: main/errorsdialog.cpp:124 msgid "1 total error" msgid_plural "%1 total errors" msgstr[0] "1 chyba" msgstr[1] "%1 chyb" #: main/errorsdialog.cpp:125 msgid "1 user mark" msgid_plural "%1 user marks" msgstr[0] "1 uživatelská značka" msgstr[1] "%1 uživatelských značek" #: main/errorswidget.cpp:491 msgid "Line Errors" msgstr "Chyby na řádcích" #: main/errorswidget.cpp:492 msgid "Count" msgstr "Počítej" #: main/errorswidget.cpp:493 msgid "Marked" msgstr "Označ" #: main/errorswidget.cpp:509 msgid "yes" msgstr "ano" #: main/errorswidget.cpp:510 msgid "no" msgstr "ne" #: main/errorswidget.cpp:517 msgid "Line %1" msgstr "Řádek %1" #: main/errorswidget.cpp:717 msgid "Expand All" msgstr "Rozbal všechny" #: main/errorswidget.cpp:718 msgid "Collapse All" msgstr "Sbal všechny" #: main/errorswidget.cpp:722 msgid "Clear Selected Marks" msgstr "Vymaž označené značky" #: main/errorswidget.cpp:723 msgid "Clear Selected Errors" msgstr "Vymaž označené chyby" #: main/errorswidget.cpp:729 msgid "Clear Fixed Selection" msgstr "Vymaž opravené výběry" #: main/lineswidget.cpp:204 msgid "Observations:" msgstr "Pozorování:" #: main/lineswidget.cpp:232 msgctxt "@title:column Subtitle line number" msgid "Line" msgstr "Řádek" #: main/lineswidget.cpp:233 msgctxt "@title:column" msgid "Show Time" msgstr "Čas zobrazení" #: main/lineswidget.cpp:234 msgctxt "@title:column" msgid "Hide Time" msgstr "Čas skrytí" #: main/lineswidget.cpp:235 msgctxt "@title:column Subtitle line (primary) text" msgid "Text" msgstr "Text" #: main/lineswidget.cpp:236 msgctxt "@title:column Subtitle line translation text" msgid "Translation" msgstr "Překlad" #: main/lineswidget.cpp:1141 msgid "Texts" msgstr "Texty" #: main/lineswidget.cpp:1162 msgid "Styles" msgstr "Styly" #: main/lineswidget.cpp:1166 widgets/simplerichtextedit.cpp:119 msgctxt "@action:inmenu Toggle bold style" msgid "Bold" msgstr "Tučné" #: main/lineswidget.cpp:1173 widgets/simplerichtextedit.cpp:125 msgctxt "@action:inmenu Toggle italic style" msgid "Italic" msgstr "Kurzíva" #: main/lineswidget.cpp:1180 widgets/simplerichtextedit.cpp:131 msgctxt "@action:inmenu Toggle underline style" msgid "Underline" msgstr "Podtržené" #: main/lineswidget.cpp:1187 widgets/simplerichtextedit.cpp:137 msgctxt "@action:inmenu Toggle strike through style" msgid "Strike Through" msgstr "Strike Through" #: main/lineswidget.cpp:1194 msgid "Times" msgstr "Časy" #: main/lineswidget.cpp:1196 msgid "Shift +%1 Milliseconds" msgstr "Posuň +%1 milisekund" #: main/lineswidget.cpp:1197 msgid "Shift -%1 Milliseconds" msgstr "Posuň -%1 milisekund" #: main/lineswidget.cpp:1207 msgid "Errors" msgstr "Chyby" #: main/lineswidget.cpp:1208 msgid "Mark" msgstr "Označ" #: main/main.cpp:43 msgid "Subtitle Composer" msgstr "Subtitle Composer" #: main/main.cpp:45 msgid "A KDE subtitle editor." msgstr "Editor titulku v prostředí KDE." #: main/main.cpp:47 msgid "(C) 2007-2009 Sergio Pistone" msgstr "(C) 2007-2009 Sergio Pistone" #: main/main.cpp:51 msgid "Sergio Pistone" msgstr "Sergio Pistone" #: main/main.cpp:52 msgid "Author & maintainer" msgstr "Autor a správce" #: main/main.cpp:61 msgid "Open location as primary subtitle" msgstr "Otevři umístění jako primární titulky" #: main/main.cpp:62 msgid "Open location as translation subtitle" msgstr "Otevři umístění jako překlad" #: main/playerwidget.cpp:103 msgid "Position" msgstr "Pozice" #: main/playerwidget.cpp:111 msgid "Length" msgstr "Délka" #: main/playerwidget.cpp:116 msgid "FPS" msgstr "FPS" #: main/playerwidget.cpp:704 main/playerwidget.cpp:705 #: main/playerwidget.cpp:706 main/playerwidget.cpp:778 #: main/playerwidget.cpp:795 main/playerwidget.cpp:802 msgid "Unknown" msgstr "Neznámý" #: main/playerwidget.cpp:715 msgid "There was an error opening file
%1
" msgstr "Vyskytla se chyba při otevírání souboru
%1
" #: main/playerwidget.cpp:741 msgid "Unexpected error while playing file." msgstr "Nečekaná chyba při přehrávání souboru." #: main/scripting/scriptsmanager.cpp:70 msgid "Installed Scripts" msgstr "Instalované skripty" #: main/scripting/scriptsmanager.cpp:88 msgid "Information" msgstr "" #: main/scripting/scriptsmanager.cpp:94 msgid "Warning" msgstr "" #: main/scripting/scriptsmanager.cpp:100 #, fuzzy msgid "Error" msgstr "Chyby" #: main/scripting/scriptsmanager.cpp:113 msgid "Scripts Manager" msgstr "Správce skriptů" #: main/scripting/scriptsmanager.cpp:129 msgid "Create..." msgstr "Vytvoř..." #: main/scripting/scriptsmanager.cpp:130 msgid "Creates a new script file." msgstr "Vytvoř prázdný skript." #: main/scripting/scriptsmanager.cpp:135 msgid "Add..." msgstr "Přidej..." #: main/scripting/scriptsmanager.cpp:136 msgid "Copies an existing script from a specified location." msgstr "Zkopíruje existující skript z určeného umístění." #: main/scripting/scriptsmanager.cpp:142 msgid "Sends the selected script to the trash." msgstr "Pošle označený skript do koše." #: main/scripting/scriptsmanager.cpp:147 msgid "Edit" msgstr "&Uprav" #: main/scripting/scriptsmanager.cpp:148 msgid "Opens the selected script with an external editor." msgstr "Otevře označený skript externím editorem." #: main/scripting/scriptsmanager.cpp:154 msgid "Run" msgstr "Spusť" #: main/scripting/scriptsmanager.cpp:155 msgid "Executes the selected script." msgstr "Spusť označený skript." #: main/scripting/scriptsmanager.cpp:160 msgid "Refresh" msgstr "Obnov" #: main/scripting/scriptsmanager.cpp:161 msgid "Reloads the installed scripts list." msgstr "Obnov seznam nainstalovaných skriptů." #: main/scripting/scriptsmanager.cpp:219 main/scripting/scriptsmanager.cpp:301 msgid "" "You must enter an unused name to continue.\n" "Would you like to enter another name?" msgstr "" "Musíš vložit nepoužité jméno, abys mohl pokračovat.\n" "Chtěl bys vložit jiné jméno?" #: main/scripting/scriptsmanager.cpp:220 main/scripting/scriptsmanager.cpp:302 msgid "Name Already Used" msgstr "Jméno již použito" #: main/scripting/scriptsmanager.cpp:226 msgid "Create New Script" msgstr "Vytvoř nový skript" #: main/scripting/scriptsmanager.cpp:226 main/scripting/scriptsmanager.cpp:308 msgid "Script name:" msgstr "Jméno skriptu:" #: main/scripting/scriptsmanager.cpp:239 msgid "There was an error creating the file %1." msgstr "Vyskytla se chyba při vytváření souboru
%1
" #: main/scripting/scriptsmanager.cpp:283 msgid "Select Existing Script" msgstr "Vyber existující skript" #: main/scripting/scriptsmanager.cpp:308 msgid "Rename Script" msgstr "Přejmenuj skript" #: main/scripting/scriptsmanager.cpp:322 msgid "There was an error opening the file %1." msgstr "Vyskytla se chyba při otevírání souboru
%1
" #: main/scripting/scriptsmanager.cpp:331 msgid "There was an error copying the file to %1." msgstr "Vyskytla se chyba při kopírování souboru
%1
" #: main/scripting/scriptsmanager.cpp:350 msgid "Do you really want to send file %1 to the trash?" msgstr "Opravdu chcete přesunout soubor %1 do koše?" #: main/scripting/scriptsmanager.cpp:351 msgid "Move to Trash" msgstr "Přesuň do koše" #: main/scripting/scriptsmanager.cpp:359 msgid "There was an error removing the file %1." msgstr "Vyskytla se chyba při odstranění souboru
%1
" #: main/scripting/scriptsmanager.cpp:377 msgid "Could not launch external editor.\n" msgstr "Nebylo možno spustit externí editor.\n" #: main/scripting/scriptsmanager.cpp:441 main/scripting/scriptsmanager.cpp:448 msgid "Error Running Script" msgstr "Chyba při běhu skriptu" #: main/scripting/scriptsmanager.cpp:462 msgid "Tools" msgstr "Nástroje" #: main/utils/errorfinder.cpp:40 main/utils/errorfinder.cpp:221 #: main/utils/errorfinder.cpp:244 msgid "Find Error" msgstr "Najdi chybu" #: main/utils/errorfinder.cpp:42 msgid "Errors to Find" msgstr "Chyby ke zkontrolování" #: main/utils/errorfinder.cpp:45 msgid "Options" msgstr "Nastavení" #: main/utils/errorfinder.cpp:51 msgid "From current line" msgstr "Ze současného řádku" #: main/utils/errorfinder.cpp:55 msgid "Find backwards" msgstr "Hledej dozadu" #: main/utils/errorfinder.cpp:216 main/utils/finder.cpp:298 #: main/utils/replacer.cpp:258 msgid "" "Beginning of selection reached.\n" "Continue from the end?" msgstr "" "Bylo dosaženo začátku výběru.\n" "Pokračovat od konce?" #: main/utils/errorfinder.cpp:217 main/utils/finder.cpp:299 #: main/utils/replacer.cpp:259 msgid "" "Beginning of subtitle reached.\n" "Continue from the end?" msgstr "" "Bylo dosaženo začátku titulků.\n" "Pokračovat od konce?" #: main/utils/errorfinder.cpp:219 main/utils/finder.cpp:301 #: main/utils/replacer.cpp:261 msgid "" "End of selection reached.\n" "Continue from the beginning?" msgstr "" "Bylo dosaženo konce výběru.\n" "Pokračovat od začátku?" #: main/utils/errorfinder.cpp:220 main/utils/finder.cpp:302 #: main/utils/replacer.cpp:262 main/utils/speller.cpp:143 msgid "" "End of subtitle reached.\n" "Continue from the beginning?" msgstr "" "Bylo dosaženo konce titulků.\n" "Pokračovat od začátku?" #: main/utils/errorfinder.cpp:243 msgid "No errors matching given criteria found!" msgstr "Žádné chyby shodující se s kritérii nebyly nalezeny!" #: main/utils/finder.cpp:55 msgid "Find In" msgstr "Najdi v" #: main/utils/finder.cpp:278 main/utils/replacer.cpp:234 msgid "No instances of '%1' found!" msgstr "Nebyla nalezena instance '%1'!" #: main/utils/finder.cpp:279 main/utils/finder.cpp:303 msgid "Find" msgstr "Najdi" #: main/utils/kreplace.cpp:49 main/utils/kreplace.cpp:53 #: main/utils/replacer.cpp:172 main/utils/replacer.cpp:229 #: main/utils/replacer.cpp:235 main/utils/replacer.cpp:263 msgid "Replace" msgstr "Nahraď" #: main/utils/kreplace.cpp:51 msgid "&All" msgstr "&Všechny" #: main/utils/kreplace.cpp:52 msgid "&Skip" msgstr "&Přeskoč" #: main/utils/kreplace.cpp:63 msgid "Replace '%1' with '%2'?" msgstr "Nahradit '%1' s '%2'?" #: main/utils/kreplace.cpp:139 main/utils/kreplace.cpp:406 msgid "No text was replaced." msgstr "Nebyl nahrazen žádný text." #: main/utils/kreplace.cpp:141 main/utils/kreplace.cpp:408 #: main/utils/replacer.cpp:228 main/utils/replacer.cpp:255 msgid "1 replacement done." msgid_plural "%1 replacements done." msgstr[0] "Provedeno jedno nahrazení." msgstr[1] "Provedeno %1 nahrazení." #: main/utils/kreplace.cpp:413 msgid "Beginning of document reached." msgstr "Bylo dosaženo začátku dokumentu." #: main/utils/kreplace.cpp:415 msgid "End of document reached." msgstr "Bylo dosaženo konce dokumentu." #: main/utils/kreplace.cpp:422 msgid "Do you want to restart search from the end?" msgstr "Chcete znovu hledat od konce?" #: main/utils/kreplace.cpp:423 msgid "Do you want to restart search at the beginning?" msgstr "Chcete znovu hledat od začátku?" #: main/utils/kreplace.cpp:425 msgid "Restart" msgstr "Restart" #: main/utils/language.cpp:125 msgid "Automatic" msgstr "Automatický" #: main/utils/language.cpp:129 msgctxt "Official language of the Philippines, aka Filipino" msgid "Tagalog" msgstr "" #: main/utils/replacer.cpp:53 msgid "Find/Replace In" msgstr "Najdi/Nahraď v" #: main/utils/speller.cpp:144 msgid "Spell Checking" msgstr "Oprava pravopisu" #: main/utils/translator.cpp:167 msgid "Operation cancelled by user" msgstr "" #: main/utils/translator.cpp:270 main/utils/translator.cpp:280 msgid "Unexpected contents received from translation service" msgstr "Nečekaný obsah obdržený překládací službou" #: player/gstreamer/gstreamerbackend.cpp:543 #: player/mplayer/mplayerbackend.cpp:259 player/xine/xinebackend.cpp:278 msgid "Audio Stream #%1" msgstr "Zvuková stopa #%1" #: player/gstreamer/gstreamerconfigwidget.cpp:34 msgctxt "@title:group GStreamer sinks settings" msgid "Sinks" msgstr "Nastavení" #: player/gstreamer/gstreamerconfigwidget.cpp:37 msgid "Audio sink:" msgstr "Ztišení zvuku:" #: player/gstreamer/gstreamerconfigwidget.cpp:46 msgid "Video sink:" msgstr "Zpomalení videa:" #: player/mplayer/mplayerconfigwidget.cpp:40 msgid "Executable path:" msgstr "Spustitelná cesta:" #: player/mplayer/mplayerconfigwidget.cpp:43 msgid "Select the MPlayer executable" msgstr "Vyber spustitelný soubor MPlayeru" #: player/mplayer/mplayerconfigwidget.cpp:47 msgctxt "@title:group Video settings" msgid "Video" msgstr "Video" #: player/mplayer/mplayerconfigwidget.cpp:50 msgid "Video output driver:" msgstr "Výstupní ovladač videa:" #: player/mplayer/mplayerconfigwidget.cpp:58 msgid "Allow frame dropping" msgstr "Povol zahazování snímků" #: player/mplayer/mplayerconfigwidget.cpp:61 msgid "Allow hard frame dropping" msgstr "Povol silné zahazování snímků" #: player/mplayer/mplayerconfigwidget.cpp:64 msgctxt "@title:group Audio settings" msgid "Audio" msgstr "Zvuk" #: player/mplayer/mplayerconfigwidget.cpp:67 msgid "Audio output driver:" msgstr "Výstupní zvukový ovladač:" #: player/mplayer/mplayerconfigwidget.cpp:75 msgid "A/V synchronization factor:" msgstr "A/V synchronizační faktor:" #: player/mplayer/mplayerconfigwidget.cpp:83 msgid "Volume normalization" msgstr "Normalizace hlasitosti" #: player/xine/xineconfigwidget.cpp:34 msgctxt "@title:group Xine drivers settings" msgid "Drivers" msgstr "Ovladače" #: player/xine/xineconfigwidget.cpp:37 msgid "Audio driver:" msgstr "Zvukový ovladač:" #: player/xine/xineconfigwidget.cpp:45 msgid "Video driver:" msgstr "Video ovladač:" #: widgets/simplerichtextedit.cpp:84 msgid "Cut" msgstr "Vyjmi" #: widgets/simplerichtextedit.cpp:90 msgid "Copy" msgstr "Kopíruj" #: widgets/simplerichtextedit.cpp:96 msgid "Paste" msgstr "Vlož" #: widgets/simplerichtextedit.cpp:102 msgid "Delete" msgstr "Vymaž" #: widgets/simplerichtextedit.cpp:108 msgctxt "@action:inmenu Clear all text" msgid "Clear" msgstr "Vyčisti" #: widgets/simplerichtextedit.cpp:143 msgid "Check Spelling..." msgstr "Kontrola pravopisu..." #: widgets/simplerichtextedit.cpp:147 msgid "Auto Spell Check" msgstr "Automatická kontrola pravopisu" #: widgets/simplerichtextedit.cpp:152 msgid "Allow Tabulations" msgstr "Povol tabelace" #: widgets/simplerichtextedit.cpp:491 msgid "Suggestions" msgstr "Návrhy" #: widgets/simplerichtextedit.cpp:492 msgid "Ignore" msgstr "Ignoruj" #: widgets/simplerichtextedit.cpp:493 msgid "Add to Dictionary" msgstr "Přidej slovník" #: widgets/simplerichtextedit.cpp:497 msgid "No suggestions" msgstr "Žádné návrhy" #. i18n: file: main/subtitlecomposerui.rc:5 #. i18n: ectx: Menu (file) #: rc.cpp:3 msgid "&File" msgstr "&Soubor" #. i18n: file: main/subtitlecomposerui.rc:16 #. i18n: ectx: Menu (translation) #: rc.cpp:6 msgid "Translation" msgstr "Překlad" #. i18n: file: main/subtitlecomposerui.rc:28 #. i18n: ectx: Menu (edit) #: rc.cpp:9 msgid "&Edit" msgstr "&Uprav" #. i18n: file: main/subtitlecomposerui.rc:51 #. i18n: ectx: Menu (texts) #: rc.cpp:12 msgid "&Texts" msgstr "&Texty" #. i18n: file: main/subtitlecomposerui.rc:62 #. i18n: ectx: Menu (styles) #: rc.cpp:15 msgid "St&yles" msgstr "St&yly" #. i18n: file: main/subtitlecomposerui.rc:69 #. i18n: ectx: Menu (times) #: rc.cpp:18 msgid "T&imes" msgstr "Č&asy" #. i18n: file: main/subtitlecomposerui.rc:91 #. i18n: ectx: Menu (errors) #: rc.cpp:21 msgid "E&rrors" msgstr "Chy&by" #. i18n: file: main/subtitlecomposerui.rc:104 #. i18n: ectx: Menu (video) #: rc.cpp:24 msgid "&Video" msgstr "&Video" #. i18n: file: main/subtitlecomposerui.rc:132 #. i18n: ectx: Menu (tools) #: rc.cpp:27 msgid "T&ools" msgstr "&Nástroje" #. i18n: file: main/subtitlecomposerui.rc:137 #. i18n: ectx: Menu (audiolevels) #: rc.cpp:30 msgid "&Audio Levels" msgstr "&Audio Levels" #. i18n: file: main/subtitlecomposerui.rc:153 #. i18n: ectx: ToolBar (mainToolBar) #: rc.cpp:33 msgid "Main Toolbar" msgstr "Hlavní lišta" #. i18n: file: main/subtitlecomposerui.rc:165 #. i18n: ectx: ToolBar (editToolBar) #: rc.cpp:36 msgctxt "The toolbar name" msgid "Edit Toolbar" msgstr "Nástrojová lišta" #: rc.cpp:37 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Goliash" #: rc.cpp:38 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "goliash@goliash.net" subtitlecomposer-0.5.3/po/Messages.sh0000755000175000001440000000311111151345073017051 0ustar sergiousers#!/bin/sh BASEDIR="../src/" # root of translatable sources PROJECT="subtitlecomposer" # project name BUGADDR="https://sourceforge.net/tracker/?atid=1005652&group_id=208427&func=browse" # MSGID-Bugs WDIR=`pwd` # working dir echo "Preparing rc files" cd ${BASEDIR} # we use simple sorting to make sure the lines do not jump around too much from system to system find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > ${WDIR}/rcfiles.list xargs --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp # additional string for KAboutData echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp cd ${WDIR} echo "Done preparing rc files" echo "Extracting messages" cd ${BASEDIR} # see above on sorting find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort > ${WDIR}/infiles.list echo "rc.cpp" >> ${WDIR}/infiles.list cd ${WDIR} xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \ -kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \ --msgid-bugs-address="${BUGADDR}" \ --files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot || { echo "error while calling xgettext. aborting."; exit 1; } echo "Done extracting messages" echo "Merging translations" catalogs=`find . -name '*.po'` for cat in $catalogs; do echo $cat msgmerge -o $cat.new $cat ${PROJECT}.pot mv $cat.new $cat done echo "Done merging translations" echo "Cleaning up" cd ${WDIR} rm rcfiles.list rm infiles.list rm rc.cpp echo "Done" subtitlecomposer-0.5.3/po/es/0000755000175000001440000000000011206423743015360 5ustar sergiouserssubtitlecomposer-0.5.3/po/es/CMakeLists.txt0000644000175000001440000000016611151345073020121 0ustar sergiousersFILE( GLOB _po_files *.po ) GETTEXT_PROCESS_PO_FILES( es ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) subtitlecomposer-0.5.3/po/es/subtitlecomposer.po0000644000175000001440000021224711206411600021320 0ustar sergiousers# translation of subtitlecomposer.po to Spanish # This file is put in the public domain. # # Daniel M. Lambea , 2008. # Sergio Pistone, 2009. # Sergio Pistone , 2009. msgid "" msgstr "" "Project-Id-Version: subtitlecomposer\n" "Report-Msgid-Bugs-To: https://sourceforge.net/tracker/?" "atid=1005652&group_id=208427&func=browse\n" "POT-Creation-Date: 2009-05-25 00:41-0300\n" "PO-Revision-Date: 2009-05-24 17:02-0300\n" "Last-Translator: Sergio Pistone \n" "Language-Team: American English \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 0.3\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: core/subtitleactions.cpp:62 msgid "Set Frame Rate" msgstr "Fijar velocidad de fotogramas" #: core/subtitleactions.cpp:93 msgid "Insert Lines" msgstr "Insertar línea" #: core/subtitleactions.cpp:177 core/subtitle.cpp:446 core/subtitle.cpp:460 #: core/subtitle.cpp:479 msgid "Remove Lines" msgstr "Eliminar líneas" #: core/subtitleactions.cpp:268 msgid "Move Line" msgstr "Mover línea" #: core/subtitleactions.cpp:381 msgid "Swap Texts" msgstr "Intercambiar textos" #: core/subtitle.cpp:66 msgid "Set Primary Data" msgstr "Asignar datos primarios" #: core/subtitle.cpp:121 msgid "Clear Primary Text Data" msgstr "Limpiar datos primarios" #: core/subtitle.cpp:134 msgid "Set Secondary Data" msgstr "Asignar datos secundarios" #: core/subtitle.cpp:180 msgid "Clear Secondary Text Data" msgstr "Limpiar datos secundarios" #: core/subtitle.cpp:265 main/dialogs/changeframeratedialog.cpp:34 msgid "Change Frame Rate" msgstr "Cambiar velocidad de fotogramas" #: core/subtitle.cpp:395 core/subtitle.cpp:412 msgid "Insert Line" msgstr "Insertar línea" #: core/subtitle.cpp:533 main/application.cpp:662 main/lineswidget.cpp:1226 msgid "Split Lines" msgstr "Dividir líneas" #: core/subtitle.cpp:590 main/application.cpp:670 main/lineswidget.cpp:1225 msgid "Join Lines" msgstr "Unir líneas" #: core/subtitle.cpp:642 msgid "Shift Lines" msgstr "Desplazar líneas" #: core/subtitle.cpp:690 msgid "Adjust Lines" msgstr "Ajustar líneas" #: core/subtitle.cpp:700 main/application.cpp:2377 main/lineswidget.cpp:1200 msgid "Sort" msgstr "Ordenar" #: core/subtitle.cpp:746 main/dialogs/durationlimitsdialog.cpp:33 msgid "Enforce Duration Limits" msgstr "Forzar límites de duración" #: core/subtitle.cpp:791 main/application.cpp:2462 main/lineswidget.cpp:1203 msgid "Maximize Durations" msgstr "Maximizar duraciones" #: core/subtitle.cpp:816 main/dialogs/autodurationsdialog.cpp:35 msgid "Set Automatic Durations" msgstr "Fijar duraciones automáticas" #: core/subtitle.cpp:856 main/dialogs/fixoverlappingtimesdialog.cpp:32 #: main/lineswidget.cpp:1204 msgid "Fix Overlapping Times" msgstr "Corregir tiempos solapados" #: core/subtitle.cpp:890 msgid "Fix Lines Punctuation" msgstr "Corregir puntuación de líneas" #: core/subtitle.cpp:986 msgid "Lower Case" msgstr "Convertir a minúsculas" #: core/subtitle.cpp:1020 msgid "Upper Case" msgstr "Convertir a mayúsculas" #: core/subtitle.cpp:1054 msgid "Title Case" msgstr "Convertir a tipo título" #: core/subtitle.cpp:1091 msgid "Sentence Case" msgstr "Convertir a tipo oración" #: core/subtitle.cpp:1142 main/dialogs/smarttextsadjustdialog.cpp:32 msgid "Break Lines" msgstr "Insertar saltos de línea" #: core/subtitle.cpp:1150 main/application.cpp:2530 main/lineswidget.cpp:1146 msgid "Unbreak Lines" msgstr "Remover saltos de línea" #: core/subtitle.cpp:1158 main/application.cpp:2544 main/lineswidget.cpp:1152 msgid "Simplify Spaces" msgstr "Simplificar espacios" #: core/subtitle.cpp:1167 msgid "Synchronize Subtitles" msgstr "Sincronizar subtítulos" #: core/subtitle.cpp:1190 main/dialogs/joinsubtitlesdialog.cpp:35 msgid "Join Subtitles" msgstr "Unir subtítulos" #: core/subtitle.cpp:1236 core/subtitle.cpp:1242 msgid "Split Subtitles" msgstr "Dividir subtítulos" #: core/subtitle.cpp:1259 core/subtitle.cpp:1274 msgid "Set Lines Style" msgstr "Modificar estilo de líneas" #: core/subtitle.cpp:1291 msgid "Toggle Lines Style" msgstr "Alternar estilo de líneas" #: core/subtitle.cpp:1304 msgid "Set Lines Mark" msgstr "Marcar líneas" #: core/subtitle.cpp:1304 msgid "Clear Lines Mark" msgstr "Eliminar marcas de líneas" #: core/subtitle.cpp:1318 msgid "Toggle Lines Mark" msgstr "Alternar marca de líneas" #: core/subtitle.cpp:1328 main/application.cpp:2261 main/application.cpp:2271 #: main/errorswidget.cpp:854 msgid "Clear Lines Errors" msgstr "Asignar errores de líneas" #: core/subtitle.cpp:1338 core/subtitle.cpp:1358 main/application.cpp:2194 #: main/application.cpp:2239 msgid "Check Lines Errors" msgstr "Verificar errores de líneas" #: core/subtitlelineactions.cpp:65 msgid "Set Line Text" msgstr "Asignar texto de línea" #: core/subtitlelineactions.cpp:101 msgid "Set Line Secondary Text" msgstr "Asignar texto de línea secundario" #: core/subtitlelineactions.cpp:137 msgid "Set Line Texts" msgstr "Asignar textos de línea" #: core/subtitlelineactions.cpp:218 msgid "Set Line Show Time" msgstr "Asignar tiempo de aparición de línea" #: core/subtitlelineactions.cpp:254 msgid "Set Line Hide Time" msgstr "Asignar tiempo de ocultamiento de línea" #: core/subtitlelineactions.cpp:371 msgid "Set Line Errors" msgstr "Asignar errores de línea" #: core/subtitleline.cpp:72 msgid "Empty text" msgstr "Texto vacío" #: core/subtitleline.cpp:74 msgid "Too many characters" msgstr "Demasiadas letras" #: core/subtitleline.cpp:76 msgid "Too many lines" msgstr "Demasiadas líneas" #: core/subtitleline.cpp:78 msgid "Unnecessary white space" msgstr "Espacios innecesarios" #: core/subtitleline.cpp:80 msgid "Unnecessary dash" msgstr "Guión innecesario" #: core/subtitleline.cpp:82 msgid "Capital letter after continuation ellipsis" msgstr "Mayúscula después de elipsis de continuación de línea" #: core/subtitleline.cpp:84 msgid "Too long duration per character" msgstr "Duración demasiado larga por cada letra" #: core/subtitleline.cpp:86 msgid "Too short duration per character" msgstr "Duración demasiado corta por cada letra" #: core/subtitleline.cpp:88 msgid "Too long duration" msgstr "Duración demasiado larga" #: core/subtitleline.cpp:89 msgid "Too short duration" msgstr "Duración demasiado corta" #: core/subtitleline.cpp:90 msgid "Overlapping times" msgstr "Tiempos solapados" #: core/subtitleline.cpp:91 msgid "Untranslated text" msgstr "Texto no traducido" #: core/subtitleline.cpp:92 msgid "User mark" msgstr "Marca de usuario" #: core/subtitleline.cpp:112 msgid "Has no primary text." msgstr "No tiene texto primario." #: core/subtitleline.cpp:116 msgid "Has no translation text." msgstr "No tiene traducción." #: core/subtitleline.cpp:120 msgid "Has too many characters in primary text (1 char)." msgid_plural "Has too many characters in primary text (%1 chars)." msgstr[0] "Tiene demasiadas letras en el texto primario (1 letra)." msgstr[1] "Tiene demasiadas letras en el texto primario (%1 letras)." #: core/subtitleline.cpp:126 msgid "Has too many characters in translation text (1 char)." msgid_plural "Has too many characters in translation text (%1 chars)." msgstr[0] "Tiene demasiadas letras en el texto traducido (1 letra)." msgstr[1] "Tiene demasiadas letras en el texto traducido (%1 letras)." #: core/subtitleline.cpp:132 msgid "Has too many lines in primary text (1 line)." msgid_plural "Has too many lines in primary text (%1 lines)." msgstr[0] "Tiene demasiadas líneas en el texto primario (1 línea)." msgstr[1] "Tiene demasiadas líneas en el texto primario (%1 líneas)." #: core/subtitleline.cpp:138 msgid "Has too many lines in translation text (1 line)." msgid_plural "Has too many lines in translation text (%1 lines)." msgstr[0] "Tiene demasiadas líneas en el texto traducido (1 línea)." msgstr[1] "Tiene demasiadas líneas en el texto traducido (%1 líneas)." #: core/subtitleline.cpp:144 msgid "Has unnecessary spaces in primary text." msgstr "Tiene espacios innecesarios en el texto primario." #: core/subtitleline.cpp:148 msgid "Has unnecessary spaces in translation text." msgstr "Tiene espacios innecesarios en el texto traducido." #: core/subtitleline.cpp:152 msgid "Has unnecessary dash in primary text." msgstr "Tiene un guión innecesario en el texto primario." #: core/subtitleline.cpp:156 msgid "Has unnecessary dash in translation text." msgstr "Tiene un guión innecesario en el texto traducido." #: core/subtitleline.cpp:160 msgid "Has capital letter after line continuation ellipsis in primary text." msgstr "" "Tiene una letra mayúscula luego de puntos suspensivos de continuación de " "línea en el texto primario." #: core/subtitleline.cpp:164 msgid "" "Has capital letter after line continuation ellipsis in translation text." msgstr "" "Tiene una letra mayúscula luego de puntos suspensivos de continuación de " "línea en el texto traducido." #: core/subtitleline.cpp:168 msgid "Has too long duration per character in primary text (1 msec/char)." msgid_plural "" "Has too long duration per character in primary text (%1 msecs/char)." msgstr[0] "" "Tiene duración demasiado larga por cada letra en el texto primario (1 mseg/" "letra)." msgstr[1] "" "Tiene duración demasiado larga por cada letra en el texto primario (%1 msegs/" "letra)." #: core/subtitleline.cpp:174 msgid "Has too long duration per character in translation text (1 msec/char)." msgid_plural "" "Has too long duration per character in translation text (%1 msecs/char)." msgstr[0] "" "Tienen duración demasiado larga por cada letra en el texto traducido (1 mseg/" "letra)." msgstr[1] "" "Tienen duración demasiado larga por cada letra en el texto traducido (%1 " "msegs/letra)." #: core/subtitleline.cpp:180 msgid "Has too short duration per character in primary text (1 msec/char)." msgid_plural "" "Has too short duration per character in primary text (%1 msecs/char)." msgstr[0] "" "Tiene duración demasiado corta por cada letra en el texto primario (1 mseg/" "letra)." msgstr[1] "" "Tiene duración demasiado corta por cada letra en el texto primario (%1 msegs/" "letra)." #: core/subtitleline.cpp:186 msgid "Has too short duration per character in translation text (1 msec/char)." msgid_plural "" "Has too short duration per character in translation text (%1 msecs/char)." msgstr[0] "" "Tiene duración demasiado corta por cada letra en el texto traducido (1 mseg/" "letra)." msgstr[1] "" "Tiene duración demasiado corta por cada letra en el texto traducido (%1 " "msegs/letra)." #: core/subtitleline.cpp:192 msgid "Has too long duration (1 msec)." msgid_plural "Has too long duration (%1 msecs)." msgstr[0] "Tiene duración demasiado larga (1 mseg)." msgstr[1] "Tiene duración demasiado larga (%1 msegs)." #: core/subtitleline.cpp:198 msgid "Has too short duration (1 msec)." msgid_plural "Has too short duration (%1 msecs)." msgstr[0] "Tienen duración demasiado corta (1 mseg)." msgstr[1] "Tienen duración demasiado corta (%1 msegs)." #: core/subtitleline.cpp:204 msgid "Overlaps with next line." msgstr "Se solapa con la línea siguiente." #: core/subtitleline.cpp:208 msgid "Has untranslated text." msgstr "No tiene traducción." #: core/subtitleline.cpp:212 msgid "Has user mark." msgstr "Tiene marca de usuario." #: core/subtitleline.cpp:680 msgid "Set Line Times" msgstr "Asignar tiempos de línea" #: core/subtitleline.cpp:691 msgid "Shift Line Times" msgstr "Desplazar tiempos de línea" #: core/subtitleline.cpp:705 msgid "Adjust Line Times" msgstr "Ajustar tiempos de línea" #: main/actions/krecentfilesactionext.cpp:37 msgid "Clear History" msgstr "Limpiar histórico" #: main/application.cpp:415 msgid "Video Files" msgstr "Archivos de vídeo" #: main/application.cpp:423 msgid "Audio Files" msgstr "Archivos de audio" #: main/application.cpp:425 msgid "Media Files" msgstr "Archivos de audio o vídeo" #: main/application.cpp:426 msgid "All Files" msgstr "Todos los archivos" #: main/application.cpp:442 msgid "Audio Levels Files" msgstr "Archivos de niveles de &audio" #: main/application.cpp:456 msgid "Exit the application" msgstr "Salir de la aplicación" #: main/application.cpp:460 msgid "Configure Subtitle Composer" msgstr "Configurar Subtitle Composer" #: main/application.cpp:465 msgctxt "@action:inmenu Create a new subtitle" msgid "New" msgstr "Nuevo" #: main/application.cpp:466 msgid "Create an empty subtitle" msgstr "Crear un subtítulo vacío" #: main/application.cpp:475 msgctxt "@action:inmenu Open subtitle file" msgid "Open..." msgstr "Abrir..." #: main/application.cpp:476 main/application.cpp:486 msgid "Open subtitle file" msgstr "Abrir archivo de subtítulo" #: main/application.cpp:485 msgctxt "@action:inmenu Open rencently used subtitle file" msgid "Open &Recent" msgstr "Abrir &reciente" #: main/application.cpp:493 msgid "Save" msgstr "Guardar" #: main/application.cpp:494 msgid "Save opened subtitle" msgstr "Guardar subtítulo abierto" #: main/application.cpp:503 msgid "Save As..." msgstr "Guardar como..." #: main/application.cpp:504 msgid "Save opened subtitle with different settings" msgstr "Guardar subtítulo abierto con otras opciones" #: main/application.cpp:512 msgid "Close" msgstr "Cerrar" #: main/application.cpp:513 msgid "Close opened subtitle" msgstr "Cerrar subtítulo abierto" #: main/application.cpp:522 msgid "New Translation" msgstr "Nueva traducción" #: main/application.cpp:523 msgid "Create an empty translation subtitle" msgstr "Crear un subtítulo de traducción vacío" #: main/application.cpp:532 msgid "Open Translation..." msgstr "Abrir traducción..." #: main/application.cpp:533 main/application.cpp:543 msgid "Open translation subtitle file" msgstr "Abrir archivo de traducción de subtítulo" #: main/application.cpp:542 msgid "Open &Recent Translation" msgstr "Abrir traducción &reciente" #: main/application.cpp:551 msgid "Save Translation" msgstr "Guardar traducción" #: main/application.cpp:552 msgid "Save opened translation subtitle" msgstr "Guardar traducción abierta de subtítulo" #: main/application.cpp:561 msgid "Save Translation As..." msgstr "Guardar traducción como..." #: main/application.cpp:562 msgid "Save opened translation subtitle with different settings" msgstr "Guardar traducción abierta de subtítulo con otras opciones" #: main/application.cpp:570 msgid "Close Translation" msgstr "Cerrar traducción" #: main/application.cpp:571 msgid "Close opened translation subtitle" msgstr "Cerrar traducción de subtítulo" #: main/application.cpp:580 msgid "Reload As..." msgstr "Recargar como..." #: main/application.cpp:581 main/application.cpp:592 msgid "Reload opened file with a different encoding" msgstr "Recargar archivo de subtítulo con una codificación diferente" #: main/application.cpp:591 msgid "Quick Reload As..." msgstr "Recarga rápida como..." #: main/application.cpp:600 main/application.cpp:601 #: widgets/simplerichtextedit.cpp:72 msgid "Undo" msgstr "Deshacer" #: main/application.cpp:610 main/application.cpp:611 #: widgets/simplerichtextedit.cpp:78 msgid "Redo" msgstr "Rehacer" #: main/application.cpp:619 msgid "Split Subtitle..." msgstr "Dividir subtítulo..." #: main/application.cpp:620 msgid "Split the opened subtitle in two parts" msgstr "Dividir el subtítulo abierto en dos partes" #: main/application.cpp:627 msgid "Join Subtitles..." msgstr "Unir subtítulos..." #: main/application.cpp:628 msgid "Append to the opened subtitle another one" msgstr "Añadir al subtítulo abierto otro subtítulo" #: main/application.cpp:635 main/lineswidget.cpp:1222 msgid "Insert Before" msgstr "Insertar antes" #: main/application.cpp:636 msgid "Insert empty line before current one" msgstr "Insertar una línea vacía antes de la activa" #: main/application.cpp:644 main/lineswidget.cpp:1223 msgid "Insert After" msgstr "Insertar después" #: main/application.cpp:645 msgid "Insert empty line after current one" msgstr "Insertar una línea vacía después de la activa" #: main/application.cpp:653 main/lineswidget.cpp:1221 #: main/scripting/scriptsmanager.cpp:141 msgid "Remove" msgstr "Eliminar línea" #: main/application.cpp:654 msgid "Remove selected lines" msgstr "Eliminar las líneas seleccionadas" #: main/application.cpp:663 msgid "Split selected lines" msgstr "Dividir las líneas seleccionadas" #: main/application.cpp:671 msgid "Join selected lines" msgstr "Unir las líneas seleccionadas" #: main/application.cpp:678 main/dialogs/actionwitherrortargetsdialog.cpp:103 #: main/lineswidget.cpp:1219 widgets/simplerichtextedit.cpp:113 msgid "Select All" msgstr "Seleccionar todo" #: main/application.cpp:679 msgid "Select all lines" msgstr "Seleccionar todas las líneas" #: main/application.cpp:687 msgid "Go to Line..." msgstr "Ir a la línea..." #: main/application.cpp:688 msgid "Go to specified line" msgstr "Ir a la línea especificada" #: main/application.cpp:697 msgid "Find..." msgstr "Buscar..." #: main/application.cpp:698 msgid "Find occurrences of strings or regular expressions" msgstr "Buscar ocurrencias de cadenas o expresiones regulares" #: main/application.cpp:708 msgid "Find Next" msgstr "Buscar siguiente" #: main/application.cpp:709 msgid "Find next occurrence of string or regular expression" msgstr "Buscar siguiente ocurrencia de cadena o expresión regular" #: main/application.cpp:719 msgid "Find Previous" msgstr "Buscar anterior" #: main/application.cpp:720 msgid "Find previous occurrence of string or regular expression" msgstr "Buscar ocurrencia anterior de cadena o expresión regular" #: main/application.cpp:728 msgid "Replace..." msgstr "Reemplazar..." #: main/application.cpp:729 msgid "Replace occurrences of strings or regular expressions" msgstr "Reemplazar ocurrencias de cadenas o expresiones regulares" #: main/application.cpp:738 msgid "Retrocede current line" msgstr "Retroceder línea activa" #: main/application.cpp:739 msgid "Makes the line before the current one active" msgstr "Convertir en activa a la línea anterior a la actual" #: main/application.cpp:748 msgid "Advance current line" msgstr "Avanzar línea activa" #: main/application.cpp:749 msgid "Makes the line after the current one active" msgstr "Convertir en activa a la línea siguiente a la actual" #: main/application.cpp:757 main/errorsdialog.cpp:59 main/lineswidget.cpp:1212 msgid "Check Errors..." msgstr "Comprobar errores..." #: main/application.cpp:758 msgid "Check for errors in the current subtitle" msgstr "Comprobar errores en el subtítulo actual" #: main/application.cpp:766 main/errorsdialog.cpp:62 main/lineswidget.cpp:1213 msgid "Clear Errors..." msgstr "Limpiar errores..." #: main/application.cpp:767 msgid "Clear errors from selected lines" msgstr "Limpiar errores de las líneas seleccionadas" #: main/application.cpp:774 main/lineswidget.cpp:1215 msgid "Show Errors..." msgstr "Mostrar errores..." #: main/application.cpp:775 msgid "Show errors information for the current subtitle" msgstr "Mostrar información de errores del subtítulo actual" #: main/application.cpp:784 msgid "Find Error..." msgstr "Buscar error..." #: main/application.cpp:785 msgid "Find lines with specified errors" msgstr "Buscar líneas con errores especificados" #: main/application.cpp:795 msgid "Find Next Error" msgstr "Buscar siguiente error" #: main/application.cpp:796 msgid "Find next line with specified errors" msgstr "Buscar línea siguiente con errores especificados" #: main/application.cpp:806 msgid "Find Previous Error" msgstr "Buscar error anterior" #: main/application.cpp:807 msgid "Find previous line with specified errors" msgstr "Buscar línea previa con errores especificados" #: main/application.cpp:816 main/lineswidget.cpp:1159 msgid "Spelling..." msgstr "Ortografía..." #: main/application.cpp:817 msgid "Check lines spelling" msgstr "Comprobar ortografía de líneas" #: main/application.cpp:824 msgid "Toggle Mark" msgstr "Alternar marca" #: main/application.cpp:825 msgid "Toggle selected lines mark" msgstr "Alternar marca en líneas seleccionadas" #: main/application.cpp:834 main/currentlinewidget.cpp:92 msgid "Toggle Bold" msgstr "Alternar negrita" #: main/application.cpp:835 msgid "Toggle selected lines bold attribute" msgstr "Alternar negrita en líneas seleccionadas" #: main/application.cpp:844 main/currentlinewidget.cpp:97 msgid "Toggle Italic" msgstr "Alternar cursiva" #: main/application.cpp:845 msgid "Toggle selected lines italic attribute" msgstr "Alternar cursiva en líneas seleccionadas" #: main/application.cpp:854 main/currentlinewidget.cpp:102 msgid "Toggle Underline" msgstr "Alternar subrayado" #: main/application.cpp:855 msgid "Toggle selected lines underline attribute" msgstr "Alternar subrayado en líneas seleccionadas" #: main/application.cpp:864 main/currentlinewidget.cpp:107 msgid "Toggle Strike Through" msgstr "Alternar tachado" #: main/application.cpp:865 msgid "Toggle selected lines strike through attribute" msgstr "Alternar tachado en líneas seleccionadas" #: main/application.cpp:873 main/lineswidget.cpp:1199 msgid "Shift..." msgstr "Desplazar..." #: main/application.cpp:874 msgid "Shift lines an specified amount of time" msgstr "Desplazar líneas una cantidad de tiempo determinada" #: main/application.cpp:901 msgid "Adjust..." msgstr "Ajustar..." #: main/application.cpp:902 msgid "Linearly adjust all lines to a specified interval" msgstr "Ajustar todas las líneas a un determinado intervalo en forma lineal" #: main/application.cpp:910 msgid "Sort..." msgstr "Ordenar..." #: main/application.cpp:911 msgid "Sort lines based on their show time" msgstr "Ordenar líneas en base a sus tiempos de mostrado" #: main/application.cpp:918 msgid "Change Frame Rate..." msgstr "Cambiar velocidad de fotograma..." #: main/application.cpp:919 msgid "Retime subtitle lines by reinterpreting its frame rate" msgstr "" "Volver a temporizar líneas mediante la reinterpretación de sus velocidades " "de fotograma" #: main/application.cpp:926 main/lineswidget.cpp:1201 msgid "Enforce Duration Limits..." msgstr "Forzar límites de duración..." #: main/application.cpp:927 msgid "Enforce lines minimum and/or maximum duration limits" msgstr "Forzar límites máximo y/o mínimo de duración de líneas" #: main/application.cpp:935 main/lineswidget.cpp:1202 msgid "Set Automatic Durations..." msgstr "Fijar duraciones automáticamente..." #: main/application.cpp:936 msgid "Set lines durations based on amount of letters, words and line breaks" msgstr "" "Asignar duraciones de línea en función de la cantidad de letras, palabras y/" "o saltos de línea" #: main/application.cpp:943 msgid "Maximize Durations..." msgstr "Maximizar duraciones..." #: main/application.cpp:944 msgid "Extend lines durations up to their next lines show time" msgstr "" "Extender duraciones de línea hasta el tiempo de aparición de las siguientes" #: main/application.cpp:951 msgid "Fix Overlapping Times..." msgstr "Corregir tiempos solapados..." #: main/application.cpp:952 msgid "Fix lines overlapping times" msgstr "Corregir tiempos de líneas solapadas" #: main/application.cpp:959 msgid "Synchronize with Subtitle..." msgstr "Sincronizar con subtítulo..." #: main/application.cpp:960 msgid "Copy timing information from another subtitle" msgstr "Copiar información de temporizado desde otro subtítulo" #: main/application.cpp:967 main/lineswidget.cpp:1142 msgid "Break Lines..." msgstr "Remover saltos de línea..." #: main/application.cpp:968 msgid "Automatically set line breaks" msgstr "Ajustar saltos de línea en forma automática" #: main/application.cpp:975 main/lineswidget.cpp:1145 msgid "Unbreak Lines..." msgstr "Remover saltos de línea..." #: main/application.cpp:976 msgid "Remove line breaks from lines" msgstr "Remover saltos de línea de los textos..." #: main/application.cpp:983 main/lineswidget.cpp:1151 msgid "Simplify Spaces..." msgstr "Simplificar espacios..." #: main/application.cpp:984 msgid "Remove unneeded spaces from lines" msgstr "Eliminar espacios innecesarios de las líneas" #: main/application.cpp:991 main/lineswidget.cpp:1155 msgid "Change Case..." msgstr "Modificar mayúsculas/minúsculas..." #: main/application.cpp:992 msgid "Change lines text to upper, lower, title or sentence case" msgstr "Modificar lineas a mayúsculas, minúsculas, oración o título." #: main/application.cpp:999 main/lineswidget.cpp:1156 msgid "Fix Punctuation..." msgstr "Corregir puntuación..." #: main/application.cpp:1000 msgid "Fix punctuation errors in lines" msgstr "Corregir errores de puntuación en líneas" #: main/application.cpp:1007 main/lineswidget.cpp:1157 msgid "Translate..." msgstr "Traducir..." #: main/application.cpp:1008 msgid "Translate lines texts using Google services" msgstr "Traducir líneas utilizando servicios de Google" #: main/application.cpp:1015 msgid "Edit Line in Place" msgstr "Editar línea in situ" #: main/application.cpp:1016 msgid "Edit current line text in place" msgstr "Editar texto de la línea activa in situ" #: main/application.cpp:1025 msgid "Open Video..." msgstr "Abrir vídeo..." #: main/application.cpp:1026 main/application.cpp:1034 msgid "Open video file" msgstr "Abrir archivo de vídeo" #: main/application.cpp:1033 msgid "Open &Recent Video" msgstr "Abrir vídeo &reciente" #: main/application.cpp:1041 msgid "Close Video" msgstr "Cerrar vídeo" #: main/application.cpp:1042 msgid "Close video file" msgstr "Cerrar archivo de vídeo" #: main/application.cpp:1051 msgid "Full Screen Mode" msgstr "Modo de pantalla completa" #: main/application.cpp:1052 msgid "Toggle full screen mode" msgstr "Alternar modo de pantalla completa" #: main/application.cpp:1060 main/utils/kreplace.cpp:425 msgid "Stop" msgstr "Detener" #: main/application.cpp:1061 msgid "Stop video playback" msgstr "Detener reproducción de vídeo" #: main/application.cpp:1069 main/application.cpp:3156 #: main/application.cpp:3163 msgid "Play" msgstr "Reproducir" #: main/application.cpp:1070 msgid "Toggle video playing/paused" msgstr "Alternar reproducir/pausar vídeo" #: main/application.cpp:1078 msgid "Seek Backwards" msgstr "Retroceder" #: main/application.cpp:1087 msgid "Seek Forwards" msgstr "Avanzar" #: main/application.cpp:1099 msgid "Jump to Previous Line" msgstr "Saltar a la línea anterior" #: main/application.cpp:1100 msgid "Seek to previous subtitle line show time" msgstr "Saltar al tiempo de aparición de la línea anterior" #: main/application.cpp:1109 msgid "Jump to Next Line" msgstr "Saltar a la línea siguiente" #: main/application.cpp:1110 msgid "Seek to next subtitle line show time" msgstr "Saltar al tiempo de aparición de la línea siguiente" #: main/application.cpp:1120 msgid "Set Current Line Show Time" msgstr "Asignar tiempo de aparición de línea activa" #: main/application.cpp:1121 msgid "Set current line show time to video position" msgstr "" "Asignar tiempo de aparición de la línea activa a partir de la posición del " "vídeo" #: main/application.cpp:1131 msgid "Set Current Line Hide Time" msgstr "Asignar tiempo de ocultamiento de línea activa" #: main/application.cpp:1132 msgid "Set current line hide time to video position" msgstr "" "Asignar tiempo de ocultamiento de la línea activa a partir de la posición " "del vídeo" #: main/application.cpp:1141 msgid "Current Line Follows Video" msgstr "Vincular línea activa a posición del vídeo" #: main/application.cpp:1142 msgid "Make current line follow the playing video position" msgstr "" "Vincular línea corriente a la posición del vídeo que se está reproduciendo" #: main/application.cpp:1149 msgctxt "@action:inmenu Toggle audio muted" msgid "Mute" msgstr "Deshabilitar sonido" #: main/application.cpp:1151 msgid "Enable/disable playback sound" msgstr "Activar/desactivar sonido de reproducción" #: main/application.cpp:1159 msgid "Increase Volume" msgstr "Subir volumen" #: main/application.cpp:1160 msgid "Increase volume by 5%" msgstr "Subir volumen un 5%" #: main/application.cpp:1168 msgid "Decrease Volume" msgstr "Bajar volumen" #: main/application.cpp:1169 msgid "Decrease volume by 5%" msgstr "Bajar volumen un 5%" #: main/application.cpp:1177 msgid "Audio Streams" msgstr "Flujos de audio" #: main/application.cpp:1178 msgid "Select active audio stream" msgstr "Seleccionar flujo de audio activo" #: main/application.cpp:1186 msgid "Increase Font Size" msgstr "Aumentar tamaño de fuente" #: main/application.cpp:1187 msgid "Increase subtitles font size by 1 point" msgstr "Aumentar 1 punto el tamaño de fuente de subtítulos" #: main/application.cpp:1195 msgid "Decrease Font Size" msgstr "Disminuir tamaño de fuente" #: main/application.cpp:1196 msgid "Decrease subtitles font size by 1 point" msgstr "Disminuir 1 punto el tamaño de fuente de subtítulos" #: main/application.cpp:1204 msgid "Subtitle Streams" msgstr "Flujos de subtítulo" #: main/application.cpp:1205 msgid "Select active subtitle stream" msgstr "Seleccionar flujo de subtítulo activo" #: main/application.cpp:1212 msgid "Shift to Video Position" msgstr "Desplazar a posición de vídeo" #: main/application.cpp:1213 msgid "" "Set current line show time to video position by equally shifting all lines" msgstr "" "Asignar el tiempo de aparición de la línea activa a la posición del vídeo " "desplazando en igual forma a todas las líneas" #: main/application.cpp:1221 msgid "Adjust to Video Position (Anchor Last Line)" msgstr "Ajustar a posición del vídeo (anclar última línea)" #: main/application.cpp:1222 msgid "" "Set current line to video position by fixing the last line and linearly " "adjusting the other ones" msgstr "" "Asignar la línea activa a la posición del video anclando la última línea y " "ajustando linealmente las restantes" #: main/application.cpp:1230 msgid "Adjust to Video Position (Anchor First Line)" msgstr "Ajustar a posición del vídeo (anclar primera línea)" #: main/application.cpp:1231 msgid "" "Set current line to video position by fixing the first line and linearly " "adjusting the other ones" msgstr "" "Asignar la línea activa a la posición del vídeo anclando la primera línea y " "ajustando linealmente las restantes" #: main/application.cpp:1240 msgctxt "@action:inmenu Manage user scripts" msgid "Scripts Manager..." msgstr "Administrador de scripts..." #: main/application.cpp:1241 msgid "Manage user scripts" msgstr "Administrar scripts de usuario" #: main/application.cpp:1365 msgid "" "The requested action would make the subtitle and its translation share the " "same file, possibly resulting in loss of information when saving.\n" "Are you sure you want to continue?" msgstr "" "La acción solicitada hará que el subtítulo y su traducción compartan el " "mismo archivo, posiblemente ocasionando pérdidas de información al guardar.\n" "¿Está seguro de que desea continuar?" #: main/application.cpp:1366 msgid "Conflicting Subtitle Files" msgstr "Archivos de subtítulos en conflicto" #: main/application.cpp:1488 msgid "" "Could not parse the subtitle file.
This may have been caused by " "usage of the wrong encoding.
" msgstr "" "No se pudo parsear el archivo de subtítulos.
Esto puede deberse al " "uso de una codificación de caracteres incorrecta.
" #: main/application.cpp:1519 msgid "There was an error saving the subtitle." msgstr "Ocurrió un error al guardar el subtítulo." #: main/application.cpp:1561 main/application.cpp:1770 msgid "" "Currently opened translation subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Hay cambios sin guardar en la traducción actualmente abierta.\n" "¿Desea guardarlos?" #: main/application.cpp:1562 main/application.cpp:1771 msgid "Close Translation Subtitle" msgstr "Cerrar traducción" #: main/application.cpp:1574 msgid "" "Currently opened subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Hay cambios sin guardar en el subtítulo actualmente abierto.\n" "¿Desea guardarlos?" #: main/application.cpp:1575 msgid "Close Subtitle" msgstr "Cerrar subtítulo" #: main/application.cpp:1678 msgctxt "@item:inmenu Display primary text in video player" msgid "Primary" msgstr "Texto primario" #: main/application.cpp:1679 msgctxt "@item:inmenu Display translation text in video player" msgid "Translation" msgstr "Traducción" #: main/application.cpp:1689 msgid "Could not parse the subtitle file." msgstr "No se pudo leer el archivo de subtítulos." #: main/application.cpp:1728 msgid "There was an error saving the translation subtitle." msgstr "Ocurrió un error al guardar la traducción." #: main/application.cpp:1864 msgid "Could not read the subtitle file to append." msgstr "No se pudo leer el archivo de subtítulos a añadir." #: main/application.cpp:1916 msgid "Could not write the splitted subtitle file." msgstr "No se pudo escribir el archivo de subtítulo dividido." #: main/application.cpp:1917 msgid "Could not write the splitted subtitle translation file." msgstr "No se pudo escribir el archivo de traducción dividido." #: main/application.cpp:1935 msgid "The specified time does not split the subtitles." msgstr "El instante especificado no divide los subtítulos." #: main/application.cpp:1984 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted part was saved as %1." msgstr "" "No se pudo abrir una nueva ventana de Subtitle Composer.\n" "La parte dividida se guardó como %1." #: main/application.cpp:1989 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted parts were saved as %1 and %2." msgstr "" "No se pudo abrir una nueva ventana de Subtitle Composer.\n" "Las partes divididas se guardaron como %1 y %2." #: main/application.cpp:2077 msgid "Go to Line" msgstr "Ir a línea" #: main/application.cpp:2077 msgid "&Go to line:" msgstr "Ir a línea:" #: main/application.cpp:2389 msgid "Can not perform sort on selection with multiple ranges." msgstr "No se puede ordenar una selección con múltiples rangos." #: main/application.cpp:2499 msgid "The reference subtitle must have more than one line to proceed." msgstr "El subtítulo de referencia debe tener más de una línea para proceder." #: main/application.cpp:2511 msgid "Could not parse the reference subtitle file." msgstr "No se pudo interpretar el archivo de subtítulo de referencia." #: main/application.cpp:2618 main/dialogs/translatedialog.cpp:31 msgid "Translate" msgstr "Traducir" #: main/application.cpp:2619 msgid "Translating text (%1 to %2)..." msgstr "Traduciendo texto (%1 a %2)" #: main/application.cpp:2628 msgid "Translating primary text (%1 to %2)..." msgstr "Traduciendo texto primario (%1 a %2)" #: main/application.cpp:2629 msgid "Translating secondary text (%1 to %2)..." msgstr "Traduciendo texto secundario (%1 a %2)" #: main/application.cpp:2661 msgid "" "Unable to perform texts synchronization (sent and received lines count do " "not match)." msgstr "" "No se pudo realizar la sincronización del texto (el número de líneas " "enviadas no coincide con el número de líneas recibidas)." #: main/application.cpp:2670 msgid "Translate Primary Text" msgstr "Traducir text primario" #: main/application.cpp:2671 msgid "Translate Secondary Text" msgstr "Traducir texto secundario" #: main/application.cpp:2687 msgid "" "There was an error performing the translation:\n" "\n" "%1" msgstr "Ocurrió un error al realizar la traducción: %1" #: main/application.cpp:2740 msgid "Open Video" msgstr "Abrir vídeo" #: main/application.cpp:2873 main/application.cpp:2911 msgid "" "Continuing would result in loss of timing information for some lines.\n" "Are you sure you want to continue?" msgstr "" "Continuar puede resultar en pérdida de información de temporización de " "algunas líneas.\n" "¿Está seguro de querer continuar?" #: main/application.cpp:2929 msgid "Open AudioLevels" msgstr "" #: main/application.cpp:3035 msgid "modified" msgstr "modificado" #: main/application.cpp:3039 main/application.cpp:3050 msgid "Untitled" msgstr "Sin título" #: main/application.cpp:3041 msgid "Untitled Translation" msgstr "Traducción sin título" #: main/application.cpp:3149 msgid "Pause" msgstr "Pausa" #: main/application.cpp:3190 msgid "Seek backwards 1 second" msgid_plural "Seek backwards %1 seconds" msgstr[0] "Retroceder 1 segundo" msgstr[1] "Retroceder %1 segundos" #: main/application.cpp:3196 msgid "Seek forwards 1 second" msgid_plural "Seek forwards %1 seconds" msgstr[0] "Avanzar 1 segundo" msgstr[1] "Avanzar %1 segundos" #: main/application.cpp:3211 main/application.cpp:3223 msgid "Shift %21 Millisecond" msgid_plural "Shift %2%1 Milliseconds" msgstr[0] "Desplazar %21 milisegundo" msgstr[1] "Desplazar %2%1 milisegundos" #: main/application.cpp:3216 main/application.cpp:3228 msgid "Shift selected lines %21 millisecond" msgid_plural "Shift selected lines %2%1 milliseconds" msgstr[0] "Desplazar las líneas seleccionadas %21 milisegundo" msgstr[1] "Desplazar las líneas seleccionadas %2%1 milisegundos" #: main/configdialog.cpp:46 msgid "Configure" msgstr "Configurar" #: main/configdialog.cpp:54 msgctxt "@title General settings" msgid "General" msgstr "General" #: main/configdialog.cpp:55 msgid "General Settings" msgstr "Configuración general" #: main/configdialog.cpp:59 msgctxt "@title Error checks settings" msgid "Error Checks" msgstr "Errores" #: main/configdialog.cpp:60 msgid "Error Checks Settings" msgstr "Opciones de comprobación de errores" #: main/configdialog.cpp:64 msgctxt "@title Spelling settings" msgid "Spelling" msgstr "Ortografía" #: main/configdialog.cpp:65 msgid "Spelling Settings" msgstr "Opciones de ortografía" #: main/configdialog.cpp:69 msgctxt "@title Player settings" msgid "Player" msgstr "Reproductor" #: main/configdialog.cpp:70 msgid "Player Settings" msgstr "Opciones del reproductor" #: main/configdialog.cpp:82 msgctxt "@title Player backend settings" msgid "%1 Backend Settings" msgstr "Opciones de %1" #: main/configs/errorsconfigwidget.cpp:37 msgctxt "@title:group" msgid "Texts" msgstr "Textos" #: main/configs/errorsconfigwidget.cpp:40 msgid "Maximum number of characters:" msgstr "Número máximo de letras:" #: main/configs/errorsconfigwidget.cpp:45 #: main/dialogs/smarttextsadjustdialog.cpp:40 msgid " characters" msgstr " letras" #: main/configs/errorsconfigwidget.cpp:48 msgid "Maximum number of lines:" msgstr "Número máximo de líneas:" #: main/configs/errorsconfigwidget.cpp:53 msgid " lines" msgstr " líneas" #: main/configs/errorsconfigwidget.cpp:56 msgctxt "@title:group" msgid "Absolute Durations" msgstr "Duraciones absolutas" #: main/configs/errorsconfigwidget.cpp:59 #: main/configs/errorsconfigwidget.cpp:78 msgid "Minimum duration:" msgstr "Duración mínima:" #: main/configs/errorsconfigwidget.cpp:64 #: main/configs/errorsconfigwidget.cpp:72 #: main/configs/generalconfigwidget.cpp:52 #: main/configs/generalconfigwidget.cpp:66 #: main/configs/generalconfigwidget.cpp:74 #: main/dialogs/fixoverlappingtimesdialog.cpp:37 msgid " msecs" msgstr " mseg" #: main/configs/errorsconfigwidget.cpp:67 #: main/configs/errorsconfigwidget.cpp:86 msgid "Maximum duration:" msgstr "Duración máxima:" #: main/configs/errorsconfigwidget.cpp:75 msgctxt "@title:group" msgid "Relative Durations" msgstr "Duraciones relativas" #: main/configs/errorsconfigwidget.cpp:83 #: main/configs/errorsconfigwidget.cpp:91 msgid " msecs/character" msgstr " mseg/letra" #: main/configs/errorsconfigwidget.cpp:93 msgctxt "@title:group" msgid "Behavior" msgstr "Comportamiento" #: main/configs/errorsconfigwidget.cpp:96 msgid "Automatically clear fixed errors" msgstr "Limpiar automáticamente los errores corregidos" #: main/configs/generalconfigwidget.cpp:38 #: main/configs/playerconfigwidget.cpp:44 #: player/mplayer/mplayerconfigwidget.cpp:37 msgctxt "@title:group General settings" msgid "General" msgstr "General" #: main/configs/generalconfigwidget.cpp:41 msgid "Default encoding for opening subtitles:" msgstr "Codificación por defecto al abrir subtítulos:" #: main/configs/generalconfigwidget.cpp:47 msgid "On line double click, jump to show time minus:" msgstr "" "Al hacer doble click sobre una línea, saltar al tiempo de aparición menos:" #: main/configs/generalconfigwidget.cpp:55 msgid "Automatically load video file when opening subtitle" msgstr "Cargar vídeo automáticamente al abrir subtítulos" #: main/configs/generalconfigwidget.cpp:58 msgctxt "@title:group" msgid "Quick Actions" msgstr "Acciones rápidas" #: main/configs/generalconfigwidget.cpp:61 msgid "Time shift for selected lines:" msgstr "Desplazamiento para líneas seleccionadas:" #: main/configs/generalconfigwidget.cpp:69 msgid "Compensation for captured video times:" msgstr "Compensación para tiempos de vídeo capturados" #: main/configs/playerconfigwidget.cpp:47 msgid "Player backend:" msgstr "Backend de reproducción:" #: main/configs/playerconfigwidget.cpp:53 msgid "Jump length on seek:" msgstr "Longitud del salto al avanzar o retroceder:" #: main/configs/playerconfigwidget.cpp:58 msgid " secs" msgstr " seg" #: main/configs/playerconfigwidget.cpp:61 main/playerwidget.cpp:452 msgid "Show editable position control" msgstr "Mostrar control para edición de posición" #: main/configs/playerconfigwidget.cpp:64 msgctxt "@title:group" msgid "Subtitles" msgstr "Subtítulo" #: main/configs/playerconfigwidget.cpp:67 msgctxt "@label:chooser The font family name" msgid "Font family:" msgstr "Familia de fuente:" #: main/configs/playerconfigwidget.cpp:72 msgid "Font size:" msgstr "Tamaño de fuente:" #: main/configs/playerconfigwidget.cpp:77 msgid " points" msgstr " puntos" #: main/configs/playerconfigwidget.cpp:80 msgid "Primary color:" msgstr "Color primario:" #: main/configs/playerconfigwidget.cpp:85 msgid "Outline color:" msgstr "Color de delineado:" #: main/configs/playerconfigwidget.cpp:91 msgid "Outline width:" msgstr "Ancho del delineado:" #: main/configs/playerconfigwidget.cpp:96 msgid " pixels" msgstr " pixels" #: main/configs/playerconfigwidget.cpp:99 msgctxt "@title:group" msgid "Subtitles Preview" msgstr "Vista previa de subtítulos" #: main/configs/playerconfigwidget.cpp:109 msgctxt "Text for previewing the subtitles font settings" msgid "

The Quick Brown Fox
Jumps Over The Lazy Dog

" msgstr "" "

Ese libro explica en su epígrafe las hazañas y aventuras
de Don " "Quijote de la Mancha en Kuwait.
" #: main/currentlinewidget.cpp:65 msgid "Show" msgstr "Mostrar" #: main/currentlinewidget.cpp:70 msgid "Hide" msgstr "Ocultar" #: main/currentlinewidget.cpp:75 msgid "Duration" msgstr "Duración" #: main/currentlinewidget.cpp:253 main/currentlinewidget.cpp:259 msgid "No current line" msgstr "Línea no seleccionada" #: main/currentlinewidget.cpp:383 msgid "Current line:" msgstr "Línea activa:" #: main/currentlinewidget.cpp:408 msgid "1 character" msgid_plural "%1 characters" msgstr[0] "1 letra" msgstr[1] "%1 letras" #: main/dialogs/actionwitherrortargetsdialog.cpp:74 msgid "Available errors" msgstr "Errores encontrados" #: main/dialogs/actionwitherrortargetsdialog.cpp:105 msgid "Select None" msgstr "Deseleccionar todos" #: main/dialogs/actionwithtargetdialog.cpp:131 msgid "Target >>" msgstr "Blanco >>" #: main/dialogs/actionwithtargetdialog.cpp:131 #: main/dialogs/actionwithtargetdialog.cpp:149 msgid "Target <<" msgstr "Blanco <<" #: main/dialogs/actionwithtargetdialog.cpp:164 msgid "All lines" msgstr "Todas las líneas" #: main/dialogs/actionwithtargetdialog.cpp:165 main/utils/errorfinder.cpp:48 msgid "Selected lines" msgstr "Líneas seleccionadas" #: main/dialogs/actionwithtargetdialog.cpp:166 msgid "All lines from first selected" msgstr "Todas las líneas desde la primera seleccionada" #: main/dialogs/actionwithtargetdialog.cpp:167 msgid "All lines up to last selected" msgstr "Todas las líneas hasta la última seleccionada" #: main/dialogs/actionwithtargetdialog.cpp:257 main/utils/finder.cpp:63 #: main/utils/replacer.cpp:61 msgid "Both subtitles" msgstr "Ambos subtítulos" #: main/dialogs/actionwithtargetdialog.cpp:260 main/utils/finder.cpp:65 #: main/utils/replacer.cpp:63 msgid "Primary subtitle" msgstr "Subtítulo primario" #: main/dialogs/actionwithtargetdialog.cpp:263 main/utils/finder.cpp:67 #: main/utils/replacer.cpp:65 msgid "Translation subtitle" msgstr "Subtítulo de traducción" #: main/dialogs/actionwithtargetdialog.h:78 msgid "Apply To" msgstr "Aplicar a" #: main/dialogs/adjusttimesdialog.cpp:32 msgid "Adjust" msgstr "Ajustar" #: main/dialogs/adjusttimesdialog.cpp:34 msgctxt "@title:group" msgid "New Times" msgstr "Tiempos nuevos" #: main/dialogs/adjusttimesdialog.cpp:39 msgid "First spoken line:" msgstr "Primera línea hablada:" #: main/dialogs/adjusttimesdialog.cpp:45 msgid "Last spoken line:" msgstr "Última línea hablada:" #: main/dialogs/autodurationsdialog.cpp:38 #: main/dialogs/changeframeratedialog.cpp:36 #: main/dialogs/fixoverlappingtimesdialog.cpp:34 #: main/dialogs/fixpunctuationdialog.cpp:33 #: main/dialogs/smarttextsadjustdialog.cpp:34 #: main/dialogs/splitsubtitledialog.cpp:38 main/dialogs/translatedialog.cpp:33 msgctxt "@title:group" msgid "Settings" msgstr "Configuración" #: main/dialogs/autodurationsdialog.cpp:46 msgid "Milliseconds per line:" msgstr "Milisegundos por línea:" #: main/dialogs/autodurationsdialog.cpp:55 msgid "Milliseconds per word:" msgstr "Milisegundos por palabra:" #: main/dialogs/autodurationsdialog.cpp:64 msgid "Milliseconds per character:" msgstr "Milisegundos por letra:" #: main/dialogs/autodurationsdialog.cpp:68 #: main/dialogs/durationlimitsdialog.cpp:45 msgid "Prevent overlapping" msgstr "Prevenir solapamiento" #: main/dialogs/autodurationsdialog.cpp:71 msgctxt "@title:group" msgid "Duration Calculation" msgstr "Cálculo de duración" #: main/dialogs/autodurationsdialog.cpp:77 msgid "Use primary text" msgstr "Usar texto primario" #: main/dialogs/autodurationsdialog.cpp:78 msgid "Use translation text" msgstr "Usar texto traducido" #: main/dialogs/autodurationsdialog.cpp:79 msgid "Calculate both and use maximum" msgstr "Calcular ambas y usar la máxima" #: main/dialogs/changeframeratedialog.cpp:45 msgid "Current frame rate:" msgstr "Velocidad de fotograma actual:" #: main/dialogs/changeframeratedialog.cpp:54 msgid "New frame rate:" msgstr "Velocidad de fotograma nueva:" #: main/dialogs/changetextscasedialog.cpp:33 msgid "Change Case" msgstr "Modificar mayúsculas/minúsculas" #: main/dialogs/changetextscasedialog.cpp:35 msgctxt "@title:group" msgid "Change To" msgstr "Cambiar a" #: main/dialogs/changetextscasedialog.cpp:39 msgid "Lower case" msgstr "Minúsculas" #: main/dialogs/changetextscasedialog.cpp:44 msgid "Upper case" msgstr "Mayúsculas" #: main/dialogs/changetextscasedialog.cpp:48 msgid "Title case" msgstr "Título" #: main/dialogs/changetextscasedialog.cpp:52 msgid "Sentence case" msgstr "Oración" #: main/dialogs/changetextscasedialog.cpp:56 msgid "Convert to lower case first" msgstr "Convertir a mínusculas primero" #: main/dialogs/checkerrorsdialog.cpp:31 msgid "Check Errors" msgstr "Comprobar errores" #: main/dialogs/checkerrorsdialog.cpp:33 msgctxt "@title:group" msgid "Errors to Check" msgstr "Errores a comprobar" #: main/dialogs/checkerrorsdialog.cpp:36 msgctxt "@title:group Miscellaneous settings" msgid "Miscellaneous" msgstr "Misceláneos" #: main/dialogs/checkerrorsdialog.cpp:39 msgid "Clear other errors" msgstr "Limpiar otros errores" #: main/dialogs/checkerrorsdialog.cpp:43 msgid "Clear user marks" msgstr "Limpiar marcas de usuario" #: main/dialogs/clearerrorsdialog.cpp:32 msgid "Clear Errors" msgstr "Limpiar errores" #: main/dialogs/clearerrorsdialog.cpp:34 msgctxt "@title:group" msgid "Errors to Clear" msgstr "Errores a limpiar" #: main/dialogs/durationlimitsdialog.cpp:35 msgctxt "@title:group" msgid "Minimum Duration" msgstr "Duración mínima" #: main/dialogs/durationlimitsdialog.cpp:41 msgid "Expand duration to:" msgstr "Expandir duración a:" #: main/dialogs/durationlimitsdialog.cpp:48 msgctxt "@title:group" msgid "Maximum Duration" msgstr "Duración máxima" #: main/dialogs/durationlimitsdialog.cpp:54 msgid "Shrink duration to:" msgstr "Encojer duraciones a:" #: main/dialogs/fixoverlappingtimesdialog.cpp:43 msgid "Minimum interval between lines:" msgstr "Intervalo mínimo entre líneas:" #: main/dialogs/fixpunctuationdialog.cpp:31 msgid "Fix Punctuation" msgstr "Corregir puntuación" #: main/dialogs/fixpunctuationdialog.cpp:36 msgid "Fix and cleanup spaces" msgstr "Corregir y limpiar espacios" #: main/dialogs/fixpunctuationdialog.cpp:40 msgid "Fix quotes and double quotes" msgstr "Corregir comillas y apóstrofes" #: main/dialogs/fixpunctuationdialog.cpp:44 msgid "Fix English 'I' pronoun" msgstr "Corregir pronombre inglés \"I\"" #: main/dialogs/fixpunctuationdialog.cpp:48 msgid "Add ellipisis indicating non finished lines" msgstr "Añadir puntos suspensivos indicando líneas inconclusas" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line Before Current" msgstr "Insertar línea antes de la activa" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line After Current" msgstr "Insertar línea después de la activa" #: main/dialogs/insertlinedialog.cpp:29 msgid "Insert Into" msgstr "Insertar en" #: main/dialogs/joinsubtitlesdialog.cpp:40 msgid "Shift subtitle forwards before append" msgstr "Desplazar tiempos de subtítulo hacia adelante antes de añexarlo" #: main/dialogs/joinsubtitlesdialog.cpp:47 #: main/dialogs/splitsubtitledialog.cpp:44 msgid "Set from video length" msgstr "Fijar desde longitud del vídeo" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Subtitle" msgstr "Abrir subtítulo" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Translation Subtitle" msgstr "Abrir traducción de subtítulo" #: main/dialogs/opensubtitledialog.cpp:46 #: main/dialogs/savesubtitledialog.cpp:80 #: main/dialogs/selectablesubtitledialog.cpp:67 msgid "Encoding:" msgstr "Codificación:" #: main/dialogs/opensubtitledialog.cpp:73 msgid "All Supported" msgstr "Todos los archivos soportados" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove Selected Lines" msgstr "Eliminar líneas seleccionadas" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove From" msgstr "Eliminar de" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Subtitle" msgstr "Guardar subtítulo" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Translation Subtitle" msgstr "Guardar traducción de subtítulo" #: main/dialogs/savesubtitledialog.cpp:69 msgid "EOL:" msgstr "Fin de Línea:" #: main/dialogs/savesubtitledialog.cpp:145 msgid "" "A file named \"%1\" already exists. Are you sure you want to overwrite it?" msgstr "" "Ya existe un archivo con el nombre \"%1\". ¿Está seguro de que desea " "sobreescribirlo? " #: main/dialogs/savesubtitledialog.cpp:148 msgid "Overwrite File?" msgstr "¿Sobreescribir archivo?" #: main/dialogs/savesubtitledialog.cpp:149 msgid "Overwrite" msgstr "Sobreescribir" #: main/dialogs/selectablesubtitledialog.cpp:51 msgid "Path:" msgstr "Ruta:" #: main/dialogs/selectablesubtitledialog.cpp:56 msgid "Select subtitle" msgstr "Seleccionar subtítulo" #: main/dialogs/selectablesubtitledialog.h:54 msgid "Subtitle" msgstr "Subtítulo" #: main/dialogs/shifttimesdialog.cpp:32 msgid "Shift" msgstr "Desplazar" #: main/dialogs/shifttimesdialog.cpp:34 msgctxt "@title:group" msgid "Shifting" msgstr "Desplazamiento" #: main/dialogs/shifttimesdialog.cpp:38 msgid "Forwards (+)" msgstr "Hacia adelante (+)" #: main/dialogs/shifttimesdialog.cpp:39 msgid "Backwards (–)" msgstr "Hacia atrás (-)" #: main/dialogs/smarttextsadjustdialog.cpp:43 msgid "Minimum length for line break:" msgstr "Mínima longitud para insertar salto de línea" #: main/dialogs/splitsubtitledialog.cpp:36 msgid "Split Subtitle" msgstr "Dividir subtítulo" #: main/dialogs/splitsubtitledialog.cpp:49 msgid "Split time:" msgstr "Tiempo de división:" #: main/dialogs/splitsubtitledialog.cpp:53 msgid "Shift new part backwards after split" msgstr "Desplazar parte separada hacia atrás" #: main/dialogs/syncsubtitlesdialog.cpp:32 msgid "Synchronize with Subtitle" msgstr "Sincronizar con subtítulo" #: main/dialogs/syncsubtitlesdialog.cpp:34 msgid "Reference Subtitle" msgstr "Subtítulo de referencia" #: main/dialogs/syncsubtitlesdialog.cpp:36 msgctxt "@title:group" msgid "Synchronization Mode" msgstr "Modo de sincronización" #: main/dialogs/syncsubtitlesdialog.cpp:39 msgid "Adjust to reference's first and last lines" msgstr "Adjustar a la primer y última línea del subtítulo de referencia" #: main/dialogs/syncsubtitlesdialog.cpp:43 msgid "Copy timing information from reference line by line" msgstr "" "Copiar línea a línea la información de tiempo desde el subtítulo de " "referencia" #: main/dialogs/translatedialog.cpp:49 msgid "Input language:" msgstr "Lenguage de entrada:" #: main/dialogs/translatedialog.cpp:66 msgid "Output language:" msgstr "Lenguage de salida:" #: main/errorsdialog.cpp:42 msgid "Subtitle Errors" msgstr "Errores de subtítulos" #: main/errorsdialog.cpp:55 msgid "Clear Fixed Errors" msgstr "Limpiar errores corregidos" #: main/errorsdialog.cpp:65 msgid "Settings..." msgstr "Configuración..." #: main/errorsdialog.cpp:121 msgid "Showing 1 line with errors" msgid_plural "Showing %1 lines with errors" msgstr[0] "Mostrando 1 línea con errores" msgstr[1] "Mostrando %1 líneas" #: main/errorsdialog.cpp:124 msgid "1 total error" msgid_plural "%1 total errors" msgstr[0] "1 error en total" msgstr[1] "%1 errores" #: main/errorsdialog.cpp:125 msgid "1 user mark" msgid_plural "%1 user marks" msgstr[0] "1 marca de usuario" msgstr[1] "Tiene marca de usuario." #: main/errorswidget.cpp:491 msgid "Line Errors" msgstr "Descripción de errores" #: main/errorswidget.cpp:492 msgid "Count" msgstr "Cantidad" #: main/errorswidget.cpp:493 msgid "Marked" msgstr "Marcada" #: main/errorswidget.cpp:509 msgid "yes" msgstr "sí" #: main/errorswidget.cpp:510 msgid "no" msgstr "no" #: main/errorswidget.cpp:517 msgid "Line %1" msgstr "Línea %1" #: main/errorswidget.cpp:717 msgid "Expand All" msgstr "Expandir todo" #: main/errorswidget.cpp:718 msgid "Collapse All" msgstr "Colapsar todo" #: main/errorswidget.cpp:722 msgid "Clear Selected Marks" msgstr "Limpiar marcas seleccionadas" #: main/errorswidget.cpp:723 msgid "Clear Selected Errors" msgstr "Limpiar errores seleccionados" #: main/errorswidget.cpp:729 msgid "Clear Fixed Selection" msgstr "Limpiar errores corregidos" #: main/lineswidget.cpp:204 msgid "Observations:" msgstr "Observaciones:" #: main/lineswidget.cpp:232 msgctxt "@title:column Subtitle line number" msgid "Line" msgstr "Línea" #: main/lineswidget.cpp:233 msgctxt "@title:column" msgid "Show Time" msgstr "Mostrar" #: main/lineswidget.cpp:234 msgctxt "@title:column" msgid "Hide Time" msgstr "Ocultar" #: main/lineswidget.cpp:235 msgctxt "@title:column Subtitle line (primary) text" msgid "Text" msgstr "Texto" #: main/lineswidget.cpp:236 msgctxt "@title:column Subtitle line translation text" msgid "Translation" msgstr "Traducción" #: main/lineswidget.cpp:1141 msgid "Texts" msgstr "Textos" #: main/lineswidget.cpp:1162 msgid "Styles" msgstr "Estilos" #: main/lineswidget.cpp:1166 widgets/simplerichtextedit.cpp:119 msgctxt "@action:inmenu Toggle bold style" msgid "Bold" msgstr "Negrita" #: main/lineswidget.cpp:1173 widgets/simplerichtextedit.cpp:125 msgctxt "@action:inmenu Toggle italic style" msgid "Italic" msgstr "Cursiva" #: main/lineswidget.cpp:1180 widgets/simplerichtextedit.cpp:131 msgctxt "@action:inmenu Toggle underline style" msgid "Underline" msgstr "Subrayado" #: main/lineswidget.cpp:1187 widgets/simplerichtextedit.cpp:137 msgctxt "@action:inmenu Toggle strike through style" msgid "Strike Through" msgstr "Tachado" #: main/lineswidget.cpp:1194 msgid "Times" msgstr "Tiempos" #: main/lineswidget.cpp:1196 msgid "Shift +%1 Milliseconds" msgstr "Desplazar +%1 milisegundos" #: main/lineswidget.cpp:1197 msgid "Shift -%1 Milliseconds" msgstr "Desplazar -%1 milisegundos" #: main/lineswidget.cpp:1207 msgid "Errors" msgstr "Errores" #: main/lineswidget.cpp:1208 msgid "Mark" msgstr "Marcar" #: main/main.cpp:43 msgid "Subtitle Composer" msgstr "Subtitle Composer" #: main/main.cpp:45 msgid "A KDE subtitle editor." msgstr "Un editor de subtítulos para KDE" #: main/main.cpp:47 msgid "(C) 2007-2009 Sergio Pistone" msgstr "(C) 2007-2009 Sergio Pistone" #: main/main.cpp:51 msgid "Sergio Pistone" msgstr "Sergio Pistone" #: main/main.cpp:52 msgid "Author & maintainer" msgstr "Autor y mantenedor" #: main/main.cpp:61 msgid "Open location as primary subtitle" msgstr "Abrir locación como subtítulo primario" #: main/main.cpp:62 msgid "Open location as translation subtitle" msgstr "Abrir locación como traducción" #: main/playerwidget.cpp:103 msgid "Position" msgstr "Posición" #: main/playerwidget.cpp:111 msgid "Length" msgstr "Longitud" #: main/playerwidget.cpp:116 msgid "FPS" msgstr "FPS" #: main/playerwidget.cpp:704 main/playerwidget.cpp:705 #: main/playerwidget.cpp:706 main/playerwidget.cpp:778 #: main/playerwidget.cpp:795 main/playerwidget.cpp:802 msgid "Unknown" msgstr "Desconocido" #: main/playerwidget.cpp:715 msgid "There was an error opening file
%1
" msgstr "Ocurrió un error al abrir el archivo
%1
" #: main/playerwidget.cpp:741 msgid "Unexpected error while playing file." msgstr "Error inesperado al reproducir el archivo." #: main/scripting/scriptsmanager.cpp:70 msgid "Installed Scripts" msgstr "Scripts instalados" #: main/scripting/scriptsmanager.cpp:88 msgid "Information" msgstr "" #: main/scripting/scriptsmanager.cpp:94 msgid "Warning" msgstr "" #: main/scripting/scriptsmanager.cpp:100 #, fuzzy msgid "Error" msgstr "Errores" #: main/scripting/scriptsmanager.cpp:113 msgid "Scripts Manager" msgstr "Administrador de scripts" #: main/scripting/scriptsmanager.cpp:129 msgid "Create..." msgstr "Crear..." #: main/scripting/scriptsmanager.cpp:130 msgid "Creates a new script file." msgstr "Crea un nuevo script." #: main/scripting/scriptsmanager.cpp:135 msgid "Add..." msgstr "Agregar..." #: main/scripting/scriptsmanager.cpp:136 msgid "Copies an existing script from a specified location." msgstr "Copia un script existente desde un ubicación dada." #: main/scripting/scriptsmanager.cpp:142 msgid "Sends the selected script to the trash." msgstr "Envía el script seleccionado a la papelera." #: main/scripting/scriptsmanager.cpp:147 msgid "Edit" msgstr "Editar" #: main/scripting/scriptsmanager.cpp:148 msgid "Opens the selected script with an external editor." msgstr "Abre el script seleccionado en un editor externo." #: main/scripting/scriptsmanager.cpp:154 msgid "Run" msgstr "Ejecutar" #: main/scripting/scriptsmanager.cpp:155 msgid "Executes the selected script." msgstr "Ejecuta el script seleccionado." #: main/scripting/scriptsmanager.cpp:160 msgid "Refresh" msgstr "Refrescar" #: main/scripting/scriptsmanager.cpp:161 msgid "Reloads the installed scripts list." msgstr "Recarga la lista de scripts instalados." #: main/scripting/scriptsmanager.cpp:219 main/scripting/scriptsmanager.cpp:301 msgid "" "You must enter an unused name to continue.\n" "Would you like to enter another name?" msgstr "" "Debe ingresar un nombre no utilizado para continuar.\n" "¿Desea ingresar otro nombre?" #: main/scripting/scriptsmanager.cpp:220 main/scripting/scriptsmanager.cpp:302 msgid "Name Already Used" msgstr "Nombre ya utilizado" #: main/scripting/scriptsmanager.cpp:226 msgid "Create New Script" msgstr "Crear nuevo script" #: main/scripting/scriptsmanager.cpp:226 main/scripting/scriptsmanager.cpp:308 msgid "Script name:" msgstr "Nombre de script:" #: main/scripting/scriptsmanager.cpp:239 msgid "There was an error creating the file %1." msgstr "Ocurrió un error al crear el archivo %1." #: main/scripting/scriptsmanager.cpp:283 msgid "Select Existing Script" msgstr "Seleccionar script existente" #: main/scripting/scriptsmanager.cpp:308 msgid "Rename Script" msgstr "Renombrar script" #: main/scripting/scriptsmanager.cpp:322 msgid "There was an error opening the file %1." msgstr "Ocurrió un error al abrir el archivo
%1" #: main/scripting/scriptsmanager.cpp:331 msgid "There was an error copying the file to %1." msgstr "Ocurrió un error al copiar el archivo
%1" #: main/scripting/scriptsmanager.cpp:350 msgid "Do you really want to send file %1 to the trash?" msgstr "¿Está seguro que desea enviar el archivo %1 a la papelera?" #: main/scripting/scriptsmanager.cpp:351 msgid "Move to Trash" msgstr "Envíar a papelera" #: main/scripting/scriptsmanager.cpp:359 msgid "There was an error removing the file %1." msgstr "Ocurrió un error al eliminar el archivo
%1" #: main/scripting/scriptsmanager.cpp:377 msgid "Could not launch external editor.\n" msgstr "No se pudo lanzar el editor externo.\n" #: main/scripting/scriptsmanager.cpp:441 main/scripting/scriptsmanager.cpp:448 msgid "Error Running Script" msgstr "Error ejecutando script" #: main/scripting/scriptsmanager.cpp:462 msgid "Tools" msgstr "Herramientas" #: main/utils/errorfinder.cpp:40 main/utils/errorfinder.cpp:221 #: main/utils/errorfinder.cpp:244 msgid "Find Error" msgstr "Buscar error" #: main/utils/errorfinder.cpp:42 msgid "Errors to Find" msgstr "Errores a comprobar" #: main/utils/errorfinder.cpp:45 msgid "Options" msgstr "Opciones" #: main/utils/errorfinder.cpp:51 msgid "From current line" msgstr "Desde línea activa" #: main/utils/errorfinder.cpp:55 msgid "Find backwards" msgstr "Buscar hacia atrás" #: main/utils/errorfinder.cpp:216 main/utils/finder.cpp:298 #: main/utils/replacer.cpp:258 msgid "" "Beginning of selection reached.\n" "Continue from the end?" msgstr "" "Se alcanzó el comienzo de la selección.\n" "¿Continuar desde el final?" #: main/utils/errorfinder.cpp:217 main/utils/finder.cpp:299 #: main/utils/replacer.cpp:259 msgid "" "Beginning of subtitle reached.\n" "Continue from the end?" msgstr "" "Se alcanzó el comienzo del subtítulo.\n" "¿Continuar desde el final?" #: main/utils/errorfinder.cpp:219 main/utils/finder.cpp:301 #: main/utils/replacer.cpp:261 msgid "" "End of selection reached.\n" "Continue from the beginning?" msgstr "" "Alcanzado fin de selección.\n" "¿Continuar desde el principio?" #: main/utils/errorfinder.cpp:220 main/utils/finder.cpp:302 #: main/utils/replacer.cpp:262 main/utils/speller.cpp:143 msgid "" "End of subtitle reached.\n" "Continue from the beginning?" msgstr "" "Alcanzado fin de subtítulo.\n" "¿Continuar desde el principio?" #: main/utils/errorfinder.cpp:243 msgid "No errors matching given criteria found!" msgstr "No se encontraron errores con criterio especificado!" #: main/utils/finder.cpp:55 msgid "Find In" msgstr "Buscar en" #: main/utils/finder.cpp:278 main/utils/replacer.cpp:234 msgid "No instances of '%1' found!" msgstr "¡No se encontraron ocurrencias de %1!" #: main/utils/finder.cpp:279 main/utils/finder.cpp:303 msgid "Find" msgstr "Buscar" #: main/utils/kreplace.cpp:49 main/utils/kreplace.cpp:53 #: main/utils/replacer.cpp:172 main/utils/replacer.cpp:229 #: main/utils/replacer.cpp:235 main/utils/replacer.cpp:263 msgid "Replace" msgstr "Reemplazar" #: main/utils/kreplace.cpp:51 msgid "&All" msgstr "&Todos" #: main/utils/kreplace.cpp:52 msgid "&Skip" msgstr "&Saltear" #: main/utils/kreplace.cpp:63 msgid "Replace '%1' with '%2'?" msgstr "¿Reemplazar '%1' con '%2'?" #: main/utils/kreplace.cpp:139 main/utils/kreplace.cpp:406 msgid "No text was replaced." msgstr "No se efectuaron reemplazos." #: main/utils/kreplace.cpp:141 main/utils/kreplace.cpp:408 #: main/utils/replacer.cpp:228 main/utils/replacer.cpp:255 msgid "1 replacement done." msgid_plural "%1 replacements done." msgstr[0] "1 reemplazo efectuado." msgstr[1] "%1 reemplazos efectuados." #: main/utils/kreplace.cpp:413 msgid "Beginning of document reached." msgstr "Se alcanzó el comienzo del documento." #: main/utils/kreplace.cpp:415 msgid "End of document reached." msgstr "Se alcanzó el final del documento." #: main/utils/kreplace.cpp:422 msgid "Do you want to restart search from the end?" msgstr "¿Desea volver a buscar desde el final?" #: main/utils/kreplace.cpp:423 msgid "Do you want to restart search at the beginning?" msgstr "¿Desea volver a buscar desde el comienzo?" #: main/utils/kreplace.cpp:425 msgid "Restart" msgstr "Reiniciar" #: main/utils/language.cpp:125 msgid "Automatic" msgstr "Automático" #: main/utils/language.cpp:129 msgctxt "Official language of the Philippines, aka Filipino" msgid "Tagalog" msgstr "Tagalo" #: main/utils/replacer.cpp:53 msgid "Find/Replace In" msgstr "Buscar/Reemplazar en" #: main/utils/speller.cpp:144 msgid "Spell Checking" msgstr "Revisión ortográfica" #: main/utils/translator.cpp:167 msgid "Operation cancelled by user" msgstr "Operación cancelada por usuario" #: main/utils/translator.cpp:270 main/utils/translator.cpp:280 msgid "Unexpected contents received from translation service" msgstr "Contenido inesperado recibido desde el servicio de traducción" #: player/gstreamer/gstreamerbackend.cpp:543 #: player/mplayer/mplayerbackend.cpp:259 player/xine/xinebackend.cpp:278 msgid "Audio Stream #%1" msgstr "Flujo de audio #%1" #: player/gstreamer/gstreamerconfigwidget.cpp:34 msgctxt "@title:group GStreamer sinks settings" msgid "Sinks" msgstr "Sumideros" #: player/gstreamer/gstreamerconfigwidget.cpp:37 msgid "Audio sink:" msgstr "Salida de audio:" #: player/gstreamer/gstreamerconfigwidget.cpp:46 msgid "Video sink:" msgstr "Salida de vídeo:" #: player/mplayer/mplayerconfigwidget.cpp:40 msgid "Executable path:" msgstr "Ruta al archivo ejecutable:" #: player/mplayer/mplayerconfigwidget.cpp:43 msgid "Select the MPlayer executable" msgstr "Seleccionar ejecutable de MPlayer" #: player/mplayer/mplayerconfigwidget.cpp:47 msgctxt "@title:group Video settings" msgid "Video" msgstr "Vídeo" #: player/mplayer/mplayerconfigwidget.cpp:50 msgid "Video output driver:" msgstr "Controlador de vídeo:" #: player/mplayer/mplayerconfigwidget.cpp:58 msgid "Allow frame dropping" msgstr "Permitir pérdida de cuadros" #: player/mplayer/mplayerconfigwidget.cpp:61 msgid "Allow hard frame dropping" msgstr "Permitir pérdida de cuadros pronunciada" #: player/mplayer/mplayerconfigwidget.cpp:64 msgctxt "@title:group Audio settings" msgid "Audio" msgstr "Audio" #: player/mplayer/mplayerconfigwidget.cpp:67 msgid "Audio output driver:" msgstr "Controlador de audio:" #: player/mplayer/mplayerconfigwidget.cpp:75 msgid "A/V synchronization factor:" msgstr "Factor de sincronizacion A/V:" #: player/mplayer/mplayerconfigwidget.cpp:83 msgid "Volume normalization" msgstr "Normalización de volumen" #: player/xine/xineconfigwidget.cpp:34 msgctxt "@title:group Xine drivers settings" msgid "Drivers" msgstr "Controladores" #: player/xine/xineconfigwidget.cpp:37 msgid "Audio driver:" msgstr "Controlador de audio:" #: player/xine/xineconfigwidget.cpp:45 msgid "Video driver:" msgstr "Controlador de vídeo:" #: widgets/simplerichtextedit.cpp:84 msgid "Cut" msgstr "Cortar" #: widgets/simplerichtextedit.cpp:90 msgid "Copy" msgstr "Copiar" #: widgets/simplerichtextedit.cpp:96 msgid "Paste" msgstr "Pegar" #: widgets/simplerichtextedit.cpp:102 msgid "Delete" msgstr "Eliminar" #: widgets/simplerichtextedit.cpp:108 msgctxt "@action:inmenu Clear all text" msgid "Clear" msgstr "Limpiar" #: widgets/simplerichtextedit.cpp:143 msgid "Check Spelling..." msgstr "Revisar ortografía " #: widgets/simplerichtextedit.cpp:147 msgid "Auto Spell Check" msgstr "Revisar ortografía automáticamente" #: widgets/simplerichtextedit.cpp:152 msgid "Allow Tabulations" msgstr "Permitir tabulaciones" #: widgets/simplerichtextedit.cpp:491 msgid "Suggestions" msgstr "Sugerencias" #: widgets/simplerichtextedit.cpp:492 msgid "Ignore" msgstr "Ignorar" #: widgets/simplerichtextedit.cpp:493 msgid "Add to Dictionary" msgstr "Agregar a diccionario" #: widgets/simplerichtextedit.cpp:497 msgid "No suggestions" msgstr "No hay sugerencias" #. i18n: file: main/subtitlecomposerui.rc:5 #. i18n: ectx: Menu (file) #: rc.cpp:3 msgid "&File" msgstr "&Archivo" #. i18n: file: main/subtitlecomposerui.rc:16 #. i18n: ectx: Menu (translation) #: rc.cpp:6 msgid "Translation" msgstr "Traducción" #. i18n: file: main/subtitlecomposerui.rc:28 #. i18n: ectx: Menu (edit) #: rc.cpp:9 msgid "&Edit" msgstr "&Edición" #. i18n: file: main/subtitlecomposerui.rc:51 #. i18n: ectx: Menu (texts) #: rc.cpp:12 msgid "&Texts" msgstr "&Textos" #. i18n: file: main/subtitlecomposerui.rc:62 #. i18n: ectx: Menu (styles) #: rc.cpp:15 msgid "St&yles" msgstr "E&stilos" #. i18n: file: main/subtitlecomposerui.rc:69 #. i18n: ectx: Menu (times) #: rc.cpp:18 msgid "T&imes" msgstr "T&iempos" #. i18n: file: main/subtitlecomposerui.rc:91 #. i18n: ectx: Menu (errors) #: rc.cpp:21 msgid "E&rrors" msgstr "E&rrores" #. i18n: file: main/subtitlecomposerui.rc:104 #. i18n: ectx: Menu (video) #: rc.cpp:24 msgid "&Video" msgstr "&Vídeo" #. i18n: file: main/subtitlecomposerui.rc:132 #. i18n: ectx: Menu (tools) #: rc.cpp:27 msgid "T&ools" msgstr "&Herramientas" #. i18n: file: main/subtitlecomposerui.rc:137 #. i18n: ectx: Menu (audiolevels) #: rc.cpp:30 msgid "&Audio Levels" msgstr "Niveles de &audio" #. i18n: file: main/subtitlecomposerui.rc:153 #. i18n: ectx: ToolBar (mainToolBar) #: rc.cpp:33 msgid "Main Toolbar" msgstr "Barra de herramientas principal" #. i18n: file: main/subtitlecomposerui.rc:165 #. i18n: ectx: ToolBar (editToolBar) #: rc.cpp:36 msgctxt "The toolbar name" msgid "Edit Toolbar" msgstr "Barra de herramientas de edición" #: rc.cpp:37 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Daniel M. Lambea" #: rc.cpp:38 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "dmlambea@gmail.com" #~ msgid "Toggle Line Mark" #~ msgstr "Alternar marca de línea" #~ msgctxt "@title:group" #~ msgid "Subtitles font" #~ msgstr "Fuente de subtítulos" #~ msgid "Size:" #~ msgstr "Tamaño:" #~ msgid "Append to" #~ msgstr "Anexar a" #~ msgid "1 mark" #~ msgid_plural "%1 marks" #~ msgstr[0] "1 marca" #~ msgstr[1] "%1 marcas" #~ msgid "Line Issues" #~ msgstr "Observaciones" #~ msgid "Marks" #~ msgstr "Marcas" #~ msgid "No line with errors found!" #~ msgstr "¡No se encontraron líneas con errores!" subtitlecomposer-0.5.3/po/el/0000755000175000001440000000000011206423743015351 5ustar sergiouserssubtitlecomposer-0.5.3/po/el/CMakeLists.txt0000644000175000001440000000016611151345071020110 0ustar sergiousersFILE( GLOB _po_files *.po ) GETTEXT_PROCESS_PO_FILES( el ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) subtitlecomposer-0.5.3/po/el/subtitlecomposer.po0000644000175000001440000025625211206411600021315 0ustar sergiousers# translation of subtitlecomposer.po to ΕΛΛΗΝΙΚΑ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # Alexandros Perdikomatis , 2008. msgid "" msgstr "" "Project-Id-Version: subtitlecomposer\n" "Report-Msgid-Bugs-To: https://sourceforge.net/tracker/?" "atid=1005652&group_id=208427&func=browse\n" "POT-Creation-Date: 2009-05-25 00:41-0300\n" "PO-Revision-Date: 2008-07-11 07:53+0300\n" "Last-Translator: Alexandros Perdikomatis \n" "Language-Team: ΕΛΛΗΝΙΚΑ \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: KBabel 1.11.4\n" #: core/subtitleactions.cpp:62 msgid "Set Frame Rate" msgstr "Ορισμός Λόγου Καρέ" #: core/subtitleactions.cpp:93 #, fuzzy msgid "Insert Lines" msgstr "Εισαγωγή Γραμμής" #: core/subtitleactions.cpp:177 core/subtitle.cpp:446 core/subtitle.cpp:460 #: core/subtitle.cpp:479 msgid "Remove Lines" msgstr "Αφαίρεση Γραμμών" #: core/subtitleactions.cpp:268 msgid "Move Line" msgstr "Μετακίνηση Γραμμής" #: core/subtitleactions.cpp:381 msgid "Swap Texts" msgstr "Αντιμετάθεση Κειμένων" #: core/subtitle.cpp:66 msgid "Set Primary Data" msgstr "Ορισμός Πρωτεύοντων Δεδομένων" #: core/subtitle.cpp:121 msgid "Clear Primary Text Data" msgstr "Καθαρισμός Δεδομένων Πρωτεύοντος Κειμένου" #: core/subtitle.cpp:134 msgid "Set Secondary Data" msgstr "Ορισμός Δευτερεύοντων Δεδομένων" #: core/subtitle.cpp:180 msgid "Clear Secondary Text Data" msgstr "Καθαρισμός Δεδομένων Δευτερεύοντος Κειμένου" #: core/subtitle.cpp:265 main/dialogs/changeframeratedialog.cpp:34 msgid "Change Frame Rate" msgstr "Αλλαγή Λόγου Καρέ" #: core/subtitle.cpp:395 core/subtitle.cpp:412 msgid "Insert Line" msgstr "Εισαγωγή Γραμμής" #: core/subtitle.cpp:533 main/application.cpp:662 main/lineswidget.cpp:1226 msgid "Split Lines" msgstr "Διαχωρισμός Γραμμών" #: core/subtitle.cpp:590 main/application.cpp:670 main/lineswidget.cpp:1225 msgid "Join Lines" msgstr "Ένωση Γραμμών" #: core/subtitle.cpp:642 msgid "Shift Lines" msgstr "Ολίσθηση Γραμμών" #: core/subtitle.cpp:690 msgid "Adjust Lines" msgstr "Ρύθμιση Γραμμών" #: core/subtitle.cpp:700 main/application.cpp:2377 main/lineswidget.cpp:1200 msgid "Sort" msgstr "" #: core/subtitle.cpp:746 main/dialogs/durationlimitsdialog.cpp:33 #, fuzzy msgid "Enforce Duration Limits" msgstr "Όρια Διάρκειας" #: core/subtitle.cpp:791 main/application.cpp:2462 main/lineswidget.cpp:1203 msgid "Maximize Durations" msgstr "Μεγιστοποίηση Διαρκειών" #: core/subtitle.cpp:816 main/dialogs/autodurationsdialog.cpp:35 msgid "Set Automatic Durations" msgstr "Ορισμός Αυτόματων Διαρκειών" #: core/subtitle.cpp:856 main/dialogs/fixoverlappingtimesdialog.cpp:32 #: main/lineswidget.cpp:1204 #, fuzzy msgid "Fix Overlapping Times" msgstr "Διόρθωση Επικαλυπτόμενων Γραμμών" #: core/subtitle.cpp:890 msgid "Fix Lines Punctuation" msgstr "Διόρθωση Στίξης Γραμμών" #: core/subtitle.cpp:986 msgid "Lower Case" msgstr "Μικρά Γράμματα" #: core/subtitle.cpp:1020 msgid "Upper Case" msgstr "Κεφαλαία Γράμματα" #: core/subtitle.cpp:1054 msgid "Title Case" msgstr "Γράμματα Τίτλου" #: core/subtitle.cpp:1091 msgid "Sentence Case" msgstr "Γράμματα Πρότασης" #: core/subtitle.cpp:1142 main/dialogs/smarttextsadjustdialog.cpp:32 #, fuzzy msgid "Break Lines" msgstr "Επανένωση Γραμμών" #: core/subtitle.cpp:1150 main/application.cpp:2530 main/lineswidget.cpp:1146 msgid "Unbreak Lines" msgstr "Επανένωση Γραμμών" #: core/subtitle.cpp:1158 main/application.cpp:2544 main/lineswidget.cpp:1152 msgid "Simplify Spaces" msgstr "Απλοποίηση Κενών" #: core/subtitle.cpp:1167 msgid "Synchronize Subtitles" msgstr "Συγχρονισμός Υποτίτλων" #: core/subtitle.cpp:1190 main/dialogs/joinsubtitlesdialog.cpp:35 msgid "Join Subtitles" msgstr "Ένωση Υποτίτλων" #: core/subtitle.cpp:1236 core/subtitle.cpp:1242 msgid "Split Subtitles" msgstr "Διαχωρισμός Υποτίτλων" #: core/subtitle.cpp:1259 core/subtitle.cpp:1274 msgid "Set Lines Style" msgstr "Ορισμός Τύπου Εμφάνισης Γραμμών" #: core/subtitle.cpp:1291 msgid "Toggle Lines Style" msgstr "Αντιθέτηση Τύπου Εμφάνισης Γραμμών" #: core/subtitle.cpp:1304 msgid "Set Lines Mark" msgstr "Ορισμός Σημαδιού Γραμμών" #: core/subtitle.cpp:1304 msgid "Clear Lines Mark" msgstr "Καθαρισμός Σημαδιού Γραμμών" #: core/subtitle.cpp:1318 #, fuzzy msgid "Toggle Lines Mark" msgstr "Αντιθέτηση Σημαδιού Γραμμής" #: core/subtitle.cpp:1328 main/application.cpp:2261 main/application.cpp:2271 #: main/errorswidget.cpp:854 msgid "Clear Lines Errors" msgstr "Καθαρισμός Λαθών Γραμμών" #: core/subtitle.cpp:1338 core/subtitle.cpp:1358 main/application.cpp:2194 #: main/application.cpp:2239 msgid "Check Lines Errors" msgstr "Έλεγχος Λαθών Γραμμών" #: core/subtitlelineactions.cpp:65 msgid "Set Line Text" msgstr "Ορισμός Κειμένου Γραμμής" #: core/subtitlelineactions.cpp:101 msgid "Set Line Secondary Text" msgstr "Ορισμός Δευτερεύοντος Κειμένου Γραμμής" #: core/subtitlelineactions.cpp:137 msgid "Set Line Texts" msgstr "Ορισμός Κειμένων Γραμμής" #: core/subtitlelineactions.cpp:218 msgid "Set Line Show Time" msgstr "Ορισμός Χρόνου Παρουσίας Γραμμής" #: core/subtitlelineactions.cpp:254 msgid "Set Line Hide Time" msgstr "Ορισμός Χρόνου Απόκρυψης Γραμμής" #: core/subtitlelineactions.cpp:371 msgid "Set Line Errors" msgstr "Ορισμός Λαθών Γραμμής" #: core/subtitleline.cpp:72 msgid "Empty text" msgstr "Άδειο Κείμενο" #: core/subtitleline.cpp:74 msgid "Too many characters" msgstr "Πάρα πολλοί χαρακτήρες" #: core/subtitleline.cpp:76 msgid "Too many lines" msgstr "Πάρα πολλές γραμμές" #: core/subtitleline.cpp:78 #, fuzzy msgid "Unnecessary white space" msgstr "μη Απαραίτητα κενά" #: core/subtitleline.cpp:80 msgid "Unnecessary dash" msgstr "μη Απαραίτητη τελεία" #: core/subtitleline.cpp:82 #, fuzzy msgid "Capital letter after continuation ellipsis" msgstr "Έλλειψη κεφαλαίου γράμματος μετά γραμμής" #: core/subtitleline.cpp:84 msgid "Too long duration per character" msgstr "Πολύ μακρά διάρκεια ανά χαρακτήρα" #: core/subtitleline.cpp:86 msgid "Too short duration per character" msgstr "Πολύ βραχεία διάρκεια ανά χαρακτήρα" #: core/subtitleline.cpp:88 msgid "Too long duration" msgstr "Πολύ μακρά διάρκεια" #: core/subtitleline.cpp:89 msgid "Too short duration" msgstr "Πολύ βραχεία διάρκεια" #: core/subtitleline.cpp:90 msgid "Overlapping times" msgstr "Επικαλυπτόμενοι χρόνοι" #: core/subtitleline.cpp:91 #, fuzzy msgid "Untranslated text" msgstr "Χρήση μεταφραστικού κειμένου" #: core/subtitleline.cpp:92 #, fuzzy msgid "User mark" msgstr "Σημάδια χρήστη" #: core/subtitleline.cpp:112 msgid "Has no primary text." msgstr "Δεν έχει πρωτεύον κείμενο." #: core/subtitleline.cpp:116 msgid "Has no translation text." msgstr "Δεν έχει κείμενο μετάφρασης." #: core/subtitleline.cpp:120 msgid "Has too many characters in primary text (1 char)." msgid_plural "Has too many characters in primary text (%1 chars)." msgstr[0] "Έχει πάρα πολλούς χαρακτήρες στο πρωτεύον κείμενο (1 χαρακτήρας)." msgstr[1] "Έχει πάρα πολλούς χαρακτήρες στο πρωτεύον κείμενο (%1 χαρακτήρες)." #: core/subtitleline.cpp:126 msgid "Has too many characters in translation text (1 char)." msgid_plural "Has too many characters in translation text (%1 chars)." msgstr[0] "Έχει πάρα πολλούς χαρακτήρες στο κείμενο μετάφρασης (1 χαρακτήρας)." msgstr[1] "" "Έχει πάρα πολλούς χαρακτήρες στο κείμενο μετάφρασης (%1 χαρακτήρες)." #: core/subtitleline.cpp:132 msgid "Has too many lines in primary text (1 line)." msgid_plural "Has too many lines in primary text (%1 lines)." msgstr[0] "Έχει πάρα πολλές γραμμές στο πρωτεύον κείμενο (1 γραμμή)." msgstr[1] "Έχει πάρα πολλές γραμμές στο πρωτεύον κείμενο (%1 γραμμές)." #: core/subtitleline.cpp:138 msgid "Has too many lines in translation text (1 line)." msgid_plural "Has too many lines in translation text (%1 lines)." msgstr[0] "Έχει πάρα πολλές γραμμές στο κείμενο μετάφρασης (1 γραμμή)." msgstr[1] "Έχει πάρα πολλές γραμμές στο κείμενο μετάφρασης (%1 γραμμές)." #: core/subtitleline.cpp:144 msgid "Has unnecessary spaces in primary text." msgstr "Έχει μη απαραίτητα κενά στο πρωτεύον κείμενο." #: core/subtitleline.cpp:148 msgid "Has unnecessary spaces in translation text." msgstr "Έχει μη απαραίτητα κενά στο κείμενο μετάφρασης." #: core/subtitleline.cpp:152 msgid "Has unnecessary dash in primary text." msgstr "Έχει μη απαραίτητες τελείες στο πρωτεύον κείμενο." #: core/subtitleline.cpp:156 msgid "Has unnecessary dash in translation text." msgstr "Έχει μη απαραίτητες τελείες στο κείμενο μετάφρασης." #: core/subtitleline.cpp:160 msgid "Has capital letter after line continuation ellipsis in primary text." msgstr "Έχει έλλειψη κεφαλαίου γράμματος μετά γραμμής στο πρωτεύον κείμενο." #: core/subtitleline.cpp:164 msgid "" "Has capital letter after line continuation ellipsis in translation text." msgstr "Έχει έλλειψη κεφαλαίου γράμματος μετά γραμμής στο κείμενο μετάφρασης." #: core/subtitleline.cpp:168 msgid "Has too long duration per character in primary text (1 msec/char)." msgid_plural "" "Has too long duration per character in primary text (%1 msecs/char)." msgstr[0] "" "Έχει πολύ μακρά διάρκεια ανά χαρακτήρα στο πρωτεύον κείμενο (1 χιλ. του δευ/" "του ανά χαρ/τήρα)." msgstr[1] "" "Έχει πολύ μακρά διάρκεια ανά χαρακτήρα στο πρωτεύον κείμενο (%1 χιλ. του δευ/" "του ανά χαρ/τήρα)." #: core/subtitleline.cpp:174 msgid "Has too long duration per character in translation text (1 msec/char)." msgid_plural "" "Has too long duration per character in translation text (%1 msecs/char)." msgstr[0] "" "Έχει πολύ μακρά διάρκεια ανά χαρακτήρα στο κείμενο μετάφρασης (1 χιλ. του " "δευ/του ανά χαρ/τήρα)." msgstr[1] "" "Έχει πολύ μακρά διάρκεια ανά χαρακτήρα στο κείμενο μετάφρασης (%1 χιλ. του " "δευ/του ανά χαρ/τήρα)." #: core/subtitleline.cpp:180 msgid "Has too short duration per character in primary text (1 msec/char)." msgid_plural "" "Has too short duration per character in primary text (%1 msecs/char)." msgstr[0] "" "Έχει πολύ βραχεία διάρκεια ανά χαρακτήρα στο πρωτεύον κείμενο (1 χιλ. του " "δευ/του ανά χαρ/τήρα)." msgstr[1] "" "Έχει πολύ βραχεία διάρκεια ανά χαρακτήρα στο πρωτεύον κείμενο (%1 χιλ. του " "δευ/του ανά χαρ/τήρα)." #: core/subtitleline.cpp:186 msgid "Has too short duration per character in translation text (1 msec/char)." msgid_plural "" "Has too short duration per character in translation text (%1 msecs/char)." msgstr[0] "" "Έχει πολύ βραχεία διάρκεια ανά χαρακτήρα στο κείμενο μετάφρασης (1 χιλ. του " "δευ/του ανά χαρ/τήρα)." msgstr[1] "" "Έχει πολύ βραχεία διάρκεια ανά χαρακτήρα στο κείμενο μετάφρασης (%1 χιλ. του " "δευ/του ανά χαρ/τήρα)." #: core/subtitleline.cpp:192 #, fuzzy msgid "Has too long duration (1 msec)." msgid_plural "Has too long duration (%1 msecs)." msgstr[0] "Έχει πολύ μακρά διάρκεια (1 χιλ. του δευ/του)." msgstr[1] "Έχει πολύ μακρά διάρκεια (%1 χιλ. του δευ/του)." #: core/subtitleline.cpp:198 #, fuzzy msgid "Has too short duration (1 msec)." msgid_plural "Has too short duration (%1 msecs)." msgstr[0] "Έχει πολύ βραχεία διάρκεια (1 χιλ. του δευ/του)." msgstr[1] "Έχει πολύ βραχεία διάρκεια (%1 χιλ. του δευ/του)." #: core/subtitleline.cpp:204 msgid "Overlaps with next line." msgstr "Επικαλύπτει την επόμενη γραμμή." #: core/subtitleline.cpp:208 #, fuzzy msgid "Has untranslated text." msgstr "Δεν έχει κείμενο μετάφρασης." #: core/subtitleline.cpp:212 msgid "Has user mark." msgstr "Έχει σημάδι χρήστη" #: core/subtitleline.cpp:680 msgid "Set Line Times" msgstr "Ορισμός Χρόνων Γραμμής" #: core/subtitleline.cpp:691 msgid "Shift Line Times" msgstr "Ολίσθηση Χρόνων Γραμμής" #: core/subtitleline.cpp:705 msgid "Adjust Line Times" msgstr "Ρύθμιση Χρόνων Γραμμής" #: main/actions/krecentfilesactionext.cpp:37 msgid "Clear History" msgstr "Καθαρισμός Ιστορικού" #: main/application.cpp:415 msgid "Video Files" msgstr "Αρχεία Βίντεο" #: main/application.cpp:423 msgid "Audio Files" msgstr "Αρχεία Ήχου" #: main/application.cpp:425 msgid "Media Files" msgstr "Αρχεία Μέσων" #: main/application.cpp:426 msgid "All Files" msgstr "Όλα τα Αρχεία" #: main/application.cpp:442 msgid "Audio Levels Files" msgstr "Αρχεία Επιπέδων Ήχου" #: main/application.cpp:456 msgid "Exit the application" msgstr "Έξοδος από την εφαρμογή" #: main/application.cpp:460 msgid "Configure Subtitle Composer" msgstr "Ρύθμιση του Συνθέτη Υποτίτλων" #: main/application.cpp:465 msgctxt "@action:inmenu Create a new subtitle" msgid "New" msgstr "Νέο" #: main/application.cpp:466 msgid "Create an empty subtitle" msgstr "Δημιουργία ενός άδειου υπότιτλου" #: main/application.cpp:475 #, fuzzy msgctxt "@action:inmenu Open subtitle file" msgid "Open..." msgstr "Άνοιγμα..." #: main/application.cpp:476 main/application.cpp:486 msgid "Open subtitle file" msgstr "Άνοιγμα αρχείου υποτίτλων" #: main/application.cpp:485 #, fuzzy msgctxt "@action:inmenu Open rencently used subtitle file" msgid "Open &Recent" msgstr "Άνοιγμα &Πρόσφατου" #: main/application.cpp:493 msgid "Save" msgstr "Αποθήκευση" #: main/application.cpp:494 msgid "Save opened subtitle" msgstr "Αποθήκευση ανοιγμένου υπότιτλου" #: main/application.cpp:503 msgid "Save As..." msgstr "Αποθήκευση ως..." #: main/application.cpp:504 msgid "Save opened subtitle with different settings" msgstr "Αποθήκευση ανοιγμένου υπότιτλου με διαφορετικές ρυθμίσεις" #: main/application.cpp:512 msgid "Close" msgstr "Κλείσιμο" #: main/application.cpp:513 msgid "Close opened subtitle" msgstr "Κλείσιμο ανοιγμένου υπότιτλου" #: main/application.cpp:522 msgid "New Translation" msgstr "Νέα Μετάφραση" #: main/application.cpp:523 msgid "Create an empty translation subtitle" msgstr "Δημιουργία ενός άδειου υπότιτλου μετάφρασης" #: main/application.cpp:532 msgid "Open Translation..." msgstr "Άνοιγμα Μετάφρασης..." #: main/application.cpp:533 main/application.cpp:543 msgid "Open translation subtitle file" msgstr "Άνοιγμα αρχείου μετάφρασης υποτίτλων" #: main/application.cpp:542 msgid "Open &Recent Translation" msgstr "Άνοιγμα &Πρόσφατης Μετάφρασης" #: main/application.cpp:551 msgid "Save Translation" msgstr "Αποθήκευση Μετάφρασης" #: main/application.cpp:552 msgid "Save opened translation subtitle" msgstr "Αποθήκευση ανοιγμένου υπότιτλου μετάφρασης" #: main/application.cpp:561 msgid "Save Translation As..." msgstr "Αποθήκευση Μετάφρασης Ως..." #: main/application.cpp:562 msgid "Save opened translation subtitle with different settings" msgstr "Αποθήκευση ανοιγμένου υπότιτλου μετάφρασης με διαφορετικές ρυθμίσεις" #: main/application.cpp:570 msgid "Close Translation" msgstr "Κλείσιμο Μετάφρασης" #: main/application.cpp:571 msgid "Close opened translation subtitle" msgstr "Κλείσιμο ανοιγμένου υπότιτλου μετάφρασης" #: main/application.cpp:580 msgid "Reload As..." msgstr "Επαναφόρτωση Ως..." #: main/application.cpp:581 main/application.cpp:592 msgid "Reload opened file with a different encoding" msgstr "Επαναφόρτωση ανοιγμένου αρχείου με διαφορετική κωδικοποίηση" #: main/application.cpp:591 msgid "Quick Reload As..." msgstr "Γρήγορη Επαναφόρτωση Ως..." #: main/application.cpp:600 main/application.cpp:601 #: widgets/simplerichtextedit.cpp:72 msgid "Undo" msgstr "Αναίρεση" #: main/application.cpp:610 main/application.cpp:611 #: widgets/simplerichtextedit.cpp:78 msgid "Redo" msgstr "Επαναφορά" #: main/application.cpp:619 msgid "Split Subtitle..." msgstr "Διαχωρισμός Υπότιτλου" #: main/application.cpp:620 msgid "Split the opened subtitle in two parts" msgstr "Διαχωρισμός ανοιγμένου υπότιτλου σε δύο μέρη" #: main/application.cpp:627 msgid "Join Subtitles..." msgstr "Ένωση Υποτίτλων" #: main/application.cpp:628 msgid "Append to the opened subtitle another one" msgstr "Προσθήκη ενός ακόμη υπότιτλου στον ανοιγμένο" #: main/application.cpp:635 main/lineswidget.cpp:1222 msgid "Insert Before" msgstr "Εισαγωγή Πριν" #: main/application.cpp:636 msgid "Insert empty line before current one" msgstr "Εισαγωγή άδειας γραμμής πριν την τρέχουσα" #: main/application.cpp:644 main/lineswidget.cpp:1223 msgid "Insert After" msgstr "Εισαγωγή Μετά" #: main/application.cpp:645 msgid "Insert empty line after current one" msgstr "Εισαγωγή άδειας γραμμής μετά αυτής" #: main/application.cpp:653 main/lineswidget.cpp:1221 #: main/scripting/scriptsmanager.cpp:141 msgid "Remove" msgstr "Αφαίρεση" #: main/application.cpp:654 msgid "Remove selected lines" msgstr "Αφαίρεση επιλεγμένων γραμμών" #: main/application.cpp:663 msgid "Split selected lines" msgstr "Διαχωρισμός επιλεγμένων γραμμών" #: main/application.cpp:671 msgid "Join selected lines" msgstr "Ένωση επιλεγμένων γραμμών" #: main/application.cpp:678 main/dialogs/actionwitherrortargetsdialog.cpp:103 #: main/lineswidget.cpp:1219 widgets/simplerichtextedit.cpp:113 msgid "Select All" msgstr "Επιλογή Όλων" #: main/application.cpp:679 msgid "Select all lines" msgstr "Επιλογή όλων των γραμμών" #: main/application.cpp:687 msgid "Go to Line..." msgstr "Πήγαινε στη Γραμμή..." #: main/application.cpp:688 msgid "Go to specified line" msgstr "Πήγαινε σε συγκεκριμένη γραμμή" #: main/application.cpp:697 msgid "Find..." msgstr "Εύρεση..." #: main/application.cpp:698 msgid "Find occurrences of strings or regular expressions" msgstr "Εύρεση απαντώμενων λεκτικών ή σταθερών εκφράσεων" #: main/application.cpp:708 msgid "Find Next" msgstr "Εύρεση Επόμενου" #: main/application.cpp:709 msgid "Find next occurrence of string or regular expression" msgstr "Εύρεση επόμενου απαντώμενου λεκτικού ή σταθερής έκφρασης" #: main/application.cpp:719 msgid "Find Previous" msgstr "Εύρεση Προηγούμενου" #: main/application.cpp:720 msgid "Find previous occurrence of string or regular expression" msgstr "Εύρεση προηγούμενου απαντώμενου λεκτικού ή σταθερής έκφρασης" #: main/application.cpp:728 msgid "Replace..." msgstr "Αντικατάσταση..." #: main/application.cpp:729 msgid "Replace occurrences of strings or regular expressions" msgstr "Αντικατάσταση απαντώμενων λεκτικών ή σταθερών εκφράσεων" #: main/application.cpp:738 msgid "Retrocede current line" msgstr "" #: main/application.cpp:739 msgid "Makes the line before the current one active" msgstr "" #: main/application.cpp:748 msgid "Advance current line" msgstr "" #: main/application.cpp:749 msgid "Makes the line after the current one active" msgstr "" #: main/application.cpp:757 main/errorsdialog.cpp:59 main/lineswidget.cpp:1212 msgid "Check Errors..." msgstr "Έλεγχος Λαθών" #: main/application.cpp:758 msgid "Check for errors in the current subtitle" msgstr "Έλεγχος για λάθη στον τρέχοντα υπότιτλο" #: main/application.cpp:766 main/errorsdialog.cpp:62 main/lineswidget.cpp:1213 msgid "Clear Errors..." msgstr "Καθαρισμός Λαθών" #: main/application.cpp:767 msgid "Clear errors from selected lines" msgstr "Καθαρισμός λαθών από επιλεγμένες γραμμές" #: main/application.cpp:774 main/lineswidget.cpp:1215 msgid "Show Errors..." msgstr "Εμφάνιση Λαθών" #: main/application.cpp:775 msgid "Show errors information for the current subtitle" msgstr "Εμφάνιση πληροφοριών λαθών για τον συγκεκριμένο υπότιτλο" #: main/application.cpp:784 #, fuzzy msgid "Find Error..." msgstr "Εύρεση Λάθους" #: main/application.cpp:785 #, fuzzy msgid "Find lines with specified errors" msgstr "Εύρεση επόμενης γραμμής με λάθη" #: main/application.cpp:795 msgid "Find Next Error" msgstr "Εύρεση Επόμενου Λάθους" #: main/application.cpp:796 #, fuzzy msgid "Find next line with specified errors" msgstr "Εύρεση επόμενης γραμμής με λάθη" #: main/application.cpp:806 msgid "Find Previous Error" msgstr "Εύρεση Προηγούμενου Λάθους" #: main/application.cpp:807 #, fuzzy msgid "Find previous line with specified errors" msgstr "Εύρεση προηγούμενης γραμμής με λάθη" #: main/application.cpp:816 main/lineswidget.cpp:1159 msgid "Spelling..." msgstr "Συλλαβισμός..." #: main/application.cpp:817 msgid "Check lines spelling" msgstr "Έλεγχος συλλαβισμού γραμμών" #: main/application.cpp:824 msgid "Toggle Mark" msgstr "Αντιθέτηση Σημαδιού" #: main/application.cpp:825 msgid "Toggle selected lines mark" msgstr "Αντιθέτηση σημαδιού επιλεγμένων γραμμών" #: main/application.cpp:834 main/currentlinewidget.cpp:92 msgid "Toggle Bold" msgstr "Αντιθέτηση Έντονου" #: main/application.cpp:835 msgid "Toggle selected lines bold attribute" msgstr "Αντιθέτηση ιδιότητας έντονου επιλεγμένων γραμμών" #: main/application.cpp:844 main/currentlinewidget.cpp:97 msgid "Toggle Italic" msgstr "Αντιθέτηση Πλάγιου" #: main/application.cpp:845 msgid "Toggle selected lines italic attribute" msgstr "Αντιθέτηση ιδιότητας πλάγιου επιλεγμένων γραμμών" #: main/application.cpp:854 main/currentlinewidget.cpp:102 msgid "Toggle Underline" msgstr "Αντιθέτηση Υπογραμμισμένου" #: main/application.cpp:855 msgid "Toggle selected lines underline attribute" msgstr "Αντιθέτηση ιδιότητας υπογραμμισμένου επιλεγμένων γραμμών" #: main/application.cpp:864 main/currentlinewidget.cpp:107 msgid "Toggle Strike Through" msgstr "Αντιθέτηση Διαγραμμένου" #: main/application.cpp:865 #, fuzzy msgid "Toggle selected lines strike through attribute" msgstr "Αντιθέτηση ιδιότητας διαγραμμένου επιλεγμένων γραμμών" #: main/application.cpp:873 main/lineswidget.cpp:1199 #, fuzzy msgid "Shift..." msgstr "Ολίσθηση Γραμμών..." #: main/application.cpp:874 msgid "Shift lines an specified amount of time" msgstr "Ολίσθηση γραμμών κατά ορισμένο χρόνο" #: main/application.cpp:901 #, fuzzy msgid "Adjust..." msgstr "Προσαρμογή Γραμμών..." #: main/application.cpp:902 #, fuzzy msgid "Linearly adjust all lines to a specified interval" msgstr "Προσαρμογή γραμμών γραμμικά κατά ορισμένο χρονικό" #: main/application.cpp:910 #, fuzzy msgid "Sort..." msgstr "Ταξινόμηση Γραμμών" #: main/application.cpp:911 msgid "Sort lines based on their show time" msgstr "Ταξινόμηση γραμμών κατά χρόνο παρουσίας" #: main/application.cpp:918 msgid "Change Frame Rate..." msgstr "Αλλαγή Λόγου Καρέ" #: main/application.cpp:919 msgid "Retime subtitle lines by reinterpreting its frame rate" msgstr "Αναχρονισμός γραμμών υποτίτλων βάσει επανερμηνείας τού λόγου των καρέ" #: main/application.cpp:926 main/lineswidget.cpp:1201 #, fuzzy msgid "Enforce Duration Limits..." msgstr "Όρια Διάρκειας" #: main/application.cpp:927 #, fuzzy msgid "Enforce lines minimum and/or maximum duration limits" msgstr "Υποχρέωση των γραμμών κατά τη ελάχιστη και/ή τη μέγιστη διάρκεια" #: main/application.cpp:935 main/lineswidget.cpp:1202 #, fuzzy msgid "Set Automatic Durations..." msgstr "Ορισμός Αυτόματων Διαρκειών" #: main/application.cpp:936 #, fuzzy msgid "Set lines durations based on amount of letters, words and line breaks" msgstr "" "Όρισε τις διάρκειες των γραμμών βάσει τού πλήθους των λέξεων και/ή τού " "πλήθους αυτών" #: main/application.cpp:943 msgid "Maximize Durations..." msgstr "Μεγιστοποίηση Διαρκειών..." #: main/application.cpp:944 msgid "Extend lines durations up to their next lines show time" msgstr "Επέκταση διάρκειας γραμμών ως τη στιγμή εμφάνισης των επόμενων" #: main/application.cpp:951 #, fuzzy msgid "Fix Overlapping Times..." msgstr "Διόρθωση Επικαλυπτόμενων Γραμμών..." #: main/application.cpp:952 msgid "Fix lines overlapping times" msgstr "Διόρθωση χρόνων επικαλυπτόμενων γραμμών" #: main/application.cpp:959 #, fuzzy msgid "Synchronize with Subtitle..." msgstr "Συγχρονισμός Με Υπότιτλο..." #: main/application.cpp:960 msgid "Copy timing information from another subtitle" msgstr "Αντιγραφή πληροφορίας χρονισμού από άλλο υπότιτλο" #: main/application.cpp:967 main/lineswidget.cpp:1142 #, fuzzy msgid "Break Lines..." msgstr "Επανένωση Γραμμών..." #: main/application.cpp:968 msgid "Automatically set line breaks" msgstr "Αυτόματος ορισμός αλλαγών γραμμής" #: main/application.cpp:975 main/lineswidget.cpp:1145 msgid "Unbreak Lines..." msgstr "Επανένωση Γραμμών..." #: main/application.cpp:976 msgid "Remove line breaks from lines" msgstr "Αφαίρεση αλλαγών γραμμής από γραμμές" #: main/application.cpp:983 main/lineswidget.cpp:1151 msgid "Simplify Spaces..." msgstr "Απλοποίηση Κενών..." #: main/application.cpp:984 msgid "Remove unneeded spaces from lines" msgstr "Αφαίρεση αχρείαστων κενών από γραμμές" #: main/application.cpp:991 main/lineswidget.cpp:1155 msgid "Change Case..." msgstr "Εναλλαγή Πεζών ή Κεφαλαίων..." #: main/application.cpp:992 msgid "Change lines text to upper, lower, title or sentence case" msgstr "Αλλαγή τύπου γραμμών σε κεφαλαία, πεζά, τίτλου ή πρότασης" #: main/application.cpp:999 main/lineswidget.cpp:1156 msgid "Fix Punctuation..." msgstr "Διόρθωση Στίξης..." #: main/application.cpp:1000 msgid "Fix punctuation errors in lines" msgstr "Διόρθωση λαθών στίξης εντός των γραμμών" #: main/application.cpp:1007 main/lineswidget.cpp:1157 #, fuzzy msgid "Translate..." msgstr "Άνοιγμα Μετάφρασης..." #: main/application.cpp:1008 msgid "Translate lines texts using Google services" msgstr "" #: main/application.cpp:1015 #, fuzzy msgid "Edit Line in Place" msgstr "Επεξεργασία Κειμένου Εντός Θέσης" #: main/application.cpp:1016 msgid "Edit current line text in place" msgstr "Επεξεργασία κειμένου τρέχουσας γραμμής εντός θέσης" #: main/application.cpp:1025 msgid "Open Video..." msgstr "Άνοιγμα Βίντεο..." #: main/application.cpp:1026 main/application.cpp:1034 msgid "Open video file" msgstr "Άνοιγμα αρχείου βίντεο" #: main/application.cpp:1033 msgid "Open &Recent Video" msgstr "Άνοιγμα &Πρόσφατου Βίντεο" #: main/application.cpp:1041 msgid "Close Video" msgstr "Κλείσιμο Βίντεο" #: main/application.cpp:1042 msgid "Close video file" msgstr "Κλείσιμο αρχείου βίντεο" #: main/application.cpp:1051 msgid "Full Screen Mode" msgstr "Λειτουργία Πλήρους Οθόνης" #: main/application.cpp:1052 msgid "Toggle full screen mode" msgstr "Αντιθέτηση λειτουργίας πλήρους οθόνης" #: main/application.cpp:1060 main/utils/kreplace.cpp:425 msgid "Stop" msgstr "Σταμάτημα" #: main/application.cpp:1061 msgid "Stop video playback" msgstr "Σταμάτημα αναπαραγωγής βίντεο" #: main/application.cpp:1069 main/application.cpp:3156 #: main/application.cpp:3163 msgid "Play" msgstr "Αναπαραγωγή" #: main/application.cpp:1070 msgid "Toggle video playing/paused" msgstr "Αντιθέτηση παύσης/αναπαραγωγής βίντεο" #: main/application.cpp:1078 msgid "Seek Backwards" msgstr "Ανίχνευση Οπισθοδρομώντας" #: main/application.cpp:1087 msgid "Seek Forwards" msgstr "Ανίχνευση Εμπροσθοδρομώντας" #: main/application.cpp:1099 msgid "Jump to Previous Line" msgstr "Μεταπήδηση στην Προηγούμενη Γραμμή" #: main/application.cpp:1100 msgid "Seek to previous subtitle line show time" msgstr "Ανίχνευση του προηγούμενου χρόνου γραμμής υπότιτλου" #: main/application.cpp:1109 msgid "Jump to Next Line" msgstr "Μεταπήδηση στην Επόμενη Γραμμή" #: main/application.cpp:1110 msgid "Seek to next subtitle line show time" msgstr "Ανίχνευση του επόμενου χρόνου γραμμής υπότιτλου" #: main/application.cpp:1120 msgid "Set Current Line Show Time" msgstr "Ορισμός Τρέχοντος Χρόνου Εμφάνισης Γραμμής" #: main/application.cpp:1121 msgid "Set current line show time to video position" msgstr "Ορισμός του χρόνου εμφάνισης γραμμής στη θέση του βίντεο" #: main/application.cpp:1131 msgid "Set Current Line Hide Time" msgstr "Ορισμός Τρέχοντος Χρόνου Απόκρυψης Γραμμής" #: main/application.cpp:1132 msgid "Set current line hide time to video position" msgstr "Ορισμός του χρόνου απόκρυψης γραμμής στη θέση του βίντεο" #: main/application.cpp:1141 msgid "Current Line Follows Video" msgstr "η Τρέχουσα Γραμμή Ακολουθεί το Βίντεο" #: main/application.cpp:1142 msgid "Make current line follow the playing video position" msgstr "Κάνε την τρέχουσα γραμμή να ακολουθεί τη θέση αναπαραγωγής του βίντεο" #: main/application.cpp:1149 #, fuzzy msgctxt "@action:inmenu Toggle audio muted" msgid "Mute" msgstr "Φίμωση" #: main/application.cpp:1151 msgid "Enable/disable playback sound" msgstr "Ενεργοποίηση/απενεργοποίηση ήχου αναπαραγωγής" #: main/application.cpp:1159 msgid "Increase Volume" msgstr "Αύξηση Στάθμης" #: main/application.cpp:1160 msgid "Increase volume by 5%" msgstr "Αύξηση Στάθμης κατά 5%" #: main/application.cpp:1168 msgid "Decrease Volume" msgstr "Μείωση Στάθμης" #: main/application.cpp:1169 msgid "Decrease volume by 5%" msgstr "Μείωση Στάθμης κατά 5%" #: main/application.cpp:1177 msgid "Audio Streams" msgstr "Ροές Δεδομένων Ήχου" #: main/application.cpp:1178 msgid "Select active audio stream" msgstr "Επιλογή ενεργής ροής δεδομένων ήχου" #: main/application.cpp:1186 msgid "Increase Font Size" msgstr "Μεγέθυνση γραμματοσειράς" #: main/application.cpp:1187 msgid "Increase subtitles font size by 1 point" msgstr "Μεγέθυνση γραμματοσειράς υποτίτλων κατά 1 πόντο" #: main/application.cpp:1195 msgid "Decrease Font Size" msgstr "Σμίκρυνση Γραμματοσειράς" #: main/application.cpp:1196 msgid "Decrease subtitles font size by 1 point" msgstr "Σμίκρυνση γραμματοσειράς υποτίτλων κατά 1 πόντο" #: main/application.cpp:1204 msgid "Subtitle Streams" msgstr "Ροές Δεδομένων Υποτίτλων" #: main/application.cpp:1205 msgid "Select active subtitle stream" msgstr "Επιλογή ενεργής ροής δεδομένων υποτίτλων" #: main/application.cpp:1212 msgid "Shift to Video Position" msgstr "Ολίσθηση στην Θέση του Βίντεο" #: main/application.cpp:1213 msgid "" "Set current line show time to video position by equally shifting all lines" msgstr "" "Ορισμός χρόνου παρουσίας τρέχουσας γραμμής στην θέση του βίντεο μέσω " "ισόβαθμης ολίσθησης όλων των γραμμών" #: main/application.cpp:1221 msgid "Adjust to Video Position (Anchor Last Line)" msgstr "Προσαρμογή στη Θέση του Βίντεο (Αγκύλωση Τελευταίας Γραμμής)" #: main/application.cpp:1222 msgid "" "Set current line to video position by fixing the last line and linearly " "adjusting the other ones" msgstr "" "Ορισμός τρέχουσας γραμμής στην θέση του βίντεο μέσω διόρθωσης της τελευταίας " "γραμμής και γραμμικής προσαρμογής των άλλων" #: main/application.cpp:1230 msgid "Adjust to Video Position (Anchor First Line)" msgstr "Προσαρμογή στην Θέση του Βίντεο (Αγκύλωση Πρώτης Γραμμής)" #: main/application.cpp:1231 msgid "" "Set current line to video position by fixing the first line and linearly " "adjusting the other ones" msgstr "" "Ορισμός τρέχουσας γραμμής στην θέση του βίντεο μέσω διόρθωσης της πρώτης " "γραμμής και γραμμικής προσαρμογής των άλλων" #: main/application.cpp:1240 msgctxt "@action:inmenu Manage user scripts" msgid "Scripts Manager..." msgstr "" #: main/application.cpp:1241 msgid "Manage user scripts" msgstr "" #: main/application.cpp:1365 #, fuzzy msgid "" "The requested action would make the subtitle and its translation share the " "same file, possibly resulting in loss of information when saving.\n" "Are you sure you want to continue?" msgstr "" "Η αιτηθείσα πράξη κάνει τον υπότιτλο και την μετάφρασή του να μοιράζονται το " "ίδιο αρχείο, με πιθανό αποτέλεσμα την απώλεια πληροφοριών κατά την " "αποθήκευση.\n" "Είσαστε σίγουρος/η ότι θέλετε να συνεχίσετε;" #: main/application.cpp:1366 msgid "Conflicting Subtitle Files" msgstr "Διένεξη Αρχείων Υποτίτλων" #: main/application.cpp:1488 #, fuzzy msgid "" "Could not parse the subtitle file.
This may have been caused by " "usage of the wrong encoding.
" msgstr "" "Αδυναμία επικόλλησης του αρχείου υποτίτλων.
Αυτό ίσως προκλήθηκε από " "χρήση λάθους κωδικοποίησης.
" #: main/application.cpp:1519 msgid "There was an error saving the subtitle." msgstr "Παρουσιάστηκε σφάλμα αποθηκεύοντας τον υπότιτλο." #: main/application.cpp:1561 main/application.cpp:1770 msgid "" "Currently opened translation subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Ο τρέχων ανοιχτός υπότιτλος μετάφρασης έχει αναποθήκευτες αλλαγές.\n" "Θέλετε να τις αποθηκεύσετε;" #: main/application.cpp:1562 main/application.cpp:1771 msgid "Close Translation Subtitle" msgstr "Κλείσιμο Υπότιτλου Μετάφρασης" #: main/application.cpp:1574 msgid "" "Currently opened subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Ο τρέχων ανοιχτός υπότιτλος έχει αναποθήκευτες αλλαγές.\n" "Θέλετε να τις αποθηκεύσετε;" #: main/application.cpp:1575 msgid "Close Subtitle" msgstr "Κλείσιμο Υπότιτλου" #: main/application.cpp:1678 #, fuzzy msgctxt "@item:inmenu Display primary text in video player" msgid "Primary" msgstr "Πρωτεύον" #: main/application.cpp:1679 #, fuzzy msgctxt "@item:inmenu Display translation text in video player" msgid "Translation" msgstr "Μετάφραση" #: main/application.cpp:1689 #, fuzzy msgid "Could not parse the subtitle file." msgstr "Αδυναμία επικόλλησης του αρχείου υποτίτλων." #: main/application.cpp:1728 msgid "There was an error saving the translation subtitle." msgstr "Παρουσιάστηκε σφάλμα αποθηκεύοντας τον υπότιτλο μετάφρασης." #: main/application.cpp:1864 #, fuzzy msgid "Could not read the subtitle file to append." msgstr "Αδυναμία ανάγνωσης του αρχείου υποτίτλων προς ενημέρωση." #: main/application.cpp:1916 #, fuzzy msgid "Could not write the splitted subtitle file." msgstr "Αδυναμία εγγραφής του διαχωρισμένου αρχείου υποτίτλων." #: main/application.cpp:1917 #, fuzzy msgid "Could not write the splitted subtitle translation file." msgstr "Αδυναμία εγγραφής του διαχωρισμένου αρχείου υποτίτλων μετάφρασης." #: main/application.cpp:1935 msgid "The specified time does not split the subtitles." msgstr "Ο συγκεκριμένος χρόνος δεν διαχωρίζει τους υπότιτλους" #: main/application.cpp:1984 #, fuzzy msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted part was saved as %1." msgstr "" "Αδυναμία ανοίγματος ενός νέου παράθυρου Συνθέτη Υποτίτλων.\n" "Το διαχωρισμένο τμήμα αποθηκεύτηκε ως %1." #: main/application.cpp:1989 #, fuzzy msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted parts were saved as %1 and %2." msgstr "" "Αδυναμία ανοίγματος ενός νέου παράθυρου Συνθέτη Υποτίτλων.\n" "Το διαχωρισμένο τμήμα αποθηκεύτηκε ως %1 και %2." #: main/application.cpp:2077 msgid "Go to Line" msgstr "Πήγαινε στη Γραμμή" #: main/application.cpp:2077 msgid "&Go to line:" msgstr "&Πήγαινε στη γραμμή:" #: main/application.cpp:2389 #, fuzzy msgid "Can not perform sort on selection with multiple ranges." msgstr "Αδυνατώ να ταξινομήσω σε επιλογή πολλαπλής έκτασης." #: main/application.cpp:2499 msgid "The reference subtitle must have more than one line to proceed." msgstr "" "Ο υπότιτλος αναφοράς πρέπει να έχει πλέον της μίας γραμμής για να συνεχίσω." #: main/application.cpp:2511 #, fuzzy msgid "Could not parse the reference subtitle file." msgstr "Αδυναμία επικόλλησης του αρχείου υποτίτλων αναφοράς." #: main/application.cpp:2618 main/dialogs/translatedialog.cpp:31 #, fuzzy msgid "Translate" msgstr "Μετάφραση" #: main/application.cpp:2619 #, fuzzy msgid "Translating text (%1 to %2)..." msgstr "Χρήση μεταφραστικού κειμένου" #: main/application.cpp:2628 msgid "Translating primary text (%1 to %2)..." msgstr "" #: main/application.cpp:2629 msgid "Translating secondary text (%1 to %2)..." msgstr "" #: main/application.cpp:2661 msgid "" "Unable to perform texts synchronization (sent and received lines count do " "not match)." msgstr "" #: main/application.cpp:2670 #, fuzzy msgid "Translate Primary Text" msgstr "Χρήση πρωτεύοντος κειμένου" #: main/application.cpp:2671 #, fuzzy msgid "Translate Secondary Text" msgstr "Ορισμός Δευτερεύοντος Κειμένου Γραμμής" #: main/application.cpp:2687 #, fuzzy msgid "" "There was an error performing the translation:\n" "\n" "%1" msgstr "Παρουσιάστηκε σφάλμα αποθηκεύοντας τον υπότιτλο μετάφρασης." #: main/application.cpp:2740 msgid "Open Video" msgstr "Άνοιγμα Βίντεο" #: main/application.cpp:2873 main/application.cpp:2911 msgid "" "Continuing would result in loss of timing information for some lines.\n" "Are you sure you want to continue?" msgstr "" "Η συνέχεια θα έχει ως αποτέλεσμα την απώλεια της πληροφορίας χρονισμού για " "κάποιες γραμμές.\n" "Είστε σίγουρος/η ότι θέλετε να συνεχίσετε;" #: main/application.cpp:2929 msgid "Open AudioLevels" msgstr "Άνοιγμα Επιπέδων Ήχου" #: main/application.cpp:3035 msgid "modified" msgstr "τροποποιημένο" #: main/application.cpp:3039 main/application.cpp:3050 msgid "Untitled" msgstr "Άτιτλο" #: main/application.cpp:3041 msgid "Untitled Translation" msgstr "Άτιτλη Μετάφραση" #: main/application.cpp:3149 msgid "Pause" msgstr "Παύση" #: main/application.cpp:3190 msgid "Seek backwards 1 second" msgid_plural "Seek backwards %1 seconds" msgstr[0] "Ανίχνευση Οπισθοδρομώντας κατά 1 δευτερόλεπτο" msgstr[1] "Ανίχνευση Οπισθοδρομώντας κατά %1 δευτερόλεπτα" #: main/application.cpp:3196 msgid "Seek forwards 1 second" msgid_plural "Seek forwards %1 seconds" msgstr[0] "Ανίχνευση Εμπροσθοδρομώντας κατά 1 δευτερόλεπτο" msgstr[1] "Ανίχνευση Εμπροσθοδρομώντας κατά %1 δευτερόλεπτα" #: main/application.cpp:3211 main/application.cpp:3223 #, fuzzy msgid "Shift %21 Millisecond" msgid_plural "Shift %2%1 Milliseconds" msgstr[0] "Ολίσθηση +%1 Χιλιοστά του δευτερολέπτου" msgstr[1] "Ολίσθηση +%1 Χιλιοστά του δευτερολέπτου" #: main/application.cpp:3216 main/application.cpp:3228 #, fuzzy msgid "Shift selected lines %21 millisecond" msgid_plural "Shift selected lines %2%1 milliseconds" msgstr[0] "Ολίσθηση +%1 Χιλιοστά του δευτερολέπτου επιλεγμένων γραμμών" msgstr[1] "Ολίσθηση +%1 Χιλιοστά του δευτερολέπτου επιλεγμένων γραμμών" #: main/configdialog.cpp:46 msgid "Configure" msgstr "Ρύθμιση" #: main/configdialog.cpp:54 #, fuzzy msgctxt "@title General settings" msgid "General" msgstr "Γενικά" #: main/configdialog.cpp:55 msgid "General Settings" msgstr "" #: main/configdialog.cpp:59 #, fuzzy msgctxt "@title Error checks settings" msgid "Error Checks" msgstr "Έλεγχος Λαθών" #: main/configdialog.cpp:60 msgid "Error Checks Settings" msgstr "" #: main/configdialog.cpp:64 #, fuzzy msgctxt "@title Spelling settings" msgid "Spelling" msgstr "Συλλαβισμός..." #: main/configdialog.cpp:65 msgid "Spelling Settings" msgstr "" #: main/configdialog.cpp:69 #, fuzzy msgctxt "@title Player settings" msgid "Player" msgstr "Αναπαραγωγέας" #: main/configdialog.cpp:70 msgid "Player Settings" msgstr "" #: main/configdialog.cpp:82 msgctxt "@title Player backend settings" msgid "%1 Backend Settings" msgstr "" #: main/configs/errorsconfigwidget.cpp:37 #, fuzzy msgctxt "@title:group" msgid "Texts" msgstr "Κείμενα" #: main/configs/errorsconfigwidget.cpp:40 msgid "Maximum number of characters:" msgstr "Μέγιστος αριθμός χαρακτήρων:" #: main/configs/errorsconfigwidget.cpp:45 #: main/dialogs/smarttextsadjustdialog.cpp:40 msgid " characters" msgstr "χαρακτήρες" #: main/configs/errorsconfigwidget.cpp:48 msgid "Maximum number of lines:" msgstr "Μέγιστος αριθμός γραμμών:" #: main/configs/errorsconfigwidget.cpp:53 msgid " lines" msgstr "γραμμές" #: main/configs/errorsconfigwidget.cpp:56 #, fuzzy msgctxt "@title:group" msgid "Absolute Durations" msgstr "Απόλυτες διάρκειες" #: main/configs/errorsconfigwidget.cpp:59 #: main/configs/errorsconfigwidget.cpp:78 msgid "Minimum duration:" msgstr "Ελάχιστη διάρκεια:" #: main/configs/errorsconfigwidget.cpp:64 #: main/configs/errorsconfigwidget.cpp:72 #: main/configs/generalconfigwidget.cpp:52 #: main/configs/generalconfigwidget.cpp:66 #: main/configs/generalconfigwidget.cpp:74 #: main/dialogs/fixoverlappingtimesdialog.cpp:37 msgid " msecs" msgstr " χιλ. του δευ/του" #: main/configs/errorsconfigwidget.cpp:67 #: main/configs/errorsconfigwidget.cpp:86 msgid "Maximum duration:" msgstr "Μέγιστη διάρκεια:" #: main/configs/errorsconfigwidget.cpp:75 #, fuzzy msgctxt "@title:group" msgid "Relative Durations" msgstr "Σχετικές διάρκειες" #: main/configs/errorsconfigwidget.cpp:83 #: main/configs/errorsconfigwidget.cpp:91 msgid " msecs/character" msgstr " χιλ. του δευ/του ανά χαρακτήρα" #: main/configs/errorsconfigwidget.cpp:93 #, fuzzy msgctxt "@title:group" msgid "Behavior" msgstr "Συμπεριφορά" #: main/configs/errorsconfigwidget.cpp:96 msgid "Automatically clear fixed errors" msgstr "Αυτόματος καθαρισμός διορθωμένων λαθών" #: main/configs/generalconfigwidget.cpp:38 #: main/configs/playerconfigwidget.cpp:44 #: player/mplayer/mplayerconfigwidget.cpp:37 #, fuzzy msgctxt "@title:group General settings" msgid "General" msgstr "Γενικά" #: main/configs/generalconfigwidget.cpp:41 msgid "Default encoding for opening subtitles:" msgstr "Εξ ορισμού κωδικοποίηση για ανοιγόμενους υπότιτλους:" #: main/configs/generalconfigwidget.cpp:47 msgid "On line double click, jump to show time minus:" msgstr "Διπλό κλικ στη γραμμή, μεταπηδά στην παρουσίαση ελάχιστου χρόνου:" #: main/configs/generalconfigwidget.cpp:55 msgid "Automatically load video file when opening subtitle" msgstr "Αυτόματη φόρτωση αρχείου βίντεο κατά το άνοιγμα υπότιτλου" #: main/configs/generalconfigwidget.cpp:58 #, fuzzy msgctxt "@title:group" msgid "Quick Actions" msgstr "Γρήγορες ενέργειες" #: main/configs/generalconfigwidget.cpp:61 msgid "Time shift for selected lines:" msgstr "Χρονική ολίσθηση για επιλεγμένες γραμμές:" #: main/configs/generalconfigwidget.cpp:69 #, fuzzy msgid "Compensation for captured video times:" msgstr "Χρονική αναπλήρωση για ληφθέντες χρόνους βίντεο:" #: main/configs/playerconfigwidget.cpp:47 msgid "Player backend:" msgstr "Ενδότερα αναπαραγωγέα:" #: main/configs/playerconfigwidget.cpp:53 #, fuzzy msgid "Jump length on seek:" msgstr "μήκος μεταπήδησης κατά την ανίχνευση εμπρός/πίσω:" #: main/configs/playerconfigwidget.cpp:58 msgid " secs" msgstr "δευτ." #: main/configs/playerconfigwidget.cpp:61 main/playerwidget.cpp:452 msgid "Show editable position control" msgstr "Εμφάνιση ελέγχου θέσης δυνάμενης να διορθωθεί" #: main/configs/playerconfigwidget.cpp:64 #, fuzzy msgctxt "@title:group" msgid "Subtitles" msgstr "Υπότιτλος" #: main/configs/playerconfigwidget.cpp:67 #, fuzzy msgctxt "@label:chooser The font family name" msgid "Font family:" msgstr "Οικογένεια:" #: main/configs/playerconfigwidget.cpp:72 msgid "Font size:" msgstr "" #: main/configs/playerconfigwidget.cpp:77 msgid " points" msgstr "πόντοι" #: main/configs/playerconfigwidget.cpp:80 msgid "Primary color:" msgstr "Πρωτεύον Χρώμα:" #: main/configs/playerconfigwidget.cpp:85 msgid "Outline color:" msgstr "Χρώμα Περιγράμματος:" #: main/configs/playerconfigwidget.cpp:91 msgid "Outline width:" msgstr "Πλάτος Περιγράμματος:" #: main/configs/playerconfigwidget.cpp:96 msgid " pixels" msgstr "εικονοστοιχεία" #: main/configs/playerconfigwidget.cpp:99 #, fuzzy msgctxt "@title:group" msgid "Subtitles Preview" msgstr "Επισκόπηση υποτίτλων" #: main/configs/playerconfigwidget.cpp:109 #, fuzzy msgctxt "Text for previewing the subtitles font settings" msgid "

The Quick Brown Fox
Jumps Over The Lazy Dog

" msgstr "

Η Γρήγορη Καφετιά Αλεπού
Πηδά Πάνω Από Το Τεμπελόσκυλο

" #: main/currentlinewidget.cpp:65 msgid "Show" msgstr "Εμφάνιση" #: main/currentlinewidget.cpp:70 msgid "Hide" msgstr "Απόκρυψη" #: main/currentlinewidget.cpp:75 msgid "Duration" msgstr "Διάρκεια" #: main/currentlinewidget.cpp:253 main/currentlinewidget.cpp:259 msgid "No current line" msgstr "Ανυπαρξία τρέχουσας γραμμής" #: main/currentlinewidget.cpp:383 msgid "Current line:" msgstr "" #: main/currentlinewidget.cpp:408 msgid "1 character" msgid_plural "%1 characters" msgstr[0] "" msgstr[1] "" #: main/dialogs/actionwitherrortargetsdialog.cpp:74 msgid "Available errors" msgstr "" #: main/dialogs/actionwitherrortargetsdialog.cpp:105 msgid "Select None" msgstr "Επιλογή Κανενός" #: main/dialogs/actionwithtargetdialog.cpp:131 #, fuzzy msgid "Target >>" msgstr "Τις στοχευμένες γραμμές" #: main/dialogs/actionwithtargetdialog.cpp:131 #: main/dialogs/actionwithtargetdialog.cpp:149 #, fuzzy msgid "Target <<" msgstr "Τις στοχευμένες γραμμές" #: main/dialogs/actionwithtargetdialog.cpp:164 msgid "All lines" msgstr "Όλες τις γραμμές" #: main/dialogs/actionwithtargetdialog.cpp:165 main/utils/errorfinder.cpp:48 msgid "Selected lines" msgstr "Επιλεγμένες γραμμές" #: main/dialogs/actionwithtargetdialog.cpp:166 msgid "All lines from first selected" msgstr "Όλες τις γραμμές από την πρώτη επιλεγμένη" #: main/dialogs/actionwithtargetdialog.cpp:167 msgid "All lines up to last selected" msgstr "Όλες τις γραμμές έως την τελευταία επιλεγμένη" #: main/dialogs/actionwithtargetdialog.cpp:257 main/utils/finder.cpp:63 #: main/utils/replacer.cpp:61 #, fuzzy msgid "Both subtitles" msgstr "Ένωση Υποτίτλων" #: main/dialogs/actionwithtargetdialog.cpp:260 main/utils/finder.cpp:65 #: main/utils/replacer.cpp:63 #, fuzzy msgid "Primary subtitle" msgstr "Ενημέρωση στον πρωτεύοντα τίτλο" #: main/dialogs/actionwithtargetdialog.cpp:263 main/utils/finder.cpp:67 #: main/utils/replacer.cpp:65 #, fuzzy msgid "Translation subtitle" msgstr "Άνοιγμα Τίτλου Μετάφρασης" #: main/dialogs/actionwithtargetdialog.h:78 msgid "Apply To" msgstr "" #: main/dialogs/adjusttimesdialog.cpp:32 #, fuzzy msgid "Adjust" msgstr "Ρύθμιση Γραμμών" #: main/dialogs/adjusttimesdialog.cpp:34 #, fuzzy msgctxt "@title:group" msgid "New Times" msgstr "Χρόνοι" #: main/dialogs/adjusttimesdialog.cpp:39 msgid "First spoken line:" msgstr "Πρώτη πρόζα:" #: main/dialogs/adjusttimesdialog.cpp:45 msgid "Last spoken line:" msgstr "Τελευταία πρόζα:" #: main/dialogs/autodurationsdialog.cpp:38 #: main/dialogs/changeframeratedialog.cpp:36 #: main/dialogs/fixoverlappingtimesdialog.cpp:34 #: main/dialogs/fixpunctuationdialog.cpp:33 #: main/dialogs/smarttextsadjustdialog.cpp:34 #: main/dialogs/splitsubtitledialog.cpp:38 main/dialogs/translatedialog.cpp:33 #, fuzzy msgctxt "@title:group" msgid "Settings" msgstr "Ρυθμίσεις" #: main/dialogs/autodurationsdialog.cpp:46 #, fuzzy msgid "Milliseconds per line:" msgstr "Χιλιοστά του δευ/του ανά γραμμή:" #: main/dialogs/autodurationsdialog.cpp:55 #, fuzzy msgid "Milliseconds per word:" msgstr "Χιλιοστά του δευ/του ανά λέξη:" #: main/dialogs/autodurationsdialog.cpp:64 #, fuzzy msgid "Milliseconds per character:" msgstr "Χιλιοστά του δευ/του ανά χαρακτήρα:" #: main/dialogs/autodurationsdialog.cpp:68 #: main/dialogs/durationlimitsdialog.cpp:45 msgid "Prevent overlapping" msgstr "Αποτροπή επικάλυψης" #: main/dialogs/autodurationsdialog.cpp:71 #, fuzzy msgctxt "@title:group" msgid "Duration Calculation" msgstr "Υπολογισμός διάρκειας" #: main/dialogs/autodurationsdialog.cpp:77 msgid "Use primary text" msgstr "Χρήση πρωτεύοντος κειμένου" #: main/dialogs/autodurationsdialog.cpp:78 msgid "Use translation text" msgstr "Χρήση μεταφραστικού κειμένου" #: main/dialogs/autodurationsdialog.cpp:79 msgid "Calculate both and use maximum" msgstr "Υπολογισμός αμφότερων και χρήση μέγιστου" #: main/dialogs/changeframeratedialog.cpp:45 #, fuzzy msgid "Current frame rate:" msgstr "Τρέχων λόγος καρέ:" #: main/dialogs/changeframeratedialog.cpp:54 #, fuzzy msgid "New frame rate:" msgstr "Νέος λόγος καρέ:" #: main/dialogs/changetextscasedialog.cpp:33 msgid "Change Case" msgstr "Εναλλαγή πεζά/κεφαλαία" #: main/dialogs/changetextscasedialog.cpp:35 #, fuzzy msgctxt "@title:group" msgid "Change To" msgstr "Εναλλαγή πεζά/κεφαλαία" #: main/dialogs/changetextscasedialog.cpp:39 msgid "Lower case" msgstr "Πεζά" #: main/dialogs/changetextscasedialog.cpp:44 msgid "Upper case" msgstr "Κεφαλαία" #: main/dialogs/changetextscasedialog.cpp:48 msgid "Title case" msgstr "Τίτλων" #: main/dialogs/changetextscasedialog.cpp:52 msgid "Sentence case" msgstr "Πρότασης" #: main/dialogs/changetextscasedialog.cpp:56 #, fuzzy msgid "Convert to lower case first" msgstr "Αλλαγή πρώτα σε πεζά" #: main/dialogs/checkerrorsdialog.cpp:31 msgid "Check Errors" msgstr "Έλεγχος Λαθών" #: main/dialogs/checkerrorsdialog.cpp:33 #, fuzzy msgctxt "@title:group" msgid "Errors to Check" msgstr "Λάθη προς έλεγχο" #: main/dialogs/checkerrorsdialog.cpp:36 #, fuzzy msgctxt "@title:group Miscellaneous settings" msgid "Miscellaneous" msgstr "Διάφορα" #: main/dialogs/checkerrorsdialog.cpp:39 msgid "Clear other errors" msgstr "Καθαρισμός άλλων λαθών" #: main/dialogs/checkerrorsdialog.cpp:43 msgid "Clear user marks" msgstr "Καθαρισμός σημαδιών χρήστη" #: main/dialogs/clearerrorsdialog.cpp:32 msgid "Clear Errors" msgstr "Καθαρισμός Λαθών" #: main/dialogs/clearerrorsdialog.cpp:34 #, fuzzy msgctxt "@title:group" msgid "Errors to Clear" msgstr "Λάθη προς εκκαθάριση" #: main/dialogs/durationlimitsdialog.cpp:35 #, fuzzy msgctxt "@title:group" msgid "Minimum Duration" msgstr "Ελάχιστη διάρκεια:" #: main/dialogs/durationlimitsdialog.cpp:41 msgid "Expand duration to:" msgstr "" #: main/dialogs/durationlimitsdialog.cpp:48 #, fuzzy msgctxt "@title:group" msgid "Maximum Duration" msgstr "Μέγιστη διάρκεια:" #: main/dialogs/durationlimitsdialog.cpp:54 msgid "Shrink duration to:" msgstr "" #: main/dialogs/fixoverlappingtimesdialog.cpp:43 #, fuzzy msgid "Minimum interval between lines:" msgstr "Ελάχιστο χρονικό" #: main/dialogs/fixpunctuationdialog.cpp:31 msgid "Fix Punctuation" msgstr "Διόρθωση Στίξης" #: main/dialogs/fixpunctuationdialog.cpp:36 msgid "Fix and cleanup spaces" msgstr "Διόρθωση και καθαρισμός κενών" #: main/dialogs/fixpunctuationdialog.cpp:40 msgid "Fix quotes and double quotes" msgstr "Διόρθωση εισαγωγικών και διπλών εισαγωγικών" #: main/dialogs/fixpunctuationdialog.cpp:44 msgid "Fix English 'I' pronoun" msgstr "Διόρθωση προφοράς του Αγγλικού 'I'" #: main/dialogs/fixpunctuationdialog.cpp:48 msgid "Add ellipisis indicating non finished lines" msgstr "Προσθήκη έλλειψης ως ένδειξη ατελών γραμμών" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line Before Current" msgstr "Εισαγωγή Γραμμής Πριν την Τρέχουσα" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line After Current" msgstr "Εισαγωγή Γραμμής Μετά την Τρέχουσα" #: main/dialogs/insertlinedialog.cpp:29 #, fuzzy msgid "Insert Into" msgstr "Εισαγωγή Γραμμής" #: main/dialogs/joinsubtitlesdialog.cpp:40 msgid "Shift subtitle forwards before append" msgstr "Ολίσθηση τίτλου εμπρός πριν την ενημέρωση" #: main/dialogs/joinsubtitlesdialog.cpp:47 #: main/dialogs/splitsubtitledialog.cpp:44 msgid "Set from video length" msgstr "Ορισμός από το μήκος του βίντεο" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Subtitle" msgstr "Άνοιγμα Τίτλου" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Translation Subtitle" msgstr "Άνοιγμα Τίτλου Μετάφρασης" #: main/dialogs/opensubtitledialog.cpp:46 #: main/dialogs/savesubtitledialog.cpp:80 #: main/dialogs/selectablesubtitledialog.cpp:67 msgid "Encoding:" msgstr "Κωδικοποίηση: " #: main/dialogs/opensubtitledialog.cpp:73 msgid "All Supported" msgstr "Όλων των Υποστηριζόμενων" #: main/dialogs/removelinesdialog.cpp:27 #, fuzzy msgid "Remove Selected Lines" msgstr "Αφαίρεση επιλεγμένων γραμμών" #: main/dialogs/removelinesdialog.cpp:27 #, fuzzy msgid "Remove From" msgstr "Αφαίρεση" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Subtitle" msgstr "Αποθήκευση Υπότιτλου" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Translation Subtitle" msgstr "Αποθήκευση Υπότιτλου Μετάφρασης" #: main/dialogs/savesubtitledialog.cpp:69 msgid "EOL:" msgstr "Τελ.Γρ.:" #: main/dialogs/savesubtitledialog.cpp:145 msgid "" "A file named \"%1\" already exists. Are you sure you want to overwrite it?" msgstr "" "Ένα αρχείο ονόματι \"%1\" υπάρχει ήδη. Είστε σίγουρος/η ότι θέλετε να το " "επικαλύψετε;" #: main/dialogs/savesubtitledialog.cpp:148 msgid "Overwrite File?" msgstr "Επικάλυψη Αρχείου;" #: main/dialogs/savesubtitledialog.cpp:149 msgid "Overwrite" msgstr "Επικάλυψη" #: main/dialogs/selectablesubtitledialog.cpp:51 #, fuzzy msgid "Path:" msgstr "Διαδρομή:" #: main/dialogs/selectablesubtitledialog.cpp:56 msgid "Select subtitle" msgstr "Επιλογή υπότιτλου" #: main/dialogs/selectablesubtitledialog.h:54 msgid "Subtitle" msgstr "Υπότιτλος" #: main/dialogs/shifttimesdialog.cpp:32 #, fuzzy msgid "Shift" msgstr "Ολίσθηση" #: main/dialogs/shifttimesdialog.cpp:34 #, fuzzy msgctxt "@title:group" msgid "Shifting" msgstr "Ολίσθηση" #: main/dialogs/shifttimesdialog.cpp:38 #, fuzzy msgid "Forwards (+)" msgstr "+ | Έμπροσθεν" #: main/dialogs/shifttimesdialog.cpp:39 #, fuzzy msgid "Backwards (–)" msgstr "- | Όπισθεν" #: main/dialogs/smarttextsadjustdialog.cpp:43 #, fuzzy msgid "Minimum length for line break:" msgstr "Ελάχιστο μήκος σημαδιού αλλαγής γραμμής:" #: main/dialogs/splitsubtitledialog.cpp:36 msgid "Split Subtitle" msgstr "Διαχωρισμός Υπότιτλου" #: main/dialogs/splitsubtitledialog.cpp:49 #, fuzzy msgid "Split time:" msgstr "Διαχωρισμός χρόνου" #: main/dialogs/splitsubtitledialog.cpp:53 msgid "Shift new part backwards after split" msgstr "Ολίσθηση νέου μέρους όπισθεν μετά το διαχωρισμό" #: main/dialogs/syncsubtitlesdialog.cpp:32 #, fuzzy msgid "Synchronize with Subtitle" msgstr "Συγχρονισμός Με Υπότιτλο" #: main/dialogs/syncsubtitlesdialog.cpp:34 #, fuzzy msgid "Reference Subtitle" msgstr "Αναφορικός υπότιτλος" #: main/dialogs/syncsubtitlesdialog.cpp:36 #, fuzzy msgctxt "@title:group" msgid "Synchronization Mode" msgstr "Τρόπος συγχρονισμού" #: main/dialogs/syncsubtitlesdialog.cpp:39 #, fuzzy msgid "Adjust to reference's first and last lines" msgstr "Προσαρμογή στους χρόνους του πρώτου και τελευταίου υπότιτλου αναφοράς" #: main/dialogs/syncsubtitlesdialog.cpp:43 #, fuzzy msgid "Copy timing information from reference line by line" msgstr "" "Αντιγραφή χρονικών πληροφοριών από τον υπότιτλο αναφοράς γραμμή προς γραμμή" #: main/dialogs/translatedialog.cpp:49 msgid "Input language:" msgstr "" #: main/dialogs/translatedialog.cpp:66 msgid "Output language:" msgstr "" #: main/errorsdialog.cpp:42 msgid "Subtitle Errors" msgstr "Λάθη Υποτίτλων" #: main/errorsdialog.cpp:55 #, fuzzy msgid "Clear Fixed Errors" msgstr "Καθαρισμός Λαθών Γραμμών" #: main/errorsdialog.cpp:65 msgid "Settings..." msgstr "Ρυθμίσεις..." #: main/errorsdialog.cpp:121 #, fuzzy msgid "Showing 1 line with errors" msgid_plural "Showing %1 lines with errors" msgstr[0] "Προβολή %1 γραμμής" msgstr[1] "Προβολή %1 γραμμών" #: main/errorsdialog.cpp:124 #, fuzzy msgid "1 total error" msgid_plural "%1 total errors" msgstr[0] "1 εσφαλμένη" msgstr[1] "%1 εσφαλμένες" #: main/errorsdialog.cpp:125 #, fuzzy msgid "1 user mark" msgid_plural "%1 user marks" msgstr[0] "Έχει σημάδι χρήστη" msgstr[1] "Έχει σημάδι χρήστη" #: main/errorswidget.cpp:491 #, fuzzy msgid "Line Errors" msgstr "Ορισμός Λαθών Γραμμής" #: main/errorswidget.cpp:492 #, fuzzy msgid "Count" msgstr "Αποκοπή" #: main/errorswidget.cpp:493 #, fuzzy msgid "Marked" msgstr "Σημάδι" #: main/errorswidget.cpp:509 #, fuzzy msgid "yes" msgstr "Μοτίβα" #: main/errorswidget.cpp:510 #, fuzzy msgid "no" msgstr "Αναίρεση" #: main/errorswidget.cpp:517 #, fuzzy msgid "Line %1" msgstr "Γραμμή %1" #: main/errorswidget.cpp:717 msgid "Expand All" msgstr "" #: main/errorswidget.cpp:718 msgid "Collapse All" msgstr "" #: main/errorswidget.cpp:722 #, fuzzy msgid "Clear Selected Marks" msgstr "Καθαρισμός Σημαδιών" #: main/errorswidget.cpp:723 #, fuzzy msgid "Clear Selected Errors" msgstr "Καθαρισμός Λαθών" #: main/errorswidget.cpp:729 #, fuzzy msgid "Clear Fixed Selection" msgstr "Καθαρισμός Διορθώσεων" #: main/lineswidget.cpp:204 msgid "Observations:" msgstr "" #: main/lineswidget.cpp:232 #, fuzzy msgctxt "@title:column Subtitle line number" msgid "Line" msgstr "Γραμμή" #: main/lineswidget.cpp:233 #, fuzzy msgctxt "@title:column" msgid "Show Time" msgstr "Χρόνος Παρουσίας" #: main/lineswidget.cpp:234 #, fuzzy msgctxt "@title:column" msgid "Hide Time" msgstr "Χρόνος Απόκρυψης" #: main/lineswidget.cpp:235 #, fuzzy msgctxt "@title:column Subtitle line (primary) text" msgid "Text" msgstr "Κείμενο" #: main/lineswidget.cpp:236 #, fuzzy msgctxt "@title:column Subtitle line translation text" msgid "Translation" msgstr "Μετάφραση" #: main/lineswidget.cpp:1141 msgid "Texts" msgstr "Κείμενα" #: main/lineswidget.cpp:1162 msgid "Styles" msgstr "Μοτίβα" #: main/lineswidget.cpp:1166 widgets/simplerichtextedit.cpp:119 #, fuzzy msgctxt "@action:inmenu Toggle bold style" msgid "Bold" msgstr "Έντονα" #: main/lineswidget.cpp:1173 widgets/simplerichtextedit.cpp:125 #, fuzzy msgctxt "@action:inmenu Toggle italic style" msgid "Italic" msgstr "Πλάγια" #: main/lineswidget.cpp:1180 widgets/simplerichtextedit.cpp:131 #, fuzzy msgctxt "@action:inmenu Toggle underline style" msgid "Underline" msgstr "Υπογραμμισμένα" #: main/lineswidget.cpp:1187 widgets/simplerichtextedit.cpp:137 #, fuzzy msgctxt "@action:inmenu Toggle strike through style" msgid "Strike Through" msgstr "Διαγραμμισμένα" #: main/lineswidget.cpp:1194 msgid "Times" msgstr "Χρόνοι" #: main/lineswidget.cpp:1196 msgid "Shift +%1 Milliseconds" msgstr "Ολίσθηση +%1 Χιλιοστά του δευτερολέπτου" #: main/lineswidget.cpp:1197 msgid "Shift -%1 Milliseconds" msgstr "Ολίσθηση -%1 Χιλιοστά του δευτερολέπτου" #: main/lineswidget.cpp:1207 msgid "Errors" msgstr "Λάθη" #: main/lineswidget.cpp:1208 msgid "Mark" msgstr "Σημάδι" #: main/main.cpp:43 msgid "Subtitle Composer" msgstr "Συνθέτης Υποτίτλων" #: main/main.cpp:45 msgid "A KDE subtitle editor." msgstr "Ένας επεξεργαστής υποτίτλων του KDE" #: main/main.cpp:47 #, fuzzy msgid "(C) 2007-2009 Sergio Pistone" msgstr "(C) 2007-2008 Sergio Pistone" #: main/main.cpp:51 msgid "Sergio Pistone" msgstr "Sergio Pistone" #: main/main.cpp:52 #, fuzzy msgid "Author & maintainer" msgstr "Συντάκτης ϗ συντηρητής" #: main/main.cpp:61 msgid "Open location as primary subtitle" msgstr "Άνοιγμα τοποθεσίας ως πρωτεύοντος τίτλου" #: main/main.cpp:62 msgid "Open location as translation subtitle" msgstr "Άνοιγμα τοποθεσίας ως τίτλου μετάφρασης" #: main/playerwidget.cpp:103 msgid "Position" msgstr "Θέση" #: main/playerwidget.cpp:111 msgid "Length" msgstr "Μήκος" #: main/playerwidget.cpp:116 msgid "FPS" msgstr "Καρέ/δευτ." #: main/playerwidget.cpp:704 main/playerwidget.cpp:705 #: main/playerwidget.cpp:706 main/playerwidget.cpp:778 #: main/playerwidget.cpp:795 main/playerwidget.cpp:802 msgid "Unknown" msgstr "Άγνωστο" #: main/playerwidget.cpp:715 msgid "There was an error opening file
%1
" msgstr "Παρουσιάστηκε σφάλμα κατά το άνοιγμα αρχείου
%1
" #: main/playerwidget.cpp:741 msgid "Unexpected error while playing file." msgstr "Απρόσμενο λάθος κατά την αναπαραγωγή αρχείου." #: main/scripting/scriptsmanager.cpp:70 msgid "Installed Scripts" msgstr "" #: main/scripting/scriptsmanager.cpp:88 #, fuzzy msgid "Information" msgstr "Πληροφορίες Λαθών" #: main/scripting/scriptsmanager.cpp:94 msgid "Warning" msgstr "" #: main/scripting/scriptsmanager.cpp:100 #, fuzzy msgid "Error" msgstr "Λάθη" #: main/scripting/scriptsmanager.cpp:113 msgid "Scripts Manager" msgstr "" #: main/scripting/scriptsmanager.cpp:129 #, fuzzy msgid "Create..." msgstr "Αντικατάσταση..." #: main/scripting/scriptsmanager.cpp:130 #, fuzzy msgid "Creates a new script file." msgstr "Δημιουργία ενός άδειου υπότιτλου" #: main/scripting/scriptsmanager.cpp:135 #, fuzzy msgid "Add..." msgstr "Προσαρμογή Γραμμών..." #: main/scripting/scriptsmanager.cpp:136 msgid "Copies an existing script from a specified location." msgstr "" #: main/scripting/scriptsmanager.cpp:142 msgid "Sends the selected script to the trash." msgstr "" #: main/scripting/scriptsmanager.cpp:147 #, fuzzy msgid "Edit" msgstr "&Επεξεργασία" #: main/scripting/scriptsmanager.cpp:148 msgid "Opens the selected script with an external editor." msgstr "" #: main/scripting/scriptsmanager.cpp:154 msgid "Run" msgstr "" #: main/scripting/scriptsmanager.cpp:155 msgid "Executes the selected script." msgstr "" #: main/scripting/scriptsmanager.cpp:160 msgid "Refresh" msgstr "" #: main/scripting/scriptsmanager.cpp:161 msgid "Reloads the installed scripts list." msgstr "" #: main/scripting/scriptsmanager.cpp:219 main/scripting/scriptsmanager.cpp:301 msgid "" "You must enter an unused name to continue.\n" "Would you like to enter another name?" msgstr "" #: main/scripting/scriptsmanager.cpp:220 main/scripting/scriptsmanager.cpp:302 msgid "Name Already Used" msgstr "" #: main/scripting/scriptsmanager.cpp:226 msgid "Create New Script" msgstr "" #: main/scripting/scriptsmanager.cpp:226 main/scripting/scriptsmanager.cpp:308 msgid "Script name:" msgstr "" #: main/scripting/scriptsmanager.cpp:239 #, fuzzy msgid "There was an error creating the file %1." msgstr "Παρουσιάστηκε σφάλμα κατά το άνοιγμα αρχείου
%1
" #: main/scripting/scriptsmanager.cpp:283 msgid "Select Existing Script" msgstr "" #: main/scripting/scriptsmanager.cpp:308 msgid "Rename Script" msgstr "" #: main/scripting/scriptsmanager.cpp:322 #, fuzzy msgid "There was an error opening the file %1." msgstr "Παρουσιάστηκε σφάλμα κατά το άνοιγμα αρχείου
%1
" #: main/scripting/scriptsmanager.cpp:331 #, fuzzy msgid "There was an error copying the file to %1." msgstr "Παρουσιάστηκε σφάλμα κατά το άνοιγμα αρχείου
%1
" #: main/scripting/scriptsmanager.cpp:350 msgid "Do you really want to send file %1 to the trash?" msgstr "" #: main/scripting/scriptsmanager.cpp:351 msgid "Move to Trash" msgstr "" #: main/scripting/scriptsmanager.cpp:359 #, fuzzy msgid "There was an error removing the file %1." msgstr "Παρουσιάστηκε σφάλμα κατά το άνοιγμα αρχείου
%1
" #: main/scripting/scriptsmanager.cpp:377 msgid "Could not launch external editor.\n" msgstr "" #: main/scripting/scriptsmanager.cpp:441 main/scripting/scriptsmanager.cpp:448 msgid "Error Running Script" msgstr "" #: main/scripting/scriptsmanager.cpp:462 msgid "Tools" msgstr "" #: main/utils/errorfinder.cpp:40 main/utils/errorfinder.cpp:221 #: main/utils/errorfinder.cpp:244 msgid "Find Error" msgstr "Εύρεση Λάθους" #: main/utils/errorfinder.cpp:42 #, fuzzy msgid "Errors to Find" msgstr "Λάθη προς έλεγχο" #: main/utils/errorfinder.cpp:45 msgid "Options" msgstr "" #: main/utils/errorfinder.cpp:51 #, fuzzy msgid "From current line" msgstr "Ανυπαρξία τρέχουσας γραμμής" #: main/utils/errorfinder.cpp:55 #, fuzzy msgid "Find backwards" msgstr "- | Όπισθεν" #: main/utils/errorfinder.cpp:216 main/utils/finder.cpp:298 #: main/utils/replacer.cpp:258 msgid "" "Beginning of selection reached.\n" "Continue from the end?" msgstr "" "Φθάσαμε στην αρχή της επιλογής.\n" "Συνέχεια από το τέλος;" #: main/utils/errorfinder.cpp:217 main/utils/finder.cpp:299 #: main/utils/replacer.cpp:259 msgid "" "Beginning of subtitle reached.\n" "Continue from the end?" msgstr "" "Φθάσαμε στην αρχή του υπότιτλου.\n" "Συνέχεια από το τέλος;" #: main/utils/errorfinder.cpp:219 main/utils/finder.cpp:301 #: main/utils/replacer.cpp:261 msgid "" "End of selection reached.\n" "Continue from the beginning?" msgstr "" "Φθάσαμε στο τέλος της επιλογής.\n" "Συνέχεια από την αρχή;" #: main/utils/errorfinder.cpp:220 main/utils/finder.cpp:302 #: main/utils/replacer.cpp:262 main/utils/speller.cpp:143 msgid "" "End of subtitle reached.\n" "Continue from the beginning?" msgstr "" "Φθάσαμε στο τέλος του υπότιτλου.\n" "Συνέχεια από την αρχή;" #: main/utils/errorfinder.cpp:243 msgid "No errors matching given criteria found!" msgstr "" #: main/utils/finder.cpp:55 #, fuzzy msgid "Find In" msgstr "Εύρεση" #: main/utils/finder.cpp:278 main/utils/replacer.cpp:234 msgid "No instances of '%1' found!" msgstr "Ανίστατο '%1'!" #: main/utils/finder.cpp:279 main/utils/finder.cpp:303 msgid "Find" msgstr "Εύρεση" #: main/utils/kreplace.cpp:49 main/utils/kreplace.cpp:53 #: main/utils/replacer.cpp:172 main/utils/replacer.cpp:229 #: main/utils/replacer.cpp:235 main/utils/replacer.cpp:263 msgid "Replace" msgstr "Αντικατάσταση" #: main/utils/kreplace.cpp:51 msgid "&All" msgstr "%Όλα" #: main/utils/kreplace.cpp:52 msgid "&Skip" msgstr "&Παράβλεψη" #: main/utils/kreplace.cpp:63 msgid "Replace '%1' with '%2'?" msgstr "Αντικατάσταση του '%1' με '%2';" #: main/utils/kreplace.cpp:139 main/utils/kreplace.cpp:406 msgid "No text was replaced." msgstr "Δεν αντικαταστάθηκε κείμενο" #: main/utils/kreplace.cpp:141 main/utils/kreplace.cpp:408 #: main/utils/replacer.cpp:228 main/utils/replacer.cpp:255 msgid "1 replacement done." msgid_plural "%1 replacements done." msgstr[0] "έγινε 1 αντικατάσταση" msgstr[1] "έγιναν %1 αντικαταστάσεις" #: main/utils/kreplace.cpp:413 msgid "Beginning of document reached." msgstr "Φθάσαμε στην αρχή του κειμένου." #: main/utils/kreplace.cpp:415 msgid "End of document reached." msgstr "Φθάσαμε στο τέλος του κειμένου." #: main/utils/kreplace.cpp:422 msgid "Do you want to restart search from the end?" msgstr "Θέλετε να επανεκκινήσετε ανεύρεση από το τέλος;" #: main/utils/kreplace.cpp:423 msgid "Do you want to restart search at the beginning?" msgstr "Θέλετε να επανακινήσετε ανεύρεση από την αρχή;" #: main/utils/kreplace.cpp:425 msgid "Restart" msgstr "Επανεκκίνηση" #: main/utils/language.cpp:125 #, fuzzy msgid "Automatic" msgstr "Αυτόματες Διάρκειες" #: main/utils/language.cpp:129 msgctxt "Official language of the Philippines, aka Filipino" msgid "Tagalog" msgstr "" #: main/utils/replacer.cpp:53 #, fuzzy msgid "Find/Replace In" msgstr "Αντικατάσταση" #: main/utils/speller.cpp:144 msgid "Spell Checking" msgstr "Ορθογραφικός Έλεγχος" #: main/utils/translator.cpp:167 msgid "Operation cancelled by user" msgstr "" #: main/utils/translator.cpp:270 main/utils/translator.cpp:280 msgid "Unexpected contents received from translation service" msgstr "" #: player/gstreamer/gstreamerbackend.cpp:543 #: player/mplayer/mplayerbackend.cpp:259 player/xine/xinebackend.cpp:278 msgid "Audio Stream #%1" msgstr "Ροή Δεδομένων Ήχου #%1" #: player/gstreamer/gstreamerconfigwidget.cpp:34 #, fuzzy msgctxt "@title:group GStreamer sinks settings" msgid "Sinks" msgstr "Ρυθμίσεις" #: player/gstreamer/gstreamerconfigwidget.cpp:37 msgid "Audio sink:" msgstr "Βύθιση ήχου:" #: player/gstreamer/gstreamerconfigwidget.cpp:46 msgid "Video sink:" msgstr "Βύθιση βίντεο:" #: player/mplayer/mplayerconfigwidget.cpp:40 msgid "Executable path:" msgstr "Διαδρομή εκτελέσιμου:" #: player/mplayer/mplayerconfigwidget.cpp:43 msgid "Select the MPlayer executable" msgstr "Επιλογή εκτελέσιμου Αναπαραγωγέα Μέσων" #: player/mplayer/mplayerconfigwidget.cpp:47 #, fuzzy msgctxt "@title:group Video settings" msgid "Video" msgstr "Βίντεο" #: player/mplayer/mplayerconfigwidget.cpp:50 msgid "Video output driver:" msgstr "Οδηγός εξόδου βίντεο:" #: player/mplayer/mplayerconfigwidget.cpp:58 msgid "Allow frame dropping" msgstr "Επιτρεπτή η απώλεια καρέ" #: player/mplayer/mplayerconfigwidget.cpp:61 msgid "Allow hard frame dropping" msgstr "Επιτρεπτή η σαφής απώλεια καρέ" #: player/mplayer/mplayerconfigwidget.cpp:64 #, fuzzy msgctxt "@title:group Audio settings" msgid "Audio" msgstr "Ήχος" #: player/mplayer/mplayerconfigwidget.cpp:67 msgid "Audio output driver:" msgstr "Οδηγός εξόδου ήχου:" #: player/mplayer/mplayerconfigwidget.cpp:75 msgid "A/V synchronization factor:" msgstr "Συντελεστής συγχρονισμού Ήχου/Βίντεο:" #: player/mplayer/mplayerconfigwidget.cpp:83 msgid "Volume normalization" msgstr "Κανονικοποίηση Στάθμης ήχου" #: player/xine/xineconfigwidget.cpp:34 msgctxt "@title:group Xine drivers settings" msgid "Drivers" msgstr "" #: player/xine/xineconfigwidget.cpp:37 msgid "Audio driver:" msgstr "Οδηγός ήχου:" #: player/xine/xineconfigwidget.cpp:45 msgid "Video driver:" msgstr "Οδηγός βίντεο:" #: widgets/simplerichtextedit.cpp:84 msgid "Cut" msgstr "Αποκοπή" #: widgets/simplerichtextedit.cpp:90 msgid "Copy" msgstr "Αντιγραφή" #: widgets/simplerichtextedit.cpp:96 msgid "Paste" msgstr "Επικόλληση" #: widgets/simplerichtextedit.cpp:102 msgid "Delete" msgstr "Διαγραφή" #: widgets/simplerichtextedit.cpp:108 #, fuzzy msgctxt "@action:inmenu Clear all text" msgid "Clear" msgstr "Καθαρισμός Σημαδιού" #: widgets/simplerichtextedit.cpp:143 #, fuzzy msgid "Check Spelling..." msgstr "Συλλαβισμός..." #: widgets/simplerichtextedit.cpp:147 msgid "Auto Spell Check" msgstr "" #: widgets/simplerichtextedit.cpp:152 msgid "Allow Tabulations" msgstr "Επίτρεψη Στηλοθετήσεων" #: widgets/simplerichtextedit.cpp:491 msgid "Suggestions" msgstr "" #: widgets/simplerichtextedit.cpp:492 msgid "Ignore" msgstr "" #: widgets/simplerichtextedit.cpp:493 msgid "Add to Dictionary" msgstr "" #: widgets/simplerichtextedit.cpp:497 msgid "No suggestions" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:5 #. i18n: ectx: Menu (file) #: rc.cpp:3 msgid "&File" msgstr "&Αρχείο" #. i18n: file: main/subtitlecomposerui.rc:16 #. i18n: ectx: Menu (translation) #: rc.cpp:6 msgid "Translation" msgstr "Μετάφραση" #. i18n: file: main/subtitlecomposerui.rc:28 #. i18n: ectx: Menu (edit) #: rc.cpp:9 msgid "&Edit" msgstr "&Επεξεργασία" #. i18n: file: main/subtitlecomposerui.rc:51 #. i18n: ectx: Menu (texts) #: rc.cpp:12 msgid "&Texts" msgstr "&Κείμενα" #. i18n: file: main/subtitlecomposerui.rc:62 #. i18n: ectx: Menu (styles) #: rc.cpp:15 msgid "St&yles" msgstr "&Μοτίβα" #. i18n: file: main/subtitlecomposerui.rc:69 #. i18n: ectx: Menu (times) #: rc.cpp:18 msgid "T&imes" msgstr "&Χρόνοι" #. i18n: file: main/subtitlecomposerui.rc:91 #. i18n: ectx: Menu (errors) #: rc.cpp:21 msgid "E&rrors" msgstr "&Λάθη" #. i18n: file: main/subtitlecomposerui.rc:104 #. i18n: ectx: Menu (video) #: rc.cpp:24 msgid "&Video" msgstr "&Βίντεο" #. i18n: file: main/subtitlecomposerui.rc:132 #. i18n: ectx: Menu (tools) #: rc.cpp:27 msgid "T&ools" msgstr "" #. i18n: file: main/subtitlecomposerui.rc:137 #. i18n: ectx: Menu (audiolevels) #: rc.cpp:30 msgid "&Audio Levels" msgstr "Στάθμες &Ήχου" #. i18n: file: main/subtitlecomposerui.rc:153 #. i18n: ectx: ToolBar (mainToolBar) #: rc.cpp:33 msgid "Main Toolbar" msgstr "Κύρια Εργαλειοδοκός" #. i18n: file: main/subtitlecomposerui.rc:165 #. i18n: ectx: ToolBar (editToolBar) #: rc.cpp:36 #, fuzzy msgctxt "The toolbar name" msgid "Edit Toolbar" msgstr "Εργαλειοδοκός Επεξεργασίας" #: rc.cpp:37 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Αλέξανδρος Περδικομάτης" #: rc.cpp:38 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "atanasia@ontelecoms.gr" #~ msgid "There was an error opening the audiolevels." #~ msgstr "Παρουσιάστηκε σφάλμα κατά το άνοιγμα των επιπέδων ήχου." #~ msgid "Save AudioLevels" #~ msgstr "Αποθήκευση Επιπέδων Ήχου" #~ msgid "There was an error saving the audiolevels." #~ msgstr "Παρουσιάστηκε κάποιο σφάλμα κατά την αποθήκευση των επιπέδων ήχου." #~ msgid "Toggle Line Mark" #~ msgstr "Αντιθέτηση Σημαδιού Γραμμής" #, fuzzy #~ msgctxt "@title:group" #~ msgid "Subtitles font" #~ msgstr "Γραμματοσειρά υποτίτλων" #~ msgid "Size:" #~ msgstr "Μέγεθος:" #, fuzzy #~ msgid "1 mark" #~ msgid_plural "%1 marks" #~ msgstr[0] "1 σημειωμένη" #~ msgstr[1] "%1 σημειωμένες" #, fuzzy #~ msgid "Marks" #~ msgstr "Σημάδι" #~ msgid "No line with errors found!" #~ msgstr "Δεν βρέθηκε εσφαλμένη γραμμή!" #, fuzzy #~ msgid "Set Set Automatic Durations" #~ msgstr "Ορισμός Αυτόματων Διαρκειών" #~ msgid "Sort Lines" #~ msgstr "Ταξινόμηση Γραμμών" #~ msgid "Apply Duration Limits" #~ msgstr "Εφαρμογή Ορίων Διάρκειας" #~ msgid "Smart Lines Adjust" #~ msgstr "Έξυπνη Ρύθμιση Γραμμών" #~ msgid "Shift selected lines -%1 milliseconds" #~ msgstr "Ολίσθηση -%1 Χιλιοστά του δευτερολέπτου επιλεγμένων γραμμών" #~ msgid "Automatic Durations..." #~ msgstr "Αυτόματες Διάρκειες..." #~ msgid "Smart Lines Adjust..." #~ msgstr "Έξυπνη Προσαρμογή Γραμμών..." #~ msgid "Adjust Subtitles" #~ msgstr "Προσαρμογή Υποτίτλων" #~ msgid "Shift Subtitles" #~ msgstr "Ολίσθηση Υποτίτλων" #~ msgid "1 replacement made." #~ msgid_plural "%1 replacements made." #~ msgstr[0] "έγινε 1 αντικατάσταση" #~ msgstr[1] "έγιναν %1 αντικαταστάσεις" #~ msgid "" #~ "Invalid current frame rate value specified:\n" #~ "%1" #~ msgstr "" #~ "Ορίστηκε άκυρος τρέχων λόγος καρέ:\n" #~ "%1" #~ msgid "" #~ "Invalid new frame rate value specified:\n" #~ "%1" #~ msgstr "" #~ "Ορίστηκε άκυρος νέος λόγος καρέ:\n" #~ "%1" #~ msgid "Encoding" #~ msgstr "Κωδικοποίηση" #~ msgid "Remove Line" #~ msgstr "Αφαίρεση Γραμμής" #~ msgid "Edit Translation In Place" #~ msgstr "Επεξεργασία Μετάφρασης Εντός Θέσης" #~ msgid "Edit current line translation text in place" #~ msgstr "Επεξεργασία μετάφρασης τρέχουσας γραμμής εντός θέσης" #~ msgid "Current line: %1 characters" #~ msgstr "Τρέχουσα γραμμή: %1 χαρακτήρες" #~ msgid "Enforce maximun duration" #~ msgstr "Υποχρέωση μέγιστης διάρκειας" #~ msgid "Enforce minimun duration" #~ msgstr "Υποχρέωση ελάχιστης διάρκειας" #~ msgid "Minimun duration" #~ msgstr "Ελάχιστη διάρκεια" #~ msgid "Clear Error" #~ msgstr "Καθαρισμός Λάθους" #~ msgid "Recheck and Clear Fixed" #~ msgstr "Επανεξέταση και Καθαρισμός Διορθωμένων" #~ msgid "Line %1" #~ msgstr "Γραμμή %1" #~ msgid "1 msec" #~ msgid_plural "%1 msecs" #~ msgstr[0] "1 χιλ. του δευ/του" #~ msgstr[1] "%1 χιλ. του δευ/του" #~ msgid "1 msec/char" #~ msgid_plural "%1 msecs/char" #~ msgstr[0] "1 χιλ. του δευ/του ανά χαρ/τήρα" #~ msgstr[1] "%1 χιλ. του δευ/του ανά χαρ/τήρα" #~ msgid "1 char" #~ msgid_plural "%1 chars" #~ msgstr[0] "1 χαρακτήρας" #~ msgstr[1] "%1 χαρακτήρες" #~ msgid "1 line" #~ msgid_plural "%1 lines" #~ msgstr[0] "1 γραμμή" #~ msgstr[1] "%1 γραμμές" #~ msgid "Target subtitle" #~ msgstr "Στοχευμένος υπότιτλος" #~ msgid "Insert only in primary" #~ msgstr "Εισαγωγή μόνο στον πρωτεύοντα" #~ msgid "Insert only in translation" #~ msgstr "Εισαγωγή μόνο στη μετάφραση" #~ msgid "Insert in both" #~ msgstr "Εισαγωγή αμφότερα" #~ msgid "Append to translation subtitle" #~ msgstr "Ενημέρωση στον τίτλο μετάφρασης" #~ msgid "Remove Line Before Current" #~ msgstr "Αφαίρεση Γραμμής Πριν την Τρέχουσα" #~ msgid "Remove Line After Current" #~ msgstr "Αφαίρεση Γραμμής Μετά την Τρέχουσα" #~ msgid "Remove only in primary" #~ msgstr "Αφαίρεση μόνο στον πρωτεύοντα" #~ msgid "Remove only in translation" #~ msgstr "Αφαίρεση μόνο στη μετάφραση" #~ msgid "Remove in both" #~ msgstr "Αφαίρεση αμφότερα" #~ msgid "Target lines" #~ msgstr "Τις στοχευμένες γραμμές" #, fuzzy #~ msgid "Primary text" #~ msgstr "Χρήση πρωτεύοντος κειμένου" #, fuzzy #~ msgid "Both texts" #~ msgstr "Άδειο Κείμενο" #~ msgid "Clear Lines Marks" #~ msgstr "Καθαρισμός Σημαδιών Γραμμών" #~ msgid "New case" #~ msgstr "Νέος ορισμός πεζών/κεφαλαίων" #~ msgid "Target subtitle (for checks involving text)" #~ msgstr "Υπότιτλος στόχου (για κείμενο περί ελέγχων)" #~ msgid "Target subtitle (for errors involving text)" #~ msgstr "Υπότιτλος στόχου (για κείμενο περί λαθών)" #~ msgid "Both" #~ msgstr "Αμφότερες" #~ msgid "Toggle Lines Marked" #~ msgstr "Αντιθέτηση Σημαδεμένων Γραμμών" subtitlecomposer-0.5.3/po/bg/0000755000175000001440000000000011206423743015341 5ustar sergiouserssubtitlecomposer-0.5.3/po/bg/CMakeLists.txt0000644000175000001440000000016611161245061020077 0ustar sergiousersFILE( GLOB _po_files *.po ) GETTEXT_PROCESS_PO_FILES( bg ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) subtitlecomposer-0.5.3/po/bg/subtitlecomposer.po0000644000175000001440000024741211206411600021303 0ustar sergiousers# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Petar Toushkov , 2009. # Petar Toushkov , 2009. msgid "" msgstr "" "Project-Id-Version: subtitlecomposer\n" "Report-Msgid-Bugs-To: https://sourceforge.net/tracker/?" "atid=1005652&group_id=208427&func=browse\n" "POT-Creation-Date: 2009-05-25 00:41-0300\n" "PO-Revision-Date: 2009-04-10 07:27+0200\n" "Last-Translator: Petar Toushkov \n" "Language-Team: Bulgarian <>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Lokalize 0.3\n" #: core/subtitleactions.cpp:62 msgid "Set Frame Rate" msgstr "Задаване на кадри в секунда" #: core/subtitleactions.cpp:93 msgid "Insert Lines" msgstr "Вмъкване на реплики" #: core/subtitleactions.cpp:177 core/subtitle.cpp:446 core/subtitle.cpp:460 #: core/subtitle.cpp:479 msgid "Remove Lines" msgstr "Премахване на реплики " #: core/subtitleactions.cpp:268 msgid "Move Line" msgstr "Преместване на реплика" #: core/subtitleactions.cpp:381 msgid "Swap Texts" msgstr "Размяна на текстове" #: core/subtitle.cpp:66 msgid "Set Primary Data" msgstr "Задаване на основни данни" #: core/subtitle.cpp:121 msgid "Clear Primary Text Data" msgstr "Изчистване на основни текстови данни" #: core/subtitle.cpp:134 msgid "Set Secondary Data" msgstr "Задаване на второстепенни данни" #: core/subtitle.cpp:180 msgid "Clear Secondary Text Data" msgstr "Изчистване на вторични текстови данни " #: core/subtitle.cpp:265 main/dialogs/changeframeratedialog.cpp:34 msgid "Change Frame Rate" msgstr "Промяна на кадри в секунда" #: core/subtitle.cpp:395 core/subtitle.cpp:412 msgid "Insert Line" msgstr "Вмъкване на реплика" #: core/subtitle.cpp:533 main/application.cpp:662 main/lineswidget.cpp:1226 msgid "Split Lines" msgstr "Обособяване на реплики" #: core/subtitle.cpp:590 main/application.cpp:670 main/lineswidget.cpp:1225 msgid "Join Lines" msgstr "Събиране на реплики" #: core/subtitle.cpp:642 msgid "Shift Lines" msgstr "Преместване на реплики" #: core/subtitle.cpp:690 msgid "Adjust Lines" msgstr "Нагаждане на реплики" #: core/subtitle.cpp:700 main/application.cpp:2377 main/lineswidget.cpp:1200 msgid "Sort" msgstr "Сортиране" #: core/subtitle.cpp:746 main/dialogs/durationlimitsdialog.cpp:33 msgid "Enforce Duration Limits" msgstr "Налагане на лимит за продължителност" #: core/subtitle.cpp:791 main/application.cpp:2462 main/lineswidget.cpp:1203 msgid "Maximize Durations" msgstr "Максимизиране на продължителност" #: core/subtitle.cpp:816 main/dialogs/autodurationsdialog.cpp:35 msgid "Set Automatic Durations" msgstr "Задаване на автоматична продължителност" #: core/subtitle.cpp:856 main/dialogs/fixoverlappingtimesdialog.cpp:32 #: main/lineswidget.cpp:1204 msgid "Fix Overlapping Times" msgstr "Поправяне на презастъпващи се времена" #: core/subtitle.cpp:890 msgid "Fix Lines Punctuation" msgstr "Поправяне на пунктуация в репликите" #: core/subtitle.cpp:986 msgid "Lower Case" msgstr "Малки букви" #: core/subtitle.cpp:1020 msgid "Upper Case" msgstr "Големи букви" #: core/subtitle.cpp:1054 msgid "Title Case" msgstr "Заглавни букви" #: core/subtitle.cpp:1091 msgid "Sentence Case" msgstr "Изречение" #: core/subtitle.cpp:1142 main/dialogs/smarttextsadjustdialog.cpp:32 msgid "Break Lines" msgstr "Нов ред в репликите" #: core/subtitle.cpp:1150 main/application.cpp:2530 main/lineswidget.cpp:1146 msgid "Unbreak Lines" msgstr "Събиране редовете на репликите" #: core/subtitle.cpp:1158 main/application.cpp:2544 main/lineswidget.cpp:1152 msgid "Simplify Spaces" msgstr "Опростяване на интервалите" #: core/subtitle.cpp:1167 msgid "Synchronize Subtitles" msgstr "Синхронизиране на субтитри" #: core/subtitle.cpp:1190 main/dialogs/joinsubtitlesdialog.cpp:35 msgid "Join Subtitles" msgstr "Присъединяване на субтитри" #: core/subtitle.cpp:1236 core/subtitle.cpp:1242 msgid "Split Subtitles" msgstr "Разделяне на субтитри" #: core/subtitle.cpp:1259 core/subtitle.cpp:1274 msgid "Set Lines Style" msgstr "Задаване стила на репликите" #: core/subtitle.cpp:1291 msgid "Toggle Lines Style" msgstr "Включване стила на репликите" #: core/subtitle.cpp:1304 msgid "Set Lines Mark" msgstr "Задаване маркировка на репликите" #: core/subtitle.cpp:1304 msgid "Clear Lines Mark" msgstr "Изчистване маркировка на репликите" #: core/subtitle.cpp:1318 msgid "Toggle Lines Mark" msgstr "Включване маркировка на репликите" #: core/subtitle.cpp:1328 main/application.cpp:2261 main/application.cpp:2271 #: main/errorswidget.cpp:854 msgid "Clear Lines Errors" msgstr "Изчистване грешки на репликите" #: core/subtitle.cpp:1338 core/subtitle.cpp:1358 main/application.cpp:2194 #: main/application.cpp:2239 msgid "Check Lines Errors" msgstr "Проверка за грешки по репликите" #: core/subtitlelineactions.cpp:65 msgid "Set Line Text" msgstr "Задаване текст за реплика" #: core/subtitlelineactions.cpp:101 msgid "Set Line Secondary Text" msgstr "Задаване на преводен текст на реплика" #: core/subtitlelineactions.cpp:137 msgid "Set Line Texts" msgstr "Задаване текстове на репликата" #: core/subtitlelineactions.cpp:218 msgid "Set Line Show Time" msgstr "Задаване време за показване на репликата" #: core/subtitlelineactions.cpp:254 msgid "Set Line Hide Time" msgstr "Задаване време за скриване на репликата" #: core/subtitlelineactions.cpp:371 msgid "Set Line Errors" msgstr "Задаване грешки за репликата" #: core/subtitleline.cpp:72 msgid "Empty text" msgstr "Празен текст" #: core/subtitleline.cpp:74 msgid "Too many characters" msgstr "Прекалено много знаци" #: core/subtitleline.cpp:76 msgid "Too many lines" msgstr "Прекалено много реплики" #: core/subtitleline.cpp:78 msgid "Unnecessary white space" msgstr "Ненужни интервали (или повтарящи се знаци)" #: core/subtitleline.cpp:80 msgid "Unnecessary dash" msgstr "Ненужно късо тире" #: core/subtitleline.cpp:82 msgid "Capital letter after continuation ellipsis" msgstr "Главна буква след изпуснат текст" #: core/subtitleline.cpp:84 msgid "Too long duration per character" msgstr "Прекалено голяма продължителност към знак" #: core/subtitleline.cpp:86 msgid "Too short duration per character" msgstr "Прекалено кратка продължителност към знак" #: core/subtitleline.cpp:88 msgid "Too long duration" msgstr "Прекалено дълга продължителност" #: core/subtitleline.cpp:89 msgid "Too short duration" msgstr "Прекалено кратка продължителност" #: core/subtitleline.cpp:90 msgid "Overlapping times" msgstr "Презастъпващи се времена" #: core/subtitleline.cpp:91 msgid "Untranslated text" msgstr "Непреведен текст" #: core/subtitleline.cpp:92 msgid "User mark" msgstr "Потребителска маркировка" #: core/subtitleline.cpp:112 msgid "Has no primary text." msgstr "Няма оригинален текст." #: core/subtitleline.cpp:116 msgid "Has no translation text." msgstr "Няма преводен текст." #: core/subtitleline.cpp:120 msgid "Has too many characters in primary text (1 char)." msgid_plural "Has too many characters in primary text (%1 chars)." msgstr[0] "В оригиналния текст има прекалено много знаци (1 знак). " msgstr[1] "В оригиналния текст има прекалено много знаци (%1 знаци)." #: core/subtitleline.cpp:126 msgid "Has too many characters in translation text (1 char)." msgid_plural "Has too many characters in translation text (%1 chars)." msgstr[0] "В преводния текст има прекалено много знаци (1 знак)." msgstr[1] "В преводния текст има прекалено много знаци (%1 знаци)." #: core/subtitleline.cpp:132 msgid "Has too many lines in primary text (1 line)." msgid_plural "Has too many lines in primary text (%1 lines)." msgstr[0] "В оригиналния текст има прекалено много реплики (1 реплика)." msgstr[1] "В оригиналния текст има прекалено много реплики (%1 реплики)." #: core/subtitleline.cpp:138 msgid "Has too many lines in translation text (1 line)." msgid_plural "Has too many lines in translation text (%1 lines)." msgstr[0] "В преводния текст има прекалено много реплики (1 реплика)." msgstr[1] "В преводния текст има прекалено много реплики (%1 реплики)." #: core/subtitleline.cpp:144 msgid "Has unnecessary spaces in primary text." msgstr "В оригиналния текст има ненужни интервали (или повтарящи се знаци)." #: core/subtitleline.cpp:148 msgid "Has unnecessary spaces in translation text." msgstr "В преводния текст има ненужни интервали (или повтарящи се знаци)." #: core/subtitleline.cpp:152 msgid "Has unnecessary dash in primary text." msgstr "В оригиналния текст има ненужно тире." #: core/subtitleline.cpp:156 msgid "Has unnecessary dash in translation text." msgstr "В преводния текст има ненужно тире." #: core/subtitleline.cpp:160 msgid "Has capital letter after line continuation ellipsis in primary text." msgstr "В оригиналния текст има главна буква след изпуснат текст." #: core/subtitleline.cpp:164 msgid "" "Has capital letter after line continuation ellipsis in translation text." msgstr "В преводния текст има главна буква след изпуснат текст." #: core/subtitleline.cpp:168 msgid "Has too long duration per character in primary text (1 msec/char)." msgid_plural "" "Has too long duration per character in primary text (%1 msecs/char)." msgstr[0] "" "В оригиналния текст има прекалено дълга продължителност на знак (1 мсек/" "знак)." msgstr[1] "" "В оригиналния текст има прекалено дълга продължителност на знак (%1 мсек/" "знак)." #: core/subtitleline.cpp:174 msgid "Has too long duration per character in translation text (1 msec/char)." msgid_plural "" "Has too long duration per character in translation text (%1 msecs/char)." msgstr[0] "" "В преводния текст има прекалено дълга продължителност на знак (1 мсек/знак)." msgstr[1] "" "В преводния текст има прекалено дълга продължителност на знак (%1 мсек/знак)." #: core/subtitleline.cpp:180 msgid "Has too short duration per character in primary text (1 msec/char)." msgid_plural "" "Has too short duration per character in primary text (%1 msecs/char)." msgstr[0] "" "В оригиналния текст има прекалено кратка продължителност на знак (1 мсек/" "знак)." msgstr[1] "" "В оригиналния текст има прекалено кратка продължителност на знак (%1 мсек/" "знак)." #: core/subtitleline.cpp:186 msgid "Has too short duration per character in translation text (1 msec/char)." msgid_plural "" "Has too short duration per character in translation text (%1 msecs/char)." msgstr[0] "" "В преводния текст има прекалено кратка продължителност на знак (1 мсек/знак)." msgstr[1] "" "В преводния текст има прекалено кратка продължителност на знак (%1 мсек/" "знак)." #: core/subtitleline.cpp:192 msgid "Has too long duration (1 msec)." msgid_plural "Has too long duration (%1 msecs)." msgstr[0] "Прекалено дълга продължителност (1 мсек)." msgstr[1] "Прекалено дълга продължителност (%1 мсек)." #: core/subtitleline.cpp:198 msgid "Has too short duration (1 msec)." msgid_plural "Has too short duration (%1 msecs)." msgstr[0] "Прекалено кратка продължителност (1 мсек)." msgstr[1] "Прекалено кратка продължителност (%1 мсек)." #: core/subtitleline.cpp:204 msgid "Overlaps with next line." msgstr "Презастъпва се с следваща реплика" #: core/subtitleline.cpp:208 msgid "Has untranslated text." msgstr "Има непреведен текст" #: core/subtitleline.cpp:212 msgid "Has user mark." msgstr "Има потребителска маркировка" #: core/subtitleline.cpp:680 msgid "Set Line Times" msgstr "Задаване на времена на репликите" #: core/subtitleline.cpp:691 msgid "Shift Line Times" msgstr "Изместване на времена на репликите" #: core/subtitleline.cpp:705 msgid "Adjust Line Times" msgstr "Нагаждане на времена на репликите" #: main/actions/krecentfilesactionext.cpp:37 msgid "Clear History" msgstr "Изчистване на историята" #: main/application.cpp:415 msgid "Video Files" msgstr "Видео файлове" #: main/application.cpp:423 msgid "Audio Files" msgstr "Аудио файлове" #: main/application.cpp:425 msgid "Media Files" msgstr "Медийни файлове" #: main/application.cpp:426 msgid "All Files" msgstr "Всички файлове" #: main/application.cpp:442 msgid "Audio Levels Files" msgstr "Файлове с нива на звука" #: main/application.cpp:456 msgid "Exit the application" msgstr "Изход от програмата" #: main/application.cpp:460 msgid "Configure Subtitle Composer" msgstr "Настройване на Subtitle Composer" #: main/application.cpp:465 msgctxt "@action:inmenu Create a new subtitle" msgid "New" msgstr "Нов" #: main/application.cpp:466 msgid "Create an empty subtitle" msgstr "Създаване на празни субтитри" #: main/application.cpp:475 msgctxt "@action:inmenu Open subtitle file" msgid "Open..." msgstr "Отваряне..." #: main/application.cpp:476 main/application.cpp:486 msgid "Open subtitle file" msgstr "Отваряне на файл със субтитри" #: main/application.cpp:485 msgctxt "@action:inmenu Open rencently used subtitle file" msgid "Open &Recent" msgstr "Отваряне &скорошни" #: main/application.cpp:493 msgid "Save" msgstr "Запазване" #: main/application.cpp:494 msgid "Save opened subtitle" msgstr "Запазване на отворени субтитри" #: main/application.cpp:503 msgid "Save As..." msgstr "Запазване като..." #: main/application.cpp:504 msgid "Save opened subtitle with different settings" msgstr "Запазване на отворени субтитри с различни настройки" #: main/application.cpp:512 msgid "Close" msgstr "Затваряне" #: main/application.cpp:513 msgid "Close opened subtitle" msgstr "Затваряне на отворени субтитри" #: main/application.cpp:522 msgid "New Translation" msgstr "Нов превод" #: main/application.cpp:523 msgid "Create an empty translation subtitle" msgstr "Създаване на празен преводен файл за субтитри" #: main/application.cpp:532 msgid "Open Translation..." msgstr "Отваряне на превод..." #: main/application.cpp:533 main/application.cpp:543 msgid "Open translation subtitle file" msgstr "Отваряне на преводен файл със субтитри" #: main/application.cpp:542 msgid "Open &Recent Translation" msgstr "Отваряне &скорошен превод" #: main/application.cpp:551 msgid "Save Translation" msgstr "Запазване на превод" #: main/application.cpp:552 msgid "Save opened translation subtitle" msgstr "Запазване на отворени преводни субтитри" #: main/application.cpp:561 msgid "Save Translation As..." msgstr "Запазване на превод като..." #: main/application.cpp:562 msgid "Save opened translation subtitle with different settings" msgstr "Запазване на отворени преводни субтитри с различни настройки" #: main/application.cpp:570 msgid "Close Translation" msgstr "Затваряне на превод" #: main/application.cpp:571 msgid "Close opened translation subtitle" msgstr "Затваряне на отворени преводни субтитри" #: main/application.cpp:580 msgid "Reload As..." msgstr "Презареждане като..." #: main/application.cpp:581 main/application.cpp:592 msgid "Reload opened file with a different encoding" msgstr "Презареждане на отворен файл с разбична кодировка" #: main/application.cpp:591 msgid "Quick Reload As..." msgstr "Бързо презареждане като..." #: main/application.cpp:600 main/application.cpp:601 #: widgets/simplerichtextedit.cpp:72 msgid "Undo" msgstr "Отмяна" #: main/application.cpp:610 main/application.cpp:611 #: widgets/simplerichtextedit.cpp:78 msgid "Redo" msgstr "Възстановяване" #: main/application.cpp:619 msgid "Split Subtitle..." msgstr "Разделяне на субтитри..." #: main/application.cpp:620 msgid "Split the opened subtitle in two parts" msgstr "Разделяне на отворените субтитри на две части" #: main/application.cpp:627 msgid "Join Subtitles..." msgstr "Присъединяване на субтитри..." #: main/application.cpp:628 msgid "Append to the opened subtitle another one" msgstr "Добавяне към отворените субтитри на други" #: main/application.cpp:635 main/lineswidget.cpp:1222 msgid "Insert Before" msgstr "Вмъкване преди" #: main/application.cpp:636 msgid "Insert empty line before current one" msgstr "Вмъкване на празна реплика преди текущата" #: main/application.cpp:644 main/lineswidget.cpp:1223 msgid "Insert After" msgstr "Вмъкване след" #: main/application.cpp:645 msgid "Insert empty line after current one" msgstr "Вмъкване на празна реплика след текущата" #: main/application.cpp:653 main/lineswidget.cpp:1221 #: main/scripting/scriptsmanager.cpp:141 msgid "Remove" msgstr "Премахване" #: main/application.cpp:654 msgid "Remove selected lines" msgstr "Премахване на избрани реплики" #: main/application.cpp:663 msgid "Split selected lines" msgstr "Обособяване на избрани реплики" #: main/application.cpp:671 msgid "Join selected lines" msgstr "Присъединяване на избрани реплики" #: main/application.cpp:678 main/dialogs/actionwitherrortargetsdialog.cpp:103 #: main/lineswidget.cpp:1219 widgets/simplerichtextedit.cpp:113 msgid "Select All" msgstr "Избиране на всичко" #: main/application.cpp:679 msgid "Select all lines" msgstr "Избиране на всички реплики" #: main/application.cpp:687 msgid "Go to Line..." msgstr "Отиване на реплика..." #: main/application.cpp:688 msgid "Go to specified line" msgstr "Отиване на посочена реплика" #: main/application.cpp:697 msgid "Find..." msgstr "Търсене..." #: main/application.cpp:698 msgid "Find occurrences of strings or regular expressions" msgstr "Търсене на съществуващи низове или регулярни изрази" #: main/application.cpp:708 msgid "Find Next" msgstr "Търсене на следващ" #: main/application.cpp:709 msgid "Find next occurrence of string or regular expression" msgstr "Търсене на следващ съществуващ низ или регулярен израз" #: main/application.cpp:719 msgid "Find Previous" msgstr "Търсене на предишен" #: main/application.cpp:720 msgid "Find previous occurrence of string or regular expression" msgstr "Търсене на предишен съществуващ низ или регулярен израз" #: main/application.cpp:728 msgid "Replace..." msgstr "Замяна..." #: main/application.cpp:729 msgid "Replace occurrences of strings or regular expressions" msgstr "Замяна на съществуващи низове или регулярни изрази" #: main/application.cpp:738 msgid "Retrocede current line" msgstr "Изтегляне на текущата реплика" #: main/application.cpp:739 msgid "Makes the line before the current one active" msgstr "Прави активна репликата преди текущата" #: main/application.cpp:748 msgid "Advance current line" msgstr "Изместване напред на текущата реплика" #: main/application.cpp:749 msgid "Makes the line after the current one active" msgstr "Прави активна репликата след текущата" #: main/application.cpp:757 main/errorsdialog.cpp:59 main/lineswidget.cpp:1212 msgid "Check Errors..." msgstr "Проверяване за грешки..." #: main/application.cpp:758 msgid "Check for errors in the current subtitle" msgstr "Проверка за грешки в текущите субтитри" #: main/application.cpp:766 main/errorsdialog.cpp:62 main/lineswidget.cpp:1213 msgid "Clear Errors..." msgstr "Изчистване на грешките..." #: main/application.cpp:767 msgid "Clear errors from selected lines" msgstr "Изчистване на грешките от текущо избраните реплики" #: main/application.cpp:774 main/lineswidget.cpp:1215 msgid "Show Errors..." msgstr "Показване на грешки..." #: main/application.cpp:775 msgid "Show errors information for the current subtitle" msgstr "Показване на информация за грешките в текущите субтитри" #: main/application.cpp:784 msgid "Find Error..." msgstr "Търсене на грешка..." #: main/application.cpp:785 msgid "Find lines with specified errors" msgstr "Търсене на реплики с определени грешки" #: main/application.cpp:795 msgid "Find Next Error" msgstr "Търсене следваща грешка" #: main/application.cpp:796 msgid "Find next line with specified errors" msgstr "Търсене следваща реплика с определени грешки" #: main/application.cpp:806 msgid "Find Previous Error" msgstr "Търсене предишна грешка" #: main/application.cpp:807 msgid "Find previous line with specified errors" msgstr "Търсене предишна реплика с определени грешки" #: main/application.cpp:816 main/lineswidget.cpp:1159 msgid "Spelling..." msgstr "Проверка на правописа..." #: main/application.cpp:817 msgid "Check lines spelling" msgstr "Проверка на правописа на репликите" #: main/application.cpp:824 msgid "Toggle Mark" msgstr "Маркиране" #: main/application.cpp:825 msgid "Toggle selected lines mark" msgstr "Включване на маркировката за избрани реплики" #: main/application.cpp:834 main/currentlinewidget.cpp:92 msgid "Toggle Bold" msgstr "Включване на получер" #: main/application.cpp:835 msgid "Toggle selected lines bold attribute" msgstr "Включване на получер за избраните реплики" #: main/application.cpp:844 main/currentlinewidget.cpp:97 msgid "Toggle Italic" msgstr "Включване на курсив" #: main/application.cpp:845 msgid "Toggle selected lines italic attribute" msgstr "Включване на курсив за избраните реплики" #: main/application.cpp:854 main/currentlinewidget.cpp:102 msgid "Toggle Underline" msgstr "Включване на подчертаване" #: main/application.cpp:855 msgid "Toggle selected lines underline attribute" msgstr "Включване на подчертаване за избраните реплики" #: main/application.cpp:864 main/currentlinewidget.cpp:107 msgid "Toggle Strike Through" msgstr "Включване на зачертаване" #: main/application.cpp:865 msgid "Toggle selected lines strike through attribute" msgstr "Включване на зачертаване за избраните реплики" #: main/application.cpp:873 main/lineswidget.cpp:1199 msgid "Shift..." msgstr "Изместване..." #: main/application.cpp:874 msgid "Shift lines an specified amount of time" msgstr "Изместване на репликите със даден период от време" #: main/application.cpp:901 msgid "Adjust..." msgstr "Нагаждане..." #: main/application.cpp:902 msgid "Linearly adjust all lines to a specified interval" msgstr "Линейно нагаждане на всички реплики към зададен интервал" #: main/application.cpp:910 msgid "Sort..." msgstr "Сортиране..." #: main/application.cpp:911 msgid "Sort lines based on their show time" msgstr "Сортиране на репликите въз основа времето им за показване" #: main/application.cpp:918 msgid "Change Frame Rate..." msgstr "Промяна на кадри в секунда..." #: main/application.cpp:919 msgid "Retime subtitle lines by reinterpreting its frame rate" msgstr "" "Преработване на времената на репликите, като се реинтерпретират кадрите в " "секунда" #: main/application.cpp:926 main/lineswidget.cpp:1201 msgid "Enforce Duration Limits..." msgstr "Налагане на ограничения за продължителността..." #: main/application.cpp:927 msgid "Enforce lines minimum and/or maximum duration limits" msgstr "" "Налагане на ограничения за минималната и/или максималната продължителност" #: main/application.cpp:935 main/lineswidget.cpp:1202 msgid "Set Automatic Durations..." msgstr "Задаване на автоматична продължителност..." #: main/application.cpp:936 msgid "Set lines durations based on amount of letters, words and line breaks" msgstr "" "Задаване на продължителност на репликите на базата на букви, думи и нов ред " "в репликите" #: main/application.cpp:943 msgid "Maximize Durations..." msgstr "Максимизиране на продължителностите" #: main/application.cpp:944 msgid "Extend lines durations up to their next lines show time" msgstr "" "Удължаване на продължителността на репликите до времето за показване на " "следваща реплика" #: main/application.cpp:951 msgid "Fix Overlapping Times..." msgstr "Поправяне на презастъпващи се времена..." #: main/application.cpp:952 msgid "Fix lines overlapping times" msgstr "Поправка на презастъпващи се времена на репликите" #: main/application.cpp:959 msgid "Synchronize with Subtitle..." msgstr "Синхронизиране със субтитри..." #: main/application.cpp:960 msgid "Copy timing information from another subtitle" msgstr "Копиране на информацията за времената на репликите от други субтитри" #: main/application.cpp:967 main/lineswidget.cpp:1142 msgid "Break Lines..." msgstr "Нов ред в репликите..." #: main/application.cpp:968 msgid "Automatically set line breaks" msgstr "Задаване на автоматичен нов ред в репликите" #: main/application.cpp:975 main/lineswidget.cpp:1145 msgid "Unbreak Lines..." msgstr "Събиране редовете на репликите..." #: main/application.cpp:976 msgid "Remove line breaks from lines" msgstr "Премахване новите редове от репликите" #: main/application.cpp:983 main/lineswidget.cpp:1151 msgid "Simplify Spaces..." msgstr "Опростяване на интервалите..." #: main/application.cpp:984 msgid "Remove unneeded spaces from lines" msgstr "Премахване на ненужни интервали (и повтарящи се символи) от репликите" #: main/application.cpp:991 main/lineswidget.cpp:1155 msgid "Change Case..." msgstr "Промяна на регистъра на буквите..." #: main/application.cpp:992 msgid "Change lines text to upper, lower, title or sentence case" msgstr "" "Промяна на регистъра на репликите до горен, долен, заглавен или \"изречение\"" #: main/application.cpp:999 main/lineswidget.cpp:1156 msgid "Fix Punctuation..." msgstr "Поправяне на пунктуация..." #: main/application.cpp:1000 msgid "Fix punctuation errors in lines" msgstr "Поправяне на пунктуационни грешки в репликите" #: main/application.cpp:1007 main/lineswidget.cpp:1157 msgid "Translate..." msgstr "Превод..." #: main/application.cpp:1008 msgid "Translate lines texts using Google services" msgstr "Превод на текста на репликите с помощта на Google" #: main/application.cpp:1015 msgid "Edit Line in Place" msgstr "Редактиране на репликата на място" #: main/application.cpp:1016 msgid "Edit current line text in place" msgstr "Редактиране на текста на текущата реплика на място" #: main/application.cpp:1025 msgid "Open Video..." msgstr "Отваряне на видео..." #: main/application.cpp:1026 main/application.cpp:1034 msgid "Open video file" msgstr "Отваряне на видео файл" #: main/application.cpp:1033 msgid "Open &Recent Video" msgstr "Отваряне &скорошно видео" #: main/application.cpp:1041 msgid "Close Video" msgstr "Затваряне на видео" #: main/application.cpp:1042 msgid "Close video file" msgstr "Затваряне на видео файл" #: main/application.cpp:1051 msgid "Full Screen Mode" msgstr "Пълноекранен режим на работа" #: main/application.cpp:1052 msgid "Toggle full screen mode" msgstr "Включване/изключване на пълноекранен режим на работа" #: main/application.cpp:1060 main/utils/kreplace.cpp:425 msgid "Stop" msgstr "Стоп" #: main/application.cpp:1061 msgid "Stop video playback" msgstr "Спиране на изпълнение на видео" #: main/application.cpp:1069 main/application.cpp:3156 #: main/application.cpp:3163 msgid "Play" msgstr "Изпълнение" #: main/application.cpp:1070 msgid "Toggle video playing/paused" msgstr "Включване/изключване на видео изпълнение/пауза" #: main/application.cpp:1078 msgid "Seek Backwards" msgstr "Обход назад" #: main/application.cpp:1087 msgid "Seek Forwards" msgstr "Обход напред" #: main/application.cpp:1099 msgid "Jump to Previous Line" msgstr "Скачане на предишната реплика" #: main/application.cpp:1100 msgid "Seek to previous subtitle line show time" msgstr "Обход до времето за показване на предишната реплика в субтитрите" #: main/application.cpp:1109 msgid "Jump to Next Line" msgstr "Скачане на следващата реплика" #: main/application.cpp:1110 msgid "Seek to next subtitle line show time" msgstr "Обход до времето за показване на следващата реплика в субтитрите" #: main/application.cpp:1120 msgid "Set Current Line Show Time" msgstr "Задаване на времето за показване на текущата реплика" #: main/application.cpp:1121 msgid "Set current line show time to video position" msgstr "" "Задаване на времето за показване на текущата реплика в момент от " "изпълнението на видео файла" #: main/application.cpp:1131 msgid "Set Current Line Hide Time" msgstr "Задаване на времето за скриване на текущата реплика" #: main/application.cpp:1132 msgid "Set current line hide time to video position" msgstr "" "Задаване на времето за скриване на текущата реплика в момент от изпълнението " "на видео файла" #: main/application.cpp:1141 msgid "Current Line Follows Video" msgstr "Текущата реплика винаги следва видеото" #: main/application.cpp:1142 msgid "Make current line follow the playing video position" msgstr "Текущата реплика ще се променя заедно с изпълнението на видеото" #: main/application.cpp:1149 msgctxt "@action:inmenu Toggle audio muted" msgid "Mute" msgstr "Заглушаване" #: main/application.cpp:1151 msgid "Enable/disable playback sound" msgstr "Включване/изключване на звука" #: main/application.cpp:1159 msgid "Increase Volume" msgstr "Увеличаване на звука" #: main/application.cpp:1160 msgid "Increase volume by 5%" msgstr "Увеличаване на звука с 5%" #: main/application.cpp:1168 msgid "Decrease Volume" msgstr "Намаляване на звука" #: main/application.cpp:1169 msgid "Decrease volume by 5%" msgstr "Намаляване на звука с 5%" #: main/application.cpp:1177 msgid "Audio Streams" msgstr "Аудио канали" #: main/application.cpp:1178 msgid "Select active audio stream" msgstr "Избиране на активен аудио канал" #: main/application.cpp:1186 msgid "Increase Font Size" msgstr "Увеличаване кегела на шрифта" #: main/application.cpp:1187 msgid "Increase subtitles font size by 1 point" msgstr "Увеличаване на размера на шрифта с единица" #: main/application.cpp:1195 msgid "Decrease Font Size" msgstr "Намаляване на кегела на шрифта" #: main/application.cpp:1196 msgid "Decrease subtitles font size by 1 point" msgstr "Намаляване на размера на шрифта с единица" #: main/application.cpp:1204 msgid "Subtitle Streams" msgstr "Канали със субтитри" #: main/application.cpp:1205 msgid "Select active subtitle stream" msgstr "Избиране на активен канал със субтитри" #: main/application.cpp:1212 msgid "Shift to Video Position" msgstr "Изместване до позиция във видеото" #: main/application.cpp:1213 msgid "" "Set current line show time to video position by equally shifting all lines" msgstr "" "Задаване времето за показване на текущата реплика към позицията във видеото " "с изместване на всички останали реплики" #: main/application.cpp:1221 msgid "Adjust to Video Position (Anchor Last Line)" msgstr "" "Нагаждане до видео позиция (блокиране на изместването в последната реплика)" #: main/application.cpp:1222 msgid "" "Set current line to video position by fixing the last line and linearly " "adjusting the other ones" msgstr "" "Задаване на позицията на текущата реплика към позицията във видеото, като се " "блокира изместването в последната реплика и линейно се нагаждат всички " "останали" #: main/application.cpp:1230 msgid "Adjust to Video Position (Anchor First Line)" msgstr "" "Нагаждане до видео позиция (блокиране на изместването в първата реплика)" #: main/application.cpp:1231 msgid "" "Set current line to video position by fixing the first line and linearly " "adjusting the other ones" msgstr "" "Задаване на позицията на текущата реплика към позицията във видеото, като се " "блокира изместването в първата реплика и линейно се нагаждат всички останали" #: main/application.cpp:1240 #, fuzzy msgctxt "@action:inmenu Manage user scripts" msgid "Scripts Manager..." msgstr "Управление на скриптовете" #: main/application.cpp:1241 msgid "Manage user scripts" msgstr "Управление на потребителски скриптове" #: main/application.cpp:1365 msgid "" "The requested action would make the subtitle and its translation share the " "same file, possibly resulting in loss of information when saving.\n" "Are you sure you want to continue?" msgstr "" "Действието ще обедини в един файл оригинала и превода на субтитрите, като " "при запазването е възможна загуба на информация.\n" "Сигурни ли сте, че искате да продължите?" #: main/application.cpp:1366 msgid "Conflicting Subtitle Files" msgstr "Конфликт между файловете със субтитри" #: main/application.cpp:1488 msgid "" "Could not parse the subtitle file.
This may have been caused by " "usage of the wrong encoding.
" msgstr "" "Неуспех при синтактичния разбор на файла със субтитри.
Възможно е " "това да се дължи на грешна кодировка.
" #: main/application.cpp:1519 msgid "There was an error saving the subtitle." msgstr "При запазването на субтитрите възникна грешка." #: main/application.cpp:1561 main/application.cpp:1770 msgid "" "Currently opened translation subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Отворените преводни субтитри имат незапазени промени\n" "Желаете ли да ги запазите?" #: main/application.cpp:1562 main/application.cpp:1771 msgid "Close Translation Subtitle" msgstr "Затваряне на преводни субтитри" #: main/application.cpp:1574 msgid "" "Currently opened subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Отворените субтитри имат незапазени промени\n" "Желаете ли да ги запазите?" #: main/application.cpp:1575 msgid "Close Subtitle" msgstr "Затваряне на субтитри" #: main/application.cpp:1678 msgctxt "@item:inmenu Display primary text in video player" msgid "Primary" msgstr "Оригинал" #: main/application.cpp:1679 msgctxt "@item:inmenu Display translation text in video player" msgid "Translation" msgstr "Превод" #: main/application.cpp:1689 msgid "Could not parse the subtitle file." msgstr "Неуспех при синтактичния разбор на файла със субтитри." #: main/application.cpp:1728 msgid "There was an error saving the translation subtitle." msgstr "При запазването на преводните субтитри възникна грешка." #: main/application.cpp:1864 msgid "Could not read the subtitle file to append." msgstr "Неуспех при зареждането на файла със субтитри за добавяне." #: main/application.cpp:1916 msgid "Could not write the splitted subtitle file." msgstr "Неуспех при записа на разделен файл със субтитри." #: main/application.cpp:1917 msgid "Could not write the splitted subtitle translation file." msgstr "Неуспех при запазването на разделен преводен файл със субтитри." #: main/application.cpp:1935 msgid "The specified time does not split the subtitles." msgstr "Указаното време не разделя субтитрите." #: main/application.cpp:1984 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted part was saved as %1." msgstr "" "Неуспех при отварянето на нов прозорец на Subtitle Composer.\n" "Разделената част е запазена като %1." #: main/application.cpp:1989 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted parts were saved as %1 and %2." msgstr "" "Неуспех при отварянето на нов прозорец на Subtitle Composer.\n" "Разделените части са запазени като %1 и %2." #: main/application.cpp:2077 msgid "Go to Line" msgstr "Отиване на реплика" #: main/application.cpp:2077 msgid "&Go to line:" msgstr "&Отиване на реплика:" #: main/application.cpp:2389 msgid "Can not perform sort on selection with multiple ranges." msgstr "Неуспех при сортирането на субтитри с множествен диапазон." #: main/application.cpp:2499 msgid "The reference subtitle must have more than one line to proceed." msgstr "Отправните субтитри трябва да имат повече от една реплика." #: main/application.cpp:2511 msgid "Could not parse the reference subtitle file." msgstr "Неуспех при синтактичния разбор на отправните субтитри." #: main/application.cpp:2618 main/dialogs/translatedialog.cpp:31 msgid "Translate" msgstr "Превод" #: main/application.cpp:2619 msgid "Translating text (%1 to %2)..." msgstr "Превод на текст (%1 до %2)..." #: main/application.cpp:2628 msgid "Translating primary text (%1 to %2)..." msgstr "Превод на оригинален текст (%1 до %2)..." #: main/application.cpp:2629 msgid "Translating secondary text (%1 to %2)..." msgstr "Превод на преводен текст (%1 до %2)..." #: main/application.cpp:2661 msgid "" "Unable to perform texts synchronization (sent and received lines count do " "not match)." msgstr "" "Неуспех при синхронизацията (броят на получените и изпратените реплики не " "съвпада)." #: main/application.cpp:2670 msgid "Translate Primary Text" msgstr "Превод на оригинален текст" #: main/application.cpp:2671 msgid "Translate Secondary Text" msgstr "Превод на преводен текст" #: main/application.cpp:2687 msgid "" "There was an error performing the translation:\n" "\n" "%1" msgstr "" "При превода възникна грешка:\n" "\n" "%1" #: main/application.cpp:2740 msgid "Open Video" msgstr "Отваряне на видео" #: main/application.cpp:2873 main/application.cpp:2911 msgid "" "Continuing would result in loss of timing information for some lines.\n" "Are you sure you want to continue?" msgstr "" "Ако продължите, ще възникне загуба на информация във времената за някои " "реплики\n" "Сигурни ли сте, че искате да продължите?" #: main/application.cpp:2929 msgid "Open AudioLevels" msgstr "Отваряне на аудио нива" #: main/application.cpp:3035 msgid "modified" msgstr "променен" #: main/application.cpp:3039 main/application.cpp:3050 msgid "Untitled" msgstr "Неозаглавен" #: main/application.cpp:3041 msgid "Untitled Translation" msgstr "Неозаглавен превод" #: main/application.cpp:3149 msgid "Pause" msgstr "Пауза" #: main/application.cpp:3190 msgid "Seek backwards 1 second" msgid_plural "Seek backwards %1 seconds" msgstr[0] "Обход назад с 1 секунда" msgstr[1] "Обход назад с %1 секунди" #: main/application.cpp:3196 msgid "Seek forwards 1 second" msgid_plural "Seek forwards %1 seconds" msgstr[0] "Обход напред с 1 секунда" msgstr[1] "Обход напред с %1 секунди" #: main/application.cpp:3211 main/application.cpp:3223 msgid "Shift %21 Millisecond" msgid_plural "Shift %2%1 Milliseconds" msgstr[0] "Изместване%21 милисекунда" msgstr[1] "Изместване%2%1 милисекунди" #: main/application.cpp:3216 main/application.cpp:3228 msgid "Shift selected lines %21 millisecond" msgid_plural "Shift selected lines %2%1 milliseconds" msgstr[0] "Изместване на избраните реплики с %21 милисекунда" msgstr[1] "Изместване на избраните реплики с %2%1 милисекунди" #: main/configdialog.cpp:46 msgid "Configure" msgstr "Настройване" #: main/configdialog.cpp:54 msgctxt "@title General settings" msgid "General" msgstr "Общи" #: main/configdialog.cpp:55 msgid "General Settings" msgstr "Общи настройки" #: main/configdialog.cpp:59 msgctxt "@title Error checks settings" msgid "Error Checks" msgstr "Грешки" #: main/configdialog.cpp:60 msgid "Error Checks Settings" msgstr "Настройване на проверката за грешки" #: main/configdialog.cpp:64 msgctxt "@title Spelling settings" msgid "Spelling" msgstr "Правопис" #: main/configdialog.cpp:65 msgid "Spelling Settings" msgstr "Настройване на правописа" #: main/configdialog.cpp:69 msgctxt "@title Player settings" msgid "Player" msgstr "Плеър" #: main/configdialog.cpp:70 msgid "Player Settings" msgstr "Настройване на плеъра" #: main/configdialog.cpp:82 msgctxt "@title Player backend settings" msgid "%1 Backend Settings" msgstr "%1 Настройване на вътрешния интерфейс" #: main/configs/errorsconfigwidget.cpp:37 msgctxt "@title:group" msgid "Texts" msgstr "Текстове" #: main/configs/errorsconfigwidget.cpp:40 msgid "Maximum number of characters:" msgstr "Максимален брой знаци:" #: main/configs/errorsconfigwidget.cpp:45 #: main/dialogs/smarttextsadjustdialog.cpp:40 msgid " characters" msgstr " знака" #: main/configs/errorsconfigwidget.cpp:48 msgid "Maximum number of lines:" msgstr "Максимален брой редове на реплика:" #: main/configs/errorsconfigwidget.cpp:53 msgid " lines" msgstr " реда" #: main/configs/errorsconfigwidget.cpp:56 msgctxt "@title:group" msgid "Absolute Durations" msgstr "Абсолютни продължителности" #: main/configs/errorsconfigwidget.cpp:59 #: main/configs/errorsconfigwidget.cpp:78 msgid "Minimum duration:" msgstr "Минимална продължителност:" #: main/configs/errorsconfigwidget.cpp:64 #: main/configs/errorsconfigwidget.cpp:72 #: main/configs/generalconfigwidget.cpp:52 #: main/configs/generalconfigwidget.cpp:66 #: main/configs/generalconfigwidget.cpp:74 #: main/dialogs/fixoverlappingtimesdialog.cpp:37 msgid " msecs" msgstr " милисекунди" #: main/configs/errorsconfigwidget.cpp:67 #: main/configs/errorsconfigwidget.cpp:86 msgid "Maximum duration:" msgstr "Максимална продължителност:" #: main/configs/errorsconfigwidget.cpp:75 msgctxt "@title:group" msgid "Relative Durations" msgstr "Относителни продължителности" #: main/configs/errorsconfigwidget.cpp:83 #: main/configs/errorsconfigwidget.cpp:91 msgid " msecs/character" msgstr " милисекунди/знак" #: main/configs/errorsconfigwidget.cpp:93 msgctxt "@title:group" msgid "Behavior" msgstr "Поведение" #: main/configs/errorsconfigwidget.cpp:96 msgid "Automatically clear fixed errors" msgstr "Автоматично изчистване на поправените грешки" #: main/configs/generalconfigwidget.cpp:38 #: main/configs/playerconfigwidget.cpp:44 #: player/mplayer/mplayerconfigwidget.cpp:37 msgctxt "@title:group General settings" msgid "General" msgstr "Общи" #: main/configs/generalconfigwidget.cpp:41 msgid "Default encoding for opening subtitles:" msgstr "Кодировка по подразбиране за отваряне на субтитри:" #: main/configs/generalconfigwidget.cpp:47 msgid "On line double click, jump to show time minus:" msgstr "" "При двойно щракване върху реплика - скок до времето за показване минус:" #: main/configs/generalconfigwidget.cpp:55 msgid "Automatically load video file when opening subtitle" msgstr "Автоматично зареждане на видео файл при отваряне на субтитри" #: main/configs/generalconfigwidget.cpp:58 msgctxt "@title:group" msgid "Quick Actions" msgstr "Бързи действия" #: main/configs/generalconfigwidget.cpp:61 msgid "Time shift for selected lines:" msgstr "Изместване във времето за избраните реплики:" #: main/configs/generalconfigwidget.cpp:69 msgid "Compensation for captured video times:" msgstr "Компенсиране за уловени видео времена:" #: main/configs/playerconfigwidget.cpp:47 msgid "Player backend:" msgstr "Вътрешен интерфейс на плеъра:" #: main/configs/playerconfigwidget.cpp:53 msgid "Jump length on seek:" msgstr "Дължина на скока при обход:" #: main/configs/playerconfigwidget.cpp:58 msgid " secs" msgstr " секунди" #: main/configs/playerconfigwidget.cpp:61 main/playerwidget.cpp:452 msgid "Show editable position control" msgstr "Показване на редактируема контрола за позиция" #: main/configs/playerconfigwidget.cpp:64 msgctxt "@title:group" msgid "Subtitles" msgstr "Субтитри" #: main/configs/playerconfigwidget.cpp:67 msgctxt "@label:chooser The font family name" msgid "Font family:" msgstr "Име на шрифт:" #: main/configs/playerconfigwidget.cpp:72 msgid "Font size:" msgstr "Кегел на шрифт:" #: main/configs/playerconfigwidget.cpp:77 msgid " points" msgstr " пункта" #: main/configs/playerconfigwidget.cpp:80 msgid "Primary color:" msgstr "Основен цвят:" #: main/configs/playerconfigwidget.cpp:85 msgid "Outline color:" msgstr "Очертаващ цвят:" #: main/configs/playerconfigwidget.cpp:91 msgid "Outline width:" msgstr "Ширина на очертаването:" #: main/configs/playerconfigwidget.cpp:96 msgid " pixels" msgstr " пиксела" #: main/configs/playerconfigwidget.cpp:99 msgctxt "@title:group" msgid "Subtitles Preview" msgstr "Преглед на субтитрите" #: main/configs/playerconfigwidget.cpp:109 msgctxt "Text for previewing the subtitles font settings" msgid "

The Quick Brown Fox
Jumps Over The Lazy Dog

" msgstr "

Ах, чудна българска земьо,
полюшвай цъфтящи жита!

" #: main/currentlinewidget.cpp:65 msgid "Show" msgstr "Показване" #: main/currentlinewidget.cpp:70 msgid "Hide" msgstr "Скриване" #: main/currentlinewidget.cpp:75 msgid "Duration" msgstr "Продължителност" #: main/currentlinewidget.cpp:253 main/currentlinewidget.cpp:259 msgid "No current line" msgstr "Няма текуща реплика" #: main/currentlinewidget.cpp:383 msgid "Current line:" msgstr "Текуща реплика:" #: main/currentlinewidget.cpp:408 msgid "1 character" msgid_plural "%1 characters" msgstr[0] "1 знак" msgstr[1] "%1 знака" #: main/dialogs/actionwitherrortargetsdialog.cpp:74 msgid "Available errors" msgstr "Налични грешки" #: main/dialogs/actionwitherrortargetsdialog.cpp:105 msgid "Select None" msgstr "Изключване на всички" #: main/dialogs/actionwithtargetdialog.cpp:131 msgid "Target >>" msgstr "Цел >>" #: main/dialogs/actionwithtargetdialog.cpp:131 #: main/dialogs/actionwithtargetdialog.cpp:149 msgid "Target <<" msgstr "Цел <<" #: main/dialogs/actionwithtargetdialog.cpp:164 msgid "All lines" msgstr "Всички реплики" #: main/dialogs/actionwithtargetdialog.cpp:165 main/utils/errorfinder.cpp:48 msgid "Selected lines" msgstr "Маркирани реплики" #: main/dialogs/actionwithtargetdialog.cpp:166 msgid "All lines from first selected" msgstr "Всички реплики от първата избрана" #: main/dialogs/actionwithtargetdialog.cpp:167 msgid "All lines up to last selected" msgstr "Всички реплики до последната избрана" #: main/dialogs/actionwithtargetdialog.cpp:257 main/utils/finder.cpp:63 #: main/utils/replacer.cpp:61 msgid "Both subtitles" msgstr "И двата файла със субтитри" #: main/dialogs/actionwithtargetdialog.cpp:260 main/utils/finder.cpp:65 #: main/utils/replacer.cpp:63 msgid "Primary subtitle" msgstr "Оригинални субтитри" #: main/dialogs/actionwithtargetdialog.cpp:263 main/utils/finder.cpp:67 #: main/utils/replacer.cpp:65 msgid "Translation subtitle" msgstr "Преводни субтитри" #: main/dialogs/actionwithtargetdialog.h:78 msgid "Apply To" msgstr "Прилагане към" #: main/dialogs/adjusttimesdialog.cpp:32 msgid "Adjust" msgstr "Нагаждане" #: main/dialogs/adjusttimesdialog.cpp:34 msgctxt "@title:group" msgid "New Times" msgstr "Нови времена" #: main/dialogs/adjusttimesdialog.cpp:39 msgid "First spoken line:" msgstr "Първа произнесена реплика:" #: main/dialogs/adjusttimesdialog.cpp:45 msgid "Last spoken line:" msgstr "Последна произнесена реплика:" #: main/dialogs/autodurationsdialog.cpp:38 #: main/dialogs/changeframeratedialog.cpp:36 #: main/dialogs/fixoverlappingtimesdialog.cpp:34 #: main/dialogs/fixpunctuationdialog.cpp:33 #: main/dialogs/smarttextsadjustdialog.cpp:34 #: main/dialogs/splitsubtitledialog.cpp:38 main/dialogs/translatedialog.cpp:33 msgctxt "@title:group" msgid "Settings" msgstr "Настройки" #: main/dialogs/autodurationsdialog.cpp:46 msgid "Milliseconds per line:" msgstr "Милисекунди на реплика:" #: main/dialogs/autodurationsdialog.cpp:55 msgid "Milliseconds per word:" msgstr "Милисекунди на дума:" #: main/dialogs/autodurationsdialog.cpp:64 msgid "Milliseconds per character:" msgstr "Милисекунди на знак:" #: main/dialogs/autodurationsdialog.cpp:68 #: main/dialogs/durationlimitsdialog.cpp:45 msgid "Prevent overlapping" msgstr "Предотвратяване на презастъпването" #: main/dialogs/autodurationsdialog.cpp:71 msgctxt "@title:group" msgid "Duration Calculation" msgstr "Калкулация на продължителността" #: main/dialogs/autodurationsdialog.cpp:77 msgid "Use primary text" msgstr "Използване на оригиналния текст" #: main/dialogs/autodurationsdialog.cpp:78 msgid "Use translation text" msgstr "Използване на преводния текст" #: main/dialogs/autodurationsdialog.cpp:79 msgid "Calculate both and use maximum" msgstr "Изчисляване и на двете и използване на максималното" #: main/dialogs/changeframeratedialog.cpp:45 msgid "Current frame rate:" msgstr "Текущи кадри в секунда:" #: main/dialogs/changeframeratedialog.cpp:54 msgid "New frame rate:" msgstr "Нови кадри в секунда:" #: main/dialogs/changetextscasedialog.cpp:33 msgid "Change Case" msgstr "Промяна на регистъра на буквите" #: main/dialogs/changetextscasedialog.cpp:35 msgctxt "@title:group" msgid "Change To" msgstr "Промяна до" #: main/dialogs/changetextscasedialog.cpp:39 msgid "Lower case" msgstr "Долен регистър" #: main/dialogs/changetextscasedialog.cpp:44 msgid "Upper case" msgstr "Горен регистър" #: main/dialogs/changetextscasedialog.cpp:48 msgid "Title case" msgstr "Заглавен регистър" #: main/dialogs/changetextscasedialog.cpp:52 msgid "Sentence case" msgstr "Изречение" #: main/dialogs/changetextscasedialog.cpp:56 msgid "Convert to lower case first" msgstr "Конвертиране първо до долен регистър" #: main/dialogs/checkerrorsdialog.cpp:31 msgid "Check Errors" msgstr "Проверяване за грешкиПроверяване за грешки" #: main/dialogs/checkerrorsdialog.cpp:33 msgctxt "@title:group" msgid "Errors to Check" msgstr "Грешки за проверяване" #: main/dialogs/checkerrorsdialog.cpp:36 msgctxt "@title:group Miscellaneous settings" msgid "Miscellaneous" msgstr "РазниРазни" #: main/dialogs/checkerrorsdialog.cpp:39 msgid "Clear other errors" msgstr "Изчистване на другите грешки" #: main/dialogs/checkerrorsdialog.cpp:43 msgid "Clear user marks" msgstr "Изчистване на потребителската маркировка" #: main/dialogs/clearerrorsdialog.cpp:32 msgid "Clear Errors" msgstr "Изчистване на грешките" #: main/dialogs/clearerrorsdialog.cpp:34 msgctxt "@title:group" msgid "Errors to Clear" msgstr "Грешки за изчистване" #: main/dialogs/durationlimitsdialog.cpp:35 msgctxt "@title:group" msgid "Minimum Duration" msgstr "Минимална продължителност" #: main/dialogs/durationlimitsdialog.cpp:41 msgid "Expand duration to:" msgstr "Разширяване на продължителността до:" #: main/dialogs/durationlimitsdialog.cpp:48 msgctxt "@title:group" msgid "Maximum Duration" msgstr "Максимална продължителност" #: main/dialogs/durationlimitsdialog.cpp:54 msgid "Shrink duration to:" msgstr "Смаляване на продължителността до:" #: main/dialogs/fixoverlappingtimesdialog.cpp:43 msgid "Minimum interval between lines:" msgstr "Минимално време между репликите:" #: main/dialogs/fixpunctuationdialog.cpp:31 msgid "Fix Punctuation" msgstr "Поправяне на пунктуация" #: main/dialogs/fixpunctuationdialog.cpp:36 msgid "Fix and cleanup spaces" msgstr "Поправяне и почистване на интервалите" #: main/dialogs/fixpunctuationdialog.cpp:40 msgid "Fix quotes and double quotes" msgstr "Поправяне на единичните и двойните кавички" #: main/dialogs/fixpunctuationdialog.cpp:44 msgid "Fix English 'I' pronoun" msgstr "Поправяне на местоимението \"I\" в английския" #: main/dialogs/fixpunctuationdialog.cpp:48 msgid "Add ellipisis indicating non finished lines" msgstr "Добавяне на скоби за индикация на недовършени изречения" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line Before Current" msgstr "Вмъкване на реплика преди текущата" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line After Current" msgstr "Вмъкване на реплика след текущата" #: main/dialogs/insertlinedialog.cpp:29 msgid "Insert Into" msgstr "Вмъкване в" #: main/dialogs/joinsubtitlesdialog.cpp:40 msgid "Shift subtitle forwards before append" msgstr "Изместване на субтитрите напред преди добавянето" #: main/dialogs/joinsubtitlesdialog.cpp:47 #: main/dialogs/splitsubtitledialog.cpp:44 msgid "Set from video length" msgstr "Задаване въз основа на дължината на видеото" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Subtitle" msgstr "Отваряне на субтитри" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Translation Subtitle" msgstr "Отваряне на преводни субтитри" #: main/dialogs/opensubtitledialog.cpp:46 #: main/dialogs/savesubtitledialog.cpp:80 #: main/dialogs/selectablesubtitledialog.cpp:67 msgid "Encoding:" msgstr "Кодировка:" #: main/dialogs/opensubtitledialog.cpp:73 msgid "All Supported" msgstr "Всички поддържани" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove Selected Lines" msgstr "Премахване на избраните реплики" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove From" msgstr "Премахване от" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Subtitle" msgstr "Запазване на субтитри" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Translation Subtitle" msgstr "Запазване на преводни субтитри" #: main/dialogs/savesubtitledialog.cpp:69 msgid "EOL:" msgstr "EOL:" #: main/dialogs/savesubtitledialog.cpp:145 msgid "" "A file named \"%1\" already exists. Are you sure you want to overwrite it?" msgstr "" "Файлът с име \"%1\" вече съществува. Сигурни ли сте, че искате да го " "презапишете?" #: main/dialogs/savesubtitledialog.cpp:148 msgid "Overwrite File?" msgstr "Презаписване на файл?" #: main/dialogs/savesubtitledialog.cpp:149 msgid "Overwrite" msgstr "Презаписване" #: main/dialogs/selectablesubtitledialog.cpp:51 msgid "Path:" msgstr "Път:" #: main/dialogs/selectablesubtitledialog.cpp:56 msgid "Select subtitle" msgstr "Избиране на субтитри" #: main/dialogs/selectablesubtitledialog.h:54 msgid "Subtitle" msgstr "Субтитри" #: main/dialogs/shifttimesdialog.cpp:32 msgid "Shift" msgstr "Shift" #: main/dialogs/shifttimesdialog.cpp:34 msgctxt "@title:group" msgid "Shifting" msgstr "Изместване" #: main/dialogs/shifttimesdialog.cpp:38 msgid "Forwards (+)" msgstr "Напред (+)" #: main/dialogs/shifttimesdialog.cpp:39 msgid "Backwards (–)" msgstr "Назад (-)" #: main/dialogs/smarttextsadjustdialog.cpp:43 msgid "Minimum length for line break:" msgstr "Минимална дължина за нов ред в реплика:" #: main/dialogs/splitsubtitledialog.cpp:36 msgid "Split Subtitle" msgstr "Разделяне на субтитрите" #: main/dialogs/splitsubtitledialog.cpp:49 msgid "Split time:" msgstr "Време за разделяне:" #: main/dialogs/splitsubtitledialog.cpp:53 msgid "Shift new part backwards after split" msgstr "Изместване на новата част назад след разделянето" #: main/dialogs/syncsubtitlesdialog.cpp:32 msgid "Synchronize with Subtitle" msgstr "Синхронизиране със субтитри" #: main/dialogs/syncsubtitlesdialog.cpp:34 msgid "Reference Subtitle" msgstr "Отправни субтитри" #: main/dialogs/syncsubtitlesdialog.cpp:36 msgctxt "@title:group" msgid "Synchronization Mode" msgstr "Режим на синхронизиране" #: main/dialogs/syncsubtitlesdialog.cpp:39 msgid "Adjust to reference's first and last lines" msgstr "Нагаждане към първата и последната реплика на отправните субтитри" #: main/dialogs/syncsubtitlesdialog.cpp:43 msgid "Copy timing information from reference line by line" msgstr "" "Копиране на информацията за времената от отправните субтитри реплика по " "реплика" #: main/dialogs/translatedialog.cpp:49 msgid "Input language:" msgstr "Входящ език:" #: main/dialogs/translatedialog.cpp:66 msgid "Output language:" msgstr "Изходящ език:" #: main/errorsdialog.cpp:42 msgid "Subtitle Errors" msgstr "Грешки в субтитрите" #: main/errorsdialog.cpp:55 msgid "Clear Fixed Errors" msgstr "Изчистване на поправените грешки" #: main/errorsdialog.cpp:65 msgid "Settings..." msgstr "Настройки..." #: main/errorsdialog.cpp:121 msgid "Showing 1 line with errors" msgid_plural "Showing %1 lines with errors" msgstr[0] "Показване на 1 реплика с грешки" msgstr[1] "Показване на %1 реплики с грешки" #: main/errorsdialog.cpp:124 msgid "1 total error" msgid_plural "%1 total errors" msgstr[0] "1 пълна грешка" msgstr[1] "%1 пълни грешки" #: main/errorsdialog.cpp:125 msgid "1 user mark" msgid_plural "%1 user marks" msgstr[0] "1 потребителска маркировка" msgstr[1] "%1 потребителски маркировки" #: main/errorswidget.cpp:491 msgid "Line Errors" msgstr "Грешки в репликите" #: main/errorswidget.cpp:492 msgid "Count" msgstr "Брой" #: main/errorswidget.cpp:493 msgid "Marked" msgstr "Маркирани" #: main/errorswidget.cpp:509 msgid "yes" msgstr "да" #: main/errorswidget.cpp:510 msgid "no" msgstr "не" #: main/errorswidget.cpp:517 msgid "Line %1" msgstr "Реплика %1" #: main/errorswidget.cpp:717 msgid "Expand All" msgstr "Разширяване на всички" #: main/errorswidget.cpp:718 msgid "Collapse All" msgstr "Свиване на всички" #: main/errorswidget.cpp:722 msgid "Clear Selected Marks" msgstr "Изчистване на избраната маркировка" #: main/errorswidget.cpp:723 msgid "Clear Selected Errors" msgstr "Изчистване на избраните грешки" #: main/errorswidget.cpp:729 msgid "Clear Fixed Selection" msgstr "Изчестване на поправен избор" #: main/lineswidget.cpp:204 msgid "Observations:" msgstr "Засечено:" #: main/lineswidget.cpp:232 msgctxt "@title:column Subtitle line number" msgid "Line" msgstr "№" #: main/lineswidget.cpp:233 msgctxt "@title:column" msgid "Show Time" msgstr "Време за показване" #: main/lineswidget.cpp:234 msgctxt "@title:column" msgid "Hide Time" msgstr "Време за скриване" #: main/lineswidget.cpp:235 msgctxt "@title:column Subtitle line (primary) text" msgid "Text" msgstr "Текст" #: main/lineswidget.cpp:236 msgctxt "@title:column Subtitle line translation text" msgid "Translation" msgstr "Превод" #: main/lineswidget.cpp:1141 msgid "Texts" msgstr "Текстове" #: main/lineswidget.cpp:1162 msgid "Styles" msgstr "Стилове" #: main/lineswidget.cpp:1166 widgets/simplerichtextedit.cpp:119 msgctxt "@action:inmenu Toggle bold style" msgid "Bold" msgstr "Получер" #: main/lineswidget.cpp:1173 widgets/simplerichtextedit.cpp:125 msgctxt "@action:inmenu Toggle italic style" msgid "Italic" msgstr "Курсив" #: main/lineswidget.cpp:1180 widgets/simplerichtextedit.cpp:131 msgctxt "@action:inmenu Toggle underline style" msgid "Underline" msgstr "Подчертан" #: main/lineswidget.cpp:1187 widgets/simplerichtextedit.cpp:137 msgctxt "@action:inmenu Toggle strike through style" msgid "Strike Through" msgstr "Зачертан" #: main/lineswidget.cpp:1194 msgid "Times" msgstr "ВРемена" #: main/lineswidget.cpp:1196 msgid "Shift +%1 Milliseconds" msgstr "Изместване с +%1 милисекунди" #: main/lineswidget.cpp:1197 msgid "Shift -%1 Milliseconds" msgstr "Изместване с -%1 милисекунди" #: main/lineswidget.cpp:1207 msgid "Errors" msgstr "Грешки" #: main/lineswidget.cpp:1208 msgid "Mark" msgstr "Маркировка" #: main/main.cpp:43 msgid "Subtitle Composer" msgstr "Subtitle Composer" #: main/main.cpp:45 msgid "A KDE subtitle editor." msgstr "Редактор на субтитри за KDE" #: main/main.cpp:47 msgid "(C) 2007-2009 Sergio Pistone" msgstr "(C) 2007-2009 Sergio Pistone" #: main/main.cpp:51 msgid "Sergio Pistone" msgstr "Sergio Pistone" #: main/main.cpp:52 msgid "Author & maintainer" msgstr "Автор и поддръжка" #: main/main.cpp:61 msgid "Open location as primary subtitle" msgstr "Отваряне на местонахождение като оригинални субтитри" #: main/main.cpp:62 msgid "Open location as translation subtitle" msgstr "Отваряне на местонахождение като преводни субтитри" #: main/playerwidget.cpp:103 msgid "Position" msgstr "Позиция" #: main/playerwidget.cpp:111 msgid "Length" msgstr "Дължина" #: main/playerwidget.cpp:116 msgid "FPS" msgstr "Кадри в секунда" #: main/playerwidget.cpp:704 main/playerwidget.cpp:705 #: main/playerwidget.cpp:706 main/playerwidget.cpp:778 #: main/playerwidget.cpp:795 main/playerwidget.cpp:802 msgid "Unknown" msgstr "Неизвестно" #: main/playerwidget.cpp:715 msgid "There was an error opening file
%1
" msgstr "Възникна грешка при отварянето на файла
%1
" #: main/playerwidget.cpp:741 msgid "Unexpected error while playing file." msgstr "Неочаквана грешка при просвирването на файла." #: main/scripting/scriptsmanager.cpp:70 msgid "Installed Scripts" msgstr "Инсталирани скриптове" #: main/scripting/scriptsmanager.cpp:88 msgid "Information" msgstr "" #: main/scripting/scriptsmanager.cpp:94 msgid "Warning" msgstr "" #: main/scripting/scriptsmanager.cpp:100 #, fuzzy msgid "Error" msgstr "Грешки" #: main/scripting/scriptsmanager.cpp:113 msgid "Scripts Manager" msgstr "Управител на скриптовете" #: main/scripting/scriptsmanager.cpp:129 msgid "Create..." msgstr "Създаване..." #: main/scripting/scriptsmanager.cpp:130 msgid "Creates a new script file." msgstr "Създава нов скриптов файл" #: main/scripting/scriptsmanager.cpp:135 msgid "Add..." msgstr "Добавяне..." #: main/scripting/scriptsmanager.cpp:136 msgid "Copies an existing script from a specified location." msgstr "Копира съществуващ скрипт от дадено местоположение." #: main/scripting/scriptsmanager.cpp:142 msgid "Sends the selected script to the trash." msgstr "Изпращане на избрания скрипт в кошчето." #: main/scripting/scriptsmanager.cpp:147 msgid "Edit" msgstr "Редактиране" #: main/scripting/scriptsmanager.cpp:148 msgid "Opens the selected script with an external editor." msgstr "Отваряне на избрания скрипт с външен редактор." #: main/scripting/scriptsmanager.cpp:154 msgid "Run" msgstr "Стартиране" #: main/scripting/scriptsmanager.cpp:155 msgid "Executes the selected script." msgstr "Изпълняване на избрания скрипт." #: main/scripting/scriptsmanager.cpp:160 msgid "Refresh" msgstr "Опресняване" #: main/scripting/scriptsmanager.cpp:161 msgid "Reloads the installed scripts list." msgstr "Презарежда списъка с инсталирани скриптове" #: main/scripting/scriptsmanager.cpp:219 main/scripting/scriptsmanager.cpp:301 msgid "" "You must enter an unused name to continue.\n" "Would you like to enter another name?" msgstr "" "За да продължите трябва да въведете неизползвано име.\n" "Желаете ли да въведете друго име?" #: main/scripting/scriptsmanager.cpp:220 main/scripting/scriptsmanager.cpp:302 msgid "Name Already Used" msgstr "Името вече е в употреба" #: main/scripting/scriptsmanager.cpp:226 msgid "Create New Script" msgstr "Създаване на нов скрипт" #: main/scripting/scriptsmanager.cpp:226 main/scripting/scriptsmanager.cpp:308 msgid "Script name:" msgstr "Име на скрипта:" #: main/scripting/scriptsmanager.cpp:239 msgid "There was an error creating the file %1." msgstr "Възникна грешка при създаването на файла %1." #: main/scripting/scriptsmanager.cpp:283 msgid "Select Existing Script" msgstr "Избиране на съществуващ скрипт" #: main/scripting/scriptsmanager.cpp:308 msgid "Rename Script" msgstr "Преименуване на скрипт" #: main/scripting/scriptsmanager.cpp:322 msgid "There was an error opening the file %1." msgstr "Възникна грешка при отварянето на файла %1." #: main/scripting/scriptsmanager.cpp:331 msgid "There was an error copying the file to %1." msgstr "Възникна грешка при копирането на файла в %1." #: main/scripting/scriptsmanager.cpp:350 msgid "Do you really want to send file %1 to the trash?" msgstr "Наистина ли искате да изпратите файла %1 в кошчето?" #: main/scripting/scriptsmanager.cpp:351 msgid "Move to Trash" msgstr "Преместване в кошчето" #: main/scripting/scriptsmanager.cpp:359 msgid "There was an error removing the file %1." msgstr "Възникна грешка при премахването на файла %1." #: main/scripting/scriptsmanager.cpp:377 msgid "Could not launch external editor.\n" msgstr "Неуспех при зареждането на външен редактор.\n" #: main/scripting/scriptsmanager.cpp:441 main/scripting/scriptsmanager.cpp:448 msgid "Error Running Script" msgstr "Грешка в работата на скрипта" #: main/scripting/scriptsmanager.cpp:462 msgid "Tools" msgstr "Инструменти" #: main/utils/errorfinder.cpp:40 main/utils/errorfinder.cpp:221 #: main/utils/errorfinder.cpp:244 msgid "Find Error" msgstr "Търсене на грешка" #: main/utils/errorfinder.cpp:42 msgid "Errors to Find" msgstr "Грешки, които да бъдат търсени" #: main/utils/errorfinder.cpp:45 msgid "Options" msgstr "Настройки" #: main/utils/errorfinder.cpp:51 msgid "From current line" msgstr "От текущата реплика" #: main/utils/errorfinder.cpp:55 msgid "Find backwards" msgstr "Търсене назад" #: main/utils/errorfinder.cpp:216 main/utils/finder.cpp:298 #: main/utils/replacer.cpp:258 msgid "" "Beginning of selection reached.\n" "Continue from the end?" msgstr "" "Началото на избраната област беше достигнато.\n" "Започване отначало?" #: main/utils/errorfinder.cpp:217 main/utils/finder.cpp:299 #: main/utils/replacer.cpp:259 msgid "" "Beginning of subtitle reached.\n" "Continue from the end?" msgstr "" "Началото на субтитри е достигнато.\n" "Продължаване от края?" #: main/utils/errorfinder.cpp:219 main/utils/finder.cpp:301 #: main/utils/replacer.cpp:261 msgid "" "End of selection reached.\n" "Continue from the beginning?" msgstr "" "Краят на на избраната област беше достигнат.\n" "Започване отначало?" #: main/utils/errorfinder.cpp:220 main/utils/finder.cpp:302 #: main/utils/replacer.cpp:262 main/utils/speller.cpp:143 msgid "" "End of subtitle reached.\n" "Continue from the beginning?" msgstr "" "Краят на субтитрите е достигнат.\n" "Продължаване от началото" #: main/utils/errorfinder.cpp:243 msgid "No errors matching given criteria found!" msgstr "Не бяха намерени грешки, отговарящи на зададените критерии!" #: main/utils/finder.cpp:55 msgid "Find In" msgstr "Търесене в" #: main/utils/finder.cpp:278 main/utils/replacer.cpp:234 msgid "No instances of '%1' found!" msgstr "Беше открито наличието на '%1'!" #: main/utils/finder.cpp:279 main/utils/finder.cpp:303 msgid "Find" msgstr "Търсене" #: main/utils/kreplace.cpp:49 main/utils/kreplace.cpp:53 #: main/utils/replacer.cpp:172 main/utils/replacer.cpp:229 #: main/utils/replacer.cpp:235 main/utils/replacer.cpp:263 msgid "Replace" msgstr "Замяна" #: main/utils/kreplace.cpp:51 msgid "&All" msgstr "&Всичко" #: main/utils/kreplace.cpp:52 msgid "&Skip" msgstr "&Пропускане" #: main/utils/kreplace.cpp:63 msgid "Replace '%1' with '%2'?" msgstr "Замяна на '%1' с '%2'?" #: main/utils/kreplace.cpp:139 main/utils/kreplace.cpp:406 msgid "No text was replaced." msgstr "Не беше заменен нито един низ." #: main/utils/kreplace.cpp:141 main/utils/kreplace.cpp:408 #: main/utils/replacer.cpp:228 main/utils/replacer.cpp:255 msgid "1 replacement done." msgid_plural "%1 replacements done." msgstr[0] "Беше извършена 1 замяна." msgstr[1] "Бяха извършени %1 замени." #: main/utils/kreplace.cpp:413 msgid "Beginning of document reached." msgstr "Началото на документа е достигнато." #: main/utils/kreplace.cpp:415 msgid "End of document reached." msgstr "Краят на документа е достигнат." #: main/utils/kreplace.cpp:422 msgid "Do you want to restart search from the end?" msgstr "Желаете ли да рестартирате търсенето от края?" #: main/utils/kreplace.cpp:423 msgid "Do you want to restart search at the beginning?" msgstr "Желаете ли да рестартирате търсенето от началото?" #: main/utils/kreplace.cpp:425 msgid "Restart" msgstr "Рестартиране" #: main/utils/language.cpp:125 msgid "Automatic" msgstr "Автоматично" #: main/utils/language.cpp:129 msgctxt "Official language of the Philippines, aka Filipino" msgid "Tagalog" msgstr "Тагалог" #: main/utils/replacer.cpp:53 msgid "Find/Replace In" msgstr "Търсене/Замяна в" #: main/utils/speller.cpp:144 msgid "Spell Checking" msgstr "Проверка на правописа" #: main/utils/translator.cpp:167 msgid "Operation cancelled by user" msgstr "" #: main/utils/translator.cpp:270 main/utils/translator.cpp:280 msgid "Unexpected contents received from translation service" msgstr "От услугата за превод беше получено непредвидено съдържание" #: player/gstreamer/gstreamerbackend.cpp:543 #: player/mplayer/mplayerbackend.cpp:259 player/xine/xinebackend.cpp:278 msgid "Audio Stream #%1" msgstr "Аудио канал №%1" #: player/gstreamer/gstreamerconfigwidget.cpp:34 msgctxt "@title:group GStreamer sinks settings" msgid "Sinks" msgstr "Буфери" #: player/gstreamer/gstreamerconfigwidget.cpp:37 msgid "Audio sink:" msgstr "Аудио буфер:" #: player/gstreamer/gstreamerconfigwidget.cpp:46 msgid "Video sink:" msgstr "Видео буфер:" #: player/mplayer/mplayerconfigwidget.cpp:40 msgid "Executable path:" msgstr "Път до изпълнителен файл:" #: player/mplayer/mplayerconfigwidget.cpp:43 msgid "Select the MPlayer executable" msgstr "Избиране на изпълнителния файл на MPlayer" #: player/mplayer/mplayerconfigwidget.cpp:47 msgctxt "@title:group Video settings" msgid "Video" msgstr "Видео" #: player/mplayer/mplayerconfigwidget.cpp:50 msgid "Video output driver:" msgstr "Изходен видео драйвер:" #: player/mplayer/mplayerconfigwidget.cpp:58 msgid "Allow frame dropping" msgstr "Позволяване на изпускане на кадри" #: player/mplayer/mplayerconfigwidget.cpp:61 msgid "Allow hard frame dropping" msgstr "Позволяване на твърдо изпускане на кадри" #: player/mplayer/mplayerconfigwidget.cpp:64 msgctxt "@title:group Audio settings" msgid "Audio" msgstr "Аудио" #: player/mplayer/mplayerconfigwidget.cpp:67 msgid "Audio output driver:" msgstr "Изходен аудио драйвер" #: player/mplayer/mplayerconfigwidget.cpp:75 msgid "A/V synchronization factor:" msgstr "А/В синхронизиращ фактор:" #: player/mplayer/mplayerconfigwidget.cpp:83 msgid "Volume normalization" msgstr "Нормализация на звука" #: player/xine/xineconfigwidget.cpp:34 msgctxt "@title:group Xine drivers settings" msgid "Drivers" msgstr "Драйвери" #: player/xine/xineconfigwidget.cpp:37 msgid "Audio driver:" msgstr "Аудио драйвер:" #: player/xine/xineconfigwidget.cpp:45 msgid "Video driver:" msgstr "Видео драйвер:" #: widgets/simplerichtextedit.cpp:84 msgid "Cut" msgstr "Изрязване" #: widgets/simplerichtextedit.cpp:90 msgid "Copy" msgstr "Копиране" #: widgets/simplerichtextedit.cpp:96 msgid "Paste" msgstr "Поставяне" #: widgets/simplerichtextedit.cpp:102 msgid "Delete" msgstr "Изтриване" #: widgets/simplerichtextedit.cpp:108 msgctxt "@action:inmenu Clear all text" msgid "Clear" msgstr "Изчистване" #: widgets/simplerichtextedit.cpp:143 msgid "Check Spelling..." msgstr "Проверка на правописа..." #: widgets/simplerichtextedit.cpp:147 msgid "Auto Spell Check" msgstr "Автоматична проверка на правописа" #: widgets/simplerichtextedit.cpp:152 msgid "Allow Tabulations" msgstr "Позволяване на табулации" #: widgets/simplerichtextedit.cpp:491 msgid "Suggestions" msgstr "Предложения" #: widgets/simplerichtextedit.cpp:492 msgid "Ignore" msgstr "Игнориране" #: widgets/simplerichtextedit.cpp:493 msgid "Add to Dictionary" msgstr "Добавяне към речник" #: widgets/simplerichtextedit.cpp:497 msgid "No suggestions" msgstr "Няма предложения" #. i18n: file: main/subtitlecomposerui.rc:5 #. i18n: ectx: Menu (file) #: rc.cpp:3 msgid "&File" msgstr "&Файл" #. i18n: file: main/subtitlecomposerui.rc:16 #. i18n: ectx: Menu (translation) #: rc.cpp:6 msgid "Translation" msgstr "Превод" #. i18n: file: main/subtitlecomposerui.rc:28 #. i18n: ectx: Menu (edit) #: rc.cpp:9 msgid "&Edit" msgstr "&Редакция" #. i18n: file: main/subtitlecomposerui.rc:51 #. i18n: ectx: Menu (texts) #: rc.cpp:12 msgid "&Texts" msgstr "&Текст" #. i18n: file: main/subtitlecomposerui.rc:62 #. i18n: ectx: Menu (styles) #: rc.cpp:15 msgid "St&yles" msgstr "&Стилове" #. i18n: file: main/subtitlecomposerui.rc:69 #. i18n: ectx: Menu (times) #: rc.cpp:18 msgid "T&imes" msgstr "&Времена" #. i18n: file: main/subtitlecomposerui.rc:91 #. i18n: ectx: Menu (errors) #: rc.cpp:21 msgid "E&rrors" msgstr "&Грешки" #. i18n: file: main/subtitlecomposerui.rc:104 #. i18n: ectx: Menu (video) #: rc.cpp:24 msgid "&Video" msgstr "&Видео" #. i18n: file: main/subtitlecomposerui.rc:132 #. i18n: ectx: Menu (tools) #: rc.cpp:27 msgid "T&ools" msgstr "&Инструменти" #. i18n: file: main/subtitlecomposerui.rc:137 #. i18n: ectx: Menu (audiolevels) #: rc.cpp:30 msgid "&Audio Levels" msgstr "&Аудио нива" #. i18n: file: main/subtitlecomposerui.rc:153 #. i18n: ectx: ToolBar (mainToolBar) #: rc.cpp:33 msgid "Main Toolbar" msgstr "Главна лента с инструменти" #. i18n: file: main/subtitlecomposerui.rc:165 #. i18n: ectx: ToolBar (editToolBar) #: rc.cpp:36 msgctxt "The toolbar name" msgid "Edit Toolbar" msgstr "Лента с инструменти за редактиране" #: rc.cpp:37 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Petar Toushkov" #: rc.cpp:38 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "pt.launchpad@gmail.com" subtitlecomposer-0.5.3/po/fr/0000755000175000001440000000000011206423743015360 5ustar sergiouserssubtitlecomposer-0.5.3/po/fr/CMakeLists.txt0000644000175000001440000000016611170276137020126 0ustar sergiousersFILE( GLOB _po_files *.po ) GETTEXT_PROCESS_PO_FILES( fr ALL INSTALL_DESTINATION ${LOCALE_INSTALL_DIR} ${_po_files} ) subtitlecomposer-0.5.3/po/fr/subtitlecomposer.po0000644000175000001440000021257511206411600021324 0ustar sergiousers# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Thomas Gastine , 2009. # Thomas Gastine , 2009. # Sergio Pistone , 2009. msgid "" msgstr "" "Project-Id-Version: subtitlecomposer\n" "Report-Msgid-Bugs-To: https://sourceforge.net/tracker/?" "atid=1005652&group_id=208427&func=browse\n" "POT-Creation-Date: 2009-05-25 00:41-0300\n" "PO-Revision-Date: 2009-05-24 17:02-0300\n" "Last-Translator: Sergio Pistone \n" "Language-Team: American English \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Lokalize 0.3\n" #: core/subtitleactions.cpp:62 msgid "Set Frame Rate" msgstr "Régler la fréquence d'affichage" #: core/subtitleactions.cpp:93 msgid "Insert Lines" msgstr "Insérer des lignes" #: core/subtitleactions.cpp:177 core/subtitle.cpp:446 core/subtitle.cpp:460 #: core/subtitle.cpp:479 msgid "Remove Lines" msgstr "Supprimer les lignes" #: core/subtitleactions.cpp:268 msgid "Move Line" msgstr "Déplacer une ligne" #: core/subtitleactions.cpp:381 msgid "Swap Texts" msgstr "Inverser des textes" #: core/subtitle.cpp:66 msgid "Set Primary Data" msgstr "Régler les données principales" #: core/subtitle.cpp:121 msgid "Clear Primary Text Data" msgstr "Nettoyer les données du texte principal" #: core/subtitle.cpp:134 msgid "Set Secondary Data" msgstr "Régler les données secondaires" #: core/subtitle.cpp:180 msgid "Clear Secondary Text Data" msgstr "Nettoyer les données du texte secondaire" #: core/subtitle.cpp:265 main/dialogs/changeframeratedialog.cpp:34 msgid "Change Frame Rate" msgstr "Changer la fréquence d'affichage" #: core/subtitle.cpp:395 core/subtitle.cpp:412 msgid "Insert Line" msgstr "Insérer une ligne" #: core/subtitle.cpp:533 main/application.cpp:662 main/lineswidget.cpp:1226 msgid "Split Lines" msgstr "Séparer les lignes" #: core/subtitle.cpp:590 main/application.cpp:670 main/lineswidget.cpp:1225 msgid "Join Lines" msgstr "Concaténer les lignes" #: core/subtitle.cpp:642 msgid "Shift Lines" msgstr "Décaler les lignes" #: core/subtitle.cpp:690 msgid "Adjust Lines" msgstr "Ajuster les lignes" #: core/subtitle.cpp:700 main/application.cpp:2377 main/lineswidget.cpp:1200 msgid "Sort" msgstr "Trier" #: core/subtitle.cpp:746 main/dialogs/durationlimitsdialog.cpp:33 msgid "Enforce Duration Limits" msgstr "Forcer les limites de durée" #: core/subtitle.cpp:791 main/application.cpp:2462 main/lineswidget.cpp:1203 msgid "Maximize Durations" msgstr "Maximiser les durées" #: core/subtitle.cpp:816 main/dialogs/autodurationsdialog.cpp:35 msgid "Set Automatic Durations" msgstr "Régler les durées automatiques" #: core/subtitle.cpp:856 main/dialogs/fixoverlappingtimesdialog.cpp:32 #: main/lineswidget.cpp:1204 msgid "Fix Overlapping Times" msgstr "Corriger les superpositions temporelles" #: core/subtitle.cpp:890 msgid "Fix Lines Punctuation" msgstr "Corriger la ponctuation des lignes" #: core/subtitle.cpp:986 msgid "Lower Case" msgstr "Minuscule" #: core/subtitle.cpp:1020 msgid "Upper Case" msgstr "Majuscule" #: core/subtitle.cpp:1054 msgid "Title Case" msgstr "Titre" #: core/subtitle.cpp:1091 msgid "Sentence Case" msgstr "Corps de texte" #: core/subtitle.cpp:1142 main/dialogs/smarttextsadjustdialog.cpp:32 msgid "Break Lines" msgstr "Sauts de ligne" #: core/subtitle.cpp:1150 main/application.cpp:2530 main/lineswidget.cpp:1146 msgid "Unbreak Lines" msgstr "Supprimer les retours à la ligne" #: core/subtitle.cpp:1158 main/application.cpp:2544 main/lineswidget.cpp:1152 msgid "Simplify Spaces" msgstr "Réduire les espaces" #: core/subtitle.cpp:1167 msgid "Synchronize Subtitles" msgstr "Synchroniser les sous-titrages" #: core/subtitle.cpp:1190 main/dialogs/joinsubtitlesdialog.cpp:35 msgid "Join Subtitles" msgstr "Concaténer les sous-titrages" #: core/subtitle.cpp:1236 core/subtitle.cpp:1242 msgid "Split Subtitles" msgstr "Scinder les sous-titres" #: core/subtitle.cpp:1259 core/subtitle.cpp:1274 msgid "Set Lines Style" msgstr "Configurer le style des lignes" #: core/subtitle.cpp:1291 msgid "Toggle Lines Style" msgstr "Changer le style des lignes" #: core/subtitle.cpp:1304 msgid "Set Lines Mark" msgstr "Régler les marques des lignes" #: core/subtitle.cpp:1304 msgid "Clear Lines Mark" msgstr "Effacer les marques des lignes" #: core/subtitle.cpp:1318 msgid "Toggle Lines Mark" msgstr "Marquer les lignes" #: core/subtitle.cpp:1328 main/application.cpp:2261 main/application.cpp:2271 #: main/errorswidget.cpp:854 msgid "Clear Lines Errors" msgstr "Effacer les erreurs des lignes" #: core/subtitle.cpp:1338 core/subtitle.cpp:1358 main/application.cpp:2194 #: main/application.cpp:2239 msgid "Check Lines Errors" msgstr "Vérifier les erreurs des lignes" #: core/subtitlelineactions.cpp:65 msgid "Set Line Text" msgstr "Régler le texte de la ligne" #: core/subtitlelineactions.cpp:101 msgid "Set Line Secondary Text" msgstr "Régler le texte secondaire de la ligne" #: core/subtitlelineactions.cpp:137 msgid "Set Line Texts" msgstr "Régler les textes de la ligne" #: core/subtitlelineactions.cpp:218 msgid "Set Line Show Time" msgstr "Régler l'instant d'affichage de la ligne" #: core/subtitlelineactions.cpp:254 msgid "Set Line Hide Time" msgstr "Régler l'instant de masquage de la ligne" #: core/subtitlelineactions.cpp:371 msgid "Set Line Errors" msgstr "Régler les erreurs de la ligne" #: core/subtitleline.cpp:72 msgid "Empty text" msgstr "Texte vide" #: core/subtitleline.cpp:74 msgid "Too many characters" msgstr "Trop de caractères" #: core/subtitleline.cpp:76 msgid "Too many lines" msgstr "Trop de lignes" #: core/subtitleline.cpp:78 msgid "Unnecessary white space" msgstr "Espace inutile" #: core/subtitleline.cpp:80 msgid "Unnecessary dash" msgstr "Tiret inutile" #: core/subtitleline.cpp:82 msgid "Capital letter after continuation ellipsis" msgstr "Majuscule après des points de suspension" #: core/subtitleline.cpp:84 msgid "Too long duration per character" msgstr "Durée d'affichage par caractère trop longue" #: core/subtitleline.cpp:86 msgid "Too short duration per character" msgstr "Durée d'affichage par caractère trop courte" #: core/subtitleline.cpp:88 msgid "Too long duration" msgstr "Durée trop longue" #: core/subtitleline.cpp:89 msgid "Too short duration" msgstr "Durée trop courte" #: core/subtitleline.cpp:90 msgid "Overlapping times" msgstr "Superpositions temporelles" #: core/subtitleline.cpp:91 msgid "Untranslated text" msgstr "Texte non-traduit" #: core/subtitleline.cpp:92 msgid "User mark" msgstr "Marque d'utilisateur" #: core/subtitleline.cpp:112 msgid "Has no primary text." msgstr "Il n'y a pas de texte principal." #: core/subtitleline.cpp:116 msgid "Has no translation text." msgstr "Il n'y a pas de texte traduit." #: core/subtitleline.cpp:120 msgid "Has too many characters in primary text (1 char)." msgid_plural "Has too many characters in primary text (%1 chars)." msgstr[0] "Il y a trop de caractères dans le texte principal (1 car)." msgstr[1] "Il y a trop de caractères dans le texte principal (%1 cars)." #: core/subtitleline.cpp:126 msgid "Has too many characters in translation text (1 char)." msgid_plural "Has too many characters in translation text (%1 chars)." msgstr[0] "Il y a trop de caractères dans le texte traduit (1 car)." msgstr[1] "Il y a trop de caractères dans le texte traduit (%1 cars)." #: core/subtitleline.cpp:132 msgid "Has too many lines in primary text (1 line)." msgid_plural "Has too many lines in primary text (%1 lines)." msgstr[0] "Il y a trop de lignes dans le texte principal (1 ligne)." msgstr[1] "Il y a trop de lignes dans le texte principal (%1 lignes)." #: core/subtitleline.cpp:138 msgid "Has too many lines in translation text (1 line)." msgid_plural "Has too many lines in translation text (%1 lines)." msgstr[0] "Il y a trop de lignes dans le texte traduit (1 ligne)." msgstr[1] "Il y a trop de lignes dans le texte traduit (%1 lignes)." #: core/subtitleline.cpp:144 msgid "Has unnecessary spaces in primary text." msgstr "Il y a des espaces inutiles dans le texte principal." #: core/subtitleline.cpp:148 msgid "Has unnecessary spaces in translation text." msgstr "Il y a des espaces inutiles dans le texte traduit." #: core/subtitleline.cpp:152 msgid "Has unnecessary dash in primary text." msgstr "Il y a un tiret inutile dans le texte principal." #: core/subtitleline.cpp:156 msgid "Has unnecessary dash in translation text." msgstr "Il y a un tiret inutile dans le texte traduit." #: core/subtitleline.cpp:160 msgid "Has capital letter after line continuation ellipsis in primary text." msgstr "" "Il y a une majuscule après des points de suspension dans le texte principal." #: core/subtitleline.cpp:164 msgid "" "Has capital letter after line continuation ellipsis in translation text." msgstr "" "Il y a une majuscule après des points de suspension dans le texte traduit." #: core/subtitleline.cpp:168 msgid "Has too long duration per character in primary text (1 msec/char)." msgid_plural "" "Has too long duration per character in primary text (%1 msecs/char)." msgstr[0] "" "La durée d'affichage par caractère est trop longue dans le texte principal " "(1 ms/car)." msgstr[1] "" "La durée d'affichage par caractère est trop longue dans le texte principal (%" "1 ms/car)." #: core/subtitleline.cpp:174 msgid "Has too long duration per character in translation text (1 msec/char)." msgid_plural "" "Has too long duration per character in translation text (%1 msecs/char)." msgstr[0] "" "La durée d'affichage par caractère est trop longue dans le texte traduit (1 " "ms/car)." msgstr[1] "" "La durée d'affichage par caractère est trop longue dans le texte traduit (%1 " "ms/car)." #: core/subtitleline.cpp:180 msgid "Has too short duration per character in primary text (1 msec/char)." msgid_plural "" "Has too short duration per character in primary text (%1 msecs/char)." msgstr[0] "" "La durée d'affichage par caractère est trop courte dans le texte principal " "(1 ms/car)." msgstr[1] "" "La durée d'affichage par caractère est trop courte dans le texte principal (%" "1 ms/car)." #: core/subtitleline.cpp:186 msgid "Has too short duration per character in translation text (1 msec/char)." msgid_plural "" "Has too short duration per character in translation text (%1 msecs/char)." msgstr[0] "" "La durée d'affichage par caractère est trop courte dans le texte traduit (1 " "ms/car)." msgstr[1] "" "La durée d'affichage par caractère est trop courte dans le texte traduit (%1 " "ms/car)." #: core/subtitleline.cpp:192 msgid "Has too long duration (1 msec)." msgid_plural "Has too long duration (%1 msecs)." msgstr[0] "Il y a une durée d'affichage trop longue (1 ms)." msgstr[1] "Il y a une durée d'affichage trop longue (%1 ms)." #: core/subtitleline.cpp:198 msgid "Has too short duration (1 msec)." msgid_plural "Has too short duration (%1 msecs)." msgstr[0] "Il y a une durée d'affichage trop courte (1 ms)." msgstr[1] "Il y a une durée d'affichage trop courte (%1 ms)." #: core/subtitleline.cpp:204 msgid "Overlaps with next line." msgstr "Se superpose avec la ligne suivante." #: core/subtitleline.cpp:208 msgid "Has untranslated text." msgstr "Il y a du texte non-traduit." #: core/subtitleline.cpp:212 msgid "Has user mark." msgstr "Il y a une marque d'utilisateur." #: core/subtitleline.cpp:680 msgid "Set Line Times" msgstr "Régler les temps de la lignes" #: core/subtitleline.cpp:691 msgid "Shift Line Times" msgstr "Décaler les temps de la ligne" #: core/subtitleline.cpp:705 msgid "Adjust Line Times" msgstr "AJuster les temps de la ligne" #: main/actions/krecentfilesactionext.cpp:37 msgid "Clear History" msgstr "Effacer l'historique" #: main/application.cpp:415 msgid "Video Files" msgstr "Fichiers vidéo" #: main/application.cpp:423 msgid "Audio Files" msgstr "Fichiers audio" #: main/application.cpp:425 msgid "Media Files" msgstr "Fichiers multimédia" #: main/application.cpp:426 msgid "All Files" msgstr "Tous les fichiers" #: main/application.cpp:442 msgid "Audio Levels Files" msgstr "Fichiers de niveaux sonores" #: main/application.cpp:456 msgid "Exit the application" msgstr "Quitter l'application" #: main/application.cpp:460 msgid "Configure Subtitle Composer" msgstr "Configurer Subtitle Composer" #: main/application.cpp:465 msgctxt "@action:inmenu Create a new subtitle" msgid "New" msgstr "Nouveau" #: main/application.cpp:466 msgid "Create an empty subtitle" msgstr "Créer un sous-titrage vide" #: main/application.cpp:475 msgctxt "@action:inmenu Open subtitle file" msgid "Open..." msgstr "Ouvrir..." #: main/application.cpp:476 main/application.cpp:486 msgid "Open subtitle file" msgstr "Ouvrir un fichier de sous-titrage" #: main/application.cpp:485 msgctxt "@action:inmenu Open rencently used subtitle file" msgid "Open &Recent" msgstr "&Récemment ouvert" #: main/application.cpp:493 msgid "Save" msgstr "Enregistrer" #: main/application.cpp:494 msgid "Save opened subtitle" msgstr "Enregistrer le sous-titrage ouvert" #: main/application.cpp:503 msgid "Save As..." msgstr "Enregistrer sous..." #: main/application.cpp:504 msgid "Save opened subtitle with different settings" msgstr "Enregistrer le sous-titrage avec des réglages différents" #: main/application.cpp:512 msgid "Close" msgstr "Fermer" #: main/application.cpp:513 msgid "Close opened subtitle" msgstr "Fermer le sous-titrage ouvert" #: main/application.cpp:522 msgid "New Translation" msgstr "Nouvelle traduction" #: main/application.cpp:523 msgid "Create an empty translation subtitle" msgstr "Créer une traduction de sous-titrage vide" #: main/application.cpp:532 msgid "Open Translation..." msgstr "Ouvrir une traduction..." #: main/application.cpp:533 main/application.cpp:543 msgid "Open translation subtitle file" msgstr "Ouvrir une traduction de sous-titrage" #: main/application.cpp:542 msgid "Open &Recent Translation" msgstr "Traductions récemment ouvertes" #: main/application.cpp:551 msgid "Save Translation" msgstr "Enregistrer la traduction" #: main/application.cpp:552 msgid "Save opened translation subtitle" msgstr "Enregistrer la traduction de sous-titrage ouverte" #: main/application.cpp:561 msgid "Save Translation As..." msgstr "Enregistrer la traduction sous..." #: main/application.cpp:562 msgid "Save opened translation subtitle with different settings" msgstr "Enregistrer la traduction de sous-titrage avec des réglages différents" #: main/application.cpp:570 msgid "Close Translation" msgstr "Fermer la traduction" #: main/application.cpp:571 msgid "Close opened translation subtitle" msgstr "Fermer la traduction de sous-titrage ouverte" #: main/application.cpp:580 msgid "Reload As..." msgstr "Recharger sous..." #: main/application.cpp:581 main/application.cpp:592 msgid "Reload opened file with a different encoding" msgstr "Recharger le fichier ouvert avec un encodage différent" #: main/application.cpp:591 msgid "Quick Reload As..." msgstr "Recharger rapidement sous..." #: main/application.cpp:600 main/application.cpp:601 #: widgets/simplerichtextedit.cpp:72 msgid "Undo" msgstr "Annuler" #: main/application.cpp:610 main/application.cpp:611 #: widgets/simplerichtextedit.cpp:78 msgid "Redo" msgstr "Refaire" #: main/application.cpp:619 msgid "Split Subtitle..." msgstr "Scinder le sous-titrage..." #: main/application.cpp:620 msgid "Split the opened subtitle in two parts" msgstr "Scinder le sous-titrage ouvert en deux parties" #: main/application.cpp:627 msgid "Join Subtitles..." msgstr "Concaténer les sous-titrages..." #: main/application.cpp:628 msgid "Append to the opened subtitle another one" msgstr "Rajouter un autre sous-titrage à celui ouvert" #: main/application.cpp:635 main/lineswidget.cpp:1222 msgid "Insert Before" msgstr "Insérer avant" #: main/application.cpp:636 msgid "Insert empty line before current one" msgstr "Insérer une ligne vide avant la ligne courante" #: main/application.cpp:644 main/lineswidget.cpp:1223 msgid "Insert After" msgstr "Insérer après" #: main/application.cpp:645 msgid "Insert empty line after current one" msgstr "Insérer une ligne vide après la ligne courante" #: main/application.cpp:653 main/lineswidget.cpp:1221 #: main/scripting/scriptsmanager.cpp:141 msgid "Remove" msgstr "Supprimer" #: main/application.cpp:654 msgid "Remove selected lines" msgstr "Supprimer les lignes séléctionnées" #: main/application.cpp:663 msgid "Split selected lines" msgstr "Séparer les lignes sélectionnées" #: main/application.cpp:671 msgid "Join selected lines" msgstr "Concaténer les lignes sélectionnées" #: main/application.cpp:678 main/dialogs/actionwitherrortargetsdialog.cpp:103 #: main/lineswidget.cpp:1219 widgets/simplerichtextedit.cpp:113 msgid "Select All" msgstr "Tout sélectionner" #: main/application.cpp:679 msgid "Select all lines" msgstr "Sélectionner toutes les lignes" #: main/application.cpp:687 msgid "Go to Line..." msgstr "Aller à la ligne..." #: main/application.cpp:688 msgid "Go to specified line" msgstr "Aller à la ligne spécifiée" #: main/application.cpp:697 msgid "Find..." msgstr "Chercher..." #: main/application.cpp:698 msgid "Find occurrences of strings or regular expressions" msgstr "Chercher les occurences de chaînes ou d'expressions régulières" #: main/application.cpp:708 msgid "Find Next" msgstr "Poursuivre la recherche" #: main/application.cpp:709 msgid "Find next occurrence of string or regular expression" msgstr "" "Chercher l'occurence suivante de la chaîne ou de l'expression régulière" #: main/application.cpp:719 msgid "Find Previous" msgstr "Chercher en arrière" #: main/application.cpp:720 msgid "Find previous occurrence of string or regular expression" msgstr "" "Chercher l'occurence précédente de la chaîne ou de l'expression régulière" #: main/application.cpp:728 msgid "Replace..." msgstr "Remplacer..." #: main/application.cpp:729 msgid "Replace occurrences of strings or regular expressions" msgstr "Remplacer les occurences de chaînes ou d'expressions régulières" #: main/application.cpp:738 msgid "Retrocede current line" msgstr "Rétrocéder la ligne courante" #: main/application.cpp:739 msgid "Makes the line before the current one active" msgstr "Rend active la ligne avant la ligne courante" #: main/application.cpp:748 msgid "Advance current line" msgstr "Avancer la ligne courante" #: main/application.cpp:749 msgid "Makes the line after the current one active" msgstr "Rend active la ligne après la ligne courante" #: main/application.cpp:757 main/errorsdialog.cpp:59 main/lineswidget.cpp:1212 msgid "Check Errors..." msgstr "Vérifier les erreurs..." #: main/application.cpp:758 msgid "Check for errors in the current subtitle" msgstr "Vérifier les erreurs du sous-titrage courant" #: main/application.cpp:766 main/errorsdialog.cpp:62 main/lineswidget.cpp:1213 msgid "Clear Errors..." msgstr "Effacer les erreurs..." #: main/application.cpp:767 msgid "Clear errors from selected lines" msgstr "Effacer les erreurs pour les lignes sélectionnées" #: main/application.cpp:774 main/lineswidget.cpp:1215 msgid "Show Errors..." msgstr "Afficher les erreurs..." #: main/application.cpp:775 msgid "Show errors information for the current subtitle" msgstr "" "Afficher les informations concernant les erreurs pour le sous-titrage courant" #: main/application.cpp:784 msgid "Find Error..." msgstr "Chercher l'erreur..." #: main/application.cpp:785 msgid "Find lines with specified errors" msgstr "Chercher les lignes ayant l'erreur spécifiée" #: main/application.cpp:795 msgid "Find Next Error" msgstr "Aller à l'erreur suivante" #: main/application.cpp:796 msgid "Find next line with specified errors" msgstr "Chercher la ligne suivante ayant l'erreur spécifiée" #: main/application.cpp:806 msgid "Find Previous Error" msgstr "Aller à l'erreur précédente" #: main/application.cpp:807 msgid "Find previous line with specified errors" msgstr "Chercher la ligne précédente ayant l'erreur spécifiée" #: main/application.cpp:816 main/lineswidget.cpp:1159 msgid "Spelling..." msgstr "Orthographe..." #: main/application.cpp:817 msgid "Check lines spelling" msgstr "Vérifier l'orthographe des lignes" #: main/application.cpp:824 msgid "Toggle Mark" msgstr "Marquer" #: main/application.cpp:825 msgid "Toggle selected lines mark" msgstr "Marquer les lignes sélectionnées" #: main/application.cpp:834 main/currentlinewidget.cpp:92 msgid "Toggle Bold" msgstr "Gras" #: main/application.cpp:835 msgid "Toggle selected lines bold attribute" msgstr "Passer la ligne en gras" #: main/application.cpp:844 main/currentlinewidget.cpp:97 msgid "Toggle Italic" msgstr "Italique" #: main/application.cpp:845 msgid "Toggle selected lines italic attribute" msgstr "Passer la ligne en italique" #: main/application.cpp:854 main/currentlinewidget.cpp:102 msgid "Toggle Underline" msgstr "Souligné" #: main/application.cpp:855 msgid "Toggle selected lines underline attribute" msgstr "Souligner la ligne" #: main/application.cpp:864 main/currentlinewidget.cpp:107 msgid "Toggle Strike Through" msgstr "Barré" #: main/application.cpp:865 msgid "Toggle selected lines strike through attribute" msgstr "Barrer la ligne" #: main/application.cpp:873 main/lineswidget.cpp:1199 msgid "Shift..." msgstr "Décaler..." #: main/application.cpp:874 msgid "Shift lines an specified amount of time" msgstr "Décaler les sous-titres d'une durée donnée" #: main/application.cpp:901 msgid "Adjust..." msgstr "Ajuster..." #: main/application.cpp:902 msgid "Linearly adjust all lines to a specified interval" msgstr "AJuster linéairement les sous-titres à un intervalle donné" #: main/application.cpp:910 msgid "Sort..." msgstr "Trier..." #: main/application.cpp:911 msgid "Sort lines based on their show time" msgstr "Trier les lignes par leur instant d'affichage" #: main/application.cpp:918 msgid "Change Frame Rate..." msgstr "Changer la fréquence d'affichage..." #: main/application.cpp:919 msgid "Retime subtitle lines by reinterpreting its frame rate" msgstr "" "Réajuster les durées des sous-titres en utilisant la fréquence d'affichage" #: main/application.cpp:926 main/lineswidget.cpp:1201 msgid "Enforce Duration Limits..." msgstr "Forcer les limites de durée..." #: main/application.cpp:927 msgid "Enforce lines minimum and/or maximum duration limits" msgstr "" "Forcer les limites minimales et/ou maximales de durée d'affichage des lignes" #: main/application.cpp:935 main/lineswidget.cpp:1202 msgid "Set Automatic Durations..." msgstr "Régler les durées automatiques..." #: main/application.cpp:936 msgid "Set lines durations based on amount of letters, words and line breaks" msgstr "" "Régler la durée d'affichage des lignes à partir du nombre de lettres, de " "mots et de sauts de ligne" #: main/application.cpp:943 msgid "Maximize Durations..." msgstr "Maximiser les durées..." #: main/application.cpp:944 msgid "Extend lines durations up to their next lines show time" msgstr "" "Augmenter la durée des lignes jusqu'à l'instant d'affichage des suivantes" #: main/application.cpp:951 msgid "Fix Overlapping Times..." msgstr "Corriger les superpositions temporelles..." #: main/application.cpp:952 msgid "Fix lines overlapping times" msgstr "Corriger les superpositions temporelles des lignes" #: main/application.cpp:959 msgid "Synchronize with Subtitle..." msgstr "Synchroniser avec un sous-titrage..." #: main/application.cpp:960 msgid "Copy timing information from another subtitle" msgstr "Copier les informations de durée à partir d'un autre sous-titrage" #: main/application.cpp:967 main/lineswidget.cpp:1142 msgid "Break Lines..." msgstr "Sauts de ligne..." #: main/application.cpp:968 msgid "Automatically set line breaks" msgstr "Régler automatiquement les sauts de ligne" #: main/application.cpp:975 main/lineswidget.cpp:1145 msgid "Unbreak Lines..." msgstr "Supprimer les sauts de ligne..." #: main/application.cpp:976 msgid "Remove line breaks from lines" msgstr "Supprimer les sauts de ligne" #: main/application.cpp:983 main/lineswidget.cpp:1151 msgid "Simplify Spaces..." msgstr "Réduire les espaces..." #: main/application.cpp:984 msgid "Remove unneeded spaces from lines" msgstr "Supprimer les espaces inutiles des lignes" #: main/application.cpp:991 main/lineswidget.cpp:1155 msgid "Change Case..." msgstr "Changer la casse..." #: main/application.cpp:992 msgid "Change lines text to upper, lower, title or sentence case" msgstr "" "Passer le texte des lignes en majuscule, minuscule, titre ou corps de texte" #: main/application.cpp:999 main/lineswidget.cpp:1156 msgid "Fix Punctuation..." msgstr "Corriger la ponctuation..." #: main/application.cpp:1000 msgid "Fix punctuation errors in lines" msgstr "Corriger les erreurs de ponctuation dans les lignes" #: main/application.cpp:1007 main/lineswidget.cpp:1157 msgid "Translate..." msgstr "Traduire..." #: main/application.cpp:1008 msgid "Translate lines texts using Google services" msgstr "Traduire le texte en utilisant les services Google" #: main/application.cpp:1015 msgid "Edit Line in Place" msgstr "Éditer la ligne à la volée" #: main/application.cpp:1016 msgid "Edit current line text in place" msgstr "Éditer le texte de la ligne courante à la volée" #: main/application.cpp:1025 msgid "Open Video..." msgstr "Ouvrir la vidéo..." #: main/application.cpp:1026 main/application.cpp:1034 msgid "Open video file" msgstr "Ouvrir un fichier vidéo" #: main/application.cpp:1033 msgid "Open &Recent Video" msgstr "Vidéo &récemment ouverte" #: main/application.cpp:1041 msgid "Close Video" msgstr "Fermer la vidéo" #: main/application.cpp:1042 msgid "Close video file" msgstr "Fermer le fichier vidéo" #: main/application.cpp:1051 msgid "Full Screen Mode" msgstr "Mode plein écran" #: main/application.cpp:1052 msgid "Toggle full screen mode" msgstr "Passer en mode plein écran" #: main/application.cpp:1060 main/utils/kreplace.cpp:425 msgid "Stop" msgstr "Stop" #: main/application.cpp:1061 msgid "Stop video playback" msgstr "Arrêter la vidéo" #: main/application.cpp:1069 main/application.cpp:3156 #: main/application.cpp:3163 msgid "Play" msgstr "Lire" #: main/application.cpp:1070 msgid "Toggle video playing/paused" msgstr "Mettre la vidéo en lecture/pause" #: main/application.cpp:1078 msgid "Seek Backwards" msgstr "Reculer" #: main/application.cpp:1087 msgid "Seek Forwards" msgstr "Avancer" #: main/application.cpp:1099 msgid "Jump to Previous Line" msgstr "Aller à la ligne précédente" #: main/application.cpp:1100 msgid "Seek to previous subtitle line show time" msgstr "Aller à l'instant d'affichage du sous-titre précédent" #: main/application.cpp:1109 msgid "Jump to Next Line" msgstr "Aller à la ligne suivante" #: main/application.cpp:1110 msgid "Seek to next subtitle line show time" msgstr "Aller à l'instant d'affichage du sous-titre suivant" #: main/application.cpp:1120 msgid "Set Current Line Show Time" msgstr "Régler l'instant d'affichage de la ligne courante" #: main/application.cpp:1121 msgid "Set current line show time to video position" msgstr "Régler l'instant d'affichage de la ligne courante à partir de la vidéo" #: main/application.cpp:1131 msgid "Set Current Line Hide Time" msgstr "Régler l'instant de masquage de la ligne courante" #: main/application.cpp:1132 msgid "Set current line hide time to video position" msgstr "Régler l'instant de masquage de la ligne courante à partir de la vidéo" #: main/application.cpp:1141 msgid "Current Line Follows Video" msgstr "Ligne courante synchronisée sur la vidéo" #: main/application.cpp:1142 msgid "Make current line follow the playing video position" msgstr "Synchroniser la ligne courante avec la position de la vidéo" #: main/application.cpp:1149 msgctxt "@action:inmenu Toggle audio muted" msgid "Mute" msgstr "Muet" #: main/application.cpp:1151 msgid "Enable/disable playback sound" msgstr "Activer/Désactiver le son" #: main/application.cpp:1159 msgid "Increase Volume" msgstr "Augmenter le volume" #: main/application.cpp:1160 msgid "Increase volume by 5%" msgstr "Augmenter le volume de 5%" #: main/application.cpp:1168 msgid "Decrease Volume" msgstr "Diminuer le volume" #: main/application.cpp:1169 msgid "Decrease volume by 5%" msgstr "Diminuer le volume de 5%" #: main/application.cpp:1177 msgid "Audio Streams" msgstr "Canaux audio" #: main/application.cpp:1178 msgid "Select active audio stream" msgstr "Sélectionner le canal audio utilisé" #: main/application.cpp:1186 msgid "Increase Font Size" msgstr "Augmenter la taille de la police" #: main/application.cpp:1187 msgid "Increase subtitles font size by 1 point" msgstr "Augmenter la taille de la police des sous-titres de 1 point " #: main/application.cpp:1195 msgid "Decrease Font Size" msgstr "Diminuer la taille de la police" #: main/application.cpp:1196 msgid "Decrease subtitles font size by 1 point" msgstr "Diminuer la taille de la police des sous-titres de 1 point " #: main/application.cpp:1204 msgid "Subtitle Streams" msgstr "Canaux de sous-titres" #: main/application.cpp:1205 msgid "Select active subtitle stream" msgstr "Sélectionner le canal de sous-titres" #: main/application.cpp:1212 msgid "Shift to Video Position" msgstr "Décaler à la position de la vidéo" #: main/application.cpp:1213 msgid "" "Set current line show time to video position by equally shifting all lines" msgstr "" "Régler l'instant d'affichage de la ligne courante à la position de la vidéo " "en décalant uniformément toutes les lignes" #: main/application.cpp:1221 msgid "Adjust to Video Position (Anchor Last Line)" msgstr "Ajuster à la position de la vidéo (ancrer la dernière ligne)" #: main/application.cpp:1222 msgid "" "Set current line to video position by fixing the last line and linearly " "adjusting the other ones" msgstr "" "Régler la ligne courante à partir de la position de la vidéo en fixant la " "dernière ligne et en ajustant linéairement les autres" #: main/application.cpp:1230 msgid "Adjust to Video Position (Anchor First Line)" msgstr "Ajuster à la position de la vidéo (ancrer la première ligne)" #: main/application.cpp:1231 msgid "" "Set current line to video position by fixing the first line and linearly " "adjusting the other ones" msgstr "" "Régler la ligne courante à partir de la position de la vidéo en fixant la " "première ligne et en ajustant linéairement les autres" #: main/application.cpp:1240 msgctxt "@action:inmenu Manage user scripts" msgid "Scripts Manager..." msgstr "Manager de scripts..." #: main/application.cpp:1241 msgid "Manage user scripts" msgstr "Gérer les scripts de l'utilisateur" #: main/application.cpp:1365 msgid "" "The requested action would make the subtitle and its translation share the " "same file, possibly resulting in loss of information when saving.\n" "Are you sure you want to continue?" msgstr "" "L'action demandée impliquerait que le sous-titrage et sa traduction " "partagent le même fichier, résultant en une possible perte d'information à " "l'enregistrement.\n" "Voulez-vous continuer ?" #: main/application.cpp:1366 msgid "Conflicting Subtitle Files" msgstr "Fichiers de sous-titrage en conflit" #: main/application.cpp:1488 msgid "" "Could not parse the subtitle file.
This may have been caused by " "usage of the wrong encoding.
" msgstr "" "Impossible d'analyser le sous-titrage.
Cela peut être dû à " "l'utilisation d'un mauvais encodage.
" #: main/application.cpp:1519 msgid "There was an error saving the subtitle." msgstr "Problème lors de l'enregistrement du sous-titrage." #: main/application.cpp:1561 main/application.cpp:1770 msgid "" "Currently opened translation subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "La traduction de sous-titrage ouverte a été modifiée.\n" "Voulez-vous enregistrer les modifications ?" #: main/application.cpp:1562 main/application.cpp:1771 msgid "Close Translation Subtitle" msgstr "Fermer la traduction de sous-titrage" #: main/application.cpp:1574 msgid "" "Currently opened subtitle has unsaved changes.\n" "Do you want to save them?" msgstr "" "Le sous-titrage ouvert a été modifié.\n" "Voulez-vous enregistrer les modifications ?" #: main/application.cpp:1575 msgid "Close Subtitle" msgstr "Fermer le sous-titrage" #: main/application.cpp:1678 msgctxt "@item:inmenu Display primary text in video player" msgid "Primary" msgstr "Principal" #: main/application.cpp:1679 msgctxt "@item:inmenu Display translation text in video player" msgid "Translation" msgstr "Traduction" #: main/application.cpp:1689 msgid "Could not parse the subtitle file." msgstr "Impossible d'analyser le fichier de sous-titrage." #: main/application.cpp:1728 msgid "There was an error saving the translation subtitle." msgstr "Problème lors de l'enregistrement de la traduction de sous-titrage." #: main/application.cpp:1864 msgid "Could not read the subtitle file to append." msgstr "Impossible de lire le fichier de sous-titrage à rajouter." #: main/application.cpp:1916 msgid "Could not write the splitted subtitle file." msgstr "Impossible d'écrire le fichier de sous-titrage séparés." #: main/application.cpp:1917 msgid "Could not write the splitted subtitle translation file." msgstr "Impossible d'écrire le fichier de traduction des sous-titres séparés." #: main/application.cpp:1935 msgid "The specified time does not split the subtitles." msgstr "Le temps spécifié ne sépare pas les sous-titres." #: main/application.cpp:1984 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted part was saved as %1." msgstr "" "Impossible d'ouvrir une nouvelle fenêtre de Subtitle Composer.\n" "La partie découpée a été enregistrée sous %1." #: main/application.cpp:1989 msgid "" "Could not open a new Subtitle Composer window.\n" "The splitted parts were saved as %1 and %2." msgstr "" "Impossible d'ouvrir une nouvelle fenêtre de Subtitle Composer.\n" "Les parties découpées ont été enregistrées sous %1 et %2." #: main/application.cpp:2077 msgid "Go to Line" msgstr "Aller à la ligne" #: main/application.cpp:2077 msgid "&Go to line:" msgstr "&Aller à la ligne :" #: main/application.cpp:2389 msgid "Can not perform sort on selection with multiple ranges." msgstr "Impossible d'effectuer de tri sur la sélection." #: main/application.cpp:2499 msgid "The reference subtitle must have more than one line to proceed." msgstr "" "Le sous-titrage de référence doit avoir plus d'une ligne pour continuer." #: main/application.cpp:2511 msgid "Could not parse the reference subtitle file." msgstr "Impossible d'analyser le sous-titrage de référence." #: main/application.cpp:2618 main/dialogs/translatedialog.cpp:31 msgid "Translate" msgstr "Traduire" #: main/application.cpp:2619 msgid "Translating text (%1 to %2)..." msgstr "Traduction du texte (de %1 en %2)..." #: main/application.cpp:2628 msgid "Translating primary text (%1 to %2)..." msgstr "Traduction du texte principal (de %1 en %2)..." #: main/application.cpp:2629 msgid "Translating secondary text (%1 to %2)..." msgstr "Traduction du texte secondaire (de %1 en %2)..." #: main/application.cpp:2661 msgid "" "Unable to perform texts synchronization (sent and received lines count do " "not match)." msgstr "" "Incapable de synchroniser les textes (les nombres de lignes envoyées et " "reçues ne correspondent pas)." #: main/application.cpp:2670 msgid "Translate Primary Text" msgstr "Traduire le texte principal" #: main/application.cpp:2671 msgid "Translate Secondary Text" msgstr "Traduire le texte secondaire" #: main/application.cpp:2687 msgid "" "There was an error performing the translation:\n" "\n" "%1" msgstr "" "Problème lors de la traduction :\n" "\n" "%1" #: main/application.cpp:2740 msgid "Open Video" msgstr "Ouvrir une vidéo" #: main/application.cpp:2873 main/application.cpp:2911 msgid "" "Continuing would result in loss of timing information for some lines.\n" "Are you sure you want to continue?" msgstr "" "Continuer résulterait en une perte des informations de durée pour certaines " "lignes.\n" "Voulez-vous continuer ?" #: main/application.cpp:2929 msgid "Open AudioLevels" msgstr "Ouvrir AudioLevels" #: main/application.cpp:3035 msgid "modified" msgstr "modifié" #: main/application.cpp:3039 main/application.cpp:3050 msgid "Untitled" msgstr "Sans-titre" #: main/application.cpp:3041 msgid "Untitled Translation" msgstr "Traduction sans-titre" #: main/application.cpp:3149 msgid "Pause" msgstr "Pause" #: main/application.cpp:3190 msgid "Seek backwards 1 second" msgid_plural "Seek backwards %1 seconds" msgstr[0] "Reculer d'une seconde" msgstr[1] "Reculer de %1 secondes" #: main/application.cpp:3196 msgid "Seek forwards 1 second" msgid_plural "Seek forwards %1 seconds" msgstr[0] "Avancer d'une seconde" msgstr[1] "Avancer de %1 secondes" #: main/application.cpp:3211 main/application.cpp:3223 msgid "Shift %21 Millisecond" msgid_plural "Shift %2%1 Milliseconds" msgstr[0] "Décaler de %21 milliseconde" msgstr[1] "Décaler de %2%1 millisecondes" #: main/application.cpp:3216 main/application.cpp:3228 msgid "Shift selected lines %21 millisecond" msgid_plural "Shift selected lines %2%1 milliseconds" msgstr[0] "Décaler les lignes séléctionnées de %21 milliseconde" msgstr[1] "Décaler les lignes séléctionnées de %2%1 millisecondes" #: main/configdialog.cpp:46 msgid "Configure" msgstr "Configurer" #: main/configdialog.cpp:54 msgctxt "@title General settings" msgid "General" msgstr "Général" #: main/configdialog.cpp:55 msgid "General Settings" msgstr "Préférences générales" #: main/configdialog.cpp:59 msgctxt "@title Error checks settings" msgid "Error Checks" msgstr "Vérifications d'erreurs" #: main/configdialog.cpp:60 msgid "Error Checks Settings" msgstr "Préférences des vérifications d'erreurs" #: main/configdialog.cpp:64 msgctxt "@title Spelling settings" msgid "Spelling" msgstr "Orthographe" #: main/configdialog.cpp:65 msgid "Spelling Settings" msgstr "Préférences pour l'orthographe" #: main/configdialog.cpp:69 msgctxt "@title Player settings" msgid "Player" msgstr "Lecteur" #: main/configdialog.cpp:70 msgid "Player Settings" msgstr "Préférences du lecteur" #: main/configdialog.cpp:82 msgctxt "@title Player backend settings" msgid "%1 Backend Settings" msgstr "Réglages du backend %1" #: main/configs/errorsconfigwidget.cpp:37 msgctxt "@title:group" msgid "Texts" msgstr "Textes" #: main/configs/errorsconfigwidget.cpp:40 msgid "Maximum number of characters:" msgstr "Nombre maximum de caractères :" #: main/configs/errorsconfigwidget.cpp:45 #: main/dialogs/smarttextsadjustdialog.cpp:40 msgid " characters" msgstr " caractères" #: main/configs/errorsconfigwidget.cpp:48 msgid "Maximum number of lines:" msgstr "Nombre maximum de lignes :" #: main/configs/errorsconfigwidget.cpp:53 msgid " lines" msgstr " lignes" #: main/configs/errorsconfigwidget.cpp:56 msgctxt "@title:group" msgid "Absolute Durations" msgstr "Durées absolues" #: main/configs/errorsconfigwidget.cpp:59 #: main/configs/errorsconfigwidget.cpp:78 msgid "Minimum duration:" msgstr "Durée minimale :" #: main/configs/errorsconfigwidget.cpp:64 #: main/configs/errorsconfigwidget.cpp:72 #: main/configs/generalconfigwidget.cpp:52 #: main/configs/generalconfigwidget.cpp:66 #: main/configs/generalconfigwidget.cpp:74 #: main/dialogs/fixoverlappingtimesdialog.cpp:37 msgid " msecs" msgstr " ms" #: main/configs/errorsconfigwidget.cpp:67 #: main/configs/errorsconfigwidget.cpp:86 msgid "Maximum duration:" msgstr "Durée maximale :" #: main/configs/errorsconfigwidget.cpp:75 msgctxt "@title:group" msgid "Relative Durations" msgstr "Durées relatives" #: main/configs/errorsconfigwidget.cpp:83 #: main/configs/errorsconfigwidget.cpp:91 msgid " msecs/character" msgstr " ms/caractère" #: main/configs/errorsconfigwidget.cpp:93 msgctxt "@title:group" msgid "Behavior" msgstr "Comportement" #: main/configs/errorsconfigwidget.cpp:96 msgid "Automatically clear fixed errors" msgstr "Effacer automatiquement les erreurs corrigées" #: main/configs/generalconfigwidget.cpp:38 #: main/configs/playerconfigwidget.cpp:44 #: player/mplayer/mplayerconfigwidget.cpp:37 msgctxt "@title:group General settings" msgid "General" msgstr "Général" #: main/configs/generalconfigwidget.cpp:41 msgid "Default encoding for opening subtitles:" msgstr "Encodage par défaut des sous-titres :" #: main/configs/generalconfigwidget.cpp:47 msgid "On line double click, jump to show time minus:" msgstr "" "Au double-clic sur un sous-titre, aller à l'instant d'affichage moins :" #: main/configs/generalconfigwidget.cpp:55 msgid "Automatically load video file when opening subtitle" msgstr "Charger automatiquement le fichier vidéo à l'ouverture des sous-titres" #: main/configs/generalconfigwidget.cpp:58 msgctxt "@title:group" msgid "Quick Actions" msgstr "Actions rapides" #: main/configs/generalconfigwidget.cpp:61 msgid "Time shift for selected lines:" msgstr "Temps de décalage des lignes sélectionnées :" #: main/configs/generalconfigwidget.cpp:69 msgid "Compensation for captured video times:" msgstr "Compensation pour les temps de capture vidéo :" #: main/configs/playerconfigwidget.cpp:47 msgid "Player backend:" msgstr "Backend du lecteur :" #: main/configs/playerconfigwidget.cpp:53 msgid "Jump length on seek:" msgstr "Durée du saut de l'avance/retour rapide:" #: main/configs/playerconfigwidget.cpp:58 msgid " secs" msgstr " s" #: main/configs/playerconfigwidget.cpp:61 main/playerwidget.cpp:452 msgid "Show editable position control" msgstr "Afficher un éditeur de contrôle du temps" #: main/configs/playerconfigwidget.cpp:64 msgctxt "@title:group" msgid "Subtitles" msgstr "Sous-titres" #: main/configs/playerconfigwidget.cpp:67 msgctxt "@label:chooser The font family name" msgid "Font family:" msgstr "Police :" #: main/configs/playerconfigwidget.cpp:72 msgid "Font size:" msgstr "Taille de police :" #: main/configs/playerconfigwidget.cpp:77 msgid " points" msgstr " points" #: main/configs/playerconfigwidget.cpp:80 msgid "Primary color:" msgstr "Couleur principale :" #: main/configs/playerconfigwidget.cpp:85 msgid "Outline color:" msgstr "Couleur de la bordure :" #: main/configs/playerconfigwidget.cpp:91 msgid "Outline width:" msgstr "Épaisseur de la bordure :" #: main/configs/playerconfigwidget.cpp:96 msgid " pixels" msgstr " pixels" #: main/configs/playerconfigwidget.cpp:99 msgctxt "@title:group" msgid "Subtitles Preview" msgstr "Prévisualiser les sous-titres" #: main/configs/playerconfigwidget.cpp:109 msgctxt "Text for previewing the subtitles font settings" msgid "

The Quick Brown Fox
Jumps Over The Lazy Dog

" msgstr "

Portez ce vieux whisky
au juge blond qui fume

" #: main/currentlinewidget.cpp:65 msgid "Show" msgstr "Afficher" #: main/currentlinewidget.cpp:70 msgid "Hide" msgstr "Masquer" #: main/currentlinewidget.cpp:75 msgid "Duration" msgstr "Durée" #: main/currentlinewidget.cpp:253 main/currentlinewidget.cpp:259 msgid "No current line" msgstr "Pas de ligne courante" #: main/currentlinewidget.cpp:383 msgid "Current line:" msgstr "Ligne courante :" #: main/currentlinewidget.cpp:408 msgid "1 character" msgid_plural "%1 characters" msgstr[0] "1 caractère" msgstr[1] "%1 caractères" #: main/dialogs/actionwitherrortargetsdialog.cpp:74 msgid "Available errors" msgstr "Erreurs disponibles" #: main/dialogs/actionwitherrortargetsdialog.cpp:105 msgid "Select None" msgstr "Ne rien sélectionner" #: main/dialogs/actionwithtargetdialog.cpp:131 msgid "Target >>" msgstr "Cible >>" #: main/dialogs/actionwithtargetdialog.cpp:131 #: main/dialogs/actionwithtargetdialog.cpp:149 msgid "Target <<" msgstr "Cible <<" #: main/dialogs/actionwithtargetdialog.cpp:164 msgid "All lines" msgstr "Toutes les lignes" #: main/dialogs/actionwithtargetdialog.cpp:165 main/utils/errorfinder.cpp:48 msgid "Selected lines" msgstr "Lignes sélectionnées" #: main/dialogs/actionwithtargetdialog.cpp:166 msgid "All lines from first selected" msgstr "Toutes les lignes depuis la première sélectionnée" #: main/dialogs/actionwithtargetdialog.cpp:167 msgid "All lines up to last selected" msgstr "Toutes les lignes jusqu'à la dernière sélectionnée" #: main/dialogs/actionwithtargetdialog.cpp:257 main/utils/finder.cpp:63 #: main/utils/replacer.cpp:61 msgid "Both subtitles" msgstr "Les deux sous-titrages" #: main/dialogs/actionwithtargetdialog.cpp:260 main/utils/finder.cpp:65 #: main/utils/replacer.cpp:63 msgid "Primary subtitle" msgstr "Sous-titres principaux" #: main/dialogs/actionwithtargetdialog.cpp:263 main/utils/finder.cpp:67 #: main/utils/replacer.cpp:65 msgid "Translation subtitle" msgstr "Traduction de sous-titrage" #: main/dialogs/actionwithtargetdialog.h:78 msgid "Apply To" msgstr "Appliquer à" #: main/dialogs/adjusttimesdialog.cpp:32 msgid "Adjust" msgstr "Ajuster" #: main/dialogs/adjusttimesdialog.cpp:34 msgctxt "@title:group" msgid "New Times" msgstr "Nouveaux temps" #: main/dialogs/adjusttimesdialog.cpp:39 msgid "First spoken line:" msgstr "Première ligne parlée :" #: main/dialogs/adjusttimesdialog.cpp:45 msgid "Last spoken line:" msgstr "Dernière ligne parlée :" #: main/dialogs/autodurationsdialog.cpp:38 #: main/dialogs/changeframeratedialog.cpp:36 #: main/dialogs/fixoverlappingtimesdialog.cpp:34 #: main/dialogs/fixpunctuationdialog.cpp:33 #: main/dialogs/smarttextsadjustdialog.cpp:34 #: main/dialogs/splitsubtitledialog.cpp:38 main/dialogs/translatedialog.cpp:33 msgctxt "@title:group" msgid "Settings" msgstr "Préférences" #: main/dialogs/autodurationsdialog.cpp:46 msgid "Milliseconds per line:" msgstr "Millisecondes par ligne :" #: main/dialogs/autodurationsdialog.cpp:55 msgid "Milliseconds per word:" msgstr "Millisecondes par mot :" #: main/dialogs/autodurationsdialog.cpp:64 msgid "Milliseconds per character:" msgstr "Millisecondes par caractère :" #: main/dialogs/autodurationsdialog.cpp:68 #: main/dialogs/durationlimitsdialog.cpp:45 msgid "Prevent overlapping" msgstr "Éviter les superpositions" #: main/dialogs/autodurationsdialog.cpp:71 msgctxt "@title:group" msgid "Duration Calculation" msgstr "Calcul de la durée d'affichage" #: main/dialogs/autodurationsdialog.cpp:77 msgid "Use primary text" msgstr "Utiliser le texte principal" #: main/dialogs/autodurationsdialog.cpp:78 msgid "Use translation text" msgstr "Utiliser le texte secondaire" #: main/dialogs/autodurationsdialog.cpp:79 msgid "Calculate both and use maximum" msgstr "Calculer les deux et utiliser le maximum" #: main/dialogs/changeframeratedialog.cpp:45 msgid "Current frame rate:" msgstr "Fréquence d'affichage actuelle :" #: main/dialogs/changeframeratedialog.cpp:54 msgid "New frame rate:" msgstr "Nouvelle fréquence d'affichage :" #: main/dialogs/changetextscasedialog.cpp:33 msgid "Change Case" msgstr "Changer la casse" #: main/dialogs/changetextscasedialog.cpp:35 msgctxt "@title:group" msgid "Change To" msgstr "Changer en" #: main/dialogs/changetextscasedialog.cpp:39 msgid "Lower case" msgstr "Minuscule" #: main/dialogs/changetextscasedialog.cpp:44 msgid "Upper case" msgstr "Majuscule" #: main/dialogs/changetextscasedialog.cpp:48 msgid "Title case" msgstr "Titre" #: main/dialogs/changetextscasedialog.cpp:52 msgid "Sentence case" msgstr "Corps de texte" #: main/dialogs/changetextscasedialog.cpp:56 msgid "Convert to lower case first" msgstr "Convertir d'abord en minuscules" #: main/dialogs/checkerrorsdialog.cpp:31 msgid "Check Errors" msgstr "Rechercher les erreurs" #: main/dialogs/checkerrorsdialog.cpp:33 msgctxt "@title:group" msgid "Errors to Check" msgstr "Erreurs à vérifier" #: main/dialogs/checkerrorsdialog.cpp:36 msgctxt "@title:group Miscellaneous settings" msgid "Miscellaneous" msgstr "Divers" #: main/dialogs/checkerrorsdialog.cpp:39 msgid "Clear other errors" msgstr "Effacer les autres erreurs" #: main/dialogs/checkerrorsdialog.cpp:43 msgid "Clear user marks" msgstr "Effacer les marques d'utilisateur" #: main/dialogs/clearerrorsdialog.cpp:32 msgid "Clear Errors" msgstr "Effacer les erreurs" #: main/dialogs/clearerrorsdialog.cpp:34 msgctxt "@title:group" msgid "Errors to Clear" msgstr "Erreurs à effacer" #: main/dialogs/durationlimitsdialog.cpp:35 msgctxt "@title:group" msgid "Minimum Duration" msgstr "Durée minimale" #: main/dialogs/durationlimitsdialog.cpp:41 msgid "Expand duration to:" msgstr "Augmenter la durée à :" #: main/dialogs/durationlimitsdialog.cpp:48 msgctxt "@title:group" msgid "Maximum Duration" msgstr "Durée maximale" #: main/dialogs/durationlimitsdialog.cpp:54 msgid "Shrink duration to:" msgstr "Diminuer la durée à :" #: main/dialogs/fixoverlappingtimesdialog.cpp:43 msgid "Minimum interval between lines:" msgstr "Intervalle minimum entre les lignes :" #: main/dialogs/fixpunctuationdialog.cpp:31 msgid "Fix Punctuation" msgstr "Corriger la ponctuation" #: main/dialogs/fixpunctuationdialog.cpp:36 msgid "Fix and cleanup spaces" msgstr "Corriger et nettoyer les espaces" #: main/dialogs/fixpunctuationdialog.cpp:40 msgid "Fix quotes and double quotes" msgstr "Corriger les quotes et double-quotes" #: main/dialogs/fixpunctuationdialog.cpp:44 msgid "Fix English 'I' pronoun" msgstr "Corriger le pronom anglais 'I'" #: main/dialogs/fixpunctuationdialog.cpp:48 msgid "Add ellipisis indicating non finished lines" msgstr "Ajouter des points de suspension indiquant une ligne non terminée" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line Before Current" msgstr "Insérer une ligne avant la ligne courante" #: main/dialogs/insertlinedialog.cpp:28 msgid "Insert Line After Current" msgstr "Insérer une ligne après la ligne courante" #: main/dialogs/insertlinedialog.cpp:29 msgid "Insert Into" msgstr "Insérer dans" #: main/dialogs/joinsubtitlesdialog.cpp:40 msgid "Shift subtitle forwards before append" msgstr "Décaler le sous-titrage avant concaténation" #: main/dialogs/joinsubtitlesdialog.cpp:47 #: main/dialogs/splitsubtitledialog.cpp:44 msgid "Set from video length" msgstr "Régler à partir de la longueur de la vidéo" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Subtitle" msgstr "Ouvrir un sous-titrage" #: main/dialogs/opensubtitledialog.cpp:34 msgid "Open Translation Subtitle" msgstr "Ouvrir une traduction de sous-titrage" #: main/dialogs/opensubtitledialog.cpp:46 #: main/dialogs/savesubtitledialog.cpp:80 #: main/dialogs/selectablesubtitledialog.cpp:67 msgid "Encoding:" msgstr "Encodage :" #: main/dialogs/opensubtitledialog.cpp:73 msgid "All Supported" msgstr "Tous les fichiers" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove Selected Lines" msgstr "Supprimer les lignes sélectionnées" #: main/dialogs/removelinesdialog.cpp:27 msgid "Remove From" msgstr "Enlever de" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Subtitle" msgstr "Enregistrer le sous-titrage" #: main/dialogs/savesubtitledialog.cpp:39 msgid "Save Translation Subtitle" msgstr "Enregistrer la traduction de sous-titrage" #: main/dialogs/savesubtitledialog.cpp:69 msgid "EOL:" msgstr "Fin de ligne :" #: main/dialogs/savesubtitledialog.cpp:145 msgid "" "A file named \"%1\" already exists. Are you sure you want to overwrite it?" msgstr "Il existe déjà un fichier nommé \"%1\". Voulez-vous l'écraser ?" #: main/dialogs/savesubtitledialog.cpp:148 msgid "Overwrite File?" msgstr "Écraser le fichier ?" #: main/dialogs/savesubtitledialog.cpp:149 msgid "Overwrite" msgstr "Écraser" #: main/dialogs/selectablesubtitledialog.cpp:51 msgid "Path:" msgstr "Chemin :" #: main/dialogs/selectablesubtitledialog.cpp:56 msgid "Select subtitle" msgstr "Sélectionner un sous-titrage" #: main/dialogs/selectablesubtitledialog.h:54 msgid "Subtitle" msgstr "Sous-titrage" #: main/dialogs/shifttimesdialog.cpp:32 msgid "Shift" msgstr "Shift" #: main/dialogs/shifttimesdialog.cpp:34 msgctxt "@title:group" msgid "Shifting" msgstr "Décalage" #: main/dialogs/shifttimesdialog.cpp:38 msgid "Forwards (+)" msgstr "En avant (+)" #: main/dialogs/shifttimesdialog.cpp:39 msgid "Backwards (–)" msgstr "En arrière (-)" #: main/dialogs/smarttextsadjustdialog.cpp:43 msgid "Minimum length for line break:" msgstr "Longueur minimale avant un saut de ligne :" #: main/dialogs/splitsubtitledialog.cpp:36 msgid "Split Subtitle" msgstr "Scinder le sous-titrage" #: main/dialogs/splitsubtitledialog.cpp:49 msgid "Split time:" msgstr "Instant de la césure :" #: main/dialogs/splitsubtitledialog.cpp:53 msgid "Shift new part backwards after split" msgstr "Décaler la nouvelle partie après la césure du sous-titrage" #: main/dialogs/syncsubtitlesdialog.cpp:32 msgid "Synchronize with Subtitle" msgstr "Synchroniser avec un sous-titrage" #: main/dialogs/syncsubtitlesdialog.cpp:34 msgid "Reference Subtitle" msgstr "Sous-titrage de référence" #: main/dialogs/syncsubtitlesdialog.cpp:36 msgctxt "@title:group" msgid "Synchronization Mode" msgstr "Type de synchronisation" #: main/dialogs/syncsubtitlesdialog.cpp:39 msgid "Adjust to reference's first and last lines" msgstr "Adapter à la première et à la dernière ligne du fichier de référence" #: main/dialogs/syncsubtitlesdialog.cpp:43 msgid "Copy timing information from reference line by line" msgstr "" "Copier les informations de durées du fichier de référence ligne à ligne" #: main/dialogs/translatedialog.cpp:49 msgid "Input language:" msgstr "Langue d'entrée" #: main/dialogs/translatedialog.cpp:66 msgid "Output language:" msgstr "Langue de sortie" #: main/errorsdialog.cpp:42 msgid "Subtitle Errors" msgstr "Erreurs de sous-titrage" #: main/errorsdialog.cpp:55 msgid "Clear Fixed Errors" msgstr "Effacer les erreurs corrigées" #: main/errorsdialog.cpp:65 msgid "Settings..." msgstr "Préférences..." #: main/errorsdialog.cpp:121 msgid "Showing 1 line with errors" msgid_plural "Showing %1 lines with errors" msgstr[0] "Affichage des erreurs d'une ligne" msgstr[1] "Affichage des erreurs de %1 lignes" #: main/errorsdialog.cpp:124 msgid "1 total error" msgid_plural "%1 total errors" msgstr[0] "1 erreur" msgstr[1] "%1 erreurs" #: main/errorsdialog.cpp:125 msgid "1 user mark" msgid_plural "%1 user marks" msgstr[0] "1 marque d'utilisateur" msgstr[1] "%1 marques d'utilisateur" #: main/errorswidget.cpp:491 msgid "Line Errors" msgstr "Erreurs des sous-titres" #: main/errorswidget.cpp:492 msgid "Count" msgstr "Compter" #: main/errorswidget.cpp:493 msgid "Marked" msgstr "Marqué" #: main/errorswidget.cpp:509 msgid "yes" msgstr "oui" #: main/errorswidget.cpp:510 msgid "no" msgstr "non" #: main/errorswidget.cpp:517 msgid "Line %1" msgstr "Ligne %1" #: main/errorswidget.cpp:717 msgid "Expand All" msgstr "Tout ouvrir" #: main/errorswidget.cpp:718 msgid "Collapse All" msgstr "Tout fermer" #: main/errorswidget.cpp:722 msgid "Clear Selected Marks" msgstr "Effacer les marques sélectionnées" #: main/errorswidget.cpp:723 msgid "Clear Selected Errors" msgstr "Effacer les erreurs sélectionnées" #: main/errorswidget.cpp:729 msgid "Clear Fixed Selection" msgstr "Effacer la sélection corrigée" #: main/lineswidget.cpp:204 msgid "Observations:" msgstr "Observations :" #: main/lineswidget.cpp:232 msgctxt "@title:column Subtitle line number" msgid "Line" msgstr "Ligne" #: main/lineswidget.cpp:233 msgctxt "@title:column" msgid "Show Time" msgstr "Instant d'affichage" #: main/lineswidget.cpp:234 msgctxt "@title:column" msgid "Hide Time" msgstr "Instant de masquage" #: main/lineswidget.cpp:235 msgctxt "@title:column Subtitle line (primary) text" msgid "Text" msgstr "Texte" #: main/lineswidget.cpp:236 msgctxt "@title:column Subtitle line translation text" msgid "Translation" msgstr "Traduction" #: main/lineswidget.cpp:1141 msgid "Texts" msgstr "Textes" #: main/lineswidget.cpp:1162 msgid "Styles" msgstr "Styles" #: main/lineswidget.cpp:1166 widgets/simplerichtextedit.cpp:119 msgctxt "@action:inmenu Toggle bold style" msgid "Bold" msgstr "Gras" #: main/lineswidget.cpp:1173 widgets/simplerichtextedit.cpp:125 msgctxt "@action:inmenu Toggle italic style" msgid "Italic" msgstr "Italique" #: main/lineswidget.cpp:1180 widgets/simplerichtextedit.cpp:131 msgctxt "@action:inmenu Toggle underline style" msgid "Underline" msgstr "Souligné" #: main/lineswidget.cpp:1187 widgets/simplerichtextedit.cpp:137 msgctxt "@action:inmenu Toggle strike through style" msgid "Strike Through" msgstr "Barré" #: main/lineswidget.cpp:1194 msgid "Times" msgstr "Temps" #: main/lineswidget.cpp:1196 msgid "Shift +%1 Milliseconds" msgstr "Décaler de +%1 millisecondes" #: main/lineswidget.cpp:1197 msgid "Shift -%1 Milliseconds" msgstr "Décaler de -%1 millisecondes" #: main/lineswidget.cpp:1207 msgid "Errors" msgstr "Erreurs" #: main/lineswidget.cpp:1208 msgid "Mark" msgstr "Marque" #: main/main.cpp:43 msgid "Subtitle Composer" msgstr "Subtitle Composer" #: main/main.cpp:45 msgid "A KDE subtitle editor." msgstr "Un éditeur de sous-titres pour KDE." #: main/main.cpp:47 msgid "(C) 2007-2009 Sergio Pistone" msgstr "(C) 2007-2009 Sergio Pistone" #: main/main.cpp:51 msgid "Sergio Pistone" msgstr "Sergio Pistone" #: main/main.cpp:52 msgid "Author & maintainer" msgstr "Auteur & Mainteneur" #: main/main.cpp:61 msgid "Open location as primary subtitle" msgstr "Ouvrir la cible comme sous-titrage principal" #: main/main.cpp:62 msgid "Open location as translation subtitle" msgstr "Ouvrir la cible comme traduction de sous-titrage" #: main/playerwidget.cpp:103 msgid "Position" msgstr "Position" #: main/playerwidget.cpp:111 msgid "Length" msgstr "Durée" #: main/playerwidget.cpp:116 msgid "FPS" msgstr "FPS" #: main/playerwidget.cpp:704 main/playerwidget.cpp:705 #: main/playerwidget.cpp:706 main/playerwidget.cpp:778 #: main/playerwidget.cpp:795 main/playerwidget.cpp:802 msgid "Unknown" msgstr "Inconnu" #: main/playerwidget.cpp:715 msgid "There was an error opening file
%1
" msgstr "Problème lors de l'ouverture du fichier
%1
" #: main/playerwidget.cpp:741 msgid "Unexpected error while playing file." msgstr "Problème lors de la lecture du fichier." #: main/scripting/scriptsmanager.cpp:70 msgid "Installed Scripts" msgstr "Scripts installés" #: main/scripting/scriptsmanager.cpp:88 msgid "Information" msgstr "" #: main/scripting/scriptsmanager.cpp:94 msgid "Warning" msgstr "" #: main/scripting/scriptsmanager.cpp:100 #, fuzzy msgid "Error" msgstr "Erreurs" #: main/scripting/scriptsmanager.cpp:113 msgid "Scripts Manager" msgstr "Manager de scripts" #: main/scripting/scriptsmanager.cpp:129 msgid "Create..." msgstr "Créer..." #: main/scripting/scriptsmanager.cpp:130 msgid "Creates a new script file." msgstr "Créer un nouveau fichier script." #: main/scripting/scriptsmanager.cpp:135 msgid "Add..." msgstr "Ajouter..." #: main/scripting/scriptsmanager.cpp:136 msgid "Copies an existing script from a specified location." msgstr "Copie un script existant depuis la source spécifiée." #: main/scripting/scriptsmanager.cpp:142 msgid "Sends the selected script to the trash." msgstr "Envoie le script sélectionné à la corbeille." #: main/scripting/scriptsmanager.cpp:147 msgid "Edit" msgstr "Éditer" #: main/scripting/scriptsmanager.cpp:148 msgid "Opens the selected script with an external editor." msgstr "Ouvre le script sélectionné avec un éditeur externe." #: main/scripting/scriptsmanager.cpp:154 msgid "Run" msgstr "Exécuter" #: main/scripting/scriptsmanager.cpp:155 msgid "Executes the selected script." msgstr "Exécute le script sélectionné." #: main/scripting/scriptsmanager.cpp:160 msgid "Refresh" msgstr "Actualiser" #: main/scripting/scriptsmanager.cpp:161 msgid "Reloads the installed scripts list." msgstr "Actualise la liste des scripts installés" #: main/scripting/scriptsmanager.cpp:219 main/scripting/scriptsmanager.cpp:301 msgid "" "You must enter an unused name to continue.\n" "Would you like to enter another name?" msgstr "" "Vous devez entrer un nom inutilisé pour continuer.\n" "Souhaitez-vous entrer un autre nom ?" #: main/scripting/scriptsmanager.cpp:220 main/scripting/scriptsmanager.cpp:302 msgid "Name Already Used" msgstr "Nom déjà utilisé" #: main/scripting/scriptsmanager.cpp:226 msgid "Create New Script" msgstr "Créer un nouveau script" #: main/scripting/scriptsmanager.cpp:226 main/scripting/scriptsmanager.cpp:308 msgid "Script name:" msgstr "Nom du script :" #: main/scripting/scriptsmanager.cpp:239 msgid "There was an error creating the file %1." msgstr "Problème lors de la création du fichier %1." #: main/scripting/scriptsmanager.cpp:283 msgid "Select Existing Script" msgstr "Sélectionner un script existant" #: main/scripting/scriptsmanager.cpp:308 msgid "Rename Script" msgstr "Renommer le script" #: main/scripting/scriptsmanager.cpp:322 msgid "There was an error opening the file %1." msgstr "Problème lors de l'ouverture du fichier %1." #: main/scripting/scriptsmanager.cpp:331 msgid "There was an error copying the file to %1." msgstr "Problème lors de la copie du fichier %1." #: main/scripting/scriptsmanager.cpp:350 msgid "Do you really want to send file %1 to the trash?" msgstr "Voulez-vous vraiment envoyer le fichier %1 à la corbeille ?" #: main/scripting/scriptsmanager.cpp:351 msgid "Move to Trash" msgstr "Déplacer vers la corbeille" #: main/scripting/scriptsmanager.cpp:359 msgid "There was an error removing the file %1." msgstr "Problème lors de la suppression du fichier %1." #: main/scripting/scriptsmanager.cpp:377 msgid "Could not launch external editor.\n" msgstr "Impossible de lancer l'éditeur externe.\n" #: main/scripting/scriptsmanager.cpp:441 main/scripting/scriptsmanager.cpp:448 msgid "Error Running Script" msgstr "Problème lors de l'exécution du script" #: main/scripting/scriptsmanager.cpp:462 msgid "Tools" msgstr "Outils" #: main/utils/errorfinder.cpp:40 main/utils/errorfinder.cpp:221 #: main/utils/errorfinder.cpp:244 msgid "Find Error" msgstr "Chercher l'erreur" #: main/utils/errorfinder.cpp:42 msgid "Errors to Find" msgstr "Erreurs à chercher" #: main/utils/errorfinder.cpp:45 msgid "Options" msgstr "Options" #: main/utils/errorfinder.cpp:51 msgid "From current line" msgstr "Depuis la ligne courante" #: main/utils/errorfinder.cpp:55 msgid "Find backwards" msgstr "Chercher en arrière" #: main/utils/errorfinder.cpp:216 main/utils/finder.cpp:298 #: main/utils/replacer.cpp:258 msgid "" "Beginning of selection reached.\n" "Continue from the end?" msgstr "" "Début de la sélection atteint.\n" "Reprendre à la fin ?" #: main/utils/errorfinder.cpp:217 main/utils/finder.cpp:299 #: main/utils/replacer.cpp:259 msgid "" "Beginning of subtitle reached.\n" "Continue from the end?" msgstr "" "Début du sous-titrage atteint.\n" "Reprendre à la fin ?" #: main/utils/errorfinder.cpp:219 main/utils/finder.cpp:301 #: main/utils/replacer.cpp:261 msgid "" "End of selection reached.\n" "Continue from the beginning?" msgstr "" "Fin de la sélection atteinte.\n" "Reprendre au début ?" #: main/utils/errorfinder.cpp:220 main/utils/finder.cpp:302 #: main/utils/replacer.cpp:262 main/utils/speller.cpp:143 msgid "" "End of subtitle reached.\n" "Continue from the beginning?" msgstr "" "Fin du sous-titrage atteinte.\n" "Reprendre au début ?" #: main/utils/errorfinder.cpp:243 msgid "No errors matching given criteria found!" msgstr "Aucune erreur correspondant aux critères n'a été trouvée !" #: main/utils/finder.cpp:55 msgid "Find In" msgstr "Chercher dans" #: main/utils/finder.cpp:278 main/utils/replacer.cpp:234 msgid "No instances of '%1' found!" msgstr "Aucune occurence de '%1' trouvée !" #: main/utils/finder.cpp:279 main/utils/finder.cpp:303 msgid "Find" msgstr "Chercher" #: main/utils/kreplace.cpp:49 main/utils/kreplace.cpp:53 #: main/utils/replacer.cpp:172 main/utils/replacer.cpp:229 #: main/utils/replacer.cpp:235 main/utils/replacer.cpp:263 msgid "Replace" msgstr "Remplacer" #: main/utils/kreplace.cpp:51 msgid "&All" msgstr "&Tous" #: main/utils/kreplace.cpp:52 msgid "&Skip" msgstr "&Sauter" #: main/utils/kreplace.cpp:63 msgid "Replace '%1' with '%2'?" msgstr "Remplacer '%1' par '%2' ?" #: main/utils/kreplace.cpp:139 main/utils/kreplace.cpp:406 msgid "No text was replaced." msgstr "Aucun texte n'a été remplacé." #: main/utils/kreplace.cpp:141 main/utils/kreplace.cpp:408 #: main/utils/replacer.cpp:228 main/utils/replacer.cpp:255 msgid "1 replacement done." msgid_plural "%1 replacements done." msgstr[0] "1 remplacement effectué." msgstr[1] "%1 remplacements effectués." #: main/utils/kreplace.cpp:413 msgid "Beginning of document reached." msgstr "Début du document atteint." #: main/utils/kreplace.cpp:415 msgid "End of document reached." msgstr "Fin du document atteinte." #: main/utils/kreplace.cpp:422 msgid "Do you want to restart search from the end?" msgstr "Voulez-vous recommencer la recherche depuis la fin ?" #: main/utils/kreplace.cpp:423 msgid "Do you want to restart search at the beginning?" msgstr "Voulez-vous recommencer la recherche depuis le début ?" #: main/utils/kreplace.cpp:425 msgid "Restart" msgstr "Redémarrer" #: main/utils/language.cpp:125 msgid "Automatic" msgstr "Automatique" #: main/utils/language.cpp:129 msgctxt "Official language of the Philippines, aka Filipino" msgid "Tagalog" msgstr "Tagalog" #: main/utils/replacer.cpp:53 msgid "Find/Replace In" msgstr "Chercher/Remplacer dans" #: main/utils/speller.cpp:144 msgid "Spell Checking" msgstr "Vérification de l'orthographe" #: main/utils/translator.cpp:167 msgid "Operation cancelled by user" msgstr "" #: main/utils/translator.cpp:270 main/utils/translator.cpp:280 msgid "Unexpected contents received from translation service" msgstr "Contenus inappropriés reçus du service de traduction" #: player/gstreamer/gstreamerbackend.cpp:543 #: player/mplayer/mplayerbackend.cpp:259 player/xine/xinebackend.cpp:278 msgid "Audio Stream #%1" msgstr "Canal audio #%1" #: player/gstreamer/gstreamerconfigwidget.cpp:34 msgctxt "@title:group GStreamer sinks settings" msgid "Sinks" msgstr "Flux" #: player/gstreamer/gstreamerconfigwidget.cpp:37 msgid "Audio sink:" msgstr "Flux audio :" #: player/gstreamer/gstreamerconfigwidget.cpp:46 msgid "Video sink:" msgstr "Flux vidéo :" #: player/mplayer/mplayerconfigwidget.cpp:40 msgid "Executable path:" msgstr "Chemin :" #: player/mplayer/mplayerconfigwidget.cpp:43 msgid "Select the MPlayer executable" msgstr "Sélectionner l'exécutable pour MPlayer" #: player/mplayer/mplayerconfigwidget.cpp:47 msgctxt "@title:group Video settings" msgid "Video" msgstr "Vidéo" #: player/mplayer/mplayerconfigwidget.cpp:50 msgid "Video output driver:" msgstr "Pilote de sortie vidéo :" #: player/mplayer/mplayerconfigwidget.cpp:58 msgid "Allow frame dropping" msgstr "Autoriser le frame-dropping" #: player/mplayer/mplayerconfigwidget.cpp:61 msgid "Allow hard frame dropping" msgstr "Autoriser le hard frame-dropping " #: player/mplayer/mplayerconfigwidget.cpp:64 msgctxt "@title:group Audio settings" msgid "Audio" msgstr "Audio" #: player/mplayer/mplayerconfigwidget.cpp:67 msgid "Audio output driver:" msgstr "Pilote de sortie audio :" #: player/mplayer/mplayerconfigwidget.cpp:75 msgid "A/V synchronization factor:" msgstr "Facteur de synchronisation A/V :" #: player/mplayer/mplayerconfigwidget.cpp:83 msgid "Volume normalization" msgstr "Normalisation du volume" #: player/xine/xineconfigwidget.cpp:34 msgctxt "@title:group Xine drivers settings" msgid "Drivers" msgstr "Pilotes" #: player/xine/xineconfigwidget.cpp:37 msgid "Audio driver:" msgstr "Pilote audio :" #: player/xine/xineconfigwidget.cpp:45 msgid "Video driver:" msgstr "Pilote vidéo :" #: widgets/simplerichtextedit.cpp:84 msgid "Cut" msgstr "Couper" #: widgets/simplerichtextedit.cpp:90 msgid "Copy" msgstr "Copier" #: widgets/simplerichtextedit.cpp:96 msgid "Paste" msgstr "Coller" #: widgets/simplerichtextedit.cpp:102 msgid "Delete" msgstr "Supprimer" #: widgets/simplerichtextedit.cpp:108 msgctxt "@action:inmenu Clear all text" msgid "Clear" msgstr "Effacer" #: widgets/simplerichtextedit.cpp:143 msgid "Check Spelling..." msgstr "Vérifier l'orthographe..." #: widgets/simplerichtextedit.cpp:147 msgid "Auto Spell Check" msgstr "Vérification automatique de l'orthographe" #: widgets/simplerichtextedit.cpp:152 msgid "Allow Tabulations" msgstr "Autoriser les tabulations" #: widgets/simplerichtextedit.cpp:491 msgid "Suggestions" msgstr "Suggestions" #: widgets/simplerichtextedit.cpp:492 msgid "Ignore" msgstr "Ignorer" #: widgets/simplerichtextedit.cpp:493 msgid "Add to Dictionary" msgstr "Ajouter au dictionnaire" #: widgets/simplerichtextedit.cpp:497 msgid "No suggestions" msgstr "Pas de suggestions" #. i18n: file: main/subtitlecomposerui.rc:5 #. i18n: ectx: Menu (file) #: rc.cpp:3 msgid "&File" msgstr "&Fichier" #. i18n: file: main/subtitlecomposerui.rc:16 #. i18n: ectx: Menu (translation) #: rc.cpp:6 msgid "Translation" msgstr "Traduction" #. i18n: file: main/subtitlecomposerui.rc:28 #. i18n: ectx: Menu (edit) #: rc.cpp:9 msgid "&Edit" msgstr "&Édition" #. i18n: file: main/subtitlecomposerui.rc:51 #. i18n: ectx: Menu (texts) #: rc.cpp:12 msgid "&Texts" msgstr "&Textes" #. i18n: file: main/subtitlecomposerui.rc:62 #. i18n: ectx: Menu (styles) #: rc.cpp:15 msgid "St&yles" msgstr "St&yles" #. i18n: file: main/subtitlecomposerui.rc:69 #. i18n: ectx: Menu (times) #: rc.cpp:18 msgid "T&imes" msgstr "Te&mps" #. i18n: file: main/subtitlecomposerui.rc:91 #. i18n: ectx: Menu (errors) #: rc.cpp:21 msgid "E&rrors" msgstr "E&rreurs" #. i18n: file: main/subtitlecomposerui.rc:104 #. i18n: ectx: Menu (video) #: rc.cpp:24 msgid "&Video" msgstr "&Vidéo" #. i18n: file: main/subtitlecomposerui.rc:132 #. i18n: ectx: Menu (tools) #: rc.cpp:27 msgid "T&ools" msgstr "&Outils" #. i18n: file: main/subtitlecomposerui.rc:137 #. i18n: ectx: Menu (audiolevels) #: rc.cpp:30 msgid "&Audio Levels" msgstr "&Niveaux sonores" #. i18n: file: main/subtitlecomposerui.rc:153 #. i18n: ectx: ToolBar (mainToolBar) #: rc.cpp:33 msgid "Main Toolbar" msgstr "Barre d'outils principale" #. i18n: file: main/subtitlecomposerui.rc:165 #. i18n: ectx: ToolBar (editToolBar) #: rc.cpp:36 msgctxt "The toolbar name" msgid "Edit Toolbar" msgstr "Barre d'édition" #: rc.cpp:37 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Thomas Gastine" #: rc.cpp:38 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "thomas.gastine@wanadoo.fr" subtitlecomposer-0.5.3/po/status.txt0000644000175000001440000000127111206423164017033 0ustar sergiousersBulgarian: currently maintained by Petar Toushkov Czech: currently maintained by Petr Gadula (Goliash) French currently maintained by Thomas Gastine German: currently unmaintained (contributed by Panagiotis Papadopoulos , unreachable) Greek: currently unmaintained (contributed by Alexandros Perdikomatis , unreachable) Polish: currently maintained by Tomasz Argasiński Brazilian Portuguese: currently maintained by Marcio P. Moraes Serbian: currently maintained by Slobodan Simic subtitlecomposer-0.5.3/install0000755000175000001440000000047611151345073015734 0ustar sergiousers#!/bin/sh CURRENT_DIR=$(echo $0 | sed -e 's/^\(.*\/\)[^\/][^\/]*$/\1/') BUILD_TESTS=ON cd ${CURRENT_DIR} && \ (rm -R build; \ mkdir build && \ cd build && \ cmake ../ -DCMAKE_INSTALL_PREFIX=$(kde4-config --prefix) -DCMAKE_BUILD_TYPE=debugfull -DKDE4_BUILD_TESTS:BOOL=${BUILD_TESTS} && \ make && \ sudo make install) subtitlecomposer-0.5.3/src/0000755000175000001440000000000011206423743015122 5ustar sergiouserssubtitlecomposer-0.5.3/src/CMakeLists.txt0000644000175000001440000000173711152551704017671 0ustar sergiousersINCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} # so files can find config.h ${CMAKE_CURRENT_SOURCE_DIR} # so that we can refer to our files starting at src dir ${KDE4_INCLUDES} # so we don't need to include it in other files ${QT_INCLUDES} # same as previous ) ADD_DEFINITIONS( ${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -fexceptions -DHAVE_CONFIG_H ) # the subdirs must be added in a specific order # if one dir uses code from another, its CMakeLists.txt will reference variables # defined in the dependency directory that must be created before the former # CMakeLists.txt is processed ADD_SUBDIRECTORY( common ) ADD_SUBDIRECTORY( core ) ADD_SUBDIRECTORY( formats ) ADD_SUBDIRECTORY( config ) # depends on common ADD_SUBDIRECTORY( widgets ) ADD_SUBDIRECTORY( player ) ADD_SUBDIRECTORY( main ) # do the configuration of config.h at the end, so all the necessary variables have been set CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h ) subtitlecomposer-0.5.3/src/config.h.cmake0000644000175000001440000000042011151345071017607 0ustar sergiousers#ifndef CONFIG_H #define CONFIG_H /* Whether GStreamer was found */ #cmakedefine HAVE_GSTREAMER /* Whether GStreamer was found */ #cmakedefine HAVE_GSTREAMER /* Whether Xine was found */ #cmakedefine HAVE_XINE /* Whether XCB was found */ #cmakedefine HAVE_XCB #endif subtitlecomposer-0.5.3/src/common/0000755000175000001440000000000011206423743016412 5ustar sergiouserssubtitlecomposer-0.5.3/src/common/filesavehelper.cpp0000644000175000001440000000623211151345062022113 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "filesavehelper.h" #include #include #include #include FileSaveHelper::FileSaveHelper( const KUrl& url, bool overwrite ): m_url( url ), m_overwrite( overwrite ), m_file( 0 ) { } FileSaveHelper::~FileSaveHelper() { if ( m_file ) close(); } const KUrl& FileSaveHelper::url() { return m_url; } bool FileSaveHelper::overwrite() { return m_overwrite; } QFile* FileSaveHelper::file() { return m_file; } bool FileSaveHelper::open() { if ( m_file ) return false; if ( ! m_overwrite && KIO::NetAccess::exists( m_url, KIO::NetAccess::DestinationSide, 0 ) ) return false; if ( m_url.isLocalFile() ) { m_file = new KSaveFile( m_url.path() ); if ( ! m_file->open( QIODevice::WriteOnly|QIODevice::Truncate ) ) { kDebug() << "couldn't open output file" << m_file->fileName(); delete m_file; m_file = 0; return false; } } else { m_file = new KTemporaryFile(); if ( ! ((KTemporaryFile*)m_file)->open() ) { kDebug() << "couldn't open output file" << m_file->fileName(); delete m_file; m_file = 0; return false; } } return true; } bool FileSaveHelper::close() { if ( ! m_file ) return false; if ( m_url.isLocalFile() ) { delete m_file; // the destructor calls finalize() which in turn calls close() m_file = 0; return true; } else { m_file->close(); // close the file to ensure everything has been written to it bool success = m_overwrite ? KIO::NetAccess::upload( m_file->fileName(), m_url, 0 ) : KIO::NetAccess::file_copy( KUrl( m_file->fileName() ), m_url, 0 ); delete m_file; // the destructor removes the temporary file m_file = 0; return success; } } bool FileSaveHelper::exists( const KUrl& url ) { return KIO::NetAccess::exists( url, KIO::NetAccess::DestinationSide, 0 ); } subtitlecomposer-0.5.3/src/common/CMakeLists.txt0000644000175000001440000000054511151345062021152 0ustar sergiousersSET( common_LIBS ${KDE4_KIO_LIBS} CACHE INTERNAL EXPORTEDVARIABLE ) SET( common_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/commondefs.cpp ${CMAKE_CURRENT_SOURCE_DIR}/qxtsignalwaiter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/fileloadhelper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/filesavehelper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/filetrasher.cpp CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/common/filetrasher.h0000644000175000001440000000324011151345062021066 0ustar sergiousers#ifndef FILETRASHER_H #define FILETRASHER_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include class FileTrasher { public: FileTrasher( const KUrl& url ); FileTrasher( const QString& path ); ~FileTrasher(); const KUrl& url(); bool exec(); private: KUrl m_url; }; #endif subtitlecomposer-0.5.3/src/common/commondefs.cpp0000644000175000001440000001475111151345062021254 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "commondefs.h" #include #include #include #include #include #include #include #include #include #include #include #ifndef Q_WS_WIN #include #endif /** * String */ QString String::title( const QString& text ) { QString auxText = text.toLower(); const QString separators( " -_([:,;./\\\t\n\"" ); int len = separators.length(), sepIdx = 0; while ( sepIdx < len ) { QStringList auxWordsList; QStringList wordsList = auxText.split( separators[sepIdx] ); for ( QStringList::ConstIterator it = wordsList.begin(), end = wordsList.end(); it != end; ++it ) if ( ! (*it).isEmpty() ) auxWordsList.append( (*it)[0].toUpper()+(*it).mid( 1 ) ); else auxWordsList.append( "" ); auxText = auxWordsList.join( separators[sepIdx] ); sepIdx++; } return auxText; } QString String::capitalize( const QString& text ) { return text.isEmpty() ? "" : text[0].toUpper() + text.mid(1).toLower(); } QString String::sentence( const QString& text ) { return text.isEmpty() ? "" : text[0].toUpper() + text.mid(1).toLower(); } int String::rfindFunctionStart( const QString& text ) { int pos[5] = { text.lastIndexOf( "capitalize{" ), text.lastIndexOf( "titlecase{" ), text.lastIndexOf( "uppercase{" ), text.lastIndexOf( "lowercase{" ), text.lastIndexOf( "ascii{" ), }; return qMax( qMax( qMax( qMax( pos[0], pos[1] ), pos[2] ), pos[3] ), pos[4] ); } int String::rfindFunctionEnd( const QString& text, int startPos ) { int pos = startPos, len = text.length(); while ( pos < len ) { // next is safe because idx will always be greater than 0 if ( text[pos] == '}' && text[pos-1] != '\\' ) return pos; pos++; } return -1; } /** * System: */ bool System::recursiveMakeDir( const QString& path, QStringList* createdDirsList ) { if ( createdDirsList ) createdDirsList->clear(); QDir parcialPath( "/" ); QStringList tokens = path.split( '/', QString::SkipEmptyParts ); for ( QStringList::ConstIterator it = tokens.begin(), end = tokens.end(); it != end; ++it ) { parcialPath.setPath( parcialPath.path() + '/' + *it ); if ( ! QFileInfo( parcialPath.path() ).exists() ) { if ( ! QDir().mkdir( parcialPath.path() ) ) return false; if ( createdDirsList ) createdDirsList->prepend( parcialPath.path() ); } } return true; } bool System::copy( const QString& srcPath, const QString& dstPath ) { if ( QFile::exists( dstPath ) ) if ( ! System::remove( dstPath ) ) return false; return QFile::copy( srcPath, dstPath ); } bool System::move( const QString& srcPath, const QString& dstPath ) { if ( ! System::copy( srcPath, dstPath ) ) { kDebug() << "move: error copying" << srcPath << "to" << dstPath; return false; } if ( ! QFile::remove( srcPath ) ) { kDebug() << "move: error removing" << srcPath; return false; } return true; } bool System::remove( const QString& path ) { return QFile::remove( path ); } bool System::isReadable( const QString& path ) { QFileInfo fileInfo( path ); return fileInfo.isFile() && fileInfo.isReadable(); } bool System::isWritable( const QString& path ) { QFileInfo fileInfo( path ); return fileInfo.isFile() && fileInfo.isWritable(); } QString System::homeDir() { return QDir::homePath(); } QString System::tempDir() { QString tempDir = KGlobal::dirs()->saveLocation( "tmp" ); tempDir.remove( QRegExp( "[\\/]+$" ) ); return tempDir; } KUrl System::newUrl( const KUrl& baseUrl, const QString& fileName, const QString& extension, int retries ) { if ( retries < 0 ) retries = INT_MAX; QString newFileName( fileName ); QString newFileNameBuilder( fileName + "-%1" ); if ( ! extension.isEmpty() ) { newFileName += '.' + extension; newFileNameBuilder += '.' + extension; } QString newFileDir = baseUrl.path(); newFileDir.remove( QRegExp( "[\\/]+$" ) ); newFileDir += '/'; if ( baseUrl.isLocalFile() ) { QFileInfo dirInfo( newFileDir ); if ( dirInfo.isDir() && dirInfo.isWritable() ) { QString newFilePath = newFileDir + newFileName; if ( ! QFile::exists( newFilePath ) ) return KUrl( newFilePath ); for ( int i = 2, limit = retries + i; i < limit; ++i ) { newFilePath = newFileDir + newFileNameBuilder.arg( i ); if ( ! QFile::exists( newFilePath ) ) return KUrl( newFilePath ); } } } else { KUrl newUrl = baseUrl; newUrl.setPath( newFileDir + newFileName ); if ( ! KIO::NetAccess::exists( newUrl, KIO::NetAccess::DestinationSide, 0 ) ) return newUrl; for ( int i = 2, limit = retries + i; i < limit; ++i ) { newUrl.setPath( newFileDir + newFileNameBuilder.arg( i ) ); if ( ! KIO::NetAccess::exists( newUrl, KIO::NetAccess::DestinationSide, 0 ) ) return newUrl; } } // could not return a writable url in baseUrl so we return one in the temp dir newFileDir = tempDir() + '/'; QString newFilePath = newFileDir + newFileName; if ( ! QFile::exists( newFilePath ) ) return KUrl( newFilePath ); int i = 2; do newFilePath = newFileDir + newFileNameBuilder.arg( i++ ); while ( QFile::exists( newFilePath ) ); return KUrl( newFilePath ); } subtitlecomposer-0.5.3/src/common/fileloadhelper.h0000644000175000001440000000337611151345062021547 0ustar sergiousers#ifndef FILELOADHELPER_H #define FILELOADHELPER_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include class FileLoadHelper { public: FileLoadHelper( const KUrl& url ); ~FileLoadHelper(); const KUrl& url(); QFile* file(); bool open(); bool close(); static bool exists( const KUrl& url ); private: KUrl m_url; QFile* m_file; }; #endif subtitlecomposer-0.5.3/src/common/filesavehelper.h0000644000175000001440000000346611151345062021566 0ustar sergiousers#ifndef FILESAVEHELPER_H #define FILESAVEHELPER_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include class FileSaveHelper { public: FileSaveHelper( const KUrl& url, bool overwrite ); ~FileSaveHelper(); const KUrl& url(); bool overwrite(); QFile* file(); bool open(); bool close(); static bool exists( const KUrl& url ); private: KUrl m_url; bool m_overwrite; QFile* m_file; }; #endif subtitlecomposer-0.5.3/src/common/filetrasher.cpp0000644000175000001440000000351611172140722021426 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "filetrasher.h" #include #include #include FileTrasher::FileTrasher( const KUrl& url ): m_url( url ) { } FileTrasher::~FileTrasher() { } FileTrasher::FileTrasher( const QString& path ): m_url() { m_url.setPath( path ); } const KUrl& FileTrasher::url() { return m_url; } bool FileTrasher::exec() { KIO::CopyJob* job = KIO::trash( m_url ); // NOTE: the call deletes job! return KIO::NetAccess::synchronousRun( job, 0 ); } subtitlecomposer-0.5.3/src/common/qxtsignalwaiter.cpp0000644000175000001440000001150411152631461022343 0ustar sergiousers/***************************************************************************** * Copyright (C) 2006 by Adam Higerd * * ahigerd@stratitec.com * * * * QxtSignalWaiter is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, version 2 or greater, or under the terms * * of the GNU Lesser General Public License, version 2.1 or greater, or * * under the terms of the Q Public License as published by Trolltech. * * This disjunctive license follows the license of the linked Qt toolkit. * * Specifically, if you use Qt under the GPL, QxtSignalWaiter is licensed * * to you under the GPL. If you use Qt under the QPL, this is licensed to * * you under the QPL. If you use Qt with a commercial license purchased * * from Trolltech, this is licensed to you under the LGPL. * * * * QxtSignalWaiter 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 * * appropriate license agreement for more details. * ****************************************************************************/ #include "qxtsignalwaiter.h" #include #include QxtSignalWaiter::QxtSignalWaiter( const QObject* sender, const char* signal, unsigned count ): QObject( 0 ), m_signals( count ), m_signalsCaught( 0 ), m_timeout( false ), m_eventFlags( QEventLoop::ExcludeUserInputEvents ) { if ( signal ) connect( sender, signal, this, SLOT(signalCaught()) ); } QxtSignalWaiter::QxtSignalWaiter( const QObject* sender, const char* signal1, const char* signal2, unsigned count ): QObject( 0 ), m_signals( count ), m_signalsCaught( 0 ), m_timeout( false ), m_eventFlags( QEventLoop::ExcludeUserInputEvents ) { if ( signal1 ) connect( sender, signal1, this, SLOT(signalCaught()) ); if ( signal2 ) connect( sender, signal2, this, SLOT(signalCaught()) ); } QxtSignalWaiter::QxtSignalWaiter( const QObject* sender, const char* signal1, const char* signal2, const char* signal3, unsigned count ): QObject( 0 ), m_signals( count ), m_signalsCaught( 0 ), m_timeout( false ), m_eventFlags( QEventLoop::ExcludeUserInputEvents ) { if ( signal1 ) connect( sender, signal1, this, SLOT(signalCaught()) ); if ( signal2 ) connect( sender, signal2, this, SLOT(signalCaught()) ); if ( signal3 ) connect( sender, signal3, this, SLOT(signalCaught()) ); } QxtSignalWaiter::QxtSignalWaiter( const QObject* sender, const char* signal1, const char* signal2, const char* signal3, const char* signal4, unsigned count ): QObject( 0 ), m_signals( count ), m_signalsCaught( 0 ), m_timeout( false ), m_eventFlags( QEventLoop::ExcludeUserInputEvents ) { if ( signal1 ) connect( sender, signal1, this, SLOT(signalCaught()) ); if ( signal2 ) connect( sender, signal2, this, SLOT(signalCaught()) ); if ( signal3 ) connect( sender, signal3, this, SLOT(signalCaught()) ); if ( signal4 ) connect( sender, signal4, this, SLOT(signalCaught()) ); } QxtSignalWaiter::~QxtSignalWaiter() { } QEventLoop::ProcessEventsFlags QxtSignalWaiter::processEventFlags() const { return m_eventFlags; } void QxtSignalWaiter::setProcessEventFlags( QEventLoop::ProcessEventsFlags eventFlags ) { m_eventFlags = eventFlags; } // Returns true if the signal was caught, returns false if the wait timed out bool QxtSignalWaiter::wait( int msec ) { // static int waitcount = 0; // int waitID = waitcount++; // qDebug( "starting wait %d", waitID ); // Check input parameters if ( msec < -1 || m_signalsCaught >= m_signals ) return m_signalsCaught >= m_signals; // activate the timeout if ( msec != -1 ) { m_timerID = startTimer( msec ); if ( m_timerID == 0 ) { qDebug( "failed to initialize timer" ); return false; } } // Begin waiting while( m_signalsCaught < m_signals && ! m_timeout ) // QApplication::eventLoop()->processEvents( QEventLoop::WaitForMore ); // we must dissallow input events to prevent recursive calls to this function QCoreApplication::processEvents( m_eventFlags ); // Clean up and return status killTimer( m_timerID ); // qDebug( "finishing wait %d", waitID ); return m_signalsCaught >= m_signals || ! m_timeout; } void QxtSignalWaiter::reset() { m_signalsCaught = 0; } void QxtSignalWaiter::signalCaught() { m_signalsCaught++; } void QxtSignalWaiter::timerEvent( QTimerEvent* ) { killTimer( m_timerID ); m_timeout = true; } #include "qxtsignalwaiter.moc" subtitlecomposer-0.5.3/src/common/commondefs.h0000644000175000001440000000466211151345062020721 0ustar sergiousers#ifndef COMMONDEFS_H #define COMMONDEFS_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include class String { public: static QString title( const QString& text ); static QString capitalize( const QString& text ); static QString sentence( const QString& text ); protected: static int rfindFunctionStart( const QString& text ); static int rfindFunctionEnd( const QString& text, int startPos ); }; class System { public: // FALSE ON ERROR static bool copy( const QString& srcPath, const QString& dstPath ); static bool move( const QString& srcPath, const QString& dstPath ); static bool remove( const QString& path ); static bool recursiveMakeDir( const QString& path, QStringList* createdDirsList=0 ); static bool isReadable( const QString& path ); static bool isWritable( const QString& path ); static QString homeDir(); static QString tempDir(); static KUrl newUrl( const KUrl& baseUrl, const QString& fileName="tempfile", const QString& extension="", int retries=10 ); }; #endif subtitlecomposer-0.5.3/src/common/fileloadhelper.cpp0000644000175000001440000000564311151345062022101 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "fileloadhelper.h" #include #include #include #include FileLoadHelper::FileLoadHelper( const KUrl& url ): m_url( url ), m_file( 0 ) { } FileLoadHelper::~FileLoadHelper() { if ( m_file ) close(); } const KUrl& FileLoadHelper::url() { return m_url; } QFile* FileLoadHelper::file() { return m_file; } bool FileLoadHelper::open() { if ( m_file ) return false; if ( ! KIO::NetAccess::exists( m_url, KIO::NetAccess::SourceSide, 0 ) ) return false; if ( m_url.isLocalFile() ) { m_file = new QFile( m_url.path() ); if ( ! m_file->open( QIODevice::ReadOnly ) ) { kDebug() << "couldn't open input file" << m_file->fileName(); delete m_file; m_file = 0; return false; } } else { QString tmpFile; if ( ! KIO::NetAccess::download( m_url, tmpFile, 0 ) ) { kDebug() << "couldn't get input url:" << m_url.prettyUrl(); kDebug() << KIO::NetAccess::lastErrorString(); return false; } m_file = new QFile( tmpFile ); if ( ! m_file->open( QIODevice::ReadOnly ) ) { kDebug() << "couldn't open input file" << m_file->fileName(); delete m_file; m_file = 0; return false; } } return true; } bool FileLoadHelper::close() { if ( ! m_file ) return false; QString tmpFilePath = m_file->fileName(); delete m_file; // closes the file m_file = 0; if ( ! m_url.isLocalFile() ) KIO::NetAccess::removeTempFile( tmpFilePath ); return true; } bool FileLoadHelper::exists( const KUrl& url ) { return KIO::NetAccess::exists( url, KIO::NetAccess::SourceSide, 0 ); } subtitlecomposer-0.5.3/src/common/qxtsignalwaiter.h0000644000175000001440000000615411152631461022015 0ustar sergiousers#ifndef QXTSIGNALWAITER_H #define QXTSIGNALWAITER_H /***************************************************************************** * Copyright (C) 2006 by Adam Higerd * * ahigerd@stratitec.com * * * * QxtSignalWaiter is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, version 2 or greater, or under the terms * * of the GNU Lesser General Public License, version 2.1 or greater, or * * under the terms of the Q Public License as published by Trolltech. * * This disjunctive license follows the license of the linked Qt toolkit. * * Specifically, if you use Qt under the GPL, QxtSignalWaiter is licensed * * to you under the GPL. If you use Qt under the QPL, this is licensed to * * you under the QPL. If you use Qt with a commercial license purchased * * from Trolltech, this is licensed to you under the LGPL. * * * * QxtSignalWaiter 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 * * appropriate license agreement for more details. * ****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include class QTimerEvent; // QxtSignalWaiter is, sadly, not reentrant. In particular, only one QxSignalWaiter // object can be safely waiting at a time. If a second QxSignalWaiter is used while // the first is waiting, the first will not return until the second has timed out or // successfully caught its signal. A later revision of the class may be able to solve // this problem. Until then, be careful not to rely on two QxtSignalWaiter objects // at the same time. class QxtSignalWaiter : public QObject { Q_OBJECT public: QxtSignalWaiter( const QObject* sender, const char* signal, unsigned count=1 ); QxtSignalWaiter( const QObject* sender, const char* signal1, const char* signal2, unsigned count=1 ); QxtSignalWaiter( const QObject* sender, const char* signal1, const char* signal2, const char* signal3, unsigned count=1 ); QxtSignalWaiter( const QObject* sender, const char* signal1, const char* signal2, const char* signal3, const char* signal4, unsigned count=1 ); virtual ~QxtSignalWaiter(); QEventLoop::ProcessEventsFlags processEventFlags() const; void setProcessEventFlags( QEventLoop::ProcessEventsFlags eventFlags ); bool wait( int msec=-1 ); void reset(); protected: void timerEvent( QTimerEvent* event ); private slots: void signalCaught(); private: const int m_signals; int m_signalsCaught; int m_timeout; int m_timerID; QEventLoop::ProcessEventsFlags m_eventFlags; }; #endif subtitlecomposer-0.5.3/src/profiler.h0000644000175000001440000000415111151345071017112 0ustar sergiousers#ifndef PROFILER_H #define PROFILER_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #define PROFILING #ifdef PROFILING #include #include class Profiler { public: Profiler( const char* description=0 ): m_description( description ) { m_time.start(); } ~Profiler() { int elapsed = m_time.elapsed(); if ( m_description ) qDebug() << m_description << " took" << elapsed << "msecs"; else qDebug() << "took" << elapsed << "msecs"; } private: const char* m_description; QTime m_time; }; #define PROFILE() Profiler _p_r_o_f_i_l_e_r_( Q_FUNC_INFO ) #define PROFILE2( x ) Profiler _p_r_o_f_i_l_e_r_( x ) #else #define PROFILE() ; #define PROFILE2( x ) ; #endif #endif subtitlecomposer-0.5.3/src/core/0000755000175000001440000000000011206423743016052 5ustar sergiouserssubtitlecomposer-0.5.3/src/core/CMakeLists.txt0000644000175000001440000000126511151345063020613 0ustar sergiousersSET( core_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/action.h ${CMAKE_CURRENT_SOURCE_DIR}/compositeaction.h ${CMAKE_CURRENT_SOURCE_DIR}/actionmanager.cpp ${CMAKE_CURRENT_SOURCE_DIR}/audiolevels.cpp ${CMAKE_CURRENT_SOURCE_DIR}/formatdata.h ${CMAKE_CURRENT_SOURCE_DIR}/range.h ${CMAKE_CURRENT_SOURCE_DIR}/rangelist.h ${CMAKE_CURRENT_SOURCE_DIR}/time.cpp ${CMAKE_CURRENT_SOURCE_DIR}/sstring.cpp ${CMAKE_CURRENT_SOURCE_DIR}/subtitle.cpp ${CMAKE_CURRENT_SOURCE_DIR}/subtitleactions.cpp ${CMAKE_CURRENT_SOURCE_DIR}/subtitleiterator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/subtitleline.cpp ${CMAKE_CURRENT_SOURCE_DIR}/subtitlelineactions.cpp CACHE INTERNAL EXPORTEDVARIABLE ) ADD_SUBDIRECTORY( tests ) subtitlecomposer-0.5.3/src/core/rangelist.h0000644000175000001440000003066411206176702020224 0ustar sergiousers#ifndef RANGELIST_H #define RANGELIST_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "range.h" #include #include #include namespace SubtitleComposer { class RangeList { public: typedef QList::Iterator Iterator; typedef QList::ConstIterator ConstIterator; RangeList() { } RangeList( const Range& range ) { m_ranges.append( range ); } RangeList( const RangeList& ranges ): m_ranges( ranges.m_ranges ) { } RangeList& operator=( const RangeList& ranges ) { if ( this == &ranges ) return *this; m_ranges = ranges.m_ranges; return *this; } bool operator==( const RangeList& ranges ) const { return m_ranges == ranges.m_ranges; } bool operator!=( const RangeList& ranges ) const { return m_ranges != ranges.m_ranges; } bool isFullRange( int maxIndex=Range::MaxIndex ) const { return m_ranges.count() == 1 && m_ranges.first().isFullRange( maxIndex ); } RangeList complement() const { kDebug() << this->inspect(); if ( m_ranges.empty() ) return Range( 0, Range::MaxIndex ); RangeList ret; QList::ConstIterator it = m_ranges.begin(); if ( (*it).m_start > 0 ) ret << Range( 0, (*it).m_start - 1 ); int lastEnd = (*it).m_end; ++it; for ( QList::ConstIterator end = m_ranges.end(); it != end; ++it ) { ret << Range( lastEnd + 1, (*it).m_start - 1 ); lastEnd = (*it).m_end; } if ( lastEnd < Range::MaxIndex ) ret << Range( lastEnd + 1, Range::MaxIndex ); kDebug() << ret.inspect(); return ret; } bool contains( int index ) const { for ( QList::ConstIterator it = m_ranges.begin(), end2 = m_ranges.end(); it != end2; ++it ) if ( (*it).contains( index ) ) return true; return false; } Range range( int rangeIndex ) const { Q_ASSERT( rangeIndex >= 0 ); Q_ASSERT( rangeIndex < m_ranges.count() ); return m_ranges.at( rangeIndex ); } bool isEmpty() const { return m_ranges.isEmpty(); } int rangesCount() const { return m_ranges.count(); } int indexesCount() const { int count = m_ranges.count(); for ( QList::ConstIterator it = m_ranges.begin(), end2 = m_ranges.end(); it != end2; ++it ) count += (*it).m_end - (*it).m_start; return count; } Range first() const { Q_ASSERT( ! m_ranges.empty() ); return m_ranges.first(); } Range last() const { Q_ASSERT( ! m_ranges.empty() ); return m_ranges.last(); } int firstIndex() const { Q_ASSERT( ! m_ranges.empty() ); return m_ranges.first().start(); } int lastIndex() const { Q_ASSERT( ! m_ranges.empty() ); return m_ranges.last().end(); } void clear() { m_ranges.clear(); } void trimToIndex( int index ) { trimToRange( Range::lower( index ) ); } void trimToRange( const Range& range ) { if ( m_ranges.empty() ) return; // GENERAL ALGORITHM FOLLOWS // - we search the lower and the upper items affected. // - update lower item start and end values // - remove all items below lower up and above upper (lower and upper excluded) // 0 1 2 // XXXXX XXXXX XXXXX [L, U] // [ ] [0, 0] // [] [0, 4] // [ ] [0, 0] // [ ] [0, 1] // [ ] [0, 1] // [] [1, 3] // [ ] [1, 1] // [ ] [1, 1] // [ ] [0, 2] // [ ] [2, 2] // [ ] [3, 2] // [ ] [0, 2] const int SIZE = m_ranges.count(); const int LAST_INDEX = SIZE - 1; int lowerIndex = SIZE; int upperIndex = LAST_INDEX; for ( int index = 0; index <= LAST_INDEX; ++index ) { Range& currentRange = m_ranges[index]; if ( lowerIndex == SIZE ) { if ( range.m_start <= currentRange.m_end ) { lowerIndex = index; if ( range.m_end < currentRange.m_start ) { // special case, we must remove all items upperIndex = LAST_INDEX + 1; break; } } } else { if ( range.m_end < currentRange.m_start ) { upperIndex = index - 1; break; } } } if ( lowerIndex > LAST_INDEX || upperIndex > LAST_INDEX ) { m_ranges.clear(); } else { Range& lowerRange = m_ranges[lowerIndex]; Range& upperRange = m_ranges[upperIndex]; if ( range.m_start > lowerRange.m_start ) lowerRange.m_start = range.m_start; if ( range.m_end < upperRange.m_end ) upperRange.m_end = range.m_end; // remove all items after upperRange for ( int index = upperIndex + 1; index < SIZE; ++index ) m_ranges.removeAt( upperIndex + 1 ); // remove all items before lowerRange for ( int index = 0; index < lowerIndex; ++index ) m_ranges.removeAt( 0 ); } } void operator<<( const Range& range ) { // first resolve the most common (and easy) cases if ( m_ranges.empty() ) { m_ranges.append( range ); return; } else { Range& lastRange = m_ranges.last(); if ( lastRange.m_end < range.m_start ) // range is higher than lastRange { if ( lastRange.m_end + 1 == range.m_start ) // range is absorbed by lastRange lastRange.m_end = range.m_end; else m_ranges.append( range ); return; } else { Range& firstRange = m_ranges.first(); if ( firstRange.m_start > range.m_end ) // range is lower than firstRange { if ( range.m_end + 1 == firstRange.m_start ) // range is absorbed by firstRange firstRange.m_start = range.m_start; else m_ranges.append( range ); return; } } } // GENERAL ALGORITHM FOLLOWS // - we search the lower and the upper items affected. // - update lower item start and end values // - remove all items following lower up to upper (lower excluded) // 0 1 2 // XXXXX XXXXX XXXXX [L, U] // [ ] [0, 0] // [ ] [0, 0] // [ ] [0, 1] // [ ] [0, 1] // [ ] [0, 0] // [ ] [0, 1] // [ ] [0, 2] // [ ] [2, 2] // [ ] [2, 2] this case isn't correctly handled below but was caught before // [] [1, 3] const int LAST_INDEX = m_ranges.count() - 1; int lowerIndex = LAST_INDEX; int upperIndex = LAST_INDEX; for ( int index = 0; index < LAST_INDEX; ++index ) { Range& currentRange = m_ranges[index]; if ( lowerIndex == LAST_INDEX ) { if ( range.m_start <= currentRange.m_end + 1 ) { lowerIndex = index; if ( range.m_end < currentRange.m_start - 1 ) { // special case, we must insert a new Range at lowerIndex upperIndex = LAST_INDEX + 1; break; } } } else { if ( range.m_end < currentRange.m_start - 1 ) { upperIndex = index - 1; break; } } } if ( upperIndex > LAST_INDEX ) { // insert new range at lowerIndex m_ranges.insert( m_ranges.begin() + lowerIndex, range ); } else { Range& lowerRange = m_ranges[lowerIndex]; Range& upperRange = m_ranges[upperIndex]; if ( range.m_start < lowerRange.m_start ) lowerRange.m_start = range.m_start; if ( range.m_end > upperRange.m_end ) lowerRange.m_end = range.m_end; else lowerRange.m_end = upperRange.m_end; for ( int index = lowerIndex + 1; index <= upperIndex; ++index ) m_ranges.removeAt( lowerIndex + 1 ); } } void shiftIndexesForwards( int fromIndex, int delta, bool fillSplitGap ) { Q_ASSERT( fromIndex >= 0 ); Q_ASSERT( delta >= 0 ); if ( ! delta || m_ranges.isEmpty() ) return; for ( int index = 0, count = m_ranges.count(); index < count; ++index ) { Range& range = m_ranges[index]; if ( range.m_start < fromIndex && fromIndex <= range.m_end ) // range must be filled or splitted to insert gap { if ( fillSplitGap ) shiftRangeForwards( range, fromIndex, delta ); else { Range range0( range.m_start, fromIndex - 1 ); range.m_start = fromIndex; shiftRangeForwards( range, fromIndex, delta ); m_ranges.insert( m_ranges.begin() + index, range0 ); } } else shiftRangeForwards( range, fromIndex, delta ); } } void shiftIndexesBackwards( int fromIndex, int delta ) { Q_ASSERT( fromIndex >= 0 ); Q_ASSERT( delta >= 0 ); if ( ! delta || m_ranges.isEmpty() ) return; for ( int index = 0, count = m_ranges.count(); index < count; ++index ) { if ( ! shiftRangeBackwards( m_ranges[index], fromIndex, delta ) ) // range invalidated by shift { m_ranges.removeAt( index ); index--; count--; } } } QString inspect() const { QStringList ranges; for ( int index = 0, count = m_ranges.count(); index < count; ++index ) ranges += QString().sprintf( "[%d,%d]", m_ranges.at( index ).m_start, m_ranges.at( index ).m_end ); return ranges.join( ", " ); } inline ConstIterator begin() const { return m_ranges.begin(); } inline ConstIterator end() const { return m_ranges.end(); } private: inline void shiftRangeForwards( Range& range, int fromIndex, int delta ) { //Q_ASSERT( delta > 0 ); if ( fromIndex <= range.m_start ) { range.m_start += delta; range.m_end += delta; } else if ( fromIndex <= range.m_end ) { range.m_end += delta; } //else // if ( fromIndex > range.m_end ) //{ // // nothing to do in this case //} } inline bool shiftRangeBackwards( Range& range, int fromIndex, int delta ) { //Q_ASSERT( delta > 0 ); if ( fromIndex <= range.m_start ) { range.m_start -= delta; range.m_end -= delta; if ( range.m_start < fromIndex ) { if ( range.m_end < fromIndex ) return false; // range invalidated else range.m_start = fromIndex; } } else if ( fromIndex <= range.m_end ) { if ( fromIndex + delta > range.m_end ) range.m_end = fromIndex - 1; else range.m_end -= delta; } //else // if ( fromIndex > range.m_end ) //{ // // nothing to do in this case //} return true; } QList m_ranges; }; } #endif subtitlecomposer-0.5.3/src/core/formatdata.h0000644000175000001440000000473011151345063020346 0ustar sergiousers#ifndef FORMATDATA_H #define FORMATDATA_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include namespace SubtitleComposer { class FormatData { friend class Format; public: FormatData( const FormatData& formatData ): m_formatName( formatData.m_formatName ), m_data( formatData.m_data ) { } FormatData& operator=( const FormatData& formatData ) { if ( this == &formatData ) return *this; m_formatName = formatData.m_formatName; m_data = formatData.m_data; return *this; } inline const QString& formatName() { return m_formatName; } inline const QString& value( const QString& key ) { static const QString empty; return m_data.contains( key ) ? m_data[key] : empty; } inline void setValue( const QString& key, const QString& value ) { m_data[key] = value; } inline void clear() { m_data.clear(); } private: FormatData( const QString& formatName ): m_formatName( formatName ) { } QString m_formatName; QMap m_data; }; } #endif subtitlecomposer-0.5.3/src/core/sstring.h0000644000175000001440000003133211206341010017700 0ustar sergiousers#ifndef SSTRING_H #define SSTRING_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include namespace SubtitleComposer { class SString; class SStringList : public QList { public: SStringList(); SStringList( const SString& str ); SStringList( const SStringList& list ); SStringList( const QList& list ); SStringList( const QStringList& list ); SStringList( const QList& list ); SString join( const SString& sep ) const; }; class SString { public: typedef enum { Bold = 0x1, Italic = 0x2, Underline = 0x4, StrikeThrough = 0x8, AllStyles = Bold|Italic|Underline|StrikeThrough } StyleFlag; typedef enum { Compact, Verbose } RichOutputMode; SString( const QString& string=QString(), int styleFlags=0 ); // krazy:exclude=c++/explicit SString( const SString& sstring ); SString& operator=( const SString& sstring ); ~SString(); bool isNull() const; bool isEmpty() const; int length() const; int size() const; QString string() const; void setString( const QString& string, int styleFlags=0 ); // always clears all the style flags QString richString( RichOutputMode mode=Compact ) const; SString& setRichString( const QString& string ); const QChar at( int index ); QCharRef operator[]( int index ); const QChar operator[]( int index ) const; int styleFlagsAt( int index ) const; void setStyleFlagsAt( int index, int styleFlags ) const; int cummulativeStyleFlags() const; bool hasStyleFlags( int styleFlags ) const; SString& setStyleFlags( int index, int len, int styleFlags ); SString& setStyleFlags( int index, int len, int styleFlags, bool on ); void clear(); void truncate( int size ); SString& insert( int index, QChar ch ); SString& insert( int index, const QString& str ); SString& insert( int index, const SString& str ); SString& append( QChar ch ); SString& append( const QString& str ); SString& append( const SString& str ); SString& prepend( QChar ch ); SString& prepend( const QString& str ); SString& prepend( const SString& str ); SString& operator+=( QChar ch ); SString& operator+=( const QString& str ); SString& operator+=( const SString& str ); SString& remove( int index, int len ); SString& remove( const QString& str, Qt::CaseSensitivity cs=Qt::CaseSensitive ); SString& remove( QChar ch, Qt::CaseSensitivity cs=Qt::CaseSensitive ); SString& remove( const QRegExp& rx ); SString& replace( int index, int len, const QString& replacement ); SString& replace( int index, int len, const SString& replacement ); SString& replace( const QString& before, const QString& after, Qt::CaseSensitivity cs=Qt::CaseSensitive ); SString& replace( const QString& before, const SString& after, Qt::CaseSensitivity cs=Qt::CaseSensitive ); SString& replace( QChar before, QChar after, Qt::CaseSensitivity cs=Qt::CaseSensitive ); SString& replace( QChar ch, const QString& after, Qt::CaseSensitivity cs=Qt::CaseSensitive ); SString& replace( QChar ch, const SString& after, Qt::CaseSensitivity cs=Qt::CaseSensitive ); SString& replace( const QRegExp& rx, const QString& after ); SString& replace( const QRegExp& rx, const SString& after ); int indexOf( QChar c, int index=0, Qt::CaseSensitivity cs=Qt::CaseSensitive ) const; int indexOf( char c, int index=0, Qt::CaseSensitivity cs=Qt::CaseSensitive ) const; int indexOf( const QString& str, int index=0, Qt::CaseSensitivity cs=Qt::CaseSensitive ) const; int indexOf( const QRegExp& rx, int index=0 ) const; int indexOf( const char* str, int index=0 ) const; int lastIndexOf( QChar c, int index=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive ) const; int lastIndexOf( char c, int index=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive ) const; int lastIndexOf( const QString& str, int index=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive ) const; int lastIndexOf( const QRegExp& rx, int index=-1 ) const; int lastIndexOf( const char* str, int index=-1 ) const; bool contains( QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive ) const; bool contains( const QString& str, Qt::CaseSensitivity cs=Qt::CaseSensitive ) const; bool contains( const QRegExp& rx ) const; int count( const QString& str, Qt::CaseSensitivity cs=Qt::CaseSensitive ) const; int count( QChar ch, Qt::CaseSensitivity cs=Qt::CaseSensitive ) const; int count( const QRegExp& rx ) const; int count() const; SStringList split( const QString& sep, QString::SplitBehavior behavior=QString::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive ) const; SStringList split( const QChar& sep, QString::SplitBehavior behavior=QString::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive ) const; SStringList split( const QRegExp& sep, QString::SplitBehavior behavior=QString::KeepEmptyParts ) const; SString left( int len ) const; SString right( int len ) const; SString mid( int index, int len=-1 ) const; SString toLower() const; SString toUpper() const; SString toTitleCase( bool lowerFirst ) const; SString toSentenceCase( bool lowerFirst, bool* cont ) const; SString simplified() const; SString trimmed() const; bool operator==( const SString& sstring ) const; bool operator==( const QString& string ) const; bool operator!=( const SString& sstring ) const; bool operator!=( const QString& string ) const; bool operator<( const SString& sstring ) const; bool operator<( const QString& string ) const; bool operator<=( const SString& sstring ) const; bool operator<=( const QString& string ) const; bool operator>( const SString& sstring ) const; bool operator>( const QString& string ) const; bool operator>=( const SString& sstring ) const; bool operator>=( const QString& string ) const; private: char* detachFlags(); void setMinFlagsCapacity( int capacity ); int length( int index, int len ) const; private: QString m_string; char* m_styleFlags; int m_capacity; }; inline bool SString::isNull() const { return m_string.isNull(); } inline bool SString::isEmpty() const { return m_string.isEmpty(); } inline int SString::length() const { return m_string.length(); } inline int SString::size() const { return m_string.size(); } inline QString SString::string() const { return m_string; } inline const QChar SString::at( int index ) { return m_string.at( index ); } inline QCharRef SString::operator[]( int index ) { return m_string[index]; } inline const QChar SString::operator[]( int index ) const { return m_string[index]; } inline int SString::styleFlagsAt( int index ) const { return m_styleFlags[index]; } inline void SString::setStyleFlagsAt( int index, int styleFlags ) const { m_styleFlags[index] = styleFlags; } inline SString& SString::append( QChar ch ) { return insert( m_string.length(), ch ); } inline SString& SString::append( const QString& str ) { return insert( m_string.length(), str ); } inline SString& SString::append( const SString& str ) { return insert( m_string.length(), str ); } inline SString& SString::prepend( QChar ch ) { return insert( 0, ch ); } inline SString& SString::prepend( const QString& str ) { return insert( 0, str ); } inline SString& SString::prepend( const SString& str ) { return insert( 0, str ); } inline SString& SString::operator+=( const QChar ch ) { return append( ch ); } inline SString& SString::operator+=( const QString& str ) { return append( str ); } inline SString& SString::operator+=( const SString& str ) { return append( str ); } inline SString& SString::remove( int index, int len ) { return replace( index, len, "" ); } inline SString& SString::remove( const QString& str, Qt::CaseSensitivity cs ) { return replace( str, "", cs ); } inline SString& SString::remove( QChar ch, Qt::CaseSensitivity cs ) { return replace( ch, "", cs ); } inline SString& SString::remove( const QRegExp& rx ) { return replace( rx, "" ); } inline int SString::indexOf( QChar c, int index, Qt::CaseSensitivity cs ) const { return m_string.indexOf( c, index, cs ); } inline int SString::indexOf( char c, int index, Qt::CaseSensitivity cs ) const { return m_string.indexOf( c, index, cs ); } inline int SString::indexOf( const QString& str, int index, Qt::CaseSensitivity cs ) const { return m_string.indexOf( str, index, cs ); } inline int SString::indexOf( const QRegExp& rx, int index ) const { return m_string.indexOf( rx, index ); } inline int SString::indexOf( const char* str, int index ) const { return m_string.indexOf( str, index ); } inline int SString::lastIndexOf( QChar c, int index, Qt::CaseSensitivity cs ) const { return m_string.lastIndexOf( c, index, cs ); } inline int SString::lastIndexOf( char c, int index, Qt::CaseSensitivity cs ) const { return m_string.lastIndexOf( c, index, cs ); } inline int SString::lastIndexOf( const QString& str, int index, Qt::CaseSensitivity cs ) const { return m_string.lastIndexOf( str, index, cs ); } inline int SString::lastIndexOf( const QRegExp& rx, int index ) const { return m_string.lastIndexOf( rx, index ); } inline int SString::lastIndexOf( const char* str, int index ) const { return m_string.lastIndexOf( str, index ); } inline bool SString::contains( QChar chr, Qt::CaseSensitivity cs ) const { return m_string.contains( chr, cs ); } inline bool SString::contains( const QString& str, Qt::CaseSensitivity cs ) const { return m_string.contains( str, cs ); } inline bool SString::contains( const QRegExp& rx ) const { return m_string.contains( rx ); } inline int SString::count( const QString& str, Qt::CaseSensitivity cs ) const { return m_string.count( str, cs ); } inline int SString::count( QChar chr, Qt::CaseSensitivity cs ) const { return m_string.count( chr, cs ); } inline int SString::count( const QRegExp& rx ) const { return m_string.count( rx ); } inline int SString::count() const { return m_string.count(); } inline bool SString::operator==( const SString& sstring ) const { return ! operator!=( sstring ); } inline bool SString::operator==( const QString& string ) const { return m_string == string; } inline bool SString::operator!=( const QString& string ) const { return m_string != string; } inline bool SString::operator<( const SString& sstring ) const { return m_string < sstring.m_string; } inline bool SString::operator<( const QString& string ) const { return m_string < string; } inline bool SString::operator<=( const SString& sstring ) const { return m_string <= sstring.m_string; } inline bool SString::operator<=( const QString& string ) const { return m_string <= string; } inline bool SString::operator>( const SString& sstring ) const { return m_string > sstring.m_string; } inline bool SString::operator>( const QString& string ) const { return m_string > string; } inline bool SString::operator>=( const SString& sstring ) const { return m_string >= sstring.m_string; } inline bool SString::operator>=( const QString& string ) const { return m_string >= string; } inline int SString::length( int index, int len ) const { return (len < 0 || (index + len) > (int)m_string.length()) ? m_string.length() - index : len; } } #endif subtitlecomposer-0.5.3/src/core/time.h0000644000175000001440000000650711151345063017166 0ustar sergiousers#ifndef SCTIME_H #define SCTIME_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include namespace SubtitleComposer { class Time { public: static const int MaxMseconds = 86399999; static const double MaxSeconds = MaxMseconds / 1000.0; /*explicit*/ Time( long mseconds=0 ); Time( int hours, int minutes, int seconds, int mseconds ); Time( const Time& time ); void setSecondsTime( double seconds ); void setMsecondsTime( long mseconds ); inline int toMillis() const { return m_mseconds; } QString toString( bool showMillis=true ) const; int hours() const; bool setHours( int hours ); int minutes() const; bool setMinutes( int hours ); int seconds() const; bool setSeconds( int seconds ); int mseconds() const; bool setMseconds( int mseconds ); void shift( long mseconds ); Time shifted( long m_seconds ) const; void adjust( long shiftMseconds, double scaleFactor ); Time adjusted( long shiftMseconds, double scaleFactor ) const; Time& operator=( const Time& time ); Time& operator=( long mseconds ); Time& operator+=( const Time& time ); Time& operator+=( long mseconds ); Time& operator-=( const Time& time ); Time& operator-=( long mseconds ); Time operator+( const Time& time ) const; Time operator+( long mseconds ) const; Time operator-( const Time& time ) const; Time operator-( long mseconds ) const; bool operator==( const Time& time ) const; bool operator==( long mseconds ) const; bool operator!=( const Time& time ) const; bool operator!=( long mseconds ) const; bool operator<( const Time& time ) const; bool operator<( long mseconds ) const; bool operator<=( const Time& time ) const; bool operator<=( long mseconds ) const; bool operator>( const Time& time ) const; bool operator>( long mseconds ) const; bool operator>=( const Time& time ) const; bool operator>=( long mseconds ) const; private: int m_mseconds; }; } #endif subtitlecomposer-0.5.3/src/core/subtitleactions.h0000644000175000001440000001021311151345063021431 0ustar sergiousers#ifndef SUBTITLEACTIONS_H #define SUBTITLEACTIONS_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "range.h" #include "rangelist.h" #include "subtitle.h" #include #include namespace SubtitleComposer { class CompositeAction; class SubtitleAction : public Action { public: typedef enum { None, Primary, Secondary, Both } DirtyMode; SubtitleAction( Subtitle& subtitle, DirtyMode dirtyMode, const QString& description=QString() ); virtual ~SubtitleAction(); inline void setLineSubtitle( SubtitleLine* line, int index ) { line->m_subtitle = &m_subtitle; line->m_cachedIndex = index; } inline void clearLineSubtitle( SubtitleLine* line ) { line->m_subtitle = 0; line->m_cachedIndex = -1; } protected: virtual void _preRedo(); virtual void _preUndo(); protected: Subtitle& m_subtitle; const DirtyMode m_dirtyMode; }; class SetFramesPerSecondAction : public SubtitleAction { public: SetFramesPerSecondAction( Subtitle& subtitle, double framesPerSecond ); virtual ~SetFramesPerSecondAction(); protected: virtual void _redo(); virtual void _undo(); virtual void _emitRedoSignals(); virtual void _emitUndoSignals(); private: double m_framesPerSecond; }; class InsertLinesAction : public SubtitleAction { public: InsertLinesAction( Subtitle& subtitle, const QList& lines, int insertIndex=-1 ); virtual ~InsertLinesAction(); protected: virtual bool mergeWithPrevious( Action* prevAction ); virtual void _redo(); virtual void _undo(); private: int m_insertIndex; int m_lastIndex; QList m_lines; }; class RemoveLinesAction : public SubtitleAction { public: RemoveLinesAction( Subtitle& subtitle, int firstIndex, int lastIndex=-1 ); virtual ~RemoveLinesAction(); protected: virtual bool mergeWithPrevious( Action* prevAction ); virtual void _redo(); virtual void _undo(); private: const int m_firstIndex; /*const*/ int m_lastIndex; QList m_lines; }; class MoveLineAction : public SubtitleAction { public: MoveLineAction( Subtitle& subtitle, int fromIndex, int toIndex=-1 ); virtual ~MoveLineAction(); protected: virtual bool mergeWithPrevious( Action* prevAction ); virtual void _redo(); virtual void _undo(); private: int m_fromIndex; int m_toIndex; }; class SwapLinesTextsAction : public SubtitleAction { public: SwapLinesTextsAction( Subtitle& subtitle, const RangeList& ranges ); virtual ~SwapLinesTextsAction(); protected: virtual void _redo(); virtual void _undo(); virtual void _emitRedoSignals(); virtual void _emitUndoSignals(); private: const RangeList m_ranges; }; } #endif subtitlecomposer-0.5.3/src/core/subtitlelineactions.cpp0000644000175000001440000002556211153636256022662 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "subtitlelineactions.h" #include "subtitle.h" #include #define PROPAGATE_LINE_SIGNALS using namespace SubtitleComposer; /// SUBTITLE LINE ACTION /// ==================== SubtitleLineAction::SubtitleLineAction( SubtitleLine& line, SubtitleAction::DirtyMode dirtyMode, const QString& description ): Action( description ), m_line( line ), m_dirtyMode( dirtyMode ) {} SubtitleLineAction::~SubtitleLineAction() {} void SubtitleLineAction::_undo() { _redo(); } void SubtitleLineAction::_preRedo() { if ( m_line.m_subtitle ) m_line.m_subtitle->incrementState( m_dirtyMode ); } void SubtitleLineAction::_preUndo() { if ( m_line.m_subtitle ) m_line.m_subtitle->decrementState( m_dirtyMode ); } void SubtitleLineAction::_emitUndoSignals() { _emitRedoSignals(); } /// SET LINE PRIMARY TEXT ACTION /// ============================ SetLinePrimaryTextAction::SetLinePrimaryTextAction( SubtitleLine& line, const SString& primaryText ): SubtitleLineAction( line, SubtitleAction::Primary, i18n( "Set Line Text" ) ), m_primaryText( primaryText ) {} SetLinePrimaryTextAction::~SetLinePrimaryTextAction() {} bool SetLinePrimaryTextAction::mergeWithPrevious( Action* pa ) { SetLinePrimaryTextAction* prevAction = tryCastToThisLineAction( pa ); if ( ! prevAction ) return false; prevAction->_preUndo(); m_primaryText = prevAction->m_primaryText; return true; } void SetLinePrimaryTextAction::_redo() { SString aux = m_line.m_primaryText; m_line.m_primaryText = m_primaryText; m_primaryText = aux; } void SetLinePrimaryTextAction::_emitRedoSignals() { m_line.emit primaryTextChanged( m_line.m_primaryText ); #ifdef PROPAGATE_LINE_SIGNALS if ( m_line.m_subtitle ) m_line.m_subtitle->emit linePrimaryTextChanged( &m_line, m_line.m_primaryText ); #endif } /// SET LINE SECONDARY TEXT ACTION /// ============================== SetLineSecondaryTextAction::SetLineSecondaryTextAction( SubtitleLine& line, const SString& secondaryText ): SubtitleLineAction( line, SubtitleAction::Secondary, i18n( "Set Line Secondary Text" ) ), m_secondaryText( secondaryText ) {} SetLineSecondaryTextAction::~SetLineSecondaryTextAction() {} bool SetLineSecondaryTextAction::mergeWithPrevious( Action* pa ) { SetLineSecondaryTextAction* prevAction = tryCastToThisLineAction( pa ); if ( ! prevAction ) return false; prevAction->_preUndo(); m_secondaryText = prevAction->m_secondaryText; return true; } void SetLineSecondaryTextAction::_redo() { SString aux = m_line.m_secondaryText; m_line.m_secondaryText = m_secondaryText; m_secondaryText = aux; } void SetLineSecondaryTextAction::_emitRedoSignals() { m_line.emit secondaryTextChanged( m_line.m_secondaryText ); #ifdef PROPAGATE_LINE_SIGNALS if ( m_line.m_subtitle ) m_line.m_subtitle->emit lineSecondaryTextChanged( &m_line, m_line.m_secondaryText ); #endif } /// SET LINE TEXTS ACTION /// ===================== SetLineTextsAction::SetLineTextsAction( SubtitleLine& line, const SString& primaryText, const SString& secondaryText ): SubtitleLineAction( line, SubtitleAction::Both, i18n( "Set Line Texts" ) ), m_primaryText( primaryText ), m_secondaryText( secondaryText ) {} SetLineTextsAction::~SetLineTextsAction() {} bool SetLineTextsAction::mergeWithPrevious( Action* pa ) { SetLineTextsAction* prevAction = tryCastToThisLineAction( pa ); if ( prevAction ) { prevAction->_preUndo(); m_primaryText = prevAction->m_primaryText; m_secondaryText = prevAction->m_secondaryText; } else { SetLinePrimaryTextAction* prevAction2 = tryCastToThisLineAction( pa ); if ( prevAction2 ) { prevAction2->_preUndo(); m_primaryText = prevAction2->m_primaryText; } else { SetLineSecondaryTextAction* prevAction3 = tryCastToThisLineAction( pa ); if ( prevAction3 ) { prevAction3->_preUndo(); m_secondaryText = prevAction3->m_secondaryText; } else return false; } } return true; } void SetLineTextsAction::_redo() { if ( m_line.m_primaryText != m_primaryText ) { SString aux = m_line.m_primaryText; m_line.m_primaryText = m_primaryText; m_primaryText = aux; } if ( m_line.m_secondaryText != m_secondaryText ) { SString aux = m_line.m_secondaryText; m_line.m_secondaryText = m_secondaryText; m_secondaryText = aux; } } void SetLineTextsAction::_emitRedoSignals() { if ( m_line.m_primaryText != m_primaryText ) { m_line.emit primaryTextChanged( m_line.m_primaryText ); #ifdef PROPAGATE_LINE_SIGNALS if ( m_line.m_subtitle ) m_line.m_subtitle->emit linePrimaryTextChanged( &m_line, m_line.m_primaryText ); #endif } if ( m_line.m_secondaryText != m_secondaryText ) { m_line.emit secondaryTextChanged( m_line.m_secondaryText ); #ifdef PROPAGATE_LINE_SIGNALS if ( m_line.m_subtitle ) m_line.m_subtitle->emit lineSecondaryTextChanged( &m_line, m_line.m_secondaryText ); #endif } } /// SET LINE SHOW TIME ACTION /// ========================= SetLineShowTimeAction::SetLineShowTimeAction( SubtitleLine& line, const Time& showTime ): SubtitleLineAction( line, SubtitleAction::Both, i18n( "Set Line Show Time" ) ), m_showTime( showTime ) {} SetLineShowTimeAction::~SetLineShowTimeAction() {} bool SetLineShowTimeAction::mergeWithPrevious( Action* pa ) { SetLineShowTimeAction* prevAction = tryCastToThisLineAction( pa ); if ( ! prevAction ) return false; prevAction->_preUndo(); m_showTime = prevAction->m_showTime; return true; } void SetLineShowTimeAction::_redo() { Time aux = m_line.m_showTime; m_line.m_showTime = m_showTime; m_showTime = aux; } void SetLineShowTimeAction::_emitRedoSignals() { m_line.emit showTimeChanged( m_line.m_showTime ); #ifdef PROPAGATE_LINE_SIGNALS if ( m_line.m_subtitle ) m_line.m_subtitle->emit lineShowTimeChanged( &m_line, m_line.m_showTime ); #endif } /// SET LINE HIDE TIME ACTION /// ========================= SetLineHideTimeAction::SetLineHideTimeAction( SubtitleLine& line, const Time& hideTime ): SubtitleLineAction( line, SubtitleAction::Both, i18n( "Set Line Hide Time" ) ), m_hideTime( hideTime ) {} SetLineHideTimeAction::~SetLineHideTimeAction() {} bool SetLineHideTimeAction::mergeWithPrevious( Action* pa ) { SetLineHideTimeAction* prevAction = tryCastToThisLineAction( pa ); if ( ! prevAction ) return false; prevAction->_preUndo(); m_hideTime = prevAction->m_hideTime; return true; } void SetLineHideTimeAction::_redo() { Time aux = m_line.m_hideTime; m_line.m_hideTime = m_hideTime; m_hideTime = aux; } void SetLineHideTimeAction::_emitRedoSignals() { m_line.emit hideTimeChanged( m_line.m_hideTime ); #ifdef PROPAGATE_LINE_SIGNALS if ( m_line.m_subtitle ) m_line.m_subtitle->emit lineHideTimeChanged( &m_line, m_line.m_hideTime ); #endif } /// SET LINE TIMES ACTION /// ===================== SetLineTimesAction::SetLineTimesAction( SubtitleLine& line, const Time& showTime, const Time& hideTime, QString description ): SubtitleLineAction( line, SubtitleAction::Both, description ), m_showTime( showTime ), m_hideTime( hideTime ) {} SetLineTimesAction::~SetLineTimesAction() {} bool SetLineTimesAction::mergeWithPrevious( Action* pa ) { SetLineTimesAction* prevAction = tryCastToThisLineAction( pa ); if ( prevAction ) { prevAction->_preUndo(); m_showTime = prevAction->m_showTime; m_hideTime = prevAction->m_hideTime; } else { SetLineHideTimeAction* prevAction2 = tryCastToThisLineAction( pa ); if ( prevAction2 ) { prevAction2->_preUndo(); m_hideTime = prevAction2->m_hideTime; } else { SetLineShowTimeAction* prevAction3 = tryCastToThisLineAction( pa ); if ( prevAction3 ) { prevAction3->_preUndo(); m_showTime = prevAction3->m_showTime; } else return false; } } return true; } void SetLineTimesAction::_redo() { if ( m_line.m_showTime != m_showTime ) { Time aux = m_line.m_showTime; m_line.m_showTime = m_showTime; m_showTime = aux; } if ( m_line.m_hideTime != m_hideTime ) { Time aux = m_line.m_hideTime; m_line.m_hideTime = m_hideTime; m_hideTime = aux; } } void SetLineTimesAction::_emitRedoSignals() { if ( m_line.m_showTime != m_showTime ) { m_line.emit showTimeChanged( m_line.m_showTime ); #ifdef PROPAGATE_LINE_SIGNALS if ( m_line.m_subtitle ) m_line.m_subtitle->emit lineShowTimeChanged( &m_line, m_line.m_showTime ); #endif } if ( m_line.m_hideTime != m_hideTime ) { m_line.emit hideTimeChanged( m_line.m_hideTime ); #ifdef PROPAGATE_LINE_SIGNALS if ( m_line.m_subtitle ) m_line.m_subtitle->emit lineHideTimeChanged( &m_line, m_line.m_hideTime ); #endif } } /// SET LINE ERRORS ACTION /// ====================== SetLineErrorsAction::SetLineErrorsAction( SubtitleLine& line, int errorFlags ): SubtitleLineAction( line, SubtitleAction::None, i18n( "Set Line Errors" ) ), m_errorFlags( errorFlags ) {} SetLineErrorsAction::~SetLineErrorsAction() {} bool SetLineErrorsAction::mergeWithPrevious( Action* pa ) { SetLineErrorsAction* prevAction = tryCastToThisLineAction( pa ); if ( ! prevAction ) return false; prevAction->_preUndo(); m_errorFlags = prevAction->m_errorFlags; return true; } void SetLineErrorsAction::_redo() { int aux = m_line.m_errorFlags; m_line.m_errorFlags = m_errorFlags; m_errorFlags = aux; } void SetLineErrorsAction::_emitRedoSignals() { m_line.emit errorFlagsChanged( m_line.m_errorFlags ); #ifdef PROPAGATE_LINE_SIGNALS if ( m_line.m_subtitle ) m_line.m_subtitle->emit lineErrorFlagsChanged( &m_line, m_line.m_errorFlags ); #endif } subtitlecomposer-0.5.3/src/core/subtitle.h0000644000175000001440000002130711153637531020064 0ustar sergiousers#ifndef SUBTITLE_H #define SUBTITLE_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "range.h" #include "rangelist.h" #include "time.h" #include "sstring.h" #include "subtitleline.h" #include "actionmanager.h" #include "formatdata.h" #include #include #include #include namespace SubtitleComposer { class CompositeAction; class Subtitle : public QObject { Q_OBJECT friend class SubtitleLine; friend class SubtitleIterator; friend class SubtitleAction; friend class SetFramesPerSecondAction; friend class InsertLinesAction; friend class RemoveLinesAction; friend class MoveLineAction; friend class SubtitleLineAction; friend class SetLinePrimaryTextAction; friend class SetLineSecondaryTextAction; friend class SetLineTextsAction; friend class SetLineShowTimeAction; friend class SetLineHideTimeAction; friend class SetLineTimesAction; friend class SetLineErrorsAction; friend class ToggleLineMarkedAction; friend class SubtitleCompositeActionExecutor; friend class Format; friend class InputFormat; public: typedef enum { Primary = SubtitleLine::Primary, Secondary = SubtitleLine::Secondary, Both = SubtitleLine::Both, TextTargetSIZE = SubtitleLine::TextTargetSIZE } TextTarget; static double defaultFramesPerSecond(); static void setDefaultFramesPerSecond( double framesPerSecond ); Subtitle( double framesPerSecond=defaultFramesPerSecond() ); virtual ~Subtitle(); /// primary data includes primary text, timing information, format data and all errors except secondary only errors void setPrimaryData( const Subtitle& from, bool usePrimaryTexts ); void clearPrimaryTextData(); /// secondary data includes secondary text and secondary only errors void setSecondaryData( const Subtitle& from, bool usePrimaryData ); void clearSecondaryTextData(); bool isPrimaryDirty() const; void clearPrimaryDirty(); bool isSecondaryDirty() const; void clearSecondaryDirty(); ActionManager& actionManager(); const ActionManager& actionManager() const; double framesPerSecond() const; void setFramesPerSecond( double framesPerSecond ); void changeFramesPerSecond( double toFramesPerSecond, double fromFramesPerSecond=-1.0 ); bool isEmpty() const; int linesCount() const; int lastIndex() const; SubtitleLine* line( int index ); const SubtitleLine* line( int index ) const; SubtitleLine* firstLine(); const SubtitleLine* firstLine() const; SubtitleLine* lastLine(); const SubtitleLine* lastLine() const; void insertLine( SubtitleLine* line, int index=-1 ); void insertLines( const QList& lines, int index=-1 ); SubtitleLine* insertNewLine( int index, bool timeAfter, TextTarget target ); void removeLines( const RangeList& ranges, TextTarget target ); void swapTexts( const RangeList& ranges ); void splitLines( const RangeList& ranges ); void joinLines( const RangeList& ranges ); void shiftLines( const RangeList& ranges, long msecs ); void adjustLines( const Range& range, long firstTime, long lastTime ); void sortLines( const Range& range ); void applyDurationLimits( const RangeList& ranges, const Time& minDuration, const Time&maxDuration, bool canOverlap ); void setMaximumDurations( const RangeList& ranges ); void setAutoDurations( const RangeList& ranges, int msecsPerChar, int msecsPerWord, int msecsPerLine, bool canOverlap, TextTarget calculationTarget ); void fixOverlappingLines( const RangeList& ranges, const Time& minInterval=100 ); void fixPunctuation( const RangeList& ranges, bool spaces, bool quotes, bool englishI, bool ellipsis, TextTarget target ); void lowerCase( const RangeList& ranges, TextTarget target ); void upperCase( const RangeList& ranges, TextTarget target ); void titleCase( const RangeList& ranges, bool lowerFirst, TextTarget target ); void sentenceCase( const RangeList& ranges, bool lowerFirst, TextTarget target ); void breakLines( const RangeList& ranges, unsigned minLengthForLineBreak, TextTarget target ); void unbreakTexts( const RangeList& ranges, TextTarget target ); void simplifyTextWhiteSpace( const RangeList& ranges, TextTarget target ); void syncWithSubtitle( const Subtitle& refSubtitle ); void appendSubtitle( const Subtitle& srcSubtitle, long shiftMsecsBeforeAppend ); void splitSubtitle( Subtitle& dstSubtitle, const Time& splitTime, bool shiftSplittedLines ); void setStyleFlags( const RangeList& ranges, int styleFlags ); void setStyleFlags( const RangeList& ranges, int styleFlags, bool on ); void toggleStyleFlag( const RangeList& ranges, SString::StyleFlag styleFlag ); void setMarked( const RangeList& ranges, bool value ); void toggleMarked( const RangeList& ranges ); void clearErrors( const RangeList& ranges, int errorFlags ); void checkErrors( const RangeList& ranges, int errorFlags, int minDurationMsecs, int maxDurationMsecs, int minMsecsPerChar, int maxMsecsPerChar, int maxChars, int maxLines ); void recheckErrors( const RangeList& ranges, int minDurationMsecs, int maxDurationMsecs, int minMsecsPerChar, int maxMsecsPerChar, int maxChars, int maxLines ); signals: void primaryDirtyStateChanged( bool dirty ); void secondaryDirtyStateChanged( bool dirty ); void framesPerSecondChanged( double fps ); void linesAboutToBeInserted( int firstIndex, int lastIndex ); void linesInserted( int firstIndex, int lastIndex ); void linesAboutToBeRemoved( int firstIndex, int lastIndex ); void linesRemoved( int firstIndex, int lastIndex ); /// forwarded line signals void linePrimaryTextChanged( SubtitleLine* line, const SString& text ); void lineSecondaryTextChanged( SubtitleLine* line, const SString& text ); void lineShowTimeChanged( SubtitleLine* line, const Time& showTime ); void lineHideTimeChanged( SubtitleLine* line, const Time& hideTime ); void lineErrorFlagsChanged( SubtitleLine* line, int errorFlags ); void lineMarkChanged( SubtitleLine* line, bool marked ); private: FormatData* const formatData() const; void setFormatData( const FormatData* formatData ); void beginCompositeAction( const QString& title, bool immediateExecution=true, bool delaySignals=true ); void endCompositeAction(); void processAction( Action* action ); void incrementState( int dirtyMode ); void decrementState( int dirtyMode ); inline int normalizeRangeIndex( int index ) const { return index >= m_lines.count() ? m_lines.count() - 1 : index; } void setLastValidCachedIndex( int lastValidCachedIndex ); private: ActionManager m_actionManager; int m_primaryState; int m_primaryCleanState; int m_secondaryState; int m_secondaryCleanState; CompositeAction* m_compositeAction; int m_compositeActionDepth; double m_framesPerSecond; mutable QList m_lines; int m_lastValidCachedIndex; // all SubtitleLines with a m_cachedIndex greater // than this value have to recalculate its value // when asked about their index() value. FormatData* m_formatData; static double s_defaultFramesPerSecond; }; class SubtitleCompositeActionExecutor { public: SubtitleCompositeActionExecutor( Subtitle& subtitle, const QString& title ); ~SubtitleCompositeActionExecutor(); private: Subtitle& m_subtitle; }; } #endif subtitlecomposer-0.5.3/src/core/subtitleline.h0000644000175000001440000002553011153127407020732 0ustar sergiousers#ifndef SUBTITLELINE_H #define SUBTITLELINE_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "action.h" #include "sstring.h" #include "time.h" #include "formatdata.h" #include #include namespace SubtitleComposer { class Subtitle; class SubtitleLine : public QObject { Q_OBJECT friend class Subtitle; friend class SubtitleAction; friend class SwapLinesTextsAction; friend class SubtitleLineAction; friend class SetLinePrimaryTextAction; friend class SetLineSecondaryTextAction; friend class SetLineTextsAction; friend class SetLineShowTimeAction; friend class SetLineHideTimeAction; friend class SetLineTimesAction; friend class SetLineStyleFlagsAction; friend class SetLineErrorsAction; friend class ToggleLineMarkedAction; friend class Format; public: typedef enum { Primary = 0, Secondary, Both, TextTargetSIZE } TextTarget; typedef enum { EmptyPrimaryTextID = 0, // Empty primary text EmptySecondaryTextID, // Empty secondary text MaxPrimaryCharsID, // Too many characters in primary text MaxSecondaryCharsID, // Too many characters in secondary text MaxPrimaryLinesID, // Too many line breaks in primary text MaxSecondaryLinesID, // Too many line breaks in secondary text PrimaryUnneededSpacesID, // Unnecessary spaces in primary text SecondaryUnneededSpacesID, // Unnecessary spaces in secondary text PrimaryUnneededDashID, // Unnecessary dash (-) in primary text SecondaryUnneededDashID, // Unnecessary dash (-) in secondary text PrimaryCapitalAfterEllipsisID, // Capital letter after ellipsis in primary text SecondaryCapitalAfterEllipsisID, // Capital letter after ellipsis in secondary text MinDurationPerPrimaryCharID , // Too short duration per primary text character MinDurationPerSecondaryCharID, // Too short duration per secondary text character MaxDurationPerPrimaryCharID , // Too long duration per primary text character MaxDurationPerSecondaryCharID, // Too long duration per secondary text character MinDurationID, // Too short duration MaxDurationID, // Too long duration OverlapsWithNextID, // Overlaps with next line UntranslatedTextID, // Primary and translation text are the same UserMarkID, ErrorSIZE, ErrorUNKNOWN } ErrorID; typedef enum { EmptyPrimaryText = 0x1 << EmptyPrimaryTextID, EmptySecondaryText = 0x1 << EmptySecondaryTextID, MaxPrimaryChars = 0x1 << MaxPrimaryCharsID, MaxSecondaryChars = 0x1 << MaxSecondaryCharsID, MaxPrimaryLines = 0x1 << MaxPrimaryLinesID, MaxSecondaryLines = 0x1 << MaxSecondaryLinesID, PrimaryUnneededSpaces = 0x1 << PrimaryUnneededSpacesID, SecondaryUnneededSpaces = 0x1 << SecondaryUnneededSpacesID, PrimaryUnneededDash = 0x1 << PrimaryUnneededDashID, SecondaryUnneededDash = 0x1 << SecondaryUnneededDashID, PrimaryCapitalAfterEllipsis = 0x1 << PrimaryCapitalAfterEllipsisID, SecondaryCapitalAfterEllipsis = 0x1 << SecondaryCapitalAfterEllipsisID, MinDurationPerPrimaryChar = 0x1 << MinDurationPerPrimaryCharID, MinDurationPerSecondaryChar = 0x1 << MinDurationPerSecondaryCharID, MaxDurationPerPrimaryChar = 0x1 << MaxDurationPerPrimaryCharID, MaxDurationPerSecondaryChar = 0x1 << MaxDurationPerSecondaryCharID, MinDuration = 0x1 << MinDurationID, MaxDuration = 0x1 << MaxDurationID, OverlapsWithNext = 0x1 << OverlapsWithNextID, UntranslatedText = 0x1 << UntranslatedTextID, UserMark = 0x1 << UserMarkID, PrimaryOnlyErrors = EmptyPrimaryText|MaxPrimaryChars|MaxPrimaryLines|PrimaryUnneededSpaces| PrimaryUnneededDash|PrimaryCapitalAfterEllipsis|MinDurationPerPrimaryChar| MaxDurationPerPrimaryChar, SecondaryOnlyErrors = EmptySecondaryText|MaxSecondaryChars|MaxSecondaryLines|SecondaryUnneededSpaces| SecondaryUnneededDash|SecondaryCapitalAfterEllipsis|MinDurationPerSecondaryChar| MaxDurationPerSecondaryChar|UntranslatedText, SharedErrors = MinDuration|MaxDuration|OverlapsWithNext|UserMark, AllErrors = PrimaryOnlyErrors|SecondaryOnlyErrors|SharedErrors, TimesErrors = MinDuration|MaxDuration|MinDurationPerPrimaryChar|MinDurationPerSecondaryChar| MaxDurationPerPrimaryChar|MaxDurationPerSecondaryChar|OverlapsWithNext, TextErrors = EmptyPrimaryText|EmptySecondaryText|MaxPrimaryChars|MaxSecondaryChars| MaxPrimaryLines|MaxSecondaryLines|PrimaryUnneededSpaces|SecondaryUnneededSpaces| PrimaryUnneededDash|SecondaryUnneededDash|PrimaryCapitalAfterEllipsis| SecondaryCapitalAfterEllipsis|MinDurationPerPrimaryChar|MinDurationPerSecondaryChar| MaxDurationPerPrimaryChar|MaxDurationPerSecondaryChar|UntranslatedText, } ErrorFlag; static int bitsCount( unsigned int bitFlags ); static ErrorFlag errorFlag( ErrorID id ); static ErrorID errorID( ErrorFlag flag ); static const QString& simpleErrorText( SubtitleLine::ErrorFlag errorFlag ); static const QString& simpleErrorText( SubtitleLine::ErrorID errorID ); QString fullErrorText( SubtitleLine::ErrorFlag errorFlag ) const; QString fullErrorText( SubtitleLine::ErrorID errorID ) const; explicit SubtitleLine( const SString& pText=SString(), const SString& sText=SString() ); SubtitleLine( const SString& pText, const Time& showTime, const Time& hideTime ); SubtitleLine( const SString& pText, const SString& sText, const Time& showTime, const Time& hideTime ); SubtitleLine( const SubtitleLine& line ); SubtitleLine& operator=( const SubtitleLine& line ); virtual ~SubtitleLine(); int number() const; int index() const; Subtitle* subtitle(); const Subtitle* subtitle() const; SubtitleLine* prevLine(); SubtitleLine* nextLine(); const SString& primaryText() const; void setPrimaryText( const SString& pText ); const SString& secondaryText() const; void setSecondaryText( const SString& sText ); void setTexts( const SString& pText, const SString& sText ); static SString fixPunctuation(const SString& text, bool spaces, bool quotes, bool englishI, bool ellipsis, bool*cont); static SString breakText( const SString& text, int minLengthForBreak ); static QString simplifyTextWhiteSpace( QString text ); static SString simplifyTextWhiteSpace( SString text ); void breakText( int minLengthForBreak, TextTarget target ); void unbreakText( TextTarget target ); void simplifyTextWhiteSpace( TextTarget target ); Time showTime() const; void setShowTime( const Time& showTime ); Time hideTime() const; void setHideTime( const Time& hideTime ); Time durationTime() const; void setDurationTime( const Time& durationTime ); void setTimes( const Time& showTime, const Time& hideTime ); int primaryCharacters() const; int primaryWords() const; int primaryLines() const; int secondaryCharacters() const; int secondaryWords() const; int secondaryLines() const; static Time autoDuration( const QString& text, int msecsPerChar, int msecsPerWord, int msecsPerLine ); Time autoDuration( int msecsPerChar, int msecsPerWord, int msecsPerLine, TextTarget calculationTarget ); void shiftTimes( long mseconds ); void adjustTimes( long shiftMseconds, double scaleFactor ); int errorFlags() const; int errorCount() const; void setErrorFlags( int errorFlags ); void setErrorFlags( int errorFlags, bool value ); bool checkEmptyPrimaryText( bool update=true ); bool checkEmptySecondaryText( bool update=true ); bool checkUntranslatedText( bool update=true ); bool checkOverlapsWithNext( bool update=true ); bool checkMinDuration( int minMsecs, bool update=true ); bool checkMaxDuration( int maxMsecs, bool update=true ); bool checkMinDurationPerPrimaryChar( int minMsecsPerChar, bool update=true ); bool checkMinDurationPerSecondaryChar( int minMsecsPerChar, bool update=true ); bool checkMaxDurationPerPrimaryChar( int maxMsecsPerChar, bool update=true ); bool checkMaxDurationPerSecondaryChar( int maxMsecsPerChar, bool update=true ); bool checkMaxPrimaryChars( int maxCharacters, bool update=true ); bool checkMaxSecondaryChars( int maxCharacters, bool update=true ); bool checkMaxPrimaryLines( int maxLines, bool update=true ); bool checkMaxSecondaryLines( int maxLines, bool update=true ); bool checkPrimaryUnneededSpaces( bool update=true ); bool checkSecondaryUnneededSpaces( bool update=true ); bool checkPrimaryCapitalAfterEllipsis( bool update=true ); bool checkSecondaryCapitalAfterEllipsis( bool update=true ); bool checkPrimaryUnneededDash( bool update=true ); bool checkSecondaryUnneededDash( bool update=true ); int check( int errorFlagsToCheck, int minDurationMsecs, int maxDurationMsecs, int minMsecsPerChar, int maxMsecsPerChar, int maxChars, int maxLines, bool update=true ); signals: void primaryTextChanged( const SString& text ); void secondaryTextChanged( const SString& text ); void showTimeChanged( const Time& showTime ); void hideTimeChanged( const Time& hideTime ); void errorFlagsChanged( int errorFlags ); private: FormatData* const formatData() const; void setFormatData( const FormatData* formatData ); void processAction( Action* action ); private: Subtitle* m_subtitle; SString m_primaryText; SString m_secondaryText; Time m_showTime; Time m_hideTime; int m_errorFlags; int m_cachedIndex; FormatData* m_formatData; }; } #endif subtitlecomposer-0.5.3/src/core/action.h0000644000175000001440000000700711151345063017501 0ustar sergiousers#ifndef ACTION_H #define ACTION_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include namespace SubtitleComposer { class Action { typedef enum { Executed = 0x1, // Action executed at least once Done = 0x2, // Action executed an odd number of times (it can be undone) } State; friend class ActionManager; friend class CompositeAction; public: Action( const QString& description=QString() ): m_description( description ), m_state( 0 ) {} virtual ~Action() {} inline const QString& description() const { return m_description; } /// true if action has been executed at least once inline bool executed() { return m_state & Executed; } /// true if action can be undone inline bool done() { return m_state & Done; } void redo() { _redo( true ); } void undo() { _undo( true ); } protected: template T* tryCastTo( Action* action ) { try { return dynamic_cast( action ); } catch( const std::bad_cast& ) { return 0; } } /// when this method is called both the callee and the action parameter have been executed /// so, if the callee can be merged with the previous action, it must recover the state /// previous to execution of both actions and return true (if the actions can't be merged, /// just return false). inline virtual bool mergeWithPrevious( Action* /*action*/ ) { return false; } void _redo( bool emitSignals ) { if ( ! (m_state & Done) ) { _preRedo(); _redo(); if ( emitSignals ) _emitRedoSignals(); m_state |= Executed|Done; } } void _undo( bool emitSignals ) { if ( m_state & Done ) { _preUndo(); _undo(); if ( emitSignals ) _emitUndoSignals(); m_state &= ~Done; } } virtual void _redo() = 0; virtual void _undo() = 0; virtual void _preRedo() {}; virtual void _preUndo() {}; virtual void _emitRedoSignals() {}; virtual void _emitUndoSignals() {}; protected: QString m_description; private: int m_state; }; } #endif subtitlecomposer-0.5.3/src/core/subtitleline.cpp0000644000175000001440000007156211153127407021273 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "subtitleline.h" #include "subtitlelineactions.h" #include "subtitle.h" #include #include #include using namespace SubtitleComposer; /// "magic" code taken from http://tekpool.wordpress.com/category/bit-count/ int SubtitleLine::bitsCount( unsigned int u ) { unsigned int uCount; uCount = u - ((u >> 1) & 033333333333) - ((u >> 2) & 011111111111); return ((uCount + (uCount >> 3)) & 030707070707) % 63; } SubtitleLine::ErrorFlag SubtitleLine::errorFlag( SubtitleLine::ErrorID id ) { if ( id < 0 || id >= ErrorSIZE ) return (ErrorFlag)0; return (ErrorFlag)(0x1 << id); } SubtitleLine::ErrorID SubtitleLine::errorID( SubtitleLine::ErrorFlag flag ) { if ( flag < 1 ) return ErrorUNKNOWN; int id = (int)log2( flag ); return id < ErrorSIZE ? (ErrorID)id : ErrorUNKNOWN; } /// ERRORS DESCRIPTIONS /// =================== const QString& SubtitleLine::simpleErrorText( SubtitleLine::ErrorFlag errorFlag ) { return simpleErrorText( errorID( errorFlag ) ); } const QString& SubtitleLine::simpleErrorText( SubtitleLine::ErrorID errorID ) { static const QString empty; static QString texts[ErrorSIZE]; if ( texts[EmptyPrimaryTextID].isEmpty() ) { texts[EmptyPrimaryTextID] = i18n( "Empty text" ); texts[EmptySecondaryTextID] = texts[EmptySecondaryTextID - 1]; texts[MaxPrimaryCharsID] = i18n( "Too many characters" ); texts[MaxSecondaryCharsID] = texts[MaxSecondaryCharsID - 1]; texts[MaxPrimaryLinesID] = i18n( "Too many lines" ); texts[MaxSecondaryLinesID] = texts[MaxSecondaryLinesID - 1]; texts[PrimaryUnneededSpacesID] = i18n( "Unnecessary white space" ); texts[SecondaryUnneededSpacesID] = texts[SecondaryUnneededSpacesID - 1]; texts[PrimaryUnneededDashID] = i18n( "Unnecessary dash" ); texts[SecondaryUnneededDashID] = texts[SecondaryUnneededDashID - 1]; texts[PrimaryCapitalAfterEllipsisID] = i18n( "Capital letter after continuation ellipsis" ); texts[SecondaryCapitalAfterEllipsisID] = texts[SecondaryCapitalAfterEllipsisID - 1]; texts[MaxDurationPerPrimaryCharID] = i18n( "Too long duration per character" ); texts[MaxDurationPerSecondaryCharID] = texts[MaxDurationPerSecondaryCharID - 1]; texts[MinDurationPerPrimaryCharID] = i18n( "Too short duration per character" ); texts[MinDurationPerSecondaryCharID] = texts[MinDurationPerSecondaryCharID - 1]; texts[MaxDurationID] = i18n( "Too long duration" ); texts[MinDurationID] = i18n( "Too short duration" ); texts[OverlapsWithNextID] = i18n( "Overlapping times" ); texts[UntranslatedTextID] = i18n( "Untranslated text" ); texts[UserMarkID] = i18n( "User mark" ); } return ( errorID < 0 || errorID >= ErrorSIZE ) ? empty : texts[errorID]; } QString SubtitleLine::fullErrorText( SubtitleLine::ErrorFlag errorFlag ) const { return fullErrorText( errorID( errorFlag ) ); } QString SubtitleLine::fullErrorText( SubtitleLine::ErrorID errorID ) const { if ( ! (m_errorFlags & (0x1 << errorID)) ) return QString(); switch ( errorID ) { case EmptyPrimaryTextID: return i18n( "Has no primary text." ); case EmptySecondaryTextID: return i18n( "Has no translation text." ); case MaxPrimaryCharsID: return i18np( "Has too many characters in primary text (1 char).", "Has too many characters in primary text (%1 chars).", primaryCharacters() ); case MaxSecondaryCharsID: return i18np( "Has too many characters in translation text (1 char).", "Has too many characters in translation text (%1 chars).", secondaryCharacters() ); case MaxPrimaryLinesID: return i18np( "Has too many lines in primary text (1 line).", "Has too many lines in primary text (%1 lines).", primaryLines() ); case MaxSecondaryLinesID: return i18np( "Has too many lines in translation text (1 line).", "Has too many lines in translation text (%1 lines).", secondaryLines() ); case PrimaryUnneededSpacesID: return i18n( "Has unnecessary spaces in primary text." ); case SecondaryUnneededSpacesID: return i18n( "Has unnecessary spaces in translation text." ); case PrimaryUnneededDashID: return i18n( "Has unnecessary dash in primary text." ); case SecondaryUnneededDashID: return i18n( "Has unnecessary dash in translation text." ); case PrimaryCapitalAfterEllipsisID: return i18n( "Has capital letter after line continuation ellipsis in primary text." ); case SecondaryCapitalAfterEllipsisID: return i18n( "Has capital letter after line continuation ellipsis in translation text." ); case MaxDurationPerPrimaryCharID: return i18np( "Has too long duration per character in primary text (1 msec/char).", "Has too long duration per character in primary text (%1 msecs/char).", durationTime().toMillis()/primaryCharacters() ); case MaxDurationPerSecondaryCharID: return i18np( "Has too long duration per character in translation text (1 msec/char).", "Has too long duration per character in translation text (%1 msecs/char).", durationTime().toMillis()/secondaryCharacters() ); case MinDurationPerPrimaryCharID: return i18np( "Has too short duration per character in primary text (1 msec/char).", "Has too short duration per character in primary text (%1 msecs/char).", durationTime().toMillis()/primaryCharacters() ); case MinDurationPerSecondaryCharID: return i18np( "Has too short duration per character in translation text (1 msec/char).", "Has too short duration per character in translation text (%1 msecs/char).", durationTime().toMillis()/secondaryCharacters() ); case MaxDurationID: return i18np( "Has too long duration (1 msec).", "Has too long duration (%1 msecs).", durationTime().toMillis() ); case MinDurationID: return i18np( "Has too short duration (1 msec).", "Has too short duration (%1 msecs).", durationTime().toMillis() ); case OverlapsWithNextID: return i18n( "Overlaps with next line." ); case UntranslatedTextID: return i18n( "Has untranslated text." ); case UserMarkID: return i18n( "Has user mark." ); default: return QString(); } } SubtitleLine::SubtitleLine( const SString& pText, const SString& sText ): QObject(), m_subtitle( 0 ), m_primaryText( pText ), m_secondaryText( sText ), m_showTime(), m_hideTime(), m_errorFlags( 0 ), m_cachedIndex( -1 ), m_formatData( 0 ) { } SubtitleLine::SubtitleLine( const SString& pText, const Time& showTime, const Time& hideTime ): QObject(), m_subtitle( 0 ), m_primaryText( pText ), m_secondaryText( QString() ), m_showTime( showTime ), m_hideTime( hideTime ), m_errorFlags( 0 ), m_cachedIndex( -1 ), m_formatData( 0 ) { } SubtitleLine::SubtitleLine( const SString& pText, const SString& sText, const Time& showTime, const Time& hideTime ): QObject(), m_subtitle( 0 ), m_primaryText( pText ), m_secondaryText( sText ), m_showTime( showTime ), m_hideTime( hideTime ), m_errorFlags( 0 ), m_cachedIndex( -1 ), m_formatData( 0 ) { } SubtitleLine::SubtitleLine( const SubtitleLine& line ): QObject(), m_subtitle( 0 ), m_primaryText( line.m_primaryText ), m_secondaryText( line.m_secondaryText ), m_showTime( line.m_showTime ), m_hideTime( line.m_hideTime ), m_errorFlags( line.m_errorFlags ), m_cachedIndex( -1 ), m_formatData( 0 ) { } SubtitleLine& SubtitleLine::operator=( const SubtitleLine& line ) { if ( this == &line ) return *this; m_primaryText = line.m_primaryText; m_secondaryText = line.m_secondaryText; m_showTime = line.m_showTime; m_hideTime = line.m_hideTime; m_errorFlags = line.m_errorFlags; return *this; } SubtitleLine::~SubtitleLine() { delete m_formatData; } FormatData* const SubtitleLine::formatData() const { return m_formatData; } void SubtitleLine::setFormatData( const FormatData* formatData ) { delete m_formatData; m_formatData = formatData ? new FormatData( *formatData ) : 0; } int SubtitleLine::number() const { return index() + 1; } int SubtitleLine::index() const { if ( ! m_subtitle ) return -1; if ( m_cachedIndex < 0 || (m_cachedIndex > m_subtitle->m_lastValidCachedIndex) ) { SubtitleLine* line; for ( int index = m_subtitle->m_lastValidCachedIndex + 1, size = m_subtitle->m_lines.count(); index < size; ++index ) { line = m_subtitle->m_lines.at( index ); line->m_cachedIndex = index; if ( line == this ) { m_subtitle->setLastValidCachedIndex( index ); break; } } //kDebug() << "searched index"; } //kDebug() << "index" << m_index << "| text" << m_primaryText.string(); return m_cachedIndex; } Subtitle* SubtitleLine::subtitle() { return m_subtitle; } const Subtitle* SubtitleLine::subtitle() const { return m_subtitle; } SubtitleLine* SubtitleLine::prevLine() { return m_subtitle ? m_subtitle->line( index() - 1 ) : 0; } SubtitleLine* SubtitleLine::nextLine() { return m_subtitle ? m_subtitle->line( index() + 1 ) : 0; } const SString& SubtitleLine::primaryText() const { return m_primaryText; } void SubtitleLine::setPrimaryText( const SString& pText ) { if ( m_primaryText != pText ) processAction( new SetLinePrimaryTextAction( *this, pText ) ); } const SString& SubtitleLine::secondaryText() const { return m_secondaryText; } void SubtitleLine::setSecondaryText( const SString& sText ) { if ( m_secondaryText != sText ) processAction( new SetLineSecondaryTextAction( *this, sText ) ); } void SubtitleLine::setTexts( const SString& pText, const SString& sText ) { if ( m_primaryText != pText || m_secondaryText != sText ) processAction( new SetLineTextsAction( *this, pText, sText ) ); } SString SubtitleLine::fixPunctuation( const SString& t, bool spaces, bool quotes, bool englishI, bool ellipsis, bool* cont ) { if ( ! t.length() ) return t; SString text( t ); if ( spaces ) { text = simplifyTextWhiteSpace( text ); // remove spaces after " or ' at the beginning of line text.replace( QRegExp( "^([\"'])\\s" ), "\\1" ); // remove space before " or ' at the end of line text.replace( QRegExp( "\\s([\"'])$" ), "\\1" ); // if not present, add space after '?', '!', ',', ';', ':', ')' and ']' text.replace( QRegExp( "([\\?!,;:\\)\\]])([^\\s\"'])" ), "\\1 \\2" ); // if not present, add space after '.' text.replace( QRegExp( "(\\.)([^\\s\\.\"'])" ), "\\1 \\2" ); // remove space after '¿', '¡', '(' and '[' text.replace( QRegExp( "([¿¡\\(\\[])\\s" ), "\\1" ); // remove space before '?', '!', ',', ';', ':', '.', ')' and ']' text.replace( QRegExp( "\\s([\\?!,;:\\.\\)\\]])" ), "\\1" ); // remove space after ... at the beginning of sentence text.replace( QRegExp( "^\\.\\.\\.?\\s" ), "..." ); } if ( quotes ) // quotes and double quotes { text.replace( QRegExp( "`|´|’" ), "'" ); text.replace( QRegExp( "''|«|»" ), "\"" ); } if ( englishI ) // fix english I pronoun capitalization text.replace( QRegExp( "([\\s\"'\\(\\[])i([\\s'\",;:\\.\\?!\\]\\)]|$)" ), "\\1I\\2" ); if ( ellipsis ) // fix ellipsis { text.replace( QRegExp( "[,;]?\\.{2,}" ), "..." ); text.replace( QRegExp( "[,;]\\s*$" ), "..." ); if ( text.indexOf( QRegExp( "[\\.:?!\\)\\]'\\\"]$" ) ) == -1 ) text.append( "..." ); if ( cont ) { if ( *cont && text.indexOf( QRegExp( "^\\s*\\.{3}[^\\.]?" ) ) == -1 ) text.replace( QRegExp( "^\\s*\\.*\\s*" ), "..." ); *cont = text.indexOf( QRegExp( "\\.{3,3}\\s*$" ) ) != -1; } } else { if ( cont ) { *cont = text.indexOf( QRegExp( "[?!\\)\\]'\\\"]\\s*$" ) ) == -1; if ( ! *cont ) *cont = text.indexOf( QRegExp( "[^\\.]?\\.\\s*$" ) ) == -1; } } return text; } SString SubtitleLine::breakText( const SString& t, int minLengthForBreak ) { Q_ASSERT( minLengthForBreak >= 0 ); SString text( t ); text.replace( '\n', ' ' ); if ( text.length() <= minLengthForBreak ) return text; static const QRegExp spaceRegExp( "[^ \t\n][ \t\n]" ); // this is a fricking test case // this is a fri|cking test case IDEAL: 13 // this is a| fricking test case LOWER: 10 <-- // this is a fricking| test case UPPER: 18 int position = text.length()/2; int lowerPosition = text.lastIndexOf( spaceRegExp, position ); int upperPosition = text.indexOf( spaceRegExp, position ); if ( (lowerPosition == -1 || lowerPosition == 0) && (upperPosition == -1 || upperPosition == (text.length()-1)) ) return text; else if ( position - lowerPosition <= upperPosition - position ) position = lowerPosition; else position = upperPosition; position++; text.insert( position, "\n" ); position++; while ( text.at( position ).isSpace() && position < text.length() ) text.remove( position, 1 ); return text; } void SubtitleLine::breakText( int minLengthForBreak, TextTarget target ) { switch ( target ) { case Primary: setPrimaryText( breakText( m_primaryText, minLengthForBreak ) ); break; case Secondary: setSecondaryText( breakText( m_secondaryText, minLengthForBreak ) ); break; case Both: setTexts( breakText( m_primaryText, minLengthForBreak ), breakText( m_secondaryText, minLengthForBreak ) ); break; default: break; } } void SubtitleLine::unbreakText( TextTarget target ) { switch ( target ) { case Primary: setPrimaryText( SString( primaryText() ).replace( '\n', ' ' ) ); break; case Secondary: setSecondaryText( SString( secondaryText() ).replace( '\n', ' ' ) ); break; case Both: setTexts( SString( primaryText() ).replace( '\n', ' ' ), SString( secondaryText() ).replace( '\n', ' ' ) ); break; default: break; } } QString SubtitleLine::simplifyTextWhiteSpace( QString text ) { static const QRegExp regExp1( " *\n *" ); static const QRegExp regExp2( " +" ); static const QRegExp regExp3( "\n+" ); text.replace( '\t', ' ' ); text.replace( regExp1, "\n" ); text.replace( regExp2, " " ); text.replace( regExp3, "\n" ); return text.trimmed(); } SString SubtitleLine::simplifyTextWhiteSpace( SString text ) { static const QRegExp regExp1( " *\n *" ); static const QRegExp regExp2( " +" ); static const QRegExp regExp3( "\n+" ); text.replace( '\t', ' ' ); text.replace( regExp1, "\n" ); text.replace( regExp2, " " ); text.replace( regExp3, "\n" ); return text.trimmed(); } void SubtitleLine::simplifyTextWhiteSpace( TextTarget target ) { switch ( target ) { case Primary: setPrimaryText( simplifyTextWhiteSpace( m_primaryText ) ); break; case Secondary: setSecondaryText( simplifyTextWhiteSpace( m_secondaryText ) ); break; case Both: setTexts( simplifyTextWhiteSpace( m_primaryText ), simplifyTextWhiteSpace( m_secondaryText ) ); break; default: break; } } Time SubtitleLine::showTime() const { return m_showTime; } void SubtitleLine::setShowTime( const Time& showTime ) { if ( m_showTime != showTime ) processAction( new SetLineShowTimeAction( *this, showTime ) ); } Time SubtitleLine::hideTime() const { return m_hideTime; } void SubtitleLine::setHideTime( const Time& hideTime ) { if ( m_hideTime != hideTime ) processAction( new SetLineHideTimeAction( *this, hideTime ) ); } Time SubtitleLine::durationTime() const { return Time( m_hideTime.toMillis() - m_showTime.toMillis() ); } void SubtitleLine::setDurationTime( const Time& durationTime ) { setHideTime( m_showTime + durationTime ); } int SubtitleLine::primaryCharacters() const { return m_primaryText.string().simplified().length(); } int SubtitleLine::primaryWords() const { QString text( m_primaryText.string().simplified() ); return text.length() ? text.count( ' ' ) + 1 : 0; } int SubtitleLine::primaryLines() const { QString text( simplifyTextWhiteSpace( m_primaryText.string() ) ); return text.length() ? text.count( '\n' ) + 1 : 0; } int SubtitleLine::secondaryCharacters() const { return m_secondaryText.string().simplified().length(); } int SubtitleLine::secondaryWords() const { QString text( m_secondaryText.string().simplified() ); return text.length() ? text.count( ' ' ) + 1 : 0; } int SubtitleLine::secondaryLines() const { QString text( simplifyTextWhiteSpace( m_secondaryText.string() ) ); return text.length() ? text.count( '\n' ) + 1 : 0; } Time SubtitleLine::autoDuration( const QString& t, int msecsPerChar, int msecsPerWord, int msecsPerLine ) { Q_ASSERT( msecsPerChar >= 0 ); Q_ASSERT( msecsPerWord >= 0 ); Q_ASSERT( msecsPerLine >= 0 ); QString text( simplifyTextWhiteSpace( t ) ); if ( ! text.length() ) return 0; int chars = text.length(); int lines = text.count( '\n' ) + 1; int words = text.count( ' ' ) + lines; return chars*msecsPerChar + words*msecsPerWord + lines*msecsPerLine; } Time SubtitleLine::autoDuration( int msecsPerChar, int msecsPerWord, int msecsPerLine, TextTarget calculationTarget ) { switch ( calculationTarget ) { case Secondary: return autoDuration( m_secondaryText.string(), msecsPerChar, msecsPerWord, msecsPerLine ); case Both: { Time primary = autoDuration( m_primaryText.string(), msecsPerChar, msecsPerWord, msecsPerLine ); Time secondary = autoDuration( m_secondaryText.string(), msecsPerChar, msecsPerWord, msecsPerLine ); return primary > secondary ? primary : secondary; } case Primary: default: return autoDuration( m_primaryText.string(), msecsPerChar, msecsPerWord, msecsPerLine ); } } void SubtitleLine::setTimes( const Time& showTime, const Time& hideTime ) { if ( m_showTime != showTime || m_hideTime != hideTime ) processAction( new SetLineTimesAction( *this, showTime, hideTime, i18n( "Set Line Times" ) ) ); } void SubtitleLine::shiftTimes( long mseconds ) { if ( mseconds ) processAction( new SetLineTimesAction( *this, Time( m_showTime.toMillis() + mseconds ), Time( m_hideTime.toMillis() + mseconds ), i18n( "Shift Line Times" ) ) ); } void SubtitleLine::adjustTimes( long shiftMseconds, double scaleFactor ) { if ( shiftMseconds || scaleFactor != 1.0 ) { processAction( new SetLineTimesAction( *this, m_showTime.adjusted( shiftMseconds, scaleFactor ), m_hideTime.adjusted( shiftMseconds, scaleFactor ), i18n( "Adjust Line Times" ) ) ); } } /// ERRORS int SubtitleLine::errorFlags() const { return m_errorFlags; } int SubtitleLine::errorCount() const { return bitsCount( m_errorFlags ); } void SubtitleLine::setErrorFlags( int errorFlags ) { if ( m_errorFlags != errorFlags ) processAction( new SetLineErrorsAction( *this, errorFlags ) ); } void SubtitleLine::setErrorFlags( int errorFlags, bool value ) { setErrorFlags( value ? (m_errorFlags | errorFlags) : (m_errorFlags & ~errorFlags) ); } bool SubtitleLine::checkEmptyPrimaryText( bool update ) { static const QRegExp emptyTextRegExp( "^\\s*$" ); bool error = m_primaryText.isEmpty() || m_primaryText.indexOf( emptyTextRegExp ) != -1; if ( update ) setErrorFlags( EmptyPrimaryText, error ); return error; } bool SubtitleLine::checkEmptySecondaryText( bool update ) { static const QRegExp emptyTextRegExp( "^\\s*$" ); bool error = m_secondaryText.isEmpty() || m_secondaryText.indexOf( emptyTextRegExp ) != -1; if ( update ) setErrorFlags( EmptySecondaryText, error ); return error; } bool SubtitleLine::checkUntranslatedText( bool update ) { bool error = m_primaryText.string() == m_secondaryText.string(); if ( update ) setErrorFlags( UntranslatedText, error ); return error; } bool SubtitleLine::checkOverlapsWithNext( bool update ) { SubtitleLine* nextLine = this->nextLine(); bool error = nextLine && nextLine->m_showTime <= m_hideTime; if ( update ) setErrorFlags( OverlapsWithNext, error ); return error; } bool SubtitleLine::checkMinDuration( int minMsecs, bool update ) { Q_ASSERT( minMsecs >= 0 ); bool error = durationTime().toMillis() < minMsecs; if ( update ) setErrorFlags( MinDuration, error ); return error; } bool SubtitleLine::checkMaxDuration( int maxMsecs, bool update ) { Q_ASSERT( maxMsecs >= 0 ); bool error = durationTime().toMillis() > maxMsecs; if ( update ) setErrorFlags( MaxDuration, error ); return error; } bool SubtitleLine::checkMinDurationPerPrimaryChar( int minMsecsPerChar, bool update ) { Q_ASSERT( minMsecsPerChar >= 0 ); int characters = primaryCharacters(); bool error = characters ? (durationTime().toMillis()/characters < minMsecsPerChar) : false; if ( update ) setErrorFlags( MinDurationPerPrimaryChar, error ); return error; } bool SubtitleLine::checkMinDurationPerSecondaryChar( int minMsecsPerChar, bool update ) { Q_ASSERT( minMsecsPerChar >= 0 ); int characters = secondaryCharacters(); bool error = characters ? (durationTime().toMillis()/characters < minMsecsPerChar) : false; if ( update ) setErrorFlags( MinDurationPerSecondaryChar, error ); return error; } bool SubtitleLine::checkMaxDurationPerPrimaryChar( int maxMsecsPerChar, bool update ) { Q_ASSERT( maxMsecsPerChar >= 0 ); int characters = primaryCharacters(); bool error = characters ? (durationTime().toMillis()/characters > maxMsecsPerChar) : false; if ( update ) setErrorFlags( MaxDurationPerPrimaryChar, error ); return error; } bool SubtitleLine::checkMaxDurationPerSecondaryChar( int maxMsecsPerChar, bool update ) { Q_ASSERT( maxMsecsPerChar >= 0 ); int characters = secondaryCharacters(); bool error = characters ? (durationTime().toMillis()/characters > maxMsecsPerChar) : false; if ( update ) setErrorFlags( MaxDurationPerSecondaryChar, error ); return error; } bool SubtitleLine::checkMaxPrimaryChars( int maxCharacters, bool update ) { Q_ASSERT( maxCharacters >= 0 ); bool error = primaryCharacters() > maxCharacters; if ( update ) setErrorFlags( MaxPrimaryChars, error ); return error; } bool SubtitleLine::checkMaxSecondaryChars( int maxCharacters, bool update ) { Q_ASSERT( maxCharacters >= 0 ); bool error = secondaryCharacters() > maxCharacters; if ( update ) setErrorFlags( MaxSecondaryChars, error ); return error; } bool SubtitleLine::checkMaxPrimaryLines( int maxLines, bool update ) { Q_ASSERT( maxLines >= 0 ); bool error = primaryLines() > maxLines; if ( update ) setErrorFlags( MaxPrimaryLines, error ); return error; } bool SubtitleLine::checkMaxSecondaryLines( int maxLines, bool update ) { Q_ASSERT( maxLines >= 0 ); bool error = secondaryLines() > maxLines; if ( update ) setErrorFlags( MaxSecondaryLines, error ); return error; } bool SubtitleLine::checkPrimaryUnneededSpaces( bool update ) { static const QRegExp unneededSpaceRegExp( "(^\\s|\\s$|¿\\s|¡\\s|\\s\\s|\\s!|\\s\\?|\\s:|\\s;|\\s,|\\s\\.)" ); bool error = m_primaryText.indexOf( unneededSpaceRegExp ) != -1; if ( update ) setErrorFlags( PrimaryUnneededSpaces, error ); return error; } bool SubtitleLine::checkSecondaryUnneededSpaces( bool update ) { static const QRegExp unneededSpaceRegExp( "(^\\s|\\s$|¿\\s|¡\\s|\\s\\s|\\s!|\\s\\?|\\s:|\\s;|\\s,|\\s\\.)" ); bool error = m_secondaryText.indexOf( unneededSpaceRegExp ) != -1; if ( update ) setErrorFlags( SecondaryUnneededSpaces, error ); return error; } bool SubtitleLine::checkPrimaryCapitalAfterEllipsis( bool update ) { static const QRegExp capitalAfterEllipsisRegExp( "^\\s*\\.\\.\\.[¡¿\\.,;\\(\\[\\{\"'\\s]*" ); bool error = m_primaryText.indexOf( capitalAfterEllipsisRegExp ) != -1; if ( error ) { QChar chr = m_primaryText.at( capitalAfterEllipsisRegExp.matchedLength() ); error = chr.isLetter() && chr == chr.toUpper(); } if ( update ) setErrorFlags( PrimaryCapitalAfterEllipsis, error ); return error; } bool SubtitleLine::checkSecondaryCapitalAfterEllipsis( bool update ) { static const QRegExp capitalAfterEllipsisRegExp( "^\\s*\\.\\.\\.[¡¿\\.,;\\(\\[\\{\"'\\s]*" ); bool error = m_secondaryText.indexOf( capitalAfterEllipsisRegExp ) != -1; if ( error ) { QChar chr = m_secondaryText.at( capitalAfterEllipsisRegExp.matchedLength() ); error = chr.isLetter() && chr == chr.toUpper(); } if ( update ) setErrorFlags( SecondaryCapitalAfterEllipsis, error ); return error; } bool SubtitleLine::checkPrimaryUnneededDash( bool update ) { static const QRegExp unneededDashRegExp( "(^|\n)\\s*-[^-]" ); bool error = m_primaryText.count( unneededDashRegExp ) == 1; if ( update ) setErrorFlags( PrimaryUnneededDash, error ); return error; } bool SubtitleLine::checkSecondaryUnneededDash( bool update ) { static const QRegExp unneededDashRegExp( "(^|\n)\\s*-[^-]" ); bool error = m_secondaryText.count( unneededDashRegExp ) == 1; if ( update ) setErrorFlags( SecondaryUnneededDash, error ); return error; } int SubtitleLine::check( int errorFlagsToCheck, int minDurationMsecs, int maxDurationMsecs, int minMsecsPerChar, int maxMsecsPerChar, int maxChars, int maxLines, bool update ) { int lineErrorFlags = m_errorFlags & ~errorFlagsToCheck; // clear the flags we're going to (re)check if ( errorFlagsToCheck & EmptyPrimaryText ) if ( checkEmptyPrimaryText( false ) ) lineErrorFlags |= EmptyPrimaryText; if ( errorFlagsToCheck & EmptySecondaryText ) if ( checkEmptySecondaryText( false ) ) lineErrorFlags |= EmptySecondaryText; if ( errorFlagsToCheck & OverlapsWithNext ) if ( checkOverlapsWithNext( false ) ) lineErrorFlags |= OverlapsWithNext; if ( errorFlagsToCheck & UntranslatedText ) if ( checkUntranslatedText( false ) ) lineErrorFlags |= UntranslatedText; if ( errorFlagsToCheck & MaxDuration ) if ( checkMaxDuration( maxDurationMsecs, false ) ) lineErrorFlags |= MaxDuration; if ( errorFlagsToCheck & MinDuration ) if ( checkMinDuration( minDurationMsecs, false ) ) lineErrorFlags |= MinDuration; if ( errorFlagsToCheck & MaxDurationPerPrimaryChar ) if ( checkMaxDurationPerPrimaryChar( maxMsecsPerChar, false ) ) lineErrorFlags |= MaxDurationPerPrimaryChar; if ( errorFlagsToCheck & MaxDurationPerSecondaryChar ) if ( checkMaxDurationPerSecondaryChar( maxMsecsPerChar, false ) ) lineErrorFlags |= MaxDurationPerSecondaryChar; if ( errorFlagsToCheck & MinDurationPerPrimaryChar ) if ( checkMinDurationPerPrimaryChar( minMsecsPerChar, false ) ) lineErrorFlags |= MinDurationPerPrimaryChar; if ( errorFlagsToCheck & MinDurationPerSecondaryChar ) if ( checkMinDurationPerSecondaryChar( minMsecsPerChar, false ) ) lineErrorFlags |= MinDurationPerSecondaryChar; if ( errorFlagsToCheck & MaxPrimaryChars ) if ( checkMaxPrimaryChars( maxChars, false ) ) lineErrorFlags |= MaxPrimaryChars; if ( errorFlagsToCheck & MaxSecondaryChars ) if ( checkMaxSecondaryChars( maxChars, false ) ) lineErrorFlags |= MaxSecondaryChars; if ( errorFlagsToCheck & MaxPrimaryLines ) if ( checkMaxPrimaryLines( maxLines, false ) ) lineErrorFlags |= MaxPrimaryLines; if ( errorFlagsToCheck & MaxSecondaryLines ) if ( checkMaxSecondaryLines( maxLines, false ) ) lineErrorFlags |= MaxSecondaryLines; if ( errorFlagsToCheck & MaxSecondaryLines ) if ( checkMaxSecondaryLines( maxLines, false ) ) lineErrorFlags |= MaxSecondaryLines; if ( errorFlagsToCheck & PrimaryUnneededSpaces ) if ( checkPrimaryUnneededSpaces( false ) ) lineErrorFlags |= PrimaryUnneededSpaces; if ( errorFlagsToCheck & SecondaryUnneededSpaces ) if ( checkSecondaryUnneededSpaces( false ) ) lineErrorFlags |= SecondaryUnneededSpaces; if ( errorFlagsToCheck & PrimaryCapitalAfterEllipsis ) if ( checkPrimaryCapitalAfterEllipsis( false ) ) lineErrorFlags |= PrimaryCapitalAfterEllipsis; if ( errorFlagsToCheck & SecondaryCapitalAfterEllipsis ) if ( checkSecondaryCapitalAfterEllipsis( false ) ) lineErrorFlags |= SecondaryCapitalAfterEllipsis; if ( errorFlagsToCheck & PrimaryUnneededDash ) if ( checkPrimaryUnneededDash( false ) ) lineErrorFlags |= PrimaryUnneededDash; if ( errorFlagsToCheck & SecondaryUnneededDash ) if ( checkSecondaryUnneededDash( false ) ) lineErrorFlags |= SecondaryUnneededDash; if ( update ) setErrorFlags( lineErrorFlags ); return lineErrorFlags; } void SubtitleLine::processAction( Action* action ) { if ( m_subtitle ) m_subtitle->processAction( action ); else { action->redo(); delete action; } } #include "subtitleline.moc" subtitlecomposer-0.5.3/src/core/actionmanager.h0000644000175000001440000000467611153662174021054 0ustar sergiousers#ifndef ACTIONMANAGER_H #define ACTIONMANAGER_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "action.h" #include #include #include namespace SubtitleComposer { class ActionManager : public QObject { Q_OBJECT public: ActionManager(); ~ActionManager(); bool hasRedo() const; bool hasUndo() const; int redoCount() const; int undoCount() const; QString redoDescription() const; QString undoDescription() const; void execAndStore( Action* action ); public slots: void redo(); void undo(); void popUndo(); void clearHistory(); signals: void actionStored(); void actionRemoved(); void actionRedone(); void actionUndone(); void historyCleared(); void stateChanged(); private: ActionManager( const ActionManager& undoManager ); ActionManager& operator=( const ActionManager& undoManager ); mutable QLinkedList m_undoStack; mutable QLinkedList m_redoStack; int m_compressionThreshold; QTime m_timeBetweenActions; }; } #endif subtitlecomposer-0.5.3/src/core/subtitleiterator.h0000644000175000001440000000670011154253500021625 0ustar sergiousers#ifndef SUBTITLEITERATOR_H #define SUBTITLEITERATOR_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "subtitleline.h" #include "subtitle.h" #include "range.h" #include "rangelist.h" #include #include namespace SubtitleComposer { class SubtitleIterator : public QObject { Q_OBJECT Q_PROPERTY( int index READ index WRITE toIndex ); public: static const int AfterLast = -1; static const int BehindFirst = -2; static const int Invalid = -3; explicit SubtitleIterator( const Subtitle& subtitle, const RangeList& ranges=Range::full(), bool toLast=false ); SubtitleIterator( const SubtitleIterator& it ); SubtitleIterator& operator=( const SubtitleIterator& it ); virtual ~SubtitleIterator(); bool isAutoSync() const; void setAutoSync( bool value ); bool isAutoCircle() const; void setAutoCircle( bool value ); bool isFullIterator() const; RangeList ranges() const; void toFirst(); void toLast(); bool toIndex( int index ); inline int index() { return m_index; } inline int firstIndex() { return m_index == Invalid ? -1 : m_ranges.firstIndex(); } inline int lastIndex() { return m_index == Invalid ? -1 : m_ranges.lastIndex(); } inline SubtitleLine* current() const { return m_index < 0 ? 0 : *m_linesIterator; } inline operator SubtitleLine*() const { return m_index < 0 ? 0 : *m_linesIterator; } SubtitleIterator& operator++(); SubtitleIterator& operator+=( int steps ); SubtitleIterator& operator--(); SubtitleIterator& operator-=( int steps ); signals: void syncronized( int firstIndex, int lastIndex, bool inserted ); private slots: void onSubtitleLinesInserted( int firstIndex, int lastIndex ); void onSubtitleLinesRemoved( int firstIndex, int lastIndex ); private: const Subtitle* m_subtitle; bool m_autoSync; bool m_autoCircle; RangeList m_ranges; bool m_isFullIterator; int m_index; RangeList::ConstIterator m_rangesIterator; QList::Iterator m_linesIterator; QList::Iterator m_linesIteratorStart; }; } #endif subtitlecomposer-0.5.3/src/core/audiolevels.cpp0000644000175000001440000001132411151345063021070 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "audiolevels.h" #include "../common/fileloadhelper.h" #include "../common/filesavehelper.h" #include #include // FIXME remove when unneeded #include #include using namespace SubtitleComposer; AudioLevels::AudioLevels(): m_channelsCount( 0 ), m_samplesInterval( 50 ), m_samplesCount( 0 ), m_samplesData( 0 ), m_lastDataIndex( -1 ), m_mediaUrl() { } AudioLevels::~AudioLevels() { delete [] m_samplesData; } bool AudioLevels::load( const KUrl& fileUrl ) { if ( m_samplesData ) return false; FileLoadHelper fileLoadHelper( fileUrl ); if ( ! fileLoadHelper.open() ) return false; QFile* file = fileLoadHelper.file(); QTextStream textStream( file ); if ( QString( "audiolevels" ) != textStream.readLine() ) return false; m_mediaUrl = KUrl( textStream.readLine() ); file->read( (char*)&m_channelsCount, sizeof(m_channelsCount) ); qint64 duration; file->read( (char*)&duration, sizeof(duration) ); m_samplesCount = 0; for( unsigned channel = 0; channel< m_channelsCount; ++channel ) { std::vector::size_type samplesCount; file->read( (char*)&samplesCount, sizeof(samplesCount) ); if ( ! m_samplesCount ) { m_samplesCount = samplesCount; m_samplesData = new double[m_samplesCount*m_channelsCount]; m_lastDataIndex = m_samplesCount*m_channelsCount - 1; } else if ( m_samplesCount != samplesCount ) { reset(); file->close(); return false; } file->read( (char*)&m_samplesData[m_samplesCount*channel], sizeof(double)*m_samplesCount ); } m_samplesInterval = (int)(duration/1000000.0 / m_samplesCount); if ( ! m_samplesInterval ) { reset(); return false; } return true; } bool AudioLevels::loadFromMedia( const QString& /*mediaPath*/, unsigned /*streamIndex*/ ) { // STUB IMPLEMENTATION just to get something we can use m_channelsCount = 1; m_samplesCount = 30000; m_samplesData = new double[m_samplesCount*m_channelsCount]; m_lastDataIndex = m_samplesCount*m_channelsCount - 1; double degrees = 0; for ( int idx = 0; idx < 30000; ++idx ) { m_samplesData[idx] = sin( degrees*M_PI/180 )/100; degrees += 10.0; } m_samplesInterval = 100; return true; return false; // FIXME stub implementation } bool AudioLevels::save( const KUrl& fileUrl, bool overwrite ) const { FileSaveHelper fileSaveHelper( fileUrl, overwrite ); if ( ! fileSaveHelper.open() ) return false; QFile* file = fileSaveHelper.file(); QString audiolevels( "audiolevels\n" ); file->write( audiolevels.toAscii(), audiolevels.length() ); QString url = m_mediaUrl.url() + '\n'; file->write( url.toAscii(), url.length() ); file->write( (const char*)&m_channelsCount, sizeof(m_channelsCount) ); qint64 duration = (qint64)m_samplesInterval*(qint64)m_samplesCount*1000000; file->write( (const char*)&duration, sizeof(duration) ); for( unsigned channel = 0; channel< m_channelsCount; ++channel ) { std::vector::size_type samplesCount = m_samplesCount; file->write( (const char*)&samplesCount, sizeof(samplesCount) ); file->write( (const char*)&m_samplesData[m_samplesCount*channel], sizeof(double)*m_samplesCount ); } return fileSaveHelper.close(); } void AudioLevels::reset() { m_channelsCount = 0; m_samplesInterval = 50; m_samplesCount = 0; delete [] m_samplesData; m_samplesData = 0; m_lastDataIndex = -1; m_mediaUrl = KUrl(); } #include "audiolevels.moc" subtitlecomposer-0.5.3/src/core/actionmanager.cpp0000644000175000001440000000762211153662670021402 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "actionmanager.h" using namespace SubtitleComposer; ActionManager::ActionManager(): m_undoStack(), m_redoStack(), m_compressionThreshold( 350 ) { m_timeBetweenActions.start(); connect( this, SIGNAL( actionStored() ), this, SIGNAL( stateChanged() ) ); connect( this, SIGNAL( actionRemoved() ), this, SIGNAL( stateChanged() ) ); connect( this, SIGNAL( actionRedone() ), this, SIGNAL( stateChanged() ) ); connect( this, SIGNAL( actionUndone() ), this, SIGNAL( stateChanged() ) ); connect( this, SIGNAL( historyCleared() ), this, SIGNAL( stateChanged() ) ); } ActionManager::~ActionManager() { disconnect(); qDeleteAll( m_undoStack ); qDeleteAll( m_redoStack ); } void ActionManager::execAndStore( Action* action ) { if ( action != 0 ) { action->redo(); bool compressed = false; if ( m_timeBetweenActions.restart() < m_compressionThreshold && m_redoStack.isEmpty() ) { Action* previousAction = m_undoStack.isEmpty() ? 0 : m_undoStack.first(); if ( previousAction && action->mergeWithPrevious( previousAction ) ) { delete m_undoStack.takeFirst(); compressed = true; } } qDeleteAll( m_redoStack ); m_redoStack.clear(); m_undoStack.prepend( action ); if ( ! compressed ) emit actionStored(); emit actionRedone(); } } void ActionManager::popUndo() { if ( m_undoStack.isEmpty() ) return; // nothing to undo delete m_undoStack.takeFirst(); m_redoStack.clear(); emit actionRemoved(); } bool ActionManager::hasRedo() const { return ! m_redoStack.isEmpty(); } bool ActionManager::hasUndo() const { return ! m_undoStack.isEmpty(); } int ActionManager::redoCount() const { return m_redoStack.count(); } int ActionManager::undoCount() const { return m_undoStack.count(); } QString ActionManager::redoDescription() const { return m_redoStack.isEmpty() ? QString() : m_redoStack.first()->description(); } QString ActionManager::undoDescription() const { return m_undoStack.isEmpty() ? QString() : m_undoStack.first()->description(); } void ActionManager::redo() { if ( m_redoStack.isEmpty() ) return; // nothing to redo Action* action = m_redoStack.takeFirst(); action->redo(); m_undoStack.prepend( action ); emit actionRedone(); } void ActionManager::undo() { if ( m_undoStack.isEmpty() ) return; // nothing to undo Action* action = m_undoStack.takeFirst(); action->undo(); m_redoStack.prepend( action ); emit actionUndone(); } void ActionManager::clearHistory() { m_undoStack.clear(); qDeleteAll( m_redoStack ); m_redoStack.clear(); emit historyCleared(); } #include "actionmanager.moc" subtitlecomposer-0.5.3/src/core/range.h0000644000175000001440000000754111154103347017323 0ustar sergiousers#ifndef RANGE_H #define RANGE_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include namespace SubtitleComposer { class Range { public: static const int MaxIndex = INT_MAX; Range( int index ): m_start( index ), m_end( index ) { Q_ASSERT( index >= 0 ); Q_ASSERT( index <= MaxIndex ); } Range( int startIndex, int endIndex ): m_start( startIndex ), m_end( endIndex ) { Q_ASSERT( m_start >= 0 ); Q_ASSERT( m_end >= 0 ); Q_ASSERT( m_start <= m_end ); Q_ASSERT( m_start <= MaxIndex ); } Range( const Range& range ): m_start( range.m_start ), m_end( range.m_end ) { } Range& operator=( const Range& range ) { if ( this == &range ) return *this; m_start = range.m_start; m_end = range.m_end; return *this; } inline static Range full() { return Range( 0, MaxIndex ); } inline static Range lower( int index ) { Q_ASSERT( index >= 0 ); Q_ASSERT( index <= MaxIndex ); return Range( 0, index ); } inline static Range upper( int index ) { Q_ASSERT( index >= 0 ); Q_ASSERT( index <= MaxIndex ); return Range( index, MaxIndex ); } inline bool isFullRange( int maxIndex=MaxIndex ) const { return m_start == 0 && m_end == maxIndex; } inline int start() const { return m_start; } inline int end() const { return m_end; } inline int length() const { return m_end - m_start + 1; } inline bool contains( int index ) const { return index >= m_start && index <= m_end; } inline bool contains( const Range& range ) const { return m_end <= range.m_end && m_start >= range.m_start; } inline bool operator==( const Range& range ) const { return m_start == range.m_start && m_end == range.m_end; } inline bool operator!=( const Range& range ) const { return m_start != range.m_start || m_end != range.m_end; } inline bool operator<( const Range& range ) const { return m_end < range.m_start; } inline bool operator<=( const Range& range ) const { return m_end <= range.m_end && m_start <= range.m_start; } inline bool operator>( const Range& range ) const { return m_start > range.m_end; } inline bool operator>=( const Range& range ) const { return m_start >= range.m_start && m_end >= range.m_end; } private: friend class RangeList; Range() {} int m_start; int m_end; }; } #endif subtitlecomposer-0.5.3/src/core/compositeaction.h0000644000175000001440000001027611151345063021426 0ustar sergiousers#ifndef COMPOSITEACTION_H #define COMPOSITE_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "action.h" #include #include namespace SubtitleComposer { class CompositeAction : public Action { public: explicit CompositeAction( const QString& description, bool immediateExecution=true, bool delaySignals=true ): Action( description ), m_actions(), m_immediateExecution( immediateExecution ), m_delaySignals( delaySignals ) { } virtual ~CompositeAction() { qDeleteAll( m_actions ); } int count() { return m_actions.count(); } /// returns the contained action when there's only one (returns 0 otherwise) Action* detachContainedAction() { if ( m_actions.count() != 1 ) return 0; Action* action = m_actions.takeFirst(); if ( m_immediateExecution && m_delaySignals ) { // NOTE: the action is in an "inconsistent" state: it has been // executed but the resulting signals have not been emitted yet action->_emitRedoSignals(); } return action; } void appendAction( Action* action ) { if ( m_immediateExecution ) action->_redo( ! m_delaySignals ); m_actions.append( action ); } protected: void compressActions() { if ( m_actions.count() < 2 ) return; QLinkedList::Iterator prevIt, it = m_actions.begin(), end = m_actions.end(); for ( prevIt = it, ++it; it != end; prevIt = it, ++it ) { if ( (*it)->mergeWithPrevious( *prevIt ) ) { delete *prevIt; it = m_actions.erase( prevIt ); } } } virtual void _redo() { if ( executed() || ! m_immediateExecution ) for ( QLinkedList::ConstIterator it = m_actions.begin(), end = m_actions.end(); it != end; ++it ) (*it)->_redo( ! m_delaySignals ); if ( ! executed() ) compressActions(); } virtual void _undo() { if ( m_actions.isEmpty() ) return; QLinkedList::Iterator it = --m_actions.end(); for ( QLinkedList::ConstIterator begin = m_actions.begin(); it != begin; --it ) (*it)->_undo( ! m_delaySignals ); (*it)->_undo( ! m_delaySignals ); } virtual void _emitRedoSignals() { if ( m_delaySignals ) for ( QLinkedList::ConstIterator it = m_actions.begin(), end = m_actions.end(); it != end; ++it ) (*it)->_emitRedoSignals(); } virtual void _emitUndoSignals() { if ( m_actions.isEmpty() || ! m_delaySignals ) return; QLinkedList::Iterator it = --m_actions.end(); for ( QLinkedList::ConstIterator begin = m_actions.begin(); it != begin; --it ) (*it)->_emitUndoSignals(); (*it)->_emitUndoSignals(); } protected: QLinkedList m_actions; bool m_immediateExecution; bool m_delaySignals; }; } #endif subtitlecomposer-0.5.3/src/core/subtitleiterator.cpp0000644000175000001440000002342211154254026022164 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "subtitleiterator.h" #include "subtitleline.h" using namespace SubtitleComposer; SubtitleIterator::SubtitleIterator( const Subtitle& subtitle, const RangeList& ranges, bool gotoLast ): QObject( 0 ), m_subtitle( &subtitle ), m_autoSync( false ), m_autoCircle( false ), m_ranges( ranges ), m_linesIterator( m_subtitle->m_lines.begin() ), m_linesIteratorStart( m_subtitle->m_lines.begin() ) { if ( m_subtitle->isEmpty() ) m_ranges.clear(); else m_ranges.trimToIndex( m_subtitle->lastIndex() ); m_isFullIterator = m_ranges.isFullRange( m_subtitle->lastIndex() ); if ( m_ranges.isEmpty() ) { m_index = Invalid; // no operations allowed if ( m_subtitle->linesCount() ) kDebug() << "SubtitleIterator requested with empty ranges list"; } else { m_index = Invalid - 1; // a non INVALID index (needed only for initialization) if ( gotoLast ) toLast(); else toFirst(); } } SubtitleIterator::SubtitleIterator( const SubtitleIterator& it ): QObject( 0 ), m_subtitle( it.m_subtitle ), m_autoSync( false ), m_autoCircle( it.m_autoCircle ), m_ranges( it.m_ranges ), m_isFullIterator( it.m_isFullIterator ), m_index( it.m_index ), m_rangesIterator( it.m_rangesIterator ), m_linesIterator( it.m_linesIterator ), m_linesIteratorStart( it.m_linesIteratorStart ) { setAutoSync( it.m_autoSync ); } SubtitleIterator& SubtitleIterator::operator=( const SubtitleIterator& it ) { if ( &it != this ) { setAutoSync( false ); m_subtitle = it.m_subtitle; m_autoCircle = it.m_autoCircle; m_ranges = it.m_ranges; m_isFullIterator = it.m_isFullIterator; m_index = it.m_index; m_rangesIterator = it.m_rangesIterator; m_linesIterator = it.m_linesIterator; m_linesIteratorStart = it.m_linesIteratorStart; setAutoSync( it.m_autoSync ); } return *this; } SubtitleIterator::~SubtitleIterator() { setAutoSync( false ); } bool SubtitleIterator::isAutoSync() const { return m_autoSync; } void SubtitleIterator::setAutoSync( bool value ) { if ( m_autoSync != value ) { if ( m_autoSync ) { disconnect( m_subtitle, SIGNAL( linesInserted(int,int) ), this, SLOT( onSubtitleLinesInserted(int,int) ) ); disconnect( m_subtitle, SIGNAL( linesRemoved(int,int) ), this, SLOT( onSubtitleLinesRemoved(int,int) ) ); } m_autoSync = value; if ( m_autoSync ) { connect( m_subtitle, SIGNAL( linesInserted(int,int) ), this, SLOT( onSubtitleLinesInserted(int,int) ) ); connect( m_subtitle, SIGNAL( linesRemoved(int,int) ), this, SLOT( onSubtitleLinesRemoved(int,int) ) ); } } } bool SubtitleIterator::isAutoCircle() const { return m_autoCircle; } void SubtitleIterator::setAutoCircle( bool value ) { if ( m_autoCircle != value ) { m_autoCircle = value; if ( m_index == AfterLast ) toFirst(); else if ( m_index == BehindFirst ) toLast(); } } bool SubtitleIterator::isFullIterator() const { return m_isFullIterator; } RangeList SubtitleIterator::ranges() const { return m_ranges; } void SubtitleIterator::toFirst() { if ( m_index == Invalid ) return; m_rangesIterator = m_ranges.begin(); m_linesIteratorStart = m_subtitle->m_lines.begin(); m_linesIterator = m_linesIteratorStart; m_index = m_ranges.firstIndex(); if ( m_index ) m_linesIterator += m_index; // safe because indexes within m_ranges are all valid lines } void SubtitleIterator::toLast() { if ( m_index == Invalid ) return; m_rangesIterator = m_ranges.end(); m_rangesIterator--; // safe because m_ranges is not empty (otherwise m_index would be INVALID). m_linesIteratorStart = m_subtitle->m_lines.begin(); m_linesIterator = m_linesIteratorStart; m_index = m_ranges.lastIndex(); if ( m_index ) m_linesIterator += m_index; // safe because indexes within m_ranges are all valid lines } bool SubtitleIterator::toIndex( const int index ) { Q_ASSERT( index >= 0 ); Q_ASSERT( index <= Range::MaxIndex ); if ( m_index == Invalid ) return false; bool savedAutoCircle = m_autoCircle; // auto circling interferes with what we have to do m_autoCircle = false; if ( m_index < index ) { while ( m_index < index ) { operator++(); if ( m_index == AfterLast ) { toLast(); // equivalent to operator--() in this case break; } } } else if ( m_index > index ) { while ( m_index > index ) { operator--(); if ( m_index == BehindFirst ) { toFirst(); // equivalent to operator++() in this case break; } } } m_autoCircle = savedAutoCircle; return m_index == index; } SubtitleIterator& SubtitleIterator::operator++() { if ( m_index == Invalid || m_index == AfterLast ) return *this; if ( m_index == BehindFirst ) toFirst(); else { m_index++; ++m_linesIterator; int currentRangeEnd = (*m_rangesIterator).end(); if ( m_index > currentRangeEnd ) { m_rangesIterator++; if ( m_rangesIterator == m_ranges.end() ) m_index = AfterLast; else { m_index = (*m_rangesIterator).start(); m_linesIterator += (m_index - (currentRangeEnd + 1)); } } } if ( m_autoCircle && m_index == AfterLast ) toFirst(); return *this; } SubtitleIterator& SubtitleIterator::operator--() { if ( m_index == Invalid || m_index == BehindFirst ) return *this; if ( m_index == AfterLast ) toLast(); else { m_index--; --m_linesIterator; int currentRangeStart = (*m_rangesIterator).start(); if ( m_index < currentRangeStart ) { if ( m_rangesIterator == m_ranges.begin() ) m_index = BehindFirst; else { m_rangesIterator--; m_index = (*m_rangesIterator).end(); m_linesIterator -= (currentRangeStart - (m_index + 1)); } } } if ( m_autoCircle && m_index == BehindFirst ) toLast(); return *this; } SubtitleIterator& SubtitleIterator::operator+=( int steps ) { if ( steps > 0 ) { for ( int i = 0; i < steps; ++i ) operator++(); } else if ( steps < 0 ) { for ( int i = 0; i > steps; --i ) operator--(); } return *this; } SubtitleIterator& SubtitleIterator::operator-=( int steps ) { if ( steps > 0 ) { for ( int i = 0; i < steps; ++i ) operator--(); } else if ( steps < 0 ) { for ( int i = 0; i > steps; --i ) operator++(); } return *this; } void SubtitleIterator::onSubtitleLinesInserted( int firstIndex, int lastIndex ) { if ( m_index == Invalid ) return; int prevIndex = m_index; Range insertedRange( firstIndex, lastIndex ); m_ranges.shiftIndexesForwards( firstIndex, insertedRange.length(), true ); if ( m_isFullIterator ) m_ranges << insertedRange; m_index = Invalid - 1; // a non Invalid index (needed only for initialization) if ( prevIndex == AfterLast ) { if ( lastIndex == m_ranges.lastIndex() ) // lines were inserted at the end { toFirst(); // restore internal variables to a valid state toIndex( firstIndex ); // point to the first newly inserted item } else { toLast(); // restore internal variables to a valid state operator++(); // point again to AfterLast } } else if ( prevIndex == BehindFirst ) { toFirst(); // restore internal variables to a valid state operator--(); // point again to BehindFirst } else { toFirst(); // restore internal variables to a valid state if ( prevIndex >= firstIndex ) toIndex( prevIndex + insertedRange.length() ); // point to the previously pointed line else toIndex( prevIndex ); // point to the previously pointed line } emit syncronized( firstIndex, lastIndex, true ); } void SubtitleIterator::onSubtitleLinesRemoved( int firstIndex, int lastIndex ) { if ( m_index == Invalid ) return; int prevIndex = m_index; Range removedRange( firstIndex, lastIndex ); kDebug() << "PREV RANGES" << m_ranges.inspect(); m_ranges.shiftIndexesBackwards( firstIndex, removedRange.length() ); kDebug() << "NEW RANGES" << m_ranges.inspect(); if ( m_ranges.isEmpty() ) m_index = Invalid; else { m_index = Invalid - 1; // a non Invalid index (needed only for initialization) if ( prevIndex == AfterLast ) { toLast(); // restore internal variables to a valid state operator++(); // point again to AfterLast } else if ( prevIndex == BehindFirst ) { toFirst(); // restore internal variables to a valid state operator--(); // point again to BehindFirst } else { toFirst(); // restore internal variables to a valid state if ( prevIndex < firstIndex ) toIndex( prevIndex ); else if ( m_index > lastIndex ) toIndex( prevIndex - removedRange.length() ); else // prevIndex was one of the removed lines toIndex( firstIndex ); } } emit syncronized( firstIndex, lastIndex, false ); } #include "subtitleiterator.moc" subtitlecomposer-0.5.3/src/core/tests/0000755000175000001440000000000011206423743017214 5ustar sergiouserssubtitlecomposer-0.5.3/src/core/tests/CMakeLists.txt0000644000175000001440000000143611151345063021755 0ustar sergiousersSET( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) SET( rangelisttest_SRCS rangelisttest.cpp ) KDE4_ADD_UNIT_TEST( core-rangelisttest ${rangelisttest_SRCS} ) TARGET_LINK_LIBRARIES( core-rangelisttest ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBS} ) SET( rangetest_SRCS rangetest.cpp ) KDE4_ADD_UNIT_TEST( core-rangetest ${rangetest_SRCS} ) TARGET_LINK_LIBRARIES( core-rangetest ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBS} ) SET( timetest_SRCS ../time.cpp timetest.cpp ) KDE4_ADD_UNIT_TEST( core-timetest ${timetest_SRCS} ) TARGET_LINK_LIBRARIES( core-timetest ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBS} ) SET( sstringtest_SRCS ../sstring.cpp sstringtest.cpp ) KDE4_ADD_UNIT_TEST( core-sstringtest ${sstringtest_SRCS} ) TARGET_LINK_LIBRARIES( core-sstringtest ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBS} ) subtitlecomposer-0.5.3/src/core/tests/rangelisttest.h0000644000175000001440000000315411151345063022255 0ustar sergiousers#ifndef RANGELISTTEST_H #define RANGELISTTEST_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include class RangeListTest: public QObject { Q_OBJECT private slots: void testConstructors(); void testJoinAndTrim(); }; #endif subtitlecomposer-0.5.3/src/core/tests/sstringtest.h0000644000175000001440000000322011151345063021750 0ustar sergiousers#ifndef SSTRINGTEST_H #define SSTRINGTEST_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include class SStringTest: public QObject { Q_OBJECT private slots: void testStyleFlags(); void testLeftMidRight(); void testInsert(); void testReplace(); }; #endif subtitlecomposer-0.5.3/src/core/tests/rangetest.cpp0000644000175000001440000000677611151345063021731 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "rangetest.h" #include "../range.h" #include // krazy:exclude=c++/includes #include // krazy:exclude=c++/includes using namespace SubtitleComposer; void RangeTest::testConstructors() { QVERIFY( Range::MaxIndex > 0 ); Range fullRange = Range::full(); QVERIFY( fullRange.start() == 0 ); QVERIFY( fullRange.end() == Range::MaxIndex ); Range lowerRange = Range::lower( 16 ); QVERIFY( lowerRange.start() == 0 ); QVERIFY( lowerRange.end() == 16 ); Range upperRange = Range::upper( 16 ); QVERIFY( upperRange.start() == 16 ); QVERIFY( upperRange.end() == Range::MaxIndex ); Range range( 13, 32 ); QVERIFY( range.start() == 13 ); QVERIFY( range.end() == 32 ); } void RangeTest::testLimits() { QVERIFY( Range::MaxIndex > 0 ); Range range( 13, 99 ); QVERIFY( ! range.contains( 12 ) ); QVERIFY( range.contains( 13 ) ); QVERIFY( range.contains( 99 ) ); QVERIFY( ! range.contains( 100 ) ); } void RangeTest::testOperators() { QVERIFY( Range::MaxIndex > 0 ); Range range( 13, 99 ); QVERIFY( range == Range( 13, 99 ) ); QVERIFY( range != Range( 12, 99 ) ); QVERIFY( range != Range( 13, 100 ) ); QVERIFY( range != Range( 13, 100 ) ); QVERIFY( Range( 11, 15 ) > Range( 8, 10 ) ); QVERIFY( ! (Range( 11, 15 ) > Range( 8, 12 )) ); QVERIFY( ! (Range( 7, 8 ) > Range( 8, 12 )) ); QVERIFY( Range( 8, 15 ) >= Range( 7, 10 ) ); QVERIFY( Range( 10, 15 ) >= Range( 7, 10 ) ); QVERIFY( Range( 11, 15 ) >= Range( 7, 10 ) ); QVERIFY( Range( 7, 10 ) >= Range( 7, 10 ) ); QVERIFY( ! (Range( 7, 9 ) >= Range( 7, 10 )) ); QVERIFY( ! (Range( 6, 11 ) >= Range( 7, 10 )) ); QVERIFY( ! (Range( 7, 9 ) >= Range( 6, 10 )) ); QVERIFY( Range( 8, 10 ) < Range( 11, 15 ) ); QVERIFY( ! (Range( 8, 12 ) < Range( 11, 15 )) ); QVERIFY( ! (Range( 8, 12 ) < Range( 7, 8 )) ); QVERIFY( Range( 7, 10 ) <= Range( 8, 15 ) ); QVERIFY( Range( 7, 10 ) <= Range( 10, 15 ) ); QVERIFY( Range( 7, 10 ) <= Range( 11, 15 ) ); QVERIFY( Range( 7, 10 ) <= Range( 7, 10 ) ); QVERIFY( ! (Range( 7, 10 ) <= Range( 7, 9 )) ); QVERIFY( ! (Range( 7, 10 ) <= Range( 6, 11 )) ); QVERIFY( ! (Range( 6, 10 ) <= Range( 7, 9 )) ); } QTEST_MAIN( RangeTest ); #include "rangetest.moc" subtitlecomposer-0.5.3/src/core/tests/timetest.cpp0000644000175000001440000001035411151345063021556 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "timetest.h" #include "../time.h" #include // krazy:exclude=c++/includes #include // krazy:exclude=c++/includes using namespace SubtitleComposer; void TimeTest::testConstructors() { Time time; QVERIFY( time.toMillis() == 0 ); Time time5( Time::MaxMseconds + 55 ); QVERIFY( time5.toMillis() == Time::MaxMseconds ); Time time6( -55 ); QVERIFY( time6.toMillis() == 0 ); Time time2( 999 ); QVERIFY( time2.toMillis() == 999 ); Time time3( 5, 5, 5, 5 ); QVERIFY( time3.toMillis() == 18305005 ); Time time4( time2 ); QVERIFY( time4.toMillis() == 999 ); } void TimeTest::testSetters() { Time time; time.setSecondsTime( 555.663 ); QVERIFY( time.toMillis() == 555663 ); time.setMsecondsTime( 64563 ); QVERIFY( time.toMillis() == 64563 ); // the following setters should all fail: QVERIFY( ! time.setHours( 24 ) && ! time.setHours( -5 ) && ! time.setHours( 25 ) ); QVERIFY( time.toMillis() == 64563 ); QVERIFY( ! time.setMinutes( 60 ) && ! time.setMinutes( -5 ) && ! time.setMinutes( 61 ) ); QVERIFY( time.toMillis() == 64563 ); QVERIFY( ! time.setSeconds( 60 ) && ! time.setSeconds( -5 ) && ! time.setSeconds( 61 ) ); QVERIFY( time.toMillis() == 64563 ); QVERIFY( ! time.setMseconds( 1000 ) && ! time.setMseconds( -5 ) && ! time.setMseconds( 1001 ) ); QVERIFY( time.toMillis() == 64563 ); // the following setters should all succed: time.setMsecondsTime( 0 ); QVERIFY( time.setHours( 23 ) ); QVERIFY( time.toMillis() == 82800000 ); QVERIFY( time.setMinutes( 14 ) ); QVERIFY( time.toMillis() == 83640000 ); QVERIFY( time.setSeconds( 33 ) ); QVERIFY( time.toMillis() == 83673000 ); QVERIFY( time.setMseconds( 356 ) ); QVERIFY( time.toMillis() == 83673356 ); time.shift( Time::MaxMseconds + 100 ); QVERIFY( time.toMillis() == Time::MaxMseconds ); time.shift( - (Time::MaxMseconds + 500) ); QVERIFY( time.toMillis() == 0 ); time.shift( 150 ); QVERIFY( time.toMillis() == 150 ); time.shift( -130 ); QVERIFY( time.toMillis() == 20 ); time.adjust( -500, 1.0 ); QVERIFY( time.toMillis() == 0 ); time.adjust( +500, 1.44 ); QVERIFY( time.toMillis() == 500 ); time.adjust( 10, 2.0 ); QVERIFY( time.toMillis() == 1010 ); time.adjust( 100, -1.1 ); QVERIFY( time.toMillis() == 0 ); } void TimeTest::testOperators() { QVERIFY( Time( 3600 ) == Time( 3600 ) ); QVERIFY( Time( 3600 ) == 3600 ); QVERIFY( Time( 3600 ) != Time( 3601 ) ); QVERIFY( Time( 3600 ) != 3601 ); QVERIFY( Time( 3600 ) <= Time( 3600 ) ); QVERIFY( Time( 3600 ) <= 3600 ); QVERIFY( Time( 3600 ) <= Time( 3601 ) ); QVERIFY( Time( 3600 ) <= 3601 ); QVERIFY( Time( 3600 ) < Time( 3601 ) ); QVERIFY( Time( 3600 ) < 3601 ); QVERIFY( Time( 3600 ) >= Time( 3600 ) ); QVERIFY( Time( 3600 ) >= 3600 ); QVERIFY( Time( 3600 ) >= Time( 3599 ) ); QVERIFY( Time( 3600 ) >= 3599 ); QVERIFY( Time( 3600 ) > Time( 3599 ) ); QVERIFY( Time( 3600 ) > 3599 ); } QTEST_MAIN( TimeTest ); #include "timetest.moc" subtitlecomposer-0.5.3/src/core/tests/rangetest.h0000644000175000001440000000316311151345063021361 0ustar sergiousers#ifndef RANGETEST_H #define RANGETEST_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include class RangeTest: public QObject { Q_OBJECT private slots: void testConstructors(); void testLimits(); void testOperators(); }; #endif subtitlecomposer-0.5.3/src/core/tests/rangelisttest.cpp0000644000175000001440000000705511151345063022614 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "rangelisttest.h" #include "../rangelist.h" #include // krazy:exclude=c++/includes #include // krazy:exclude=c++/includes using namespace SubtitleComposer; void RangeListTest::testConstructors() { RangeList ranges; QVERIFY( ranges.isEmpty() && ranges.rangesCount() == 0 ); ranges << Range( 1, 2 ); QVERIFY( ranges.firstIndex() == 1 && ranges.lastIndex() == 2 && ranges.indexesCount() == 2 ); RangeList ranges2( Range( 1, 2 ) ); QVERIFY( ranges == ranges2 ); ranges2 = ranges; QVERIFY( ranges == ranges2 ); ranges << Range( 7, 9 ); QVERIFY( ranges.firstIndex() == 1 && ranges.lastIndex() == 9 && ranges.indexesCount() == 5 ); RangeList ranges3( ranges ); QVERIFY( ranges == ranges3 ); ranges3 = ranges; QVERIFY( ranges == ranges3 ); RangeList complementRanges = ranges.complement(); QVERIFY( complementRanges.firstIndex() == 0 ); QVERIFY( complementRanges.lastIndex() == Range::MaxIndex ); RangeList::ConstIterator complementRangesIt = complementRanges.begin(); QVERIFY( *(complementRangesIt++) == Range( 0, 0 ) ); QVERIFY( *(complementRangesIt++) == Range( 3, 6 ) ); QVERIFY( *(complementRangesIt++) == Range( 10, Range::MaxIndex ) ); } void RangeListTest::testJoinAndTrim() { RangeList ranges; ranges << Range( 1, 4 ); QVERIFY( ranges.rangesCount() == 1 && ranges.indexesCount() == 4 ); ranges << Range( 3, 5 ); QVERIFY( ranges.rangesCount() == 1 && ranges.indexesCount() == 5 ); ranges << Range( 7, 7 ); QVERIFY( ranges.rangesCount() == 2 && ranges.indexesCount() == 6 ); ranges << Range( 13, 16 ); QVERIFY( ranges.rangesCount() == 3 && ranges.indexesCount() == 10 ); ranges << Range( 6, 15 ); QVERIFY( ranges.rangesCount() == 1 && ranges.indexesCount() == 16 ); ranges.trimToRange( Range( 0, 17 ) ); QVERIFY( ranges.rangesCount() == 1 && ranges.indexesCount() == 16 ); ranges.trimToRange( Range( 0, 16 ) ); QVERIFY( ranges.rangesCount() == 1 && ranges.indexesCount() == 16 ); ranges.trimToRange( Range( 0, 15 ) ); QVERIFY( ranges.rangesCount() == 1 && ranges.indexesCount() == 15 ); ranges.trimToRange( Range( 0, 5 ) ); QVERIFY( ranges.rangesCount() == 1 && ranges.indexesCount() == 5 ); } QTEST_MAIN( RangeListTest ); #include "rangelisttest.moc" subtitlecomposer-0.5.3/src/core/tests/timetest.h0000644000175000001440000000316111151345063021221 0ustar sergiousers#ifndef TIMETEST_H #define TIMETEST_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include class TimeTest: public QObject { Q_OBJECT private slots: void testConstructors(); void testSetters(); void testOperators(); }; #endif subtitlecomposer-0.5.3/src/core/tests/sstringtest.cpp0000644000175000001440000003701711151345063022316 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "sstringtest.h" #include "../sstring.h" #include // krazy:exclude=c++/includes #include // krazy:exclude=c++/includes #include using namespace SubtitleComposer; void SStringTest::testStyleFlags() { SString sstring( "0123456789" ); sstring.setStyleFlagsAt( 0, SString::Bold ); QVERIFY( sstring.styleFlagsAt( 0 ) == SString::Bold ); QVERIFY( sstring.cummulativeStyleFlags() == SString::Bold ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); sstring.setStyleFlagsAt( 2, SString::Italic ); QVERIFY( sstring.styleFlagsAt( 2 ) == SString::Italic ); QVERIFY( sstring.cummulativeStyleFlags() == SString::Bold|SString::Italic ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); sstring.setStyleFlagsAt( 1, SString::Italic ); QVERIFY( sstring.styleFlagsAt( 1 ) == SString::Italic ); QVERIFY( sstring.cummulativeStyleFlags() == SString::Bold|SString::Italic ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); sstring.setStyleFlagsAt( 0, SString::Italic ); QVERIFY( sstring.styleFlagsAt( 0 ) == SString::Italic ); QVERIFY( sstring.cummulativeStyleFlags() == SString::Italic ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); sstring.setStyleFlagsAt( 9, SString::Underline ); QVERIFY( sstring.styleFlagsAt( 9 ) == SString::Underline ); QVERIFY( sstring.cummulativeStyleFlags() == SString::Italic|SString::Underline ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); sstring.setStyleFlags( 0, 15, 0 ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); sstring.setStyleFlags( 0, 3, SString::Bold ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); sstring.setStyleFlags( 3, 3, SString::Italic ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); sstring.setStyleFlags( 6, 3, SString::Underline ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); sstring.setStyleFlags( 9, 3, SString::StrikeThrough ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); sstring.setStyleFlags( 0, 15, SString::Bold|SString::Underline, false ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); sstring.setStyleFlags( 0, 15, SString::StrikeThrough, true ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); sstring.setStyleFlags( 4, 1, SString::Italic, false ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); } void SStringTest::testLeftMidRight() { SString sstring; sstring.setRichString( "0123456789" ); QVERIFY( sstring.left( -1 ).richString() == QString( "0123456789" ) ); QVERIFY( sstring.left( -5 ).richString() == QString( "0123456789" ) ); QVERIFY( sstring.left( 10 ).richString() == QString( "0123456789" ) ); QVERIFY( sstring.left( 11 ).richString() == QString( "0123456789" ) ); QVERIFY( sstring.left( 4 ).richString() == QString( "0123" ) ); QVERIFY( sstring.left( 0 ).richString() == QString( "" ) ); QVERIFY( sstring.mid( 1, -1 ).richString() == QString( "123456789" ) ); QVERIFY( sstring.mid( 1, -5 ).richString() == QString( "123456789" ) ); QVERIFY( sstring.mid( 1, 10 ).richString() == QString( "123456789" ) ); QVERIFY( sstring.mid( 1, 11 ).richString() == QString( "123456789" ) ); QVERIFY( sstring.mid( 1, 4 ).richString() == QString( "1234" ) ); QVERIFY( sstring.mid( 1, 0 ).richString() == QString( "" ) ); QVERIFY( sstring.mid( 10, 2 ).richString() == QString( "" ) ); QVERIFY( sstring.mid( -2, 4 ).richString() == QString( "01" ) ); QVERIFY( sstring.mid( -2, 11 ).richString() == QString( "012345678" ) ); QVERIFY( sstring.mid( -2, -1 ).richString() == QString( "0123456789" ) ); QVERIFY( sstring.right( -1 ).richString() == QString( "0123456789" ) ); QVERIFY( sstring.right( -5 ).richString() == QString( "0123456789" ) ); QVERIFY( sstring.right( 10 ).richString() == QString( "0123456789" ) ); QVERIFY( sstring.right( 11 ).richString() == QString( "0123456789" ) ); QVERIFY( sstring.right( 4 ).richString() == QString( "6789" ) ); QVERIFY( sstring.right( 0 ).richString() == QString( "" ) ); } void SStringTest::testInsert() { SString sstring; sstring.append( "" ); QVERIFY( sstring == SString() ); sstring.append( SString( "x", SString::Bold ) ); QVERIFY( sstring.richString() == QString( "x" ) ); sstring.append( QString( "y" ) ); QVERIFY( sstring.richString() == QString( "xy" ) ); sstring.append( 'z' ); QVERIFY( sstring.richString() == QString( "xyz" ) ); sstring.prepend( SString( "c", SString::Italic ) ); QVERIFY( sstring.richString() == QString( "cxyz" ) ); sstring.prepend( QString( "b" ) ); QVERIFY( sstring.richString() == QString( "bcxyz" ) ); sstring.prepend( 'a' ); QVERIFY( sstring.richString() == QString( "abcxyz" ) ); sstring.insert( 3, SString( "g", SString::Underline ) ); QVERIFY( sstring.richString() == QString( "abcgxyz" ) ); sstring.insert( 4, QString( "h" ) ); QVERIFY( sstring.richString() == QString( "abcghxyz" ) ); sstring.insert( 5, 'i' ); QVERIFY( sstring.richString() == QString( "abcghixyz" ) ); sstring.clear(); QVERIFY( sstring == SString() ); } void SStringTest::testReplace() { SString sstring; // SString& replace( int index, int len, const QString& replacement ) sstring = SString( "0123456789" ); sstring.replace( -1, 4, QString( "aaaa" ) ); QVERIFY( sstring == SString( "0123456789" ) ); sstring.replace( -1, 0, QString( "bbbb" ) ); QVERIFY( sstring == SString( "0123456789" ) ); sstring.replace( 15, 0, QString( "cccc" ) ); QVERIFY( sstring == SString( "0123456789" ) ); sstring.replace( 15, 5, QString( "dddd" ) ); QVERIFY( sstring == SString( "0123456789" ) ); sstring.replace( 0, 2, QString( "eeee" ) ); QVERIFY( sstring == SString( "eeee23456789" ) ); sstring.replace( 5, -1, QString( "dddd" ) ); QVERIFY( sstring == SString( "eeee2dddd" ) ); // SString& replace( int index, int len, const SString& replacement ) sstring = SString( "0123456789" ); sstring.replace( -1, 4, SString( "aaaa" ) ); QVERIFY( sstring == SString( "0123456789" ) ); sstring.replace( -1, 0, SString( "bbbb" ) ); QVERIFY( sstring == SString( "0123456789" ) ); sstring.replace( 15, 0, SString( "cccc" ) ); QVERIFY( sstring == SString( "0123456789" ) ); sstring.replace( 15, 5, SString( "dddd" ) ); QVERIFY( sstring == SString( "0123456789" ) ); sstring.replace( 0, 2, SString( "eeee" ) ); QVERIFY( sstring == SString( "eeee23456789" ) ); sstring.replace( 5, -1, SString( "dddd" ) ); QVERIFY( sstring == SString( "eeee2dddd" ) ); // SString& replace( const QString& before, const QString& after, Qt::CaseSensitivity cs=Qt::CaseSensitive ) sstring = SString( "01234567890123456789" ); sstring.replace( QString( "0" ), QString( "A" ), Qt::CaseSensitive ); QVERIFY( sstring == SString( "A123456789A123456789" ) ); sstring.replace( QString( "23" ), QString( "B" ), Qt::CaseSensitive ); QVERIFY( sstring == SString( "A1B456789A1B456789" ) ); sstring.replace( QString( "89" ), QString( "C" ), Qt::CaseSensitive ); QVERIFY( sstring == SString( "A1B4567CA1B4567C" ) ); sstring.replace( QString( "67CA1B" ), QString( "D" ), Qt::CaseSensitive ); QVERIFY( sstring == SString( "A1B45D4567C" ) ); sstring.replace( QString( "" ), QString( "E" ), Qt::CaseSensitive ); QVERIFY( sstring == SString( "EAE1EBE4E5EDE4E5E6E7ECE" ) ); sstring = SString( "3" ); sstring.replace( QString( "" ), QString( "AA" ), Qt::CaseSensitive ); QVERIFY( sstring == SString( "AA3AA" ) ); sstring = SString(); sstring.replace( QString( "" ), QString( "AA" ), Qt::CaseSensitive ); QVERIFY( sstring == SString( "AA" ) ); // SString& replace( const QString& before, const SString& after, Qt::CaseSensitivity cs=Qt::CaseSensitive ) sstring = SString( "01234567890123456789" ); sstring.replace( QString( "0" ), SString( "A", SString::Bold ), Qt::CaseSensitive ); QVERIFY( sstring.richString() == QString( "A123456789A123456789" ) ); sstring.replace( QString( "23" ), SString( "B", SString::Italic ), Qt::CaseSensitive ); QVERIFY( sstring.richString() == QString( "A1B456789A1B456789" ) ); sstring.replace( QString( "89" ), SString( "C", SString::Underline ), Qt::CaseSensitive ); QVERIFY( sstring.richString() == QString( "A1B4567CA1B4567C" ) ); sstring.replace( QString( "67CA1B" ), SString( "D", SString::StrikeThrough ), Qt::CaseSensitive ); QVERIFY( sstring.richString() == QString( "A1B45D4567C" ) ); sstring.replace( QString( "" ), SString( "E" ), Qt::CaseSensitive ); QVERIFY( sstring.richString() == QString( "EAE1EBE4E5EDE4E5E6E7ECE" ) ); sstring = SString( "3" ); sstring.replace( QString( "" ), SString( "AA", SString::Bold ), Qt::CaseSensitive ); QVERIFY( sstring.richString() == QString( "AA3AA" ) ); sstring = SString(); sstring.replace( QString( "" ), SString( "AA", SString::Italic ), Qt::CaseSensitive ); QVERIFY( sstring.richString() == QString( "AA" ) ); // SString& replace( const QRegExp& rx, const QString& after ) sstring = SString( "this is a pretty test" ); sstring.replace( QRegExp( "^this" ), "\\2\\0" ); QVERIFY( sstring.richString() == QString( "\\2this is a pretty test" ) ); sstring.replace( QRegExp( "[\\w]+" ), "w" ); QVERIFY( sstring.richString() == QString( "\\w w w w w" ) ); sstring = SString( "this is a pretty test" ); sstring.replace( QRegExp( "([\\w]*)" ), "[\\1]" ); QVERIFY( sstring.richString() == QString( "[this][] [is][] [a][] [pretty][] [test][]" ) ); //SString& SString::replace( QChar before, QChar after, Qt::CaseSensitivity cs=Qt::CaseSensitive ) sstring.setRichString( "This Is a preTtI testi" ); sstring.replace( 'I', 'X', Qt::CaseSensitive ); QVERIFY( sstring.richString() == QString( "This Xs a preTtX testi" ) ); sstring.replace( 'T', 'w', Qt::CaseInsensitive ); QVERIFY( sstring.richString() == QString( "whis Xs a prewwX weswi" ) ); //SString& SString::replace( QChar ch, const QString& after, Qt::CaseSensitivity cs=Qt::CaseSensitive ) sstring.setRichString( "This Is a preTtI testi" ); sstring.replace( 'i', QString( "AA" ), Qt::CaseInsensitive ); QVERIFY( sstring.richString() == QString( "ThAAs AAs a preTtAA testAA" ) ); sstring.replace( 'T', QString( "XX" ), Qt::CaseSensitive ); QVERIFY( sstring.richString() == QString( "XXhAAs AAs a preXXtAA testAA" ) ); // SString& SString::replace( QChar ch, const SString& after, Qt::CaseSensitivity cs=Qt::CaseSensitive ) sstring.setRichString( "This Is a preTtI testi" ); sstring.replace( 'i', SString( "A", SString::Bold ) ); QVERIFY( sstring.richString() == QString( "ThAs Is a preTtI testA" ) ); sstring.replace( 'T', SString( "X", SString::Underline ), Qt::CaseInsensitive ); QVERIFY( sstring==SString().setRichString("XhAs Is a preXXI XesXA") ); // SString& remove( int index, int len ); sstring.setRichString( "0123456789" ); sstring.remove( 0, 0 ); QVERIFY( sstring.richString() == QString( "0123456789" ) ); sstring.remove( 0, 2 ); QVERIFY( sstring.richString() == QString( "23456789" ) ); sstring.remove( 10, 2 ); QVERIFY( sstring.richString() == QString( "23456789" ) ); sstring.remove( 8, 5 ); QVERIFY( sstring.richString() == QString( "23456789" ) ); sstring.remove( 7, 3 ); QVERIFY( sstring.richString() == QString( "2345678" ) ); sstring.remove( 0, 3 ); QVERIFY( sstring.richString() == QString( "5678" ) ); sstring.remove( 0, -1 ); QVERIFY( sstring.richString() == QString( "" ) ); // SString& remove( const QString& str, Qt::CaseSensitivity cs=Qt::CaseSensitive ); sstring.setRichString( "012012345345" ); sstring.remove( "013" ); QVERIFY( sstring.richString() == QString( "012012345345" ) ); sstring.remove( "01" ); QVERIFY( sstring.richString() == QString( "22345345" ) ); sstring.remove( "2345" ); QVERIFY( sstring.richString() == QString( "2345" ) ); // SString& remove( const QRegExp& rx ); sstring.setRichString( "012012345345" ); sstring.remove( QRegExp( "^013" ) ); QVERIFY( sstring.richString() == QString( "012012345345" ) ); sstring.remove( QRegExp( "^012" ) ); QVERIFY( sstring.richString() == QString( "012345345" ) ); sstring.remove( QRegExp( "345$" ) ); QVERIFY( sstring.richString() == QString( "012345" ) ); sstring.remove( QRegExp( "\\d+" ) ); QVERIFY( sstring.richString() == QString( "" ) ); // SString& remove( QChar ch, Qt::CaseSensitivity cs=Qt::CaseSensitive ); sstring.setRichString( "This Is a preTtI testi" ); sstring.remove( QChar( 'T' ), Qt::CaseSensitive ); QVERIFY( sstring.richString() == QString( "his Is a pretI testi" ) ); sstring.remove( QChar( 'i' ), Qt::CaseInsensitive ); QVERIFY( sstring.richString() == QString( "hs s a pret test" ) ); sstring.setRichString( "a" ); sstring.replace( QRegExp( "a$" ), "b" ); QVERIFY( sstring.richString() == QString( "b" ) ); sstring.setRichString( "cac" ); sstring.replace( "c", "b" ); // krazy:exclude=c++/doublequote_chars QVERIFY( sstring.richString() == QString( "bab" ) ); sstring.setRichString( "cac" ); sstring.replace( 'c', 'b' ); QVERIFY( sstring.richString() == QString( "bab" ) ); } QTEST_MAIN( SStringTest ); #include "sstringtest.moc" subtitlecomposer-0.5.3/src/core/time.cpp0000644000175000001440000001333211151345063017513 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "time.h" using namespace SubtitleComposer; Time::Time( long mseconds ): m_mseconds( 0 ) { operator=( mseconds ); } Time::Time( int hours, int minutes, int seconds, int mseconds ): m_mseconds( 0 ) { setHours( hours ); setMinutes( minutes ); setSeconds( seconds ); setMseconds( mseconds ); } Time::Time( const Time& time ): m_mseconds( time.m_mseconds ) { } void Time::setSecondsTime( double seconds ) { operator=( (long)(seconds*1000 + 0.5) ); } void Time::setMsecondsTime( long mseconds ) { operator=( mseconds ); } QString Time::toString( bool showMillis ) const { static QString builder; int hours = m_mseconds / 3600000; int minutes = (m_mseconds % 3600000) / 60000; int seconds = (m_mseconds % 60000) / 1000; if ( showMillis ) return builder.sprintf( "%02d:%02d:%02d.%03d", hours, minutes, seconds, m_mseconds % 1000 ); else return builder.sprintf( "%02d:%02d:%02d", hours, minutes, seconds ); } int Time::hours() const { return m_mseconds / 3600000; } bool Time::setHours( int hours ) { if ( hours < 0 || hours > 23 ) return false; m_mseconds += (hours - this->hours()) * 3600000; return true; } int Time::minutes() const { return (m_mseconds % 3600000) / 60000; } bool Time::setMinutes( int minutes ) { if ( minutes < 0 || minutes > 59 ) return false; m_mseconds += (minutes - this->minutes()) * 60000; return true; } int Time::seconds() const { return (m_mseconds % 60000) / 1000; } bool Time::setSeconds( int seconds ) { if ( seconds < 0 || seconds > 59 ) return false; m_mseconds += (seconds - this->seconds()) * 1000; return true; } int Time::mseconds() const { return m_mseconds % 1000; } bool Time::setMseconds( int mseconds ) { if ( mseconds < 0 || mseconds > 999 ) return false; m_mseconds += mseconds - this->mseconds(); return true; } void Time::shift( long mseconds ) { operator=( m_mseconds + mseconds ); } Time Time::shifted( long mseconds ) const { return Time( m_mseconds + mseconds ); } void Time::adjust( long shiftMseconds, double scaleFactor ) { operator=( (long)(shiftMseconds + m_mseconds*scaleFactor + 0.5) ); } Time Time::adjusted( long shiftMseconds, double scaleFactor ) const { return Time( (long)(shiftMseconds + m_mseconds*scaleFactor + 0.5) ); } Time& Time::operator=( const Time& time ) { if ( this == &time ) return *this; m_mseconds = time.m_mseconds; // m_string.clear(); return *this; } Time& Time::operator=( long mseconds ) { if ( mseconds < 0 ) m_mseconds = 0; else if ( mseconds > MaxMseconds ) m_mseconds = MaxMseconds; else m_mseconds = mseconds; // m_string.clear(); return *this; } Time Time::operator+( const Time& time ) const { return Time( m_mseconds + time.m_mseconds ); } Time Time::operator+( long mseconds ) const { return Time( m_mseconds + mseconds ); } Time& Time::operator+=( const Time& time ) { operator=( m_mseconds + time.m_mseconds ); return *this; } Time& Time::operator+=( long mseconds ) { operator=( m_mseconds + mseconds ); return *this; } Time Time::operator-( const Time& time ) const { return Time( m_mseconds - time.m_mseconds ); } Time Time::operator-( long mseconds ) const { return Time( m_mseconds - mseconds ); } Time& Time::operator-=( const Time& time ) { operator=( m_mseconds - time.m_mseconds ); return *this; } Time& Time::operator-=( long mseconds ) { operator=( m_mseconds - mseconds ); return *this; } bool Time::operator==( const Time& time ) const { return m_mseconds == time.m_mseconds; } bool Time::operator==( long mseconds ) const { return m_mseconds == mseconds; } bool Time::operator!=( const Time& time ) const { return m_mseconds != time.m_mseconds; } bool Time::operator!=( long mseconds ) const { return m_mseconds != mseconds; } bool Time::operator<( const Time& time ) const { return m_mseconds < time.m_mseconds; } bool Time::operator<( long mseconds ) const { return m_mseconds < mseconds; } bool Time::operator<=( const Time& time ) const { return m_mseconds <= time.m_mseconds; } bool Time::operator<=( long mseconds ) const { return m_mseconds <= mseconds; } bool Time::operator>( const Time& time ) const { return m_mseconds > time.m_mseconds; } bool Time::operator>( long mseconds ) const { return m_mseconds > mseconds; } bool Time::operator>=( const Time& time ) const { return m_mseconds >= time.m_mseconds; } bool Time::operator>=( long mseconds ) const { return m_mseconds >= mseconds; } subtitlecomposer-0.5.3/src/core/sstring.cpp0000644000175000001440000007146011206341216020251 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "sstring.h" #include #include #include using namespace SubtitleComposer; SString::SString( const QString& string, int styleFlags ): m_string( string ), m_styleFlags( 0 ), m_capacity( 0 ) { if ( m_string.length() ) { setMinFlagsCapacity( m_string.length() ); memset( m_styleFlags, styleFlags & AllStyles, m_string.length() ); } } SString::SString( const SString& sstring ): m_string( sstring.m_string ), m_styleFlags( 0 ), m_capacity( 0 ) { if ( m_string.length() ) { setMinFlagsCapacity( m_string.length() ); memcpy( m_styleFlags, sstring.m_styleFlags, m_string.length() ); } } SString& SString::operator=( const SString& sstring ) { if ( this == &sstring ) return *this; m_string = sstring.m_string; setMinFlagsCapacity( m_string.length() ); if ( m_string.length() ) memcpy( m_styleFlags, sstring.m_styleFlags, m_string.length() ); return *this; } SString::~SString() { delete [] m_styleFlags; } void SString::setString( const QString& string, int styleFlags ) { m_string = string; setMinFlagsCapacity( m_string.length() ); if ( m_string.length() ) memset( m_styleFlags, styleFlags & AllStyles, m_string.length() ); } QString SString::richString( RichOutputMode mode ) const { if ( m_string.isEmpty() ) return m_string; QString ret; if ( mode == Compact ) { char prevStyleFlags = m_styleFlags[0]; int prevIndex = 0; if ( prevStyleFlags & Italic ) ret += ""; if ( prevStyleFlags & Bold ) ret += ""; if ( prevStyleFlags & Underline ) ret += ""; if ( prevStyleFlags & StrikeThrough ) ret += ""; const int size = m_string.length(); for ( int index = 1; index < size; ++index ) { if ( m_styleFlags[index] != prevStyleFlags ) { QString token( m_string.mid( prevIndex, index - prevIndex ) ); ret += token.replace( '<', "<" ).replace( '>', ">" ); if ( (prevStyleFlags & StrikeThrough) && ! (m_styleFlags[index] & StrikeThrough) ) ret += ""; if ( (prevStyleFlags & Underline) && ! (m_styleFlags[index] & Underline) ) ret += ""; if ( (prevStyleFlags & Bold) && ! (m_styleFlags[index] & Bold) ) ret += ""; if ( (prevStyleFlags & Italic) && ! (m_styleFlags[index] & Italic) ) ret += ""; if ( ! (prevStyleFlags & Italic) && (m_styleFlags[index] & Italic) ) ret += ""; if ( ! (prevStyleFlags & Bold) && (m_styleFlags[index] & Bold) ) ret += ""; if ( ! (prevStyleFlags & Underline) && (m_styleFlags[index] & Underline) ) ret += ""; if ( ! (prevStyleFlags & StrikeThrough) && (m_styleFlags[index] & StrikeThrough) ) ret += ""; prevIndex = index; prevStyleFlags = m_styleFlags[index]; } } QString token( m_string.mid( prevIndex, m_string.length() - prevIndex ) ); if ( token.length() ) { ret += token.replace( '<', "<" ).replace( '>', ">" ); if ( prevStyleFlags & StrikeThrough ) ret += ""; if ( prevStyleFlags & Underline ) ret += ""; if ( prevStyleFlags & Bold ) ret += ""; if ( prevStyleFlags & Italic ) ret += ""; } } else // outputMode == Verbose { int currentStyleFlags = m_styleFlags[0]; int prevIndex = 0; for ( uint index = 1, size = m_string.length(); index < size; ++index ) { if ( currentStyleFlags != m_styleFlags[index] ) { if ( currentStyleFlags & StrikeThrough ) ret += ""; if ( currentStyleFlags & Bold ) ret += ""; if ( currentStyleFlags & Italic ) ret += ""; if ( currentStyleFlags & Underline ) ret += ""; ret += m_string.mid( prevIndex, index - prevIndex ); if ( currentStyleFlags & Underline ) ret += ""; if ( currentStyleFlags & Italic ) ret += ""; if ( currentStyleFlags & Bold ) ret += ""; if ( currentStyleFlags & StrikeThrough ) ret += ""; prevIndex = index; currentStyleFlags = m_styleFlags[index]; } } if ( prevIndex + 1 < m_string.length() ) { if ( currentStyleFlags & StrikeThrough ) ret += ""; if ( currentStyleFlags & Bold ) ret += ""; if ( currentStyleFlags & Italic ) ret += ""; if ( currentStyleFlags & Underline ) ret += ""; ret += m_string.mid( prevIndex ); if ( currentStyleFlags & Underline ) ret += ""; if ( currentStyleFlags & Italic ) ret += ""; if ( currentStyleFlags & Bold ) ret += ""; if ( currentStyleFlags & StrikeThrough ) ret += ""; } } return ret; } SString& SString::setRichString( const QString& string ) { QRegExp tagRegExp( "" ); m_string.clear(); int currentStyle = 0; int offsetPos = 0, matchedPos; while ( (matchedPos = tagRegExp.indexIn( string, offsetPos ) ) != -1 ) { QString matched( tagRegExp.cap( 0 ).toLower() ); int newStyle = currentStyle; if ( matched == "" ) newStyle |= SString::Bold; else if ( matched == "" ) newStyle |= SString::Italic; else if ( matched == "" ) newStyle |= SString::Underline; else if ( matched == "" ) newStyle |= SString::StrikeThrough; else if ( matched == "" ) newStyle &= ~SString::Bold; else if ( matched == "" ) newStyle &= ~SString::Italic; else if ( matched == "" ) newStyle &= ~SString::Underline; else if ( matched == "" ) newStyle &= ~SString::StrikeThrough; if ( newStyle != currentStyle ) { QString token( string.mid( offsetPos, matchedPos - offsetPos ) ); append( SString( token.replace( "<", "<" ).replace( ">", ">" ), currentStyle ) ); currentStyle = newStyle; } offsetPos = matchedPos + matched.length(); } QString token( string.mid( offsetPos, matchedPos - offsetPos ) ); append( SString( token.replace( "<", "<" ).replace( ">", ">" ), currentStyle ) ); return *this; } int SString::cummulativeStyleFlags() const { int cummulativeStyleFlags = 0; for ( int index = 0, size = m_string.length(); index < size; ++index ) { cummulativeStyleFlags |= m_styleFlags[index]; if ( cummulativeStyleFlags == AllStyles ) break; } return cummulativeStyleFlags; } bool SString::hasStyleFlags( int styleFlags ) const { int cummulativeStyleFlags = 0; for ( int index = 0, size = m_string.length(); index < size; ++index ) { cummulativeStyleFlags |= m_styleFlags[index]; if ( (cummulativeStyleFlags & styleFlags) == styleFlags ) return true; } return false; } SString& SString::setStyleFlags( int index, int len, int styleFlags ) { if ( index < 0 || index >= (int)m_string.length() ) return *this; for ( int index2 = index + length( index, len ); index < index2; ++index ) m_styleFlags[index] = styleFlags; return *this; } SString& SString::setStyleFlags( int index, int len, int styleFlags, bool on ) { if ( index < 0 || index >= (int)m_string.length() ) return *this; if ( on ) { for ( int index2 = index + length( index, len ); index < index2; ++index ) m_styleFlags[index] = m_styleFlags[index] | styleFlags; } else { styleFlags = ~styleFlags; for ( int index2 = index + length( index, len ); index < index2; ++index ) m_styleFlags[index] = m_styleFlags[index] & styleFlags; } return *this; } void SString::clear() { m_string.clear(); setMinFlagsCapacity( 0 ); } void SString::truncate( int size ) { // no need to change m_styleFlags m_string.truncate( size ); } SString& SString::insert( int index, QChar ch ) { int oldLength = m_string.length(); if ( index <= oldLength && index >= 0 ) { m_string.insert( index, ch ); char* oldStyleFlags = detachFlags(); setMinFlagsCapacity( m_string.length() ); char fillFlags = 0; if ( oldLength ) { if ( index == 0 ) fillFlags = oldStyleFlags[0]; else fillFlags = oldStyleFlags[index-1]; } memcpy( m_styleFlags, oldStyleFlags, index ); m_styleFlags[index] = fillFlags; memcpy( m_styleFlags + index + 1, oldStyleFlags + index, m_string.length() - index - 1 ); delete [] oldStyleFlags; } return *this; } SString& SString::insert( int index, const QString& str ) { int oldLength = m_string.length(); if ( str.length() && index <= oldLength && index >= 0 ) { m_string.insert( index, str ); char* oldStyleFlags = detachFlags(); setMinFlagsCapacity( m_string.length() ); char fillFlags = 0; if ( oldLength ) { if ( index == 0 ) fillFlags = oldStyleFlags[0]; else fillFlags = oldStyleFlags[index-1]; } int addedLength = str.length(); memcpy( m_styleFlags, oldStyleFlags, index ); memset( m_styleFlags + index, fillFlags, addedLength ); memcpy( m_styleFlags + index + addedLength, oldStyleFlags + index, m_string.length() - index - addedLength ); delete [] oldStyleFlags; } return *this; } SString& SString::insert( int index, const SString& str ) { int oldLength = m_string.length(); if ( str.m_string.length() && index <= oldLength && index >= 0 ) { m_string.insert( index, str.m_string ); char* oldStyleFlags = detachFlags(); setMinFlagsCapacity( m_string.length() ); int addedLength = str.m_string.length(); memcpy( m_styleFlags, oldStyleFlags, index ); memcpy( m_styleFlags + index, str.m_styleFlags, addedLength ); memcpy( m_styleFlags + index + addedLength, oldStyleFlags + index, m_string.length() - index - addedLength ); delete [] oldStyleFlags; } return *this; } SString& SString::replace( int index, int len, const QString& replacement ) { int oldLength = m_string.length(); if ( index < 0 || index >= oldLength ) return *this; len = length( index, len ); if ( len == 0 && replacement.length() == 0 ) // nothing to do (replace nothing with nothing) return *this; m_string.replace( index, len, replacement ); // simple path for when there's no need to change the styles (char substitution) if ( len == 1 && replacement.length() == 1 ) return *this; if ( len == replacement.length() ) // the length of the string wasn't changed { if ( index >= oldLength ) // index can't really be greater than oldLength memset( m_styleFlags + index, oldLength ? m_styleFlags[oldLength-1] : 0, len ); else // index < oldLength (NOTE: index is always >= 0) memset( m_styleFlags + index, m_styleFlags[index], len ); } else // the length of the string was changed { char* oldStyleFlags = detachFlags(); setMinFlagsCapacity( m_string.length() ); memcpy( m_styleFlags, oldStyleFlags, index ); memset( m_styleFlags + index, oldStyleFlags[index], replacement.length() ); memcpy( m_styleFlags + index + replacement.length(), oldStyleFlags + index + len, m_string.length() - index - replacement.length() ); delete [] oldStyleFlags; } return *this; } SString& SString::replace( int index, int len, const SString& replacement ) { int oldLength = m_string.length(); if ( index < 0 || index >= oldLength ) return *this; len = length( index, len ); if ( len == 0 && replacement.m_string.length() == 0 ) // nothing to do (replace nothing with nothing) return *this; m_string.replace( index, len, replacement.m_string ); // simple path for when there's no need to change the styles (char substitution) if ( len == 1 && replacement.m_string.length() == 1 ) return *this; char* oldStyleFlags = detachFlags(); setMinFlagsCapacity( m_string.length() ); memcpy( m_styleFlags, oldStyleFlags, index ); memcpy( m_styleFlags + index, replacement.m_styleFlags, replacement.m_string.length() ); memcpy( m_styleFlags + index + replacement.m_string.length(), oldStyleFlags + index + len, m_string.length() - index - replacement.m_string.length() ); delete [] oldStyleFlags; return *this; } SString& SString::replace( const QString& before, const QString& after, Qt::CaseSensitivity cs ) { if ( before.length() == 0 && after.length() == 0 ) return *this; if ( before.length() == 1 && after.length() == 1 ) { // simple path for when there's no need to change the styles flags m_string.replace( before, after ); return *this; } int oldLength = m_string.length(); int beforeLength = before.length(); int afterLength = after.length(); QList changedData; // each entry contains the start index of a replaced substring for ( int offsetIndex = 0, matchedIndex; (matchedIndex = m_string.indexOf( before, offsetIndex, cs )) != -1; offsetIndex = matchedIndex + afterLength ) { m_string.replace( matchedIndex, beforeLength, after ); changedData.append( matchedIndex ); if ( ! beforeLength ) matchedIndex++; } if ( changedData.empty() ) // nothing was replaced return *this; if ( m_string.length() ) { int newOffset = 0; int oldOffset = 0; int unchangedLength; char* oldStyleFlags = detachFlags(); setMinFlagsCapacity( m_string.length() ); for ( int index = 0; index < changedData.size(); ++index ) { unchangedLength = changedData[index] - newOffset; memcpy( m_styleFlags + newOffset, oldStyleFlags + oldOffset, unchangedLength ); newOffset += unchangedLength; oldOffset += unchangedLength; memset( m_styleFlags + newOffset, oldOffset changedData; // each entry contains the start index of a replaced substring for ( int offsetIndex = 0, matchedIndex; (matchedIndex = m_string.indexOf( before, offsetIndex, cs )) != -1; offsetIndex = matchedIndex + afterLength ) { m_string.replace( matchedIndex, beforeLength, after.m_string ); changedData.append( matchedIndex ); if ( ! beforeLength ) matchedIndex++; } if ( changedData.empty() ) // nothing was replaced return *this; if ( m_string.length() ) { int newOffset = 0; int oldOffset = 0; int unchangedLength; char* oldStyleFlags = detachFlags(); setMinFlagsCapacity( m_string.length() ); for ( int index = 0; index < changedData.size(); ++index ) { unchangedLength = changedData[index] - newOffset; memcpy( m_styleFlags + newOffset, oldStyleFlags + oldOffset, unchangedLength ); newOffset += unchangedLength; oldOffset += unchangedLength; memcpy( m_styleFlags + newOffset, after.m_styleFlags, afterLength ); newOffset += afterLength; oldOffset += beforeLength; } memcpy( m_styleFlags + newOffset, oldStyleFlags + oldOffset, oldLength - oldOffset ); delete [] oldStyleFlags; } else setMinFlagsCapacity( m_string.length() ); return *this; } SString& SString::replace( QChar before, QChar after, Qt::CaseSensitivity cs ) { m_string.replace( before, after, cs ); return *this; } SString& SString::replace( QChar ch, const QString& after, Qt::CaseSensitivity cs ) { if ( after.length() == 1 ) { // simple path for when there's no need to change the styles flags m_string.replace( ch, after.at( 0 ) ); return *this; } int oldLength = m_string.length(); int afterLength = after.length(); QList changedData; // each entry contains the start index of a replaced substring for ( int offsetIndex = 0, matchedIndex; (matchedIndex = m_string.indexOf( ch, offsetIndex, cs )) != -1; offsetIndex = matchedIndex + afterLength ) { m_string.replace( matchedIndex, 1, after ); changedData.append( matchedIndex ); } if ( changedData.empty() ) // nothing was replaced return *this; if ( m_string.length() ) { int newOffset = 0; int oldOffset = 0; int unchangedLength; char* oldStyleFlags = detachFlags(); setMinFlagsCapacity( m_string.length() ); for ( int index = 0; index < changedData.size(); ++index ) { unchangedLength = changedData[index] - newOffset; memcpy( m_styleFlags + newOffset, oldStyleFlags + oldOffset, unchangedLength ); newOffset += unchangedLength; oldOffset += unchangedLength; memset( m_styleFlags + newOffset, oldOffset changedData; // each entry contains the start index of a replaced substring for ( int offsetIndex = 0, matchedIndex; (matchedIndex = m_string.indexOf( ch, offsetIndex, cs )) != -1; offsetIndex = matchedIndex + afterLength ) { m_string.replace( matchedIndex, 1, after.m_string ); changedData.append( matchedIndex ); } if ( changedData.empty() ) // nothing was replaced return *this; if ( m_string.length() ) { int newOffset = 0; int oldOffset = 0; int unchangedLength; char* oldStyleFlags = detachFlags(); setMinFlagsCapacity( m_string.length() ); for ( int index = 0; index < changedData.size(); ++index ) { unchangedLength = changedData[index] - newOffset; memcpy( m_styleFlags + newOffset, oldStyleFlags + oldOffset, unchangedLength ); newOffset += unchangedLength; oldOffset += unchangedLength; memcpy( m_styleFlags + newOffset, after.m_styleFlags, afterLength ); newOffset += afterLength; oldOffset += 1; } memcpy( m_styleFlags + newOffset, oldStyleFlags + oldOffset, oldLength - oldOffset ); delete [] oldStyleFlags; } else setMinFlagsCapacity( m_string.length() ); return *this; } SString& SString::replace( const QRegExp& rx, const QString& a ) { QRegExp regExp( rx ); int oldLength = m_string.length(); QList changedData; // each entry contains the start index of a replaced substring QRegExp::CaretMode caretMode = QRegExp::CaretAtZero; for ( int offsetIndex = 0, matchedIndex; (matchedIndex = regExp.indexIn( m_string, offsetIndex, caretMode )) != -1; ) { QString after( a ); bool escaping = false; for ( int afterIndex = 0, afterSize = after.length(); afterIndex < afterSize; ++afterIndex ) { QChar chr = after.at( afterIndex ); if ( escaping ) // perform replace { escaping = false; if ( chr.isNumber() ) { int capNumber = chr.digitValue(); if ( capNumber <= regExp.numCaptures() ) { QString cap( regExp.cap( capNumber ) ); after.replace( afterIndex - 1, 2, cap ); afterIndex = afterIndex - 1 + cap.length(); afterSize = after.length(); } } } else if ( chr == '\\' ) escaping = ! escaping; } if ( regExp.matchedLength() == 0 && after.length() == 0 ) continue; m_string.replace( matchedIndex, regExp.matchedLength(), after ); if ( regExp.matchedLength() != 1 || after.length() != 1 ) { changedData.append( matchedIndex ); changedData.append( regExp.matchedLength() ); // before length changedData.append( after.length() ); // after length if ( ! regExp.matchedLength() ) matchedIndex++; } offsetIndex = matchedIndex + after.length(); caretMode = QRegExp::CaretWontMatch; // caret should only be matched the first time } if ( changedData.empty() ) // nothing was replaced return *this; if ( m_string.length() ) { int newOffset = 0; int oldOffset = 0; int unchangedLength; int beforeLength; int afterLength; char* oldStyleFlags = detachFlags(); setMinFlagsCapacity( m_string.length() ); for ( int index = 0; index < changedData.size(); index += 3 ) { unchangedLength = changedData[index] - newOffset; beforeLength = changedData[index+1]; afterLength = changedData[index+2]; memcpy( m_styleFlags + newOffset, oldStyleFlags + oldOffset, unchangedLength ); newOffset += unchangedLength; oldOffset += unchangedLength; memset( m_styleFlags + newOffset, oldOffset= 0 ) len += index; index = 0; } if ( index >= (int)m_string.length() ) return SString(); len = length( index, len ); SString ret; ret.m_string = m_string.mid( index, len ); ret.setMinFlagsCapacity( len ); memcpy( ret.m_styleFlags, m_styleFlags + index, len ); return ret; } SString SString::toLower() const { SString ret( *this ); ret.m_string = m_string.toLower(); return ret; } SString SString::toUpper() const { SString ret( *this ); ret.m_string = m_string.toUpper(); return ret; } SString SString::toTitleCase( bool lowerFirst ) const { const QString wordSeparators( " -_([:,;./\\\t\n\"" ); SString ret( *this ); if ( lowerFirst ) ret.m_string = m_string.toLower(); bool wordStart = true; for ( uint idx = 0, size = m_string.length(); idx < size; ++idx ) { QCharRef chr = ret.m_string[idx]; if ( wordStart ) { if ( ! wordSeparators.contains( chr ) ) { wordStart = false; chr = chr.toUpper(); } } else if ( wordSeparators.contains( chr ) ) wordStart = true; } return ret; } SString SString::toSentenceCase( bool lowerFirst, bool* cont ) const { const QString sentenceEndChars( ".?!" ); SString ret( *this ); if ( lowerFirst ) ret.m_string = m_string.toLower(); if ( m_string.isEmpty() ) return ret; uint prevDots = 0; bool startSentence = cont ? ! *cont : true; for ( uint index = 0, size = m_string.length(); index < size; ++index ) { QCharRef chr = ret.m_string[index]; if ( sentenceEndChars.contains( chr ) ) { if ( chr == '.' ) { prevDots++; startSentence = prevDots < 3; } else { prevDots = 0; startSentence = true; } } else { if ( startSentence && chr.isLetterOrNumber() ) { chr = chr.toUpper(); startSentence = false; } if ( ! chr.isSpace() ) prevDots = 0; } } if ( cont ) *cont = prevDots != 1 && ! startSentence; return ret; } SString SString::simplified() const { const QRegExp simplifySpaceRegExp( "\\s{2,MAXINT}" ); return trimmed().replace( simplifySpaceRegExp, " " ); } SString SString::trimmed() const { const QRegExp trimRegExp( "(^\\s+|\\s+$)" ); SString ret( *this ); return ret.remove( trimRegExp ); } bool SString::operator!=( const SString& sstring ) const { if ( m_string != sstring.m_string ) return true; for ( int index = 0, size = m_string.length(); index < size; ++index ) if ( m_styleFlags[index] != sstring.m_styleFlags[index] ) return true; return false; } char* SString::detachFlags() { char* ret = m_styleFlags; m_styleFlags = 0; m_capacity = 0; return ret; } void SString::setMinFlagsCapacity( int capacity ) { if ( capacity > m_capacity ) { m_capacity = capacity * 2; delete [] m_styleFlags; m_styleFlags = new char[m_capacity]; } else if ( capacity == 0 ) { m_capacity = 0; delete [] m_styleFlags; m_styleFlags = 0; } else if ( m_capacity > 100 && capacity < m_capacity / 2 ) { m_capacity = m_capacity / 2; delete [] m_styleFlags; m_styleFlags = new char[m_capacity]; } } SStringList::SStringList() { } SStringList::SStringList( const SString& str ) { append( str ); } SStringList::SStringList( const SStringList::SStringList& list ): QList( list ) { } SStringList::SStringList( const QList& list ): QList( list ) { } SStringList::SStringList( const QStringList& list ) { for ( QStringList::ConstIterator it = list.begin(), end = list.end(); it != end; ++it ) append( *it ); } SStringList::SStringList( const QList& list ) { for ( QList::ConstIterator it = list.begin(), end = list.end(); it != end; ++it ) append( *it ); } SString SStringList::join( const SString& sep ) const { SString ret; bool skipSeparator = true; for ( SStringList::ConstIterator it = begin(), end = this->end(); it != end; ++it ) { if ( skipSeparator ) { ret += *it; skipSeparator = false; continue; } ret += sep; ret += *it; } return ret; } subtitlecomposer-0.5.3/src/core/subtitleactions.cpp0000644000175000001440000002740411151345063021776 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "subtitleactions.h" #include "subtitleiterator.h" #include "subtitleline.h" #include "sstring.h" #include #include using namespace SubtitleComposer; /// SUBTITLE ACTION /// =============== SubtitleAction::SubtitleAction( Subtitle& subtitle, SubtitleAction::DirtyMode dirtyMode, const QString& description ): Action( description ), m_subtitle( subtitle ), m_dirtyMode( dirtyMode ) { } SubtitleAction::~SubtitleAction() { } void SubtitleAction::_preRedo() { m_subtitle.incrementState( m_dirtyMode ); } void SubtitleAction::_preUndo() { m_subtitle.decrementState( m_dirtyMode ); } /// SET FRAMES PER SECOND ACTION /// ============================ SetFramesPerSecondAction::SetFramesPerSecondAction( Subtitle& subtitle, double framesPerSecond ): SubtitleAction( subtitle, SubtitleAction::Both, i18n( "Set Frame Rate" ) ), m_framesPerSecond( framesPerSecond ) {} SetFramesPerSecondAction::~SetFramesPerSecondAction() {} void SetFramesPerSecondAction::_redo() { double aux = m_subtitle.m_framesPerSecond; m_subtitle.m_framesPerSecond = m_framesPerSecond; m_framesPerSecond = aux; } void SetFramesPerSecondAction::_undo() { _redo(); } void SetFramesPerSecondAction::_emitRedoSignals() { emit m_subtitle.framesPerSecondChanged( m_subtitle.m_framesPerSecond ); } void SetFramesPerSecondAction::_emitUndoSignals() { _emitRedoSignals(); } /// INSERT LINES ACTION /// =================== InsertLinesAction::InsertLinesAction( Subtitle& subtitle, const QList& lines, int insertIndex ): SubtitleAction( subtitle, SubtitleAction::Both, i18n( "Insert Lines" ) ), m_insertIndex( insertIndex < 0 ? subtitle.linesCount() : insertIndex ), m_lastIndex( m_insertIndex + lines.count() - 1 ), m_lines( lines ) { Q_ASSERT( m_insertIndex >= 0 ); Q_ASSERT( m_insertIndex <= m_subtitle.linesCount() ); Q_ASSERT( m_lastIndex >= 0 ); Q_ASSERT( m_insertIndex <= m_lastIndex ); } InsertLinesAction::~InsertLinesAction() { qDeleteAll( m_lines ); } bool InsertLinesAction::mergeWithPrevious( Action* pa ) { InsertLinesAction* prevAction = tryCastTo( pa ); if ( ! prevAction || &prevAction->m_subtitle != &m_subtitle ) return false; if ( m_insertIndex == prevAction->m_insertIndex ) { // this inserted lines immediately above those inserted by prevAction m_lastIndex += (prevAction->m_lastIndex - prevAction->m_insertIndex + 1); prevAction->_preUndo(); return true; } else if ( m_insertIndex == prevAction->m_lastIndex + 1 ) { // this inserted lines immediately below those inserted by prevAction m_insertIndex -= (prevAction->m_lastIndex - prevAction->m_insertIndex + 1); prevAction->_preUndo(); return true; } return false; } void InsertLinesAction::_redo() { emit m_subtitle.linesAboutToBeInserted( m_insertIndex, m_lastIndex ); SubtitleLine* line; int insertOffset = 0; int lineIndex; while ( ! m_lines.isEmpty() ) { line = m_lines.takeFirst(); lineIndex = m_insertIndex + insertOffset++; m_subtitle.m_lines.insert( lineIndex, line ); setLineSubtitle( line, lineIndex ); } if ( m_subtitle.m_lastValidCachedIndex >= m_insertIndex || m_insertIndex == 0 ) m_subtitle.setLastValidCachedIndex( lineIndex ); emit m_subtitle.linesInserted( m_insertIndex, m_lastIndex ); } void InsertLinesAction::_undo() { emit m_subtitle.linesAboutToBeRemoved( m_insertIndex, m_lastIndex ); for ( int index = m_insertIndex; index <= m_lastIndex; ++index ) { SubtitleLine* line = m_subtitle.m_lines.takeAt( m_insertIndex ); clearLineSubtitle( line ); m_lines.append( line ); } if ( m_subtitle.m_lastValidCachedIndex >= m_insertIndex ) m_subtitle.setLastValidCachedIndex( m_insertIndex - 1 ); emit m_subtitle.linesRemoved( m_insertIndex, m_lastIndex ); } /// REMOVE LINES ACTION /// =================== RemoveLinesAction::RemoveLinesAction( Subtitle& subtitle, int firstIndex, int lastIndex ): SubtitleAction( subtitle, SubtitleAction::Both, i18n( "Remove Lines" ) ), m_firstIndex( firstIndex ), m_lastIndex( lastIndex < 0 ? subtitle.lastIndex() : lastIndex ), m_lines() { Q_ASSERT( m_firstIndex >= 0 ); Q_ASSERT( m_firstIndex <= m_subtitle.linesCount() ); Q_ASSERT( m_lastIndex >= 0 ); Q_ASSERT( m_lastIndex <= m_subtitle.linesCount() ); Q_ASSERT( m_firstIndex <= m_lastIndex ); } RemoveLinesAction::~RemoveLinesAction() { qDeleteAll( m_lines ); } bool RemoveLinesAction::mergeWithPrevious( Action* pa ) { RemoveLinesAction* prevAction = tryCastTo( pa ); if ( ! prevAction || &prevAction->m_subtitle != &m_subtitle ) return false; if ( m_firstIndex == prevAction->m_firstIndex ) { // this removed lines immediately below those removed by prevAction m_lastIndex += prevAction->m_lines.count(); while ( ! prevAction->m_lines.isEmpty() ) m_lines.prepend( prevAction->m_lines.takeLast() ); prevAction->_preUndo(); return true; } else if ( m_lastIndex + 1 == prevAction->m_firstIndex ) { // this removed lines immediately above those removed by prevAction m_lastIndex += prevAction->m_lines.count(); while ( ! prevAction->m_lines.isEmpty() ) m_lines.append( prevAction->m_lines.takeFirst() ); prevAction->_preUndo(); return true; } return false; } void RemoveLinesAction::_redo() { emit m_subtitle.linesAboutToBeRemoved( m_firstIndex, m_lastIndex ); for ( int index = m_firstIndex; index <= m_lastIndex; ++index ) { SubtitleLine* line = m_subtitle.m_lines.takeAt( m_firstIndex ); clearLineSubtitle( line ); m_lines.append( line ); } if ( m_subtitle.m_lastValidCachedIndex >= m_firstIndex ) m_subtitle.setLastValidCachedIndex( m_firstIndex - 1 ); emit m_subtitle.linesRemoved( m_firstIndex, m_lastIndex ); } void RemoveLinesAction::_undo() { emit m_subtitle.linesAboutToBeInserted( m_firstIndex, m_lastIndex ); int insertOffset = 0; int lineIndex; while ( ! m_lines.isEmpty() ) { SubtitleLine* line = m_lines.takeFirst(); lineIndex = m_firstIndex + insertOffset++; m_subtitle.m_lines.insert( lineIndex, line ); setLineSubtitle( line, lineIndex ); } if ( m_subtitle.m_lastValidCachedIndex >= m_firstIndex || m_firstIndex == 0 ) m_subtitle.setLastValidCachedIndex( lineIndex ); emit m_subtitle.linesInserted( m_firstIndex, m_lastIndex ); } /// MOVE LINE ACTION /// ================ MoveLineAction::MoveLineAction( Subtitle& subtitle, int fromIndex, int toIndex ): SubtitleAction( subtitle, SubtitleAction::Both, i18n( "Move Line" ) ), m_fromIndex( fromIndex ), m_toIndex( toIndex < 0 ? subtitle.lastIndex() : toIndex ) { Q_ASSERT( m_fromIndex >= 0 ); Q_ASSERT( m_fromIndex <= m_subtitle.linesCount() ); Q_ASSERT( m_toIndex >= 0 ); Q_ASSERT( m_toIndex <= m_subtitle.linesCount() ); Q_ASSERT( m_fromIndex != m_toIndex ); } MoveLineAction::~MoveLineAction() {} bool MoveLineAction::mergeWithPrevious( Action* pa ) { MoveLineAction* prevAction = tryCastTo( pa ); if ( ! prevAction || &prevAction->m_subtitle != &m_subtitle ) return false; Q_ASSERT( pa != this ); bool compressed = false; if ( prevAction->m_toIndex == m_fromIndex ) { m_fromIndex = prevAction->m_fromIndex; compressed = true; } // when the distance between fromIndex and toIndex is 1, the action is the same as if the values were swapped else if ( m_toIndex - m_fromIndex == 1 || m_fromIndex - m_toIndex == 1 ) { if ( prevAction->m_toIndex == m_toIndex ) { m_toIndex = m_fromIndex; m_fromIndex = prevAction->m_fromIndex; compressed = true; } // same as before, but now we consider inverting the previous action too else if ( prevAction->m_toIndex - prevAction->m_fromIndex == 1 || prevAction->m_fromIndex - prevAction->m_toIndex == 1 ) { if ( prevAction->m_fromIndex == m_toIndex ) { m_toIndex = m_fromIndex; m_fromIndex = prevAction->m_toIndex; compressed = true; } } } // again, same as before, but now we consider inverting only the previous action else if ( prevAction->m_toIndex - prevAction->m_fromIndex == 1 || prevAction->m_fromIndex - prevAction->m_toIndex == 1 ) { if ( prevAction->m_fromIndex == m_fromIndex ) { m_fromIndex = prevAction->m_toIndex; compressed = true; } } if ( compressed ) { prevAction->_preUndo(); } return compressed; } void MoveLineAction::_redo() { emit m_subtitle.linesAboutToBeRemoved( m_fromIndex, m_fromIndex ); SubtitleLine* line = m_subtitle.m_lines.takeAt( m_fromIndex ); clearLineSubtitle( line ); if ( m_subtitle.m_lastValidCachedIndex >= m_fromIndex ) m_subtitle.setLastValidCachedIndex( m_fromIndex - 1 ); emit m_subtitle.linesRemoved( m_fromIndex, m_fromIndex ); emit m_subtitle.linesAboutToBeInserted( m_toIndex, m_toIndex ); m_subtitle.m_lines.insert( m_toIndex, line ); setLineSubtitle( line, m_toIndex ); if ( m_subtitle.m_lastValidCachedIndex >= m_toIndex || m_toIndex == 0 ) m_subtitle.setLastValidCachedIndex( m_toIndex ); emit m_subtitle.linesInserted( m_toIndex, m_toIndex ); } void MoveLineAction::_undo() { emit m_subtitle.linesAboutToBeRemoved( m_toIndex, m_toIndex ); SubtitleLine* line = m_subtitle.m_lines.takeAt( m_toIndex ); clearLineSubtitle( line ); if ( m_subtitle.m_lastValidCachedIndex >= m_toIndex ) m_subtitle.setLastValidCachedIndex( m_toIndex - 1 ); emit m_subtitle.linesRemoved( m_toIndex, m_toIndex ); emit m_subtitle.linesAboutToBeInserted( m_fromIndex, m_fromIndex ); m_subtitle.m_lines.insert( m_fromIndex, line ); setLineSubtitle( line, m_fromIndex ); if ( m_subtitle.m_lastValidCachedIndex >= m_fromIndex || m_fromIndex == 0 ) m_subtitle.setLastValidCachedIndex( m_fromIndex ); emit m_subtitle.linesInserted( m_fromIndex, m_fromIndex ); } /// SWAP LINES TEXTS ACTION /// ======================= SwapLinesTextsAction::SwapLinesTextsAction( Subtitle& subtitle, const RangeList& ranges ): SubtitleAction( subtitle, SubtitleAction::Both, i18n( "Swap Texts" ) ), m_ranges( ranges ) { } SwapLinesTextsAction::~SwapLinesTextsAction() { } void SwapLinesTextsAction::_redo() { for ( SubtitleIterator it( m_subtitle, m_ranges ); it.current(); ++it ) { SubtitleLine* line = it.current(); SString aux = line->m_primaryText; line->m_secondaryText = line->m_primaryText; line->m_primaryText = aux; } } void SwapLinesTextsAction::_undo() { _redo(); } void SwapLinesTextsAction::_emitRedoSignals() { for ( SubtitleIterator it( m_subtitle, m_ranges ); it.current(); ++it ) { SubtitleLine* line = it.current(); emit line->primaryTextChanged( line->m_primaryText ); emit line->secondaryTextChanged( line->m_secondaryText ); } } void SwapLinesTextsAction::_emitUndoSignals() { _emitRedoSignals(); } subtitlecomposer-0.5.3/src/core/subtitle.cpp0000644000175000001440000012566211206200225020411 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "subtitle.h" #include "subtitleline.h" #include "subtitleiterator.h" #include "subtitleactions.h" #include "compositeaction.h" #include using namespace SubtitleComposer; double Subtitle::s_defaultFramesPerSecond( 23.976 ); double Subtitle::defaultFramesPerSecond() { return s_defaultFramesPerSecond; } void Subtitle::setDefaultFramesPerSecond( double framesPerSecond ) { s_defaultFramesPerSecond = framesPerSecond; } Subtitle::Subtitle( double framesPerSecond ): m_primaryState( 0 ), m_primaryCleanState( 0 ), m_secondaryState( 0 ), m_secondaryCleanState( 0 ), m_compositeAction( 0 ), m_compositeActionDepth( 0 ), m_framesPerSecond( framesPerSecond ), m_lastValidCachedIndex( -1 ), m_formatData( 0 ) { } Subtitle::~Subtitle() { qDeleteAll( m_lines ); delete m_compositeAction; delete m_formatData; } void Subtitle::setPrimaryData( const Subtitle& from, bool usePrimaryData ) { beginCompositeAction( i18n( "Set Primary Data" ) ); setFormatData( from.m_formatData ); setFramesPerSecond( from.framesPerSecond() ); SubtitleIterator fromIt( from, Range::full() ); SubtitleIterator thisIt( *this, Range::full() ); // the errors that we are going to take from 'from': const int fromErrors = (usePrimaryData ? SubtitleLine::PrimaryOnlyErrors : SubtitleLine::SecondaryOnlyErrors)| SubtitleLine::SharedErrors; // the errors that we are going to keep: const int thisErrors = SubtitleLine::SecondaryOnlyErrors; for ( SubtitleLine *fromLine = fromIt.current(), *thisLine = thisIt.current(); fromLine && thisLine; ++fromIt, ++thisIt, fromLine = fromIt.current(), thisLine = thisIt.current() ) { thisLine->setPrimaryText( usePrimaryData ? fromLine->primaryText() : fromLine->secondaryText() ); thisLine->setTimes( fromLine->showTime(), fromLine->hideTime() ); thisLine->setErrorFlags( (fromLine->errorFlags() & fromErrors) | (thisLine->errorFlags() & thisErrors) ); thisLine->setFormatData( fromLine->formatData() ); } if ( fromIt.current() ) // 'from' had more lines than '*this' { QList lines; for ( ; fromIt.current(); ++fromIt ) { SubtitleLine* thisLine = new SubtitleLine( *fromIt.current() ); if ( ! usePrimaryData ) thisLine->setPrimaryText( thisLine->secondaryText() ); thisLine->setSecondaryText( SString() ); thisLine->setErrorFlags( SubtitleLine::SecondaryOnlyErrors, false ); thisLine->setFormatData( fromIt.current()->formatData() ); lines.append( thisLine ); } processAction( new InsertLinesAction( *this, lines ) ); } else if ( thisIt.current() ) // '*this' had more lines than 'from' { for ( SubtitleLine* thisLine = thisIt.current(); thisLine; ++thisIt, thisLine = thisIt.current() ) { thisLine->setPrimaryText( SString() ); thisLine->setErrorFlags( SubtitleLine::PrimaryOnlyErrors, false ); thisLine->setFormatData( 0 ); } } endCompositeAction(); } void Subtitle::clearPrimaryTextData() { beginCompositeAction( i18n( "Clear Primary Text Data" ) ); for ( SubtitleIterator it( *this ); it.current(); ++it ) { it.current()->setPrimaryText( SString() ); it.current()->setErrorFlags( SubtitleLine::PrimaryOnlyErrors, false ); } endCompositeAction(); } void Subtitle::setSecondaryData( const Subtitle& from, bool fromPrimaryData ) { beginCompositeAction( i18n( "Set Secondary Data" ) ); SubtitleIterator fromIt( from, Range::full() ); SubtitleIterator thisIt( *this, Range::full() ); // the errors that we are going to take from 'from': const int fromErrors = fromPrimaryData ? SubtitleLine::PrimaryOnlyErrors : SubtitleLine::SecondaryOnlyErrors; // the errors that we are going to keep: const int thisErrors = SubtitleLine::PrimaryOnlyErrors|SubtitleLine::SharedErrors; for ( SubtitleLine *fromLine = fromIt.current(), *thisLine = thisIt.current(); fromLine && thisLine; ++fromIt, ++thisIt, fromLine = fromIt.current(), thisLine = thisIt.current() ) { thisLine->setSecondaryText( fromPrimaryData ? fromLine->primaryText() : fromLine->secondaryText() ); thisLine->setErrorFlags( (thisLine->errorFlags() & thisErrors) | (fromLine->errorFlags() & fromErrors) ); } if ( fromIt.current() ) // subtitle had more lines than *this { QList lines; for ( ; fromIt.current(); ++fromIt ) { SubtitleLine* thisLine = new SubtitleLine( *fromIt.current() ); if ( fromPrimaryData ) thisLine->setSecondaryText( thisLine->primaryText() ); thisLine->setPrimaryText( SString() ); thisLine->setErrorFlags( SubtitleLine::PrimaryOnlyErrors, false ); lines.append( thisLine ); } processAction( new InsertLinesAction( *this, lines ) ); } else if ( thisIt.current() ) // *this had more lines than subtitle { for ( SubtitleLine* thisLine = thisIt.current(); thisLine; ++thisIt, thisLine = thisIt.current() ) { thisLine->setSecondaryText( SString() ); thisLine->setErrorFlags( SubtitleLine::SecondaryOnlyErrors, false ); } } endCompositeAction(); } void Subtitle::clearSecondaryTextData() { beginCompositeAction( i18n( "Clear Secondary Text Data" ) ); for ( SubtitleIterator it( *this ); it.current(); ++it ) { it.current()->setSecondaryText( SString() ); it.current()->setErrorFlags( SubtitleLine::SecondaryOnlyErrors, false ); } endCompositeAction(); } bool Subtitle::isPrimaryDirty() const { return m_primaryState != m_primaryCleanState; } void Subtitle::clearPrimaryDirty() { if ( m_primaryCleanState != m_primaryState ) { m_primaryCleanState = m_primaryState; emit primaryDirtyStateChanged( false ); } } bool Subtitle::isSecondaryDirty() const { return m_secondaryState != m_secondaryCleanState; } void Subtitle::clearSecondaryDirty() { if ( m_secondaryCleanState != m_secondaryState ) { m_secondaryCleanState = m_secondaryState; emit secondaryDirtyStateChanged( false ); } } FormatData* const Subtitle::formatData() const { return m_formatData; } void Subtitle::setFormatData( const FormatData* formatData ) { delete m_formatData; m_formatData = formatData ? new FormatData( *formatData ) : 0; } ActionManager& Subtitle::actionManager() { return m_actionManager; } const ActionManager& Subtitle::actionManager() const { return m_actionManager; } double Subtitle::framesPerSecond() const { return m_framesPerSecond; } void Subtitle::setFramesPerSecond( double framesPerSecond ) { if ( m_framesPerSecond != framesPerSecond ) processAction( new SetFramesPerSecondAction( *this, framesPerSecond ) ); } void Subtitle::changeFramesPerSecond( double toFramesPerSecond, double fromFramesPerSecond ) { if ( toFramesPerSecond <= 0 ) return; if ( fromFramesPerSecond <= 0 ) fromFramesPerSecond = m_framesPerSecond; double scaleFactor = fromFramesPerSecond/toFramesPerSecond; if ( scaleFactor == 1.0 ) return; beginCompositeAction( i18n( "Change Frame Rate" ) ); setFramesPerSecond( toFramesPerSecond ); for ( SubtitleIterator it( *this, Range::full() ); it.current(); ++it ) { Time showTime = it.current()->showTime(); showTime.adjust( 0, scaleFactor ); Time hideTime = it.current()->hideTime(); hideTime.adjust( 0, scaleFactor ); it.current()->setTimes( showTime, hideTime ); } endCompositeAction(); } bool Subtitle::isEmpty() const { return m_lines.empty(); } int Subtitle::linesCount() const { return m_lines.count(); } int Subtitle::lastIndex() const { return m_lines.count() - 1; } SubtitleLine* Subtitle::line( int index ) { // return (index < m_lines.count() ? m_lines.at( index ) : 0); return index < 0 ? 0 : (index < m_lines.count() ? m_lines.at( index ) : 0); } const SubtitleLine* Subtitle::line( int index ) const { // return (index < m_lines.count() ? m_lines.at( index ) : 0); return index < 0 ? 0 : (index < m_lines.count() ? m_lines.at( index ) : 0); } SubtitleLine* Subtitle::firstLine() { return m_lines.isEmpty() ? 0 : m_lines.first(); } const SubtitleLine* Subtitle::firstLine() const { return m_lines.isEmpty() ? 0 : m_lines.first(); } SubtitleLine* Subtitle::lastLine() { return m_lines.isEmpty() ? 0 : m_lines.last(); } const SubtitleLine* Subtitle::lastLine() const { return m_lines.isEmpty() ? 0 : m_lines.last(); } void Subtitle::insertLine( SubtitleLine* line, int index ) { QList lines; lines.append( line ); insertLines( lines, index ); } void Subtitle::insertLines( const QList& lines, int index ) { Q_ASSERT( index <= m_lines.count() ); if ( index < 0 ) index = m_lines.count(); processAction( new InsertLinesAction( *this, lines, index ) ); } SubtitleLine* Subtitle::insertNewLine( int index, bool timeAfter, TextTarget target ) { Q_ASSERT( index <= m_lines.count() ); if ( index < 0 ) index = m_lines.count(); SubtitleLine* newLine = new SubtitleLine(); int newLineIndex = (target == Secondary) ? m_lines.count() : index; if ( timeAfter ) { if ( newLineIndex ) // there is a previous line { SubtitleLine* prevLine = m_lines.value( newLineIndex - 1 ); newLine->setTimes( prevLine->hideTime() + 100, prevLine->hideTime() + 1000 ); } else if ( newLineIndex < m_lines.count() ) // there is a next line { SubtitleLine* nextLine = m_lines.value( newLineIndex ); newLine->setTimes( nextLine->showTime() - 1100, nextLine->showTime() - 100 ); } else newLine->setHideTime( 1000 ); } else // ! timeAfter { if ( newLineIndex < m_lines.count() ) // there is a next line { SubtitleLine* nextLine = m_lines.at( newLineIndex ); newLine->setTimes( nextLine->showTime() - 1100, nextLine->showTime() - 100 ); } else if ( newLineIndex ) // there is a previous line { SubtitleLine* prevLine = m_lines.at( newLineIndex - 1 ); newLine->setTimes( prevLine->hideTime() + 100, prevLine->hideTime() + 1000 ); } else newLine->setHideTime( 1000 ); } if ( target == Both || index == m_lines.count() ) { insertLine( newLine, newLineIndex ); } else if ( target == Primary ) { beginCompositeAction( i18n( "Insert Line" ) ); insertLine( newLine, newLineIndex ); SubtitleLine* line = newLine; SubtitleIterator it( *this, Range::full(), false ); for ( it.toIndex( newLineIndex + 1 ); it.current(); ++it ) { line->setSecondaryText( it.current()->secondaryText() ); line = it.current(); } line->setSecondaryText( SString() ); endCompositeAction(); } else if ( target == Secondary ) { beginCompositeAction( i18n( "Insert Line" ) ); insertLine( newLine, newLineIndex ); SubtitleIterator it( *this, Range::full(), true ); SubtitleLine* line = it.current(); for ( --it; it.index() >= index; --it ) { line->setSecondaryText( it.current()->secondaryText() ); line = it.current(); } line->setSecondaryText( SString() ); newLine = line; endCompositeAction(); } return newLine; } void Subtitle::removeLines( const RangeList& r, TextTarget target ) { if ( m_lines.isEmpty() ) return; RangeList ranges = r; ranges.trimToIndex( m_lines.count() - 1 ); if ( ranges.isEmpty() ) return; if ( target == Both ) { beginCompositeAction( i18n( "Remove Lines" ) ); RangeList::ConstIterator rangesIt = ranges.end(), begin = ranges.begin(); do { rangesIt--; processAction( new RemoveLinesAction( *this, (*rangesIt).start(), (*rangesIt).end() ) ); } while ( rangesIt != begin ); endCompositeAction(); } else if ( target == Secondary ) { beginCompositeAction( i18n( "Remove Lines" ) ); RangeList rangesComplement = ranges.complement(); rangesComplement.trimToRange( Range( ranges.firstIndex(), m_lines.count() - 1 ) ); // we have to move the secondary texts up (we do it in chunks) SubtitleIterator srcIt( *this, rangesComplement ); SubtitleIterator dstIt( *this, Range::upper( ranges.firstIndex() ) ); for ( ; srcIt.current() && dstIt.current(); ++srcIt, ++dstIt ) dstIt.current()->setSecondaryText( srcIt.current()->secondaryText() ); // the remaining lines secondary text must be cleared for ( ; dstIt.current(); ++dstIt ) dstIt.current()->setSecondaryText( SString() ); endCompositeAction(); } else // if target == Primary { beginCompositeAction( i18n( "Remove Lines" ), true, false ); RangeList mutableRanges( ranges ); mutableRanges.trimToIndex( m_lines.count() - 1 ); // first, we need to append as many empty lines as we're to remove // we insert them with a greater time than the one of the last (non deleted) line int linesCount = m_lines.count(); Range lastRange = mutableRanges.last(); int lastIndex = lastRange.end() == linesCount - 1 ? lastRange.start() - 1 : linesCount - 1; SubtitleLine* lastLine = lastIndex < linesCount ? m_lines.at( lastIndex ) : 0; Time showTime( lastLine ? lastLine->hideTime() + 100 : 0 ); Time hideTime( showTime + 1000 ); QList lines; for ( int index = 0, size = ranges.indexesCount(); index < size; ++index ) { lines.append( new SubtitleLine( SString(), SString(), showTime, hideTime ) ); showTime.shift( 1100 ); hideTime.shift( 1100 ); } processAction( new InsertLinesAction( *this, lines ) ); // then, we move the secondary texts down (we need to iterate from bottom to top for that) RangeList rangesComplement = mutableRanges.complement(); SubtitleIterator srcIt( *this, Range( ranges.firstIndex(), m_lines.count() - lines.count() - 1 ), true ); SubtitleIterator dstIt( *this, rangesComplement, true ); for ( ; srcIt.current() && dstIt.current(); --srcIt, --dstIt ) dstIt.current()->setSecondaryText( srcIt.current()->secondaryText() ); // finally, we can remove the specified lines RangeList::ConstIterator rangesIt = ranges.end(), begin = ranges.begin(); do { rangesIt--; processAction( new RemoveLinesAction( *this, (*rangesIt).start(), (*rangesIt).end() ) ); } while ( rangesIt != begin ); endCompositeAction(); } } void Subtitle::swapTexts( const RangeList& ranges ) { processAction( new SwapLinesTextsAction( *this, ranges ) ); } void Subtitle::splitLines( const RangeList& ranges ) { beginCompositeAction( i18n( "Split Lines" ) ); for ( SubtitleIterator it( *this, ranges, true ); it.current(); --it ) { SubtitleLine* line = it.current(); if ( line->primaryLines() > 1 ) { line->simplifyTextWhiteSpace( SubtitleLine::Primary ); long autoDurationsSum = 0; QList autoDurations; SStringList primaryLines = line->primaryText().split( '\n' ); for ( SStringList::ConstIterator ptIt = primaryLines.begin(), ptEnd = primaryLines.end(); ptIt != ptEnd; ++ptIt ) { const Time& autoDuration = SubtitleLine::autoDuration( (*ptIt).string(), 60, 50, 50 ); autoDurations.append( autoDuration.toMillis() ); autoDurationsSum += autoDuration.toMillis(); } double factor = (double)line->durationTime().toMillis() / autoDurationsSum; SStringList secondaryLines = line->secondaryText().split( '\n' ); while ( secondaryLines.count() < primaryLines.count() ) secondaryLines.append( SString() ); while ( secondaryLines.count() > primaryLines.count() ) { SString lastLine = secondaryLines.last(); secondaryLines.pop_back(); secondaryLines.last() += '\n'; secondaryLines.last() += lastLine; } int subLineIndex = it.index(), splitLineIndex = 0; for ( SStringList::ConstIterator ptIt = primaryLines.begin(), ptEnd = secondaryLines.end(), stIt = secondaryLines.begin(), stEnd = secondaryLines.end(); ptIt != ptEnd && stIt != stEnd; ++ptIt, ++stIt, ++subLineIndex, ++splitLineIndex ) { if ( splitLineIndex ) { SubtitleLine* newLine = new SubtitleLine(); newLine->setShowTime( line->hideTime() + 1 ); insertLine( newLine, subLineIndex ); line = newLine; } line->setTexts( *ptIt, *stIt ); line->setDurationTime( Time( (long)(factor*autoDurations[splitLineIndex]) - 1 ) ); } } } endCompositeAction(); } void Subtitle::joinLines( const RangeList& ranges ) { beginCompositeAction( i18n( "Join Lines" ) ); RangeList obsoletedRanges; for ( RangeList::ConstIterator rangesIt = ranges.begin(), end = ranges.end(); rangesIt != end; ++rangesIt ) { int rangeStart = (*rangesIt).start(); int rangeEnd = normalizeRangeIndex( (*rangesIt).end() ); if ( rangeStart >= rangeEnd ) continue; SubtitleLine* firstLine = m_lines.at( rangeStart ); SubtitleLine* lastLine = m_lines.at( rangeEnd ); SString primaryText, secondaryText; for ( SubtitleIterator it( *this, Range( rangeStart, rangeEnd-1 ) ); it.current(); ++it ) { if ( ! it.current()->primaryText().isEmpty() ) { primaryText.append( it.current()->primaryText() ); primaryText.append( "\n" ); } if ( ! it.current()->secondaryText().isEmpty() ) { secondaryText.append( it.current()->secondaryText() ); secondaryText.append( "\n" ); } } primaryText.append( lastLine->primaryText() ); secondaryText.append( lastLine->secondaryText() ); firstLine->setTexts( primaryText, secondaryText ); firstLine->setHideTime( lastLine->hideTime() ); obsoletedRanges << Range( rangeStart + 1, rangeEnd ); } removeLines( obsoletedRanges, Both ); endCompositeAction(); } void Subtitle::shiftLines( const RangeList& ranges, long msecs ) { if ( msecs == 0 ) return; beginCompositeAction( i18n( "Shift Lines" ) ); for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->shiftTimes( msecs ); endCompositeAction(); } void Subtitle::adjustLines( const Range& range, long newFirstTime, long newLastTime ) { if ( m_lines.isEmpty() || newFirstTime >= newLastTime ) return; int firstIndex = range.start(); int lastIndex = normalizeRangeIndex( range.end() ); if ( firstIndex >= lastIndex ) return; long oldFirstTime = m_lines.at( firstIndex )->showTime().toMillis(); long oldLastTime = m_lines.at( lastIndex )->showTime().toMillis(); long oldDeltaTime = oldLastTime - oldFirstTime; long newDeltaTime = newLastTime - newFirstTime; // special case in which we can't procede as there's no way to // linearly transform the same time into two different ones... if ( ! oldDeltaTime && newDeltaTime ) return; long shiftMseconds; double scaleFactor; if ( oldDeltaTime ) { shiftMseconds = (long)(newFirstTime-((double)newDeltaTime/oldDeltaTime)*oldFirstTime + 0.5); scaleFactor = (double)newDeltaTime/oldDeltaTime; } else // oldDeltaTime == 0 && newDeltaTime == 0 { // in this particular case we can make the adjust transformation act as a plain shift shiftMseconds = newFirstTime - oldFirstTime; scaleFactor = 1.0; } if ( shiftMseconds == 0 && scaleFactor == 1.0 ) return; beginCompositeAction( i18n( "Adjust Lines" ) ); for ( SubtitleIterator it( *this, range ); it.current(); ++it ) it.current()->adjustTimes( shiftMseconds, scaleFactor ); endCompositeAction(); } void Subtitle::sortLines( const Range& range ) { beginCompositeAction( i18n( "Sort" ), true, false ); SubtitleIterator it( *this, range ); SubtitleLine* line = it.current(); ++it; int itPositions = 1; for ( SubtitleLine* nextLine = it.current(); nextLine; ++it, line = nextLine, nextLine = it.current(), ++itPositions ) { if ( nextLine->showTime() < line->showTime() ) // nextLine is not at the right position, we'll move it backwards { int fromIndex = it.index(); // nextLine current index // We set the first target index candidate. Note that we can't tell is this is the // correct target index as nextLine my be misplaced by more than one position. // We do now, however, that the new index must be one before fromIndex. int toIndex = (--it).index(); // we iterate backwards finding the correct position knowing that all previous lines ARE sorted for ( ; it.current(); --it ) { if ( it.current()->showTime() < nextLine->showTime() ) { toIndex = (++it).index(); break; } } // kDebug() << "moving from" << fromIndex << "to" << toIndex; processAction( new MoveLineAction( *this, fromIndex, toIndex ) ); // moving the lines invalidates the iterator so we recreate it and advance it to where it was it = SubtitleIterator( *this, range ); it += itPositions; nextLine = it.current(); } } endCompositeAction(); } void Subtitle::applyDurationLimits( const RangeList& ranges, const Time& minDuration, const Time& maxDuration, bool canOverlap ) { if ( m_lines.isEmpty() || minDuration > maxDuration ) return; beginCompositeAction( i18n( "Enforce Duration Limits" ) ); for ( RangeList::ConstIterator rangesIt = ranges.begin(), end = ranges.end(); rangesIt != end; ++rangesIt ) { Time lineDuration; SubtitleIterator it( *this, *rangesIt ); SubtitleLine* line = it.current(); ++it; SubtitleLine* nextLine = it.current(); for ( ; line; ++it, line = nextLine, nextLine = it.current() ) { lineDuration = line->durationTime(); if ( lineDuration > maxDuration ) line->setDurationTime( maxDuration ); else if ( lineDuration < minDuration ) { if ( ! nextLine ) // the last line doesn't have risk of overlapping line->setDurationTime( minDuration ); else { if ( canOverlap || line->showTime() + minDuration < nextLine->showTime() ) line->setDurationTime( minDuration ); else // setting the duration to minDuration will cause an unwanted overlap { if ( line->hideTime() < nextLine->showTime() ) // make duration as big as possible without overlap line->setHideTime( nextLine->showTime() - 1 ); // else line is already at the maximum duration without overlap (or overlapping) so we don't change it } } } } } endCompositeAction(); } void Subtitle::setMaximumDurations( const RangeList& ranges ) { if ( m_lines.isEmpty() ) return; beginCompositeAction( i18n( "Maximize Durations" ) ); for ( RangeList::ConstIterator rangesIt = ranges.begin(), end = ranges.end(); rangesIt != end; ++rangesIt ) { SubtitleIterator it( *this, *rangesIt ); SubtitleLine* line = it.current(); ++it; SubtitleLine* nextLine = it.current(); for ( ; line && nextLine; ++it, line = nextLine, nextLine = it.current() ) { if ( line->hideTime() < nextLine->showTime() ) line->setHideTime( nextLine->showTime() - 1 ); } } endCompositeAction(); } void Subtitle::setAutoDurations( const RangeList& ranges, int msecsPerChar, int msecsPerWord, int msecsPerLine, bool canOverlap, TextTarget calculationTarget ) { if ( m_lines.isEmpty() ) return; beginCompositeAction( i18n( "Set Automatic Durations" ) ); for ( RangeList::ConstIterator rangesIt = ranges.begin(), end = ranges.end(); rangesIt != end; ++rangesIt ) { Time autoDuration; SubtitleIterator it( *this, *rangesIt ); SubtitleLine* line = it.current(); ++it; SubtitleLine* nextLine = it.current(); for ( ; line; ++it, line = nextLine, nextLine = it.current() ) { autoDuration = line->autoDuration( msecsPerChar, msecsPerWord, msecsPerLine, (SubtitleLine::TextTarget)calculationTarget ); if ( ! nextLine ) // the last line doesn't have risk of overlapping line->setDurationTime( autoDuration ); else { if ( canOverlap || line->showTime() + autoDuration < nextLine->showTime() ) line->setDurationTime( autoDuration ); else // setting the duration to autoDuration will cause an unwanted overlap line->setHideTime( nextLine->showTime() - 1 ); } } } endCompositeAction(); } void Subtitle::fixOverlappingLines( const RangeList& ranges, const Time& minInterval ) { if ( m_lines.isEmpty() ) return; beginCompositeAction( i18n( "Fix Overlapping Times" ) ); for ( RangeList::ConstIterator rangesIt = ranges.begin(), end = ranges.end(); rangesIt != end; ++rangesIt ) { int rangeStart = (*rangesIt).start(); int rangeEnd = normalizeRangeIndex( (*rangesIt).end() + 1 ); if ( rangeStart >= rangeEnd ) break; SubtitleIterator it( *this, Range( rangeStart, rangeEnd ) ); SubtitleLine* line = it.current(); ++it; SubtitleLine* nextLine = it.current(); for ( ; nextLine; ++it, line = nextLine, nextLine = it.current() ) { if ( line->hideTime() + minInterval >= nextLine->showTime() ) { Time newHideTime = nextLine->showTime() - minInterval; line->setHideTime( newHideTime >= line->showTime() ? newHideTime : line->showTime() ); } } } endCompositeAction(); } void Subtitle::fixPunctuation( const RangeList& ranges, bool spaces, bool quotes, bool engI, bool ellipsis, TextTarget target ) { if ( m_lines.isEmpty() || (! spaces && ! quotes && ! engI && ! ellipsis) || target >= TextTargetSIZE ) return; beginCompositeAction( i18n( "Fix Lines Punctuation" ) ); for ( RangeList::ConstIterator rangesIt = ranges.begin(), end = ranges.end(); rangesIt != end; ++rangesIt ) { SubtitleIterator it( *this, *rangesIt ); bool primaryContinues = false; bool secondaryContinues = false; if ( it.index() > 0 ) { if ( target == Primary || target == Both ) // Initialize the value of primaryContinues SubtitleLine::fixPunctuation( m_lines.at( it.index() - 1 )->primaryText(), spaces, quotes, engI, ellipsis, &primaryContinues ); if ( target == Secondary || target == Both ) // Initialize the value of secondaryContinues SubtitleLine::fixPunctuation( m_lines.at( it.index() - 1 )->secondaryText(), spaces, quotes, engI, ellipsis, &secondaryContinues ); } for ( ; it.current(); ++it ) { switch ( target ) { case Primary: it.current()->setPrimaryText( SubtitleLine::fixPunctuation( it.current()->primaryText(), spaces, quotes, engI, ellipsis, &primaryContinues ) ); break; case Secondary: it.current()->setSecondaryText( SubtitleLine::fixPunctuation( it.current()->secondaryText(), spaces, quotes, engI, ellipsis, &secondaryContinues ) ); break; case Both: it.current()->setTexts( SubtitleLine::fixPunctuation( it.current()->primaryText(), spaces, quotes, engI, ellipsis, &primaryContinues ), SubtitleLine::fixPunctuation( it.current()->secondaryText(), spaces, quotes, engI, ellipsis, &secondaryContinues ) ); break; default: break; } } } endCompositeAction(); } void Subtitle::lowerCase( const RangeList& ranges, TextTarget target ) { if ( m_lines.isEmpty() || target >= TextTargetSIZE ) return; beginCompositeAction( i18n( "Lower Case" ) ); switch ( target ) { case Primary: { for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->setPrimaryText( it.current()->primaryText().toLower() ); break; } case Secondary: { for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->setSecondaryText( it.current()->secondaryText().toLower() ); break; } case Both: { for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->setTexts( it.current()->primaryText().toLower(), it.current()->secondaryText().toLower() ); break; } default: break; } endCompositeAction(); } void Subtitle::upperCase( const RangeList& ranges, TextTarget target ) { if ( m_lines.isEmpty() || target >= TextTargetSIZE ) return; beginCompositeAction( i18n( "Upper Case" ) ); switch ( target ) { case Primary: { for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->setPrimaryText( it.current()->primaryText().toUpper() ); break; } case Secondary: { for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->setSecondaryText( it.current()->secondaryText().toUpper() ); break; } case Both: { for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->setTexts( it.current()->primaryText().toUpper(), it.current()->secondaryText().toUpper() ); break; } default: break; } endCompositeAction(); } void Subtitle::titleCase( const RangeList& ranges, bool lowerFirst, TextTarget target ) { if ( m_lines.isEmpty() || target >= TextTargetSIZE ) return; beginCompositeAction( i18n( "Title Case" ) ); switch ( target ) { case Primary: { for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->setPrimaryText( it.current()->primaryText().toTitleCase( lowerFirst ) ); break; } case Secondary: { for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->setSecondaryText( it.current()->secondaryText().toTitleCase( lowerFirst ) ); break; } case Both: { for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->setTexts( it.current()->primaryText().toTitleCase( lowerFirst ), it.current()->secondaryText().toTitleCase( lowerFirst ) ); break; } default: break; } endCompositeAction(); } void Subtitle::sentenceCase( const RangeList& ranges, bool lowerFirst, TextTarget target ) { if ( m_lines.isEmpty() || target >= TextTargetSIZE ) return; beginCompositeAction( i18n( "Sentence Case" ) ); for ( RangeList::ConstIterator rangesIt = ranges.begin(), rangesEnd = ranges.end(); rangesIt != rangesEnd; ++rangesIt ) { SubtitleIterator it( *this, *rangesIt ); bool pCont = false; bool sCont = false; if ( it.index() > 0 ) { if ( target == Primary || target == Both ) // Initialize pCont m_lines.at( it.index() - 1 )->primaryText().toSentenceCase( lowerFirst, &pCont ); if ( target == Secondary || target == Both ) // Initialize sCont m_lines.at( it.index() - 1 )->secondaryText().toSentenceCase( lowerFirst, &sCont ); } switch ( target ) { case Primary: { for ( ; it.current(); ++it ) it.current()->setPrimaryText( it.current()->primaryText().toSentenceCase( lowerFirst, &pCont ) ); break; } case Secondary: { for ( ; it.current(); ++it ) it.current()->setSecondaryText( it.current()->secondaryText().toSentenceCase( lowerFirst, &sCont ) ); break; } case Both: { for ( ; it.current(); ++it ) it.current()->setTexts( it.current()->primaryText().toSentenceCase( lowerFirst, &pCont ), it.current()->secondaryText().toSentenceCase( lowerFirst, &sCont ) ); break; } default: break; } } endCompositeAction(); } void Subtitle::breakLines( const RangeList& ranges, unsigned minLengthForLineBreak, TextTarget target ) { SubtitleCompositeActionExecutor executor( *this, i18n( "Break Lines" ) ); for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->breakText( minLengthForLineBreak, (SubtitleLine::TextTarget)target ); } void Subtitle::unbreakTexts( const RangeList& ranges, TextTarget target ) { SubtitleCompositeActionExecutor executor( *this, i18n( "Unbreak Lines" ) ); for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->unbreakText( (SubtitleLine::TextTarget)target ); } void Subtitle::simplifyTextWhiteSpace( const RangeList& ranges, TextTarget target ) { SubtitleCompositeActionExecutor executor( *this, i18n( "Simplify Spaces" ) ); for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->simplifyTextWhiteSpace( (SubtitleLine::TextTarget)target ); } void Subtitle::syncWithSubtitle( const Subtitle& refSubtitle ) { beginCompositeAction( i18n( "Synchronize Subtitles" ) ); for ( SubtitleIterator it( *this, Range::full() ), refIt( refSubtitle, Range::full() ); it.current() && refIt.current(); ++it, ++refIt ) it.current()->setTimes( refIt.current()->showTime(), refIt.current()->hideTime() ); endCompositeAction(); } void Subtitle::appendSubtitle( const Subtitle& srcSubtitle, long shiftMsecsBeforeAppend ) { if ( ! srcSubtitle.m_lines.count() ) return; QList lines; for ( SubtitleIterator it( srcSubtitle ); it.current(); ++it ) { SubtitleLine* newLine = new SubtitleLine( *(it.current()) ); newLine->shiftTimes( shiftMsecsBeforeAppend ); lines.append( newLine ); } beginCompositeAction( i18n( "Join Subtitles" ) ); processAction( new InsertLinesAction( *this, lines ) ); endCompositeAction(); } void Subtitle::splitSubtitle( Subtitle& dstSubtitle, const Time& splitTime, bool shiftSplittedLines ) { if ( ! m_lines.count() ) return; int splitIndex = -1; // the index of the first line to move (or copy) to dstSub bool splitsLine; // splitTime falls in within a line's time QList lines; for ( SubtitleIterator it( *this, Range::full() ); it.current(); ++it ) { if ( splitTime <= it.current()->hideTime() ) { SubtitleLine* newLine = new SubtitleLine( *(it.current()) ); if ( splitIndex < 0 ) // the first line of the new subtitle { splitIndex = it.index(); splitsLine = splitTime > newLine->showTime(); if ( splitsLine ) newLine->setShowTime( splitTime ); } if ( it.current()->m_formatData ) newLine->m_formatData = new FormatData( *(it.current()->m_formatData) ); if ( shiftSplittedLines ) newLine->shiftTimes( - splitTime.toMillis() ); lines.append( newLine ); } } if ( splitIndex > 0 || (splitIndex == 0 && splitsLine) ) { dstSubtitle.m_formatData = m_formatData ? new FormatData( *m_formatData ) : 0; dstSubtitle.beginCompositeAction( i18n( "Split Subtitles" ) ); if ( dstSubtitle.m_lines.count() ) dstSubtitle.processAction( new RemoveLinesAction( dstSubtitle, 0, -1 ) ); dstSubtitle.processAction( new InsertLinesAction( dstSubtitle, lines, 0 ) ); dstSubtitle.endCompositeAction(); beginCompositeAction( i18n( "Split Subtitles" ) ); if ( splitsLine ) { m_lines.at( splitIndex )->setHideTime( splitTime ); splitIndex++; if ( splitIndex < m_lines.size() ) processAction( new RemoveLinesAction( *this, splitIndex ) ); } else processAction( new RemoveLinesAction( *this, splitIndex ) ); endCompositeAction(); } } void Subtitle::setStyleFlags( const RangeList& ranges, int styleFlags ) { beginCompositeAction( i18n( "Set Lines Style" ) ); for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) { kDebug() << it.current()->primaryText().string(); it.current()->setPrimaryText( SString( it.current()->primaryText() ).setStyleFlags( 0, -1, styleFlags ) ); it.current()->setSecondaryText( SString( it.current()->secondaryText() ).setStyleFlags( 0, -1, styleFlags ) ); } endCompositeAction(); } void Subtitle::setStyleFlags( const RangeList& ranges, int styleFlags, bool on ) { beginCompositeAction( i18n( "Set Lines Style" ) ); for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) { it.current()->setPrimaryText( SString( it.current()->primaryText() ).setStyleFlags( 0, -1, styleFlags, on ) ); it.current()->setSecondaryText( SString( it.current()->secondaryText() ).setStyleFlags( 0, -1, styleFlags, on ) ); } endCompositeAction(); } void Subtitle::toggleStyleFlag( const RangeList& ranges, SString::StyleFlag styleFlag ) { SubtitleIterator it( *this, ranges ); if ( ! it.current() ) return; beginCompositeAction( i18n( "Toggle Lines Style" ) ); bool isOn = it.current()->primaryText().hasStyleFlags( styleFlag ) || it.current()->secondaryText().hasStyleFlags( styleFlag ); setStyleFlags( ranges, styleFlag, ! isOn ); endCompositeAction(); } void Subtitle::setMarked( const RangeList& ranges, bool value ) { beginCompositeAction( value ? i18n( "Set Lines Mark" ) : i18n( "Clear Lines Mark" ) ); for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->setErrorFlags( SubtitleLine::UserMark, value ); endCompositeAction(); } void Subtitle::toggleMarked( const RangeList& ranges ) { SubtitleIterator it( *this, ranges ); if ( ! it.current() ) return; beginCompositeAction( i18n( "Toggle Lines Mark" ) ); setMarked( ranges, ! (it.current()->errorFlags() & SubtitleLine::UserMark) ); endCompositeAction(); } void Subtitle::clearErrors( const RangeList& ranges, int errorFlags ) { beginCompositeAction( i18n( "Clear Lines Errors" ) ); for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) it.current()->setErrorFlags( errorFlags, false ); endCompositeAction(); } void Subtitle::checkErrors( const RangeList& ranges, int errorFlags, int minDurationMsecs, int maxDurationMsecs, int minMsecsPerChar, int maxMsecsPerChar, int maxChars, int maxLines ) { beginCompositeAction( i18n( "Check Lines Errors" ) ); for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) { it.current()->check( errorFlags, minDurationMsecs, maxDurationMsecs, minMsecsPerChar, maxMsecsPerChar, maxChars, maxLines ); } endCompositeAction(); } void Subtitle::recheckErrors( const RangeList& ranges, int minDurationMsecs, int maxDurationMsecs, int minMsecsPerChar, int maxMsecsPerChar, int maxChars, int maxLines ) { beginCompositeAction( i18n( "Check Lines Errors" ) ); for ( SubtitleIterator it( *this, ranges ); it.current(); ++it ) { it.current()->check( it.current()->errorFlags(), minDurationMsecs, maxDurationMsecs, minMsecsPerChar, maxMsecsPerChar, maxChars, maxLines ); } endCompositeAction(); } void Subtitle::processAction( Action* action ) { if ( m_compositeAction ) m_compositeAction->appendAction( action ); else m_actionManager.execAndStore( action ); } void Subtitle::beginCompositeAction( const QString& title, bool immediateExecution, bool delaySignals ) { m_compositeActionDepth++; if ( ! m_compositeAction ) m_compositeAction = new CompositeAction( title, immediateExecution, delaySignals ); } void Subtitle::endCompositeAction() { m_compositeActionDepth--; if ( ! m_compositeActionDepth ) { // NOTE: it is EXTREMELY IMPORTANT to mark the composite action as finished (setting it to 0) // before performing m_actionManager.execAndStore() because that call may spawn other composite // actions that won't be correctly initialized if m_compositeAction was not set to 0. CompositeAction* compositeAction = m_compositeAction; m_compositeAction = 0; if ( compositeAction->count() > 1 ) m_actionManager.execAndStore( compositeAction ); else { if ( compositeAction->count() ) // compositeAction->count() == 1 m_actionManager.execAndStore( compositeAction->detachContainedAction() ); delete compositeAction; } } } void Subtitle::incrementState( int dirtyMode ) { switch ( dirtyMode ) { case SubtitleAction::Primary: m_primaryState++; if ( m_primaryState == (m_primaryCleanState + 1) ) emit primaryDirtyStateChanged( true ); else if ( m_primaryState == m_primaryCleanState ) emit primaryDirtyStateChanged( false ); break; case SubtitleAction::Secondary: m_secondaryState++; if ( m_secondaryState == (m_secondaryCleanState + 1) ) emit secondaryDirtyStateChanged( true ); else if ( m_secondaryState == m_secondaryCleanState ) emit secondaryDirtyStateChanged( false ); break; case SubtitleAction::Both: m_primaryState++; m_secondaryState++; if ( m_primaryState == (m_primaryCleanState + 1) ) emit primaryDirtyStateChanged( true ); else if ( m_primaryState == m_primaryCleanState ) emit primaryDirtyStateChanged( false ); if ( m_secondaryState == (m_secondaryCleanState + 1) ) emit secondaryDirtyStateChanged( true ); else if ( m_secondaryState == m_secondaryCleanState ) emit secondaryDirtyStateChanged( false ); break; default: break; } } void Subtitle::decrementState( int dirtyMode ) { switch ( dirtyMode ) { case SubtitleAction::Primary: m_primaryState--; if ( m_primaryState == m_primaryCleanState ) emit primaryDirtyStateChanged( false ); else if ( m_primaryState == (m_primaryCleanState - 1) ) emit primaryDirtyStateChanged( true ); break; case SubtitleAction::Secondary: m_secondaryState--; if ( m_secondaryState == m_secondaryCleanState ) emit secondaryDirtyStateChanged( false ); else if ( m_secondaryState == (m_secondaryCleanState - 1) ) emit secondaryDirtyStateChanged( true ); break; case SubtitleAction::Both: m_primaryState--; m_secondaryState--; if ( m_primaryState == m_primaryCleanState ) emit primaryDirtyStateChanged( false ); else if ( m_primaryState == (m_primaryCleanState - 1) ) emit primaryDirtyStateChanged( true ); if ( m_secondaryState == m_secondaryCleanState ) emit secondaryDirtyStateChanged( false ); else if ( m_secondaryState == (m_secondaryCleanState - 1) ) emit secondaryDirtyStateChanged( true ); break; } } void Subtitle::setLastValidCachedIndex( int lastValidCachedIndex ) { if ( lastValidCachedIndex > m_lastValidCachedIndex ) { // It's possible for incrementing m_lastValidCachedIndex to result in some lines having // an m_cachedIndex value lower than lastValidCachedIndex which though previously regarded // as correct, would be incorrect once we change m_lastValidCachedIndex. // We have to invalidate such lines' m_cachedIndex. SubtitleLine* line; for ( int lineIndex = lastValidCachedIndex + 1, linesCount = m_lines.count(); lineIndex < linesCount; ++linesCount ) { line = m_lines.at( lineIndex ); if ( line->m_cachedIndex < 0 || line->m_cachedIndex > lastValidCachedIndex ) break; line->m_cachedIndex = -1; } } else if ( lastValidCachedIndex < m_lastValidCachedIndex ) { if ( m_lines.count() > lastValidCachedIndex + 1 ) m_lines.at( lastValidCachedIndex + 1 )->m_cachedIndex = -1; } else return; m_lastValidCachedIndex = lastValidCachedIndex; /* kDebug() << "last valid cached index" << m_lastValidCachedIndex; QStringList cacheIndexList, indexList; for ( int lineIndex = 0, linesCount = m_lines.count(); lineIndex < linesCount; ++lineIndex ) cacheIndexList << QString::number( m_lines.at( lineIndex )->m_cachedIndex ); kDebug() << "cached indexes:" << cacheIndexList.join( " " ); for ( int lineIndex = 0, linesCount = m_lines.count(); lineIndex < linesCount; ++lineIndex ) indexList << QString::number( m_lines.at( lineIndex )->index() ); kDebug() << "indexes:" << indexList.join( " " ); */ } /// SUBTITLECOMPOSITEACTIONEXECUTOR SubtitleCompositeActionExecutor::SubtitleCompositeActionExecutor( Subtitle& subtitle, const QString& title ): m_subtitle( subtitle ) { m_subtitle.beginCompositeAction( title ); } SubtitleCompositeActionExecutor::~SubtitleCompositeActionExecutor() { m_subtitle.endCompositeAction(); } #include "subtitle.moc" subtitlecomposer-0.5.3/src/core/subtitlelineactions.h0000644000175000001440000001205411151345063022306 0ustar sergiousers#ifndef SUBTITLELINEACTIONS_H #define SUBTITLELINEACTIONS_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "action.h" #include "time.h" #include "sstring.h" #include "subtitleline.h" #include "subtitleactions.h" #include namespace SubtitleComposer { class SubtitleLineAction : public Action { public: SubtitleLineAction( SubtitleLine& line, SubtitleAction::DirtyMode dirtyMode, const QString& desc=QString() ); virtual ~SubtitleLineAction(); protected: virtual void _undo(); virtual void _preRedo(); virtual void _preUndo(); virtual void _emitUndoSignals(); template T* tryCastToThisLineAction( Action* prevAction ) { T* castedPrevAction = tryCastTo( prevAction ); return castedPrevAction ? (&castedPrevAction->m_line == &m_line ? castedPrevAction : 0) : 0; } protected: SubtitleLine& m_line; SubtitleAction::DirtyMode m_dirtyMode; }; class SetLinePrimaryTextAction : public SubtitleLineAction { friend class SetLineTextsAction; public: SetLinePrimaryTextAction( SubtitleLine& line, const SString& primaryText ); virtual ~SetLinePrimaryTextAction(); protected: virtual bool mergeWithPrevious( Action* prevAction ); virtual void _redo(); virtual void _emitRedoSignals(); private: SString m_primaryText; }; class SetLineSecondaryTextAction : public SubtitleLineAction { friend class SetLineTextsAction; public: SetLineSecondaryTextAction( SubtitleLine& line, const SString& secondaryText ); virtual ~SetLineSecondaryTextAction(); protected: virtual bool mergeWithPrevious( Action* prevAction ); virtual void _redo(); virtual void _emitRedoSignals(); private: SString m_secondaryText; }; class SetLineTextsAction : public SubtitleLineAction { public: SetLineTextsAction( SubtitleLine& line, const SString& primaryText, const SString& secondaryText ); virtual ~SetLineTextsAction(); protected: virtual bool mergeWithPrevious( Action* prevAction ); virtual void _redo(); virtual void _emitRedoSignals(); private: SString m_primaryText; SString m_secondaryText; }; class SetLineShowTimeAction : public SubtitleLineAction { friend class SetLineTimesAction; public: SetLineShowTimeAction( SubtitleLine& line, const Time& showTime ); virtual ~SetLineShowTimeAction(); protected: virtual bool mergeWithPrevious( Action* prevAction ); virtual void _redo(); virtual void _emitRedoSignals(); private: Time m_showTime; }; class SetLineHideTimeAction : public SubtitleLineAction { friend class SetLineTimesAction; public: SetLineHideTimeAction( SubtitleLine& line, const Time& hideTime ); virtual ~SetLineHideTimeAction(); protected: virtual bool mergeWithPrevious( Action* prevAction ); virtual void _redo(); virtual void _emitRedoSignals(); private: Time m_hideTime; }; class SetLineTimesAction : public SubtitleLineAction { public: SetLineTimesAction( SubtitleLine& line, const Time& showTime, const Time& hideTime, QString description=QString() ); virtual ~SetLineTimesAction(); protected: virtual bool mergeWithPrevious( Action* prevAction ); virtual void _redo(); virtual void _emitRedoSignals(); private: typedef enum { ShowTime = 0x1, HideTime = 0x2 } SignalFlags; Time m_showTime; Time m_hideTime; }; class SetLineErrorsAction : public SubtitleLineAction { public: SetLineErrorsAction( SubtitleLine& line, int errorFlags ); virtual ~SetLineErrorsAction(); protected: virtual bool mergeWithPrevious( Action* prevAction ); virtual void _redo(); virtual void _emitRedoSignals(); private: int m_errorFlags; }; } #endif subtitlecomposer-0.5.3/src/core/audiolevels.h0000644000175000001440000000620611151345063020540 0ustar sergiousers#ifndef AUDIOLEVELS_H #define AUDIOLEVELS_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "time.h" #include #include namespace SubtitleComposer { class AudioLevels : public QObject { Q_OBJECT public: AudioLevels(); virtual ~AudioLevels(); bool load( const KUrl& fileUrl ); bool loadFromMedia( const QString& mediaPath, unsigned streamIndex ); bool save( const KUrl& fileUrl, bool overwrite ) const; void reset(); inline unsigned channelsCount() const { return m_channelsCount; }; inline unsigned samplesCount() const // in milliseconds { return m_samplesCount; }; inline unsigned samplesInterval() const // in milliseconds { return m_samplesInterval; }; inline Time length() const // in milliseconds { return m_samplesCount*m_samplesInterval; }; /// warning!! no checks performed! inline double dataBySample( unsigned channel, unsigned sample ) const { //return sample >= m_samplesCount ? 0 : m_samplesData[m_samplesCount*channel+sample]; return m_samplesData[m_samplesCount*channel+sample]; }; inline double dataByPosition( unsigned channel, const Time& position ) const { int dataIndex = m_samplesCount*channel+position.toMillis()/m_samplesInterval; return dataIndex > m_lastDataIndex ? 0 : m_samplesData[dataIndex]; }; inline unsigned sampleForPosition( const Time& position ) const { if ( position > length() ) return m_samplesCount - 1; return position.toMillis()/m_samplesInterval; }; signals: void loadProgress( int percentage ); private: unsigned m_channelsCount; unsigned m_samplesInterval; unsigned m_samplesCount; double* m_samplesData; int m_lastDataIndex; KUrl m_mediaUrl; }; } #endif subtitlecomposer-0.5.3/src/main/0000755000175000001440000000000011206423743016046 5ustar sergiouserssubtitlecomposer-0.5.3/src/main/CMakeLists.txt0000644000175000001440000000346311172151730020610 0ustar sergiousersADD_SUBDIRECTORY( configs ) ADD_SUBDIRECTORY( dialogs ) ADD_SUBDIRECTORY( images ) ADD_SUBDIRECTORY( actions ) ADD_SUBDIRECTORY( utils ) ADD_SUBDIRECTORY( scripting ) INCLUDE_DIRECTORIES( ${common_INCLUDE_DIR} ${config_INCLUDE_DIR} ${core_INCLUDE_DIR} ${formats_INCLUDE_DIR} ${players_INCLUDE_DIR} ${widgets_INCLUDE_DIR} ) SET( subtitlecomposer_SRCS ${common_SRCS} ${config_SRCS} ${core_SRCS} ${formats_SRCS} ${players_SRCS} ${widgets_SRCS} ${main_configs_SRCS} ${main_dialogs_SRCS} ${main_actions_SRCS} ${main_utils_SRCS} ${main_scripting_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/application.cpp ${CMAKE_CURRENT_SOURCE_DIR}/audiolevelswidget.cpp ${CMAKE_CURRENT_SOURCE_DIR}/configdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/currentlinewidget.cpp ${CMAKE_CURRENT_SOURCE_DIR}/errorsdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/errorswidget.cpp ${CMAKE_CURRENT_SOURCE_DIR}/lineswidget.cpp ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mainwindow.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerwidget.cpp CACHE INTERNAL EXPORTEDVARIABLE ) KDE4_ADD_EXECUTABLE( subtitlecomposer ${subtitlecomposer_SRCS} ) TARGET_LINK_LIBRARIES( subtitlecomposer ${KDE4_KDEUI_LIBS} ${KDE4_KHTML_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KROSSUI_LIBS} ${common_LIBS} ${config_LIBS} ${core_LIBS} ${formats_LIBS} ${players_LIBS} ${widgets_LIBS} ) ADD_DEFINITIONS( ${common_DEFS} ${config_DEFS} ${core_DEFS} ${formats_DEFS} ${players_DEFS} ${widgets_DEFS} ) INSTALL( TARGETS subtitlecomposer DESTINATION ${BIN_INSTALL_DIR} ) INSTALL( FILES subtitlecomposerrc DESTINATION ${CONFIG_INSTALL_DIR} ) INSTALL( FILES subtitlecomposerui.rc DESTINATION ${DATA_INSTALL_DIR}/subtitlecomposer ) INSTALL( FILES subtitlecomposer.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) INSTALL( FILES subtitlecomposer.xml DESTINATION ${XDG_MIME_INSTALL_DIR} ) subtitlecomposer-0.5.3/src/main/lineswidget.cpp0000644000175000001440000011555111153407043021074 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "lineswidget.h" #include "application.h" #include "configs/generalconfig.h" #include "dialogs/actionwithtargetdialog.h" #include "profiler.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if QT_VERSION >= 0x40500 #define TEXT_DOCUMENT_CORRECTION 4 #else #define TEXT_DOCUMENT_CORRECTION 2 #endif using namespace SubtitleComposer; /// LINES MODEL /// =========== LinesModel::LinesModel( QObject* parent ): QAbstractListModel( parent ), m_subtitle( 0 ), m_playingLine( 0 ), m_dataChangedTimer( new QTimer( this ) ), m_minChangedLineIndex( -1 ), m_maxChangedLineIndex( -1 ) { m_dataChangedTimer->setInterval( 0 ); m_dataChangedTimer->setSingleShot( true ); connect( m_dataChangedTimer, SIGNAL( timeout() ), this, SLOT( emitDataChanged() ) ); } Subtitle* LinesModel::subtitle() const { return m_subtitle; } void LinesModel::setSubtitle( Subtitle* subtitle ) { if ( m_subtitle != subtitle ) { m_playingLine = 0; if ( m_subtitle ) { /* disconnect( m_subtitle, SIGNAL( linesAboutToBeInserted( int, int ) ), this, SLOT( onLinesAboutToBeInserted( int, int ) ) );*/ disconnect( m_subtitle, SIGNAL( linesInserted( int, int ) ), this, SLOT( onLinesInserted( int, int ) ) ); /* disconnect( m_subtitle, SIGNAL( linesAboutToBeRemoved( int, int ) ), this, SLOT( onLinesAboutToBeRemoved( int, int ) ) );*/ disconnect( m_subtitle, SIGNAL( linesRemoved( int, int ) ), this, SLOT( onLinesRemoved( int, int ) ) ); disconnect( m_subtitle, SIGNAL( lineErrorFlagsChanged( SubtitleLine*, int ) ), this, SLOT( onLineChanged( SubtitleLine* ) ) ); disconnect( m_subtitle, SIGNAL( linePrimaryTextChanged( SubtitleLine*, const SString& ) ), this, SLOT( onLineChanged( SubtitleLine* ) ) ); disconnect( m_subtitle, SIGNAL( lineSecondaryTextChanged( SubtitleLine*, const SString& ) ), this, SLOT( onLineChanged( SubtitleLine* ) ) ); disconnect( m_subtitle, SIGNAL( lineShowTimeChanged( SubtitleLine*, const Time& ) ), this, SLOT( onLineChanged( SubtitleLine* ) ) ); disconnect( m_subtitle, SIGNAL( lineHideTimeChanged( SubtitleLine*, const Time& ) ), this, SLOT( onLineChanged( SubtitleLine* ) ) ); if ( m_subtitle->linesCount() ) { // onLinesAboutToBeRemoved( 0, m_subtitle->linesCount() - 1 ); onLinesRemoved( 0, m_subtitle->linesCount() - 1 ); } } m_subtitle = subtitle; if ( m_subtitle ) { if ( m_subtitle->linesCount() ) { // onLinesAboutToBeInserted( 0, m_subtitle->linesCount() - 1 ); onLinesInserted( 0, m_subtitle->linesCount() - 1 ); } /* connect( m_subtitle, SIGNAL( linesAboutToBeInserted( int, int ) ), this, SLOT( onLinesAboutToBeInserted( int, int ) ) );*/ connect( m_subtitle, SIGNAL( linesInserted( int, int ) ), this, SLOT( onLinesInserted( int, int ) ) ); /* connect( m_subtitle, SIGNAL( linesAboutToBeRemoved( int, int ) ), this, SLOT( onLinesAboutToBeRemoved( int, int ) ) );*/ connect( m_subtitle, SIGNAL( linesRemoved( int, int ) ), this, SLOT( onLinesRemoved( int, int ) ) ); connect( m_subtitle, SIGNAL( lineErrorFlagsChanged( SubtitleLine*, int ) ), this, SLOT( onLineChanged( SubtitleLine* ) ) ); connect( m_subtitle, SIGNAL( linePrimaryTextChanged( SubtitleLine*, const SString& ) ), this, SLOT( onLineChanged( SubtitleLine* ) ) ); connect( m_subtitle, SIGNAL( lineSecondaryTextChanged( SubtitleLine*, const SString& ) ), this, SLOT( onLineChanged( SubtitleLine* ) ) ); connect( m_subtitle, SIGNAL( lineShowTimeChanged( SubtitleLine*, const Time& ) ), this, SLOT( onLineChanged( SubtitleLine* ) ) ); connect( m_subtitle, SIGNAL( lineHideTimeChanged( SubtitleLine*, const Time& ) ), this, SLOT( onLineChanged( SubtitleLine* ) ) ); } } } SubtitleLine* LinesModel::playingLine() const { return m_playingLine; } void LinesModel::setPlayingLine( SubtitleLine* line ) { if ( m_playingLine != line ) { if ( m_playingLine ) { int row = m_playingLine->index(); m_playingLine = 0; emit dataChanged( index( row, 0 ), index( row, ColumnCount ) ); } m_playingLine = line; if ( line ) { int row = m_playingLine->index(); emit dataChanged( index( row, 0 ), index( row, ColumnCount ) ); } } } int LinesModel::rowCount( const QModelIndex& /*parent*/ ) const { return m_subtitle ? m_subtitle->linesCount() : 0; } int LinesModel::columnCount( const QModelIndex& /*parent*/ ) const { return ColumnCount; } Qt::ItemFlags LinesModel::flags( const QModelIndex& index ) const { if ( ! index.isValid() || index.column() < Text ) return QAbstractItemModel::flags( index ); return QAbstractItemModel::flags( index ) | Qt::ItemIsEditable; } QString LinesModel::buildToolTip( SubtitleLine* line, bool primary ) { int errorFlags = line->errorFlags(); if ( primary ) errorFlags &= ~SubtitleLine::SecondaryOnlyErrors; else errorFlags &= ~SubtitleLine::PrimaryOnlyErrors; const SString& text = primary? line->primaryText() : line->secondaryText(); if ( errorFlags ) { QString toolTip = "

" + text.richString() + "

"; if ( errorFlags ) { toolTip += i18n( "Observations:" ); for ( int id = 0; id < SubtitleLine::ErrorSIZE; ++id ) { if ( ! ((0x1 << id) & errorFlags) ) continue; QString errorText = line->fullErrorText( (SubtitleLine::ErrorID)id ); if ( ! errorText.isEmpty() ) toolTip += "\n - " + errorText; } } toolTip += "

"; return toolTip; } else return text.richString(); } QVariant LinesModel::headerData( int section, Qt::Orientation orientation, int role ) const { if ( role != Qt::DisplayRole || orientation == Qt::Vertical ) return QVariant(); switch ( section ) { case 0: return i18nc( "@title:column Subtitle line number", "Line" ); case 1: return i18nc( "@title:column", "Show Time" ); case 2: return i18nc( "@title:column", "Hide Time" ); case 3: return i18nc( "@title:column Subtitle line (primary) text", "Text" ); case 4: return i18nc( "@title:column Subtitle line translation text", "Translation" ); default: return QVariant(); } } QVariant LinesModel::data( const QModelIndex& index, int role ) const { if ( ! m_subtitle /*|| ! index.isValid() || index.row() >= rowCount() || index.column() >= ColumnCount*/ ) return QVariant(); SubtitleLine* line = m_subtitle->line( index.row() ); if ( role == PlayingLineRole ) return line == m_playingLine; switch ( index.column() ) { case Number: if ( role == Qt::DisplayRole ) return index.row() + 1; break; case ShowTime: //if ( role == Qt::DisplayRole || role == Qt::ToolTipRole ) if ( role == Qt::DisplayRole ) return line->showTime().toString(); else if ( role == Qt::TextAlignmentRole ) return Qt::AlignCenter; break; case HideTime: //if ( role == Qt::DisplayRole || role == Qt::ToolTipRole ) if ( role == Qt::DisplayRole ) return line->hideTime().toString(); else if ( role == Qt::TextAlignmentRole ) return Qt::AlignCenter; break; case Text: if ( role == Qt::DisplayRole ) return line->primaryText().richString(); else if ( role == MarkedRole ) return line->errorFlags() & SubtitleLine::UserMark; else if ( role == ErrorRole ) return line->errorFlags() & ((SubtitleLine::SharedErrors|SubtitleLine::PrimaryOnlyErrors) & ~SubtitleLine::UserMark); else if ( role == Qt::ToolTipRole ) return buildToolTip( m_subtitle->line( index.row() ), true ); else if ( role == Qt::EditRole ) return m_subtitle->line( index.row() )->primaryText().richString().replace( '\n', '|' ); break; case Translation: if ( role == Qt::DisplayRole ) return m_subtitle->line( index.row() )->secondaryText().richString(); else if ( role == MarkedRole ) return line->errorFlags() & SubtitleLine::UserMark; else if ( role == ErrorRole ) return line->errorFlags() & ((SubtitleLine::SharedErrors|SubtitleLine::SecondaryOnlyErrors) & ~SubtitleLine::UserMark); else if ( role == Qt::ToolTipRole ) return buildToolTip( m_subtitle->line( index.row() ), false ); else if ( role == Qt::EditRole ) return m_subtitle->line( index.row() )->secondaryText().richString().replace( '\n', '|' ); break; default: break; } return QVariant(); } bool LinesModel::setData( const QModelIndex& index, const QVariant& value, int role ) { if ( ! m_subtitle || ! index.isValid() ) return false; switch ( index.column() ) { case Text: if ( role == Qt::EditRole ) { SString sstring; sstring.setRichString( value.toString().replace( '|', '\n' ) ); m_subtitle->line( index.row() )->setPrimaryText( sstring ); emit dataChanged( index, index ); return true; } break; case Translation: if ( role == Qt::EditRole ) { SString sstring; sstring.setRichString( value.toString().replace( '|', '\n' ) ); m_subtitle->line( index.row() )->setSecondaryText( sstring ); emit dataChanged( index, index ); return true; } break; default: break; } return false; } void LinesModel::onLinesInserted( int firstIndex, int lastIndex ) { static const QModelIndex rootIndex; beginInsertRows( rootIndex, firstIndex, lastIndex ); endInsertRows(); // ridiculously costly operation } void LinesModel::onLinesRemoved( int firstIndex, int lastIndex ) { static const QModelIndex rootIndex; beginRemoveRows( rootIndex, firstIndex, lastIndex ); endRemoveRows(); } void LinesModel::onLineChanged( SubtitleLine* line ) { int lineIndex = line->index(); if ( m_minChangedLineIndex < 0 ) { m_minChangedLineIndex = lineIndex; m_maxChangedLineIndex = lineIndex; m_dataChangedTimer->start(); } else if ( lineIndex < m_minChangedLineIndex ) m_minChangedLineIndex = lineIndex; else if ( lineIndex > m_maxChangedLineIndex ) m_maxChangedLineIndex = lineIndex; } void LinesModel::emitDataChanged() { if ( m_minChangedLineIndex < 0 ) m_minChangedLineIndex = m_maxChangedLineIndex; else if ( m_maxChangedLineIndex < 0 ) m_maxChangedLineIndex = m_minChangedLineIndex; emit dataChanged( index( m_minChangedLineIndex, 0 ), index( m_maxChangedLineIndex, ColumnCount-1 ) ); m_minChangedLineIndex = -1; m_maxChangedLineIndex = -1; } /// ITEM DELEGATE /// ============= LinesItemDelegate::LinesItemDelegate( bool useStyle, bool singleLineMode, bool richTextMode, LinesWidget* parent ): QStyledItemDelegate( parent ), m_useStyle( useStyle ), m_singleLineMode( singleLineMode ), m_textDocument( 0 ) { setRichTextMode( richTextMode ); } LinesItemDelegate::~LinesItemDelegate() { delete m_textDocument; } bool LinesItemDelegate::useStyle() const { return m_useStyle; } void LinesItemDelegate::setUseStyle( bool useStyle ) { m_useStyle = useStyle; } bool LinesItemDelegate::singleLineMode() const { return m_singleLineMode; } void LinesItemDelegate::setSingleLineMode( bool singleLineMode ) { m_singleLineMode = singleLineMode; } bool LinesItemDelegate::richTextMode() const { return m_textDocument != 0; } void LinesItemDelegate::setRichTextMode( bool richTextMode ) { if ( richTextMode != (m_textDocument != 0) ) { if ( richTextMode ) { QTextOption defaultTextOption; defaultTextOption.setWrapMode( QTextOption::NoWrap ); m_textDocument = new QTextDocument(); m_textDocument->setDefaultTextOption( defaultTextOption ); m_textDocument->setUndoRedoEnabled( false ); m_textDocument->setDefaultStyleSheet( "p { display: inline; white-space: pre; vertical-align: baseline; margin-bottom: 0px; margin-top: 0px }" ); } else { delete m_textDocument; m_textDocument = 0; } } } bool LinesItemDelegate::eventFilter( QObject* object, QEvent* event ) { QWidget *editor = qobject_cast(object); if ( ! editor ) return false; if ( event->type() == QEvent::KeyPress ) { switch ( static_cast(event)->key() ) { case Qt::Key_Tab: emit commitData( editor ); emit closeEditor( editor, QAbstractItemDelegate::EditNextItem ); return true; case Qt::Key_Backtab: emit commitData( editor ); emit closeEditor( editor, QAbstractItemDelegate::EditPreviousItem ); return true; case Qt::Key_Up: emit commitData( editor ); emit closeEditor( editor, (QAbstractItemDelegate::EndEditHint)EditUpperItem ); return true; case Qt::Key_Down: emit commitData( editor ); emit closeEditor( editor, (QAbstractItemDelegate::EndEditHint)EditLowerItem ); return true; default: break; } } return QStyledItemDelegate::eventFilter( object, event ); } void LinesItemDelegate::drawBackgroundPrimitive( QPainter* painter, const QStyle* style, const QStyleOptionViewItemV4& option ) const { if ( m_useStyle ) { style->drawPrimitive( QStyle::PE_PanelItemViewItem, &option, painter, option.widget ); } else { QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled; if ( cg == QPalette::Normal && ! (option.state & QStyle::State_Active) ) cg = QPalette::Inactive; if ( option.showDecorationSelected && (option.state & QStyle::State_Selected) ) { painter->fillRect( option.rect, option.palette.brush( cg, QPalette::Highlight ) ); } else { if ( option.backgroundBrush.style() != Qt::NoBrush ) { QPointF oldBO = painter->brushOrigin(); painter->setBrushOrigin( option.rect.topLeft() ); painter->fillRect( option.rect, option.backgroundBrush ); painter->setBrushOrigin( oldBO ); } if ( option.state & QStyle::State_Selected ) { QRect textRect = style->subElementRect( QStyle::SE_ItemViewItemText, &option, option.widget ); painter->fillRect( textRect, option.palette.brush( cg, QPalette::Highlight ) ); } } } } void LinesItemDelegate::drawTextPrimitive( QPainter* painter, const QStyle* style, const QStyleOptionViewItemV4& option, const QRect& rect, QPalette::ColorGroup cg ) const { const int textMargin = style->pixelMetric( QStyle::PM_FocusFrameHMargin, 0, option.widget ) + 1; const int alignment = QStyle::visualAlignment( option.direction, option.displayAlignment ); QRect textRect = rect.adjusted( textMargin, 0, -textMargin, 0 ); // remove width padding QString text = QString( option.text ); QFontMetrics fm = painter->fontMetrics(); text = fm.elidedText( option.text, option.textElideMode, textRect.width() ); if ( m_textDocument ) { QTextOption textOption; textOption.setTextDirection( option.direction ); textOption.setAlignment( (Qt::Alignment)alignment ); m_textDocument->setDefaultTextOption( textOption ); m_textDocument->setTextWidth( textRect.width() - textMargin ); m_textDocument->setHtml( "

" + text + "

" ); QPalette palette( option.palette ); palette.setColor( QPalette::Text, palette.color( cg, option.state & QStyle::State_Selected ? QPalette::HighlightedText : QPalette::Text ) ); QAbstractTextDocumentLayout::PaintContext context; context.palette = palette; painter->translate( textRect.x() - TEXT_DOCUMENT_CORRECTION, textRect.y() - TEXT_DOCUMENT_CORRECTION ); m_textDocument->documentLayout()->draw( painter, context ); painter->translate( -textRect.x() + TEXT_DOCUMENT_CORRECTION, -textRect.y() + TEXT_DOCUMENT_CORRECTION ); } else { if ( option.state & QStyle::State_Selected ) painter->setPen( option.palette.color( cg, QPalette::HighlightedText ) ); else painter->setPen( option.palette.color( cg, QPalette::Text ) ); painter->drawText( textRect, alignment, text ); } } void LinesItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& opt, const QModelIndex& index ) const { QStyleOptionViewItemV4 option = opt; initStyleOption( &option, index ); const QWidget* widget = option.widget; const QStyle* style = widget ? widget->style() : QApplication::style(); painter->save(); painter->setClipRect( option.rect ); QRect textRect = style->subElementRect( QStyle::SE_ItemViewItemText, &option, widget ); QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled; if ( cg == QPalette::Normal && ! (option.state & QStyle::State_Active) ) cg = QPalette::Inactive; // draw the background if ( index.data( LinesModel::PlayingLineRole ).toBool() ) { if ( option.state & QStyle::State_Selected ) { option.backgroundBrush = option.palette.highlight().color().lighter( 125 ); option.palette.setBrush( cg, QPalette::Highlight, option.backgroundBrush ); } else option.backgroundBrush = option.palette.highlight().color().lighter( 165 ); } drawBackgroundPrimitive( painter, style, option ); // draw the icon(s) bool showMarkedIcon = index.data( LinesModel::MarkedRole ).toBool(); bool showErrorIcon = index.data( LinesModel::ErrorRole ).toBool(); if ( showMarkedIcon || showErrorIcon ) { int iconSize = qMin( textRect.width(), textRect.height() ) - 3; QRect iconRect = QRect( textRect.x() + 2, textRect.y() + 1, iconSize, iconSize ); QIcon::Mode mode = QIcon::Normal; if ( ! ( option.state & QStyle::State_Enabled ) ) mode = QIcon::Disabled; else if ( option.state & QStyle::State_Selected ) mode = QIcon::Selected; QIcon::State state = option.state & QStyle::State_Open ? QIcon::On : QIcon::Off; if ( showMarkedIcon ) { //painter->drawPixmap( iconRect, markPixmap() ); markIcon().paint( painter, iconRect, option.decorationAlignment, mode, state ); textRect.setX( textRect.x() + iconSize + 2 ); if ( showErrorIcon ) iconRect.translate( iconSize + 2, 0 ); } if ( showErrorIcon ) { //painter->drawPixmap( iconRect, errorPixmap() ); errorIcon().paint( painter, iconRect, option.decorationAlignment, mode, state ); textRect.setX( textRect.x() + iconSize + 2 ); } } // draw the text if ( ! option.text.isEmpty() ) { if ( option.state & QStyle::State_Editing ) { painter->setPen( option.palette.color( cg, QPalette::Text ) ); painter->drawRect( textRect.adjusted( 0, 0, -1, -1 ) ); } drawTextPrimitive( painter, style, option, textRect, cg ); } // draw the focus rect if ( option.state & QStyle::State_HasFocus ) { QStyleOptionFocusRect frOption; frOption.QStyleOption::operator=( option ); frOption.rect = style->subElementRect( QStyle::SE_ItemViewItemFocusRect, &option, widget ); frOption.state |= QStyle::State_KeyboardFocusChange; frOption.state |= QStyle::State_Item; frOption.backgroundColor = option.palette.color( (option.state & QStyle::State_Enabled) ? QPalette::Normal : QPalette::Disabled, (option.state & QStyle::State_Selected) ? QPalette::Highlight : QPalette::Window ); style->drawPrimitive( QStyle::PE_FrameFocusRect, &frOption, painter, widget ); } painter->restore(); } QString LinesItemDelegate::displayText( const QVariant& value, const QLocale& locale ) const { static const QChar pipeChar( '|' ); static const QChar newLineChar( QChar::LineSeparator ); if ( value.type() == QVariant::String ) return value.toString().replace( '\n', m_singleLineMode ? pipeChar : newLineChar ); else return QStyledItemDelegate::displayText( value, locale ); } const QIcon& LinesItemDelegate::markIcon() { static QIcon markIcon; if ( markIcon.isNull() ) markIcon = KIcon( "dialog-warning" ); return markIcon; } const QIcon& LinesItemDelegate::errorIcon() { static QIcon errorIcon; if ( errorIcon.isNull() ) errorIcon = KIcon( "dialog-error" ); return errorIcon; } const QPixmap& LinesItemDelegate::markPixmap() { static QPixmap markPixmap; if ( markPixmap.isNull() ) markPixmap = markIcon().pixmap( 13, 13 ); return markPixmap; } const QPixmap& LinesItemDelegate::errorPixmap() { static QPixmap errorPixmap; if ( errorPixmap.isNull() ) errorPixmap = errorIcon().pixmap( 13, 13 ); return errorPixmap; } /// LINES WIDGET /// ============ LinesWidget::LinesWidget( QWidget* parent ): TreeView( parent ), m_translationMode( false ), m_showingContextMenu( false ) { setModel( new LinesModel( this ) ); LinesItemDelegate* plainTextDelegate = new LinesItemDelegate( true, true, false, this ); LinesItemDelegate* richTextDelegate = new LinesItemDelegate( true, true, true, this ); for ( int column = 0, columnCount = model()->columnCount(); column < columnCount; ++column ) setItemDelegateForColumn( column, column < LinesModel::Text ? plainTextDelegate : richTextDelegate ); QHeaderView* header = this->header(); header->setClickable( false ); header->setMovable( false ); header->setResizeMode( LinesModel::Number, QHeaderView::ResizeToContents ); header->setResizeMode( LinesModel::ShowTime, QHeaderView::ResizeToContents ); header->setResizeMode( LinesModel::HideTime, QHeaderView::ResizeToContents ); header->setResizeMode( LinesModel::Text, QHeaderView::Interactive ); header->setResizeMode( LinesModel::Translation, QHeaderView::Interactive ); header->setSectionHidden( LinesModel::Translation, true ); setUniformRowHeights( true ); setItemsExpandable( false ); setAutoExpandDelay( -1 ); setExpandsOnDoubleClick( false ); setRootIsDecorated( false ); setAllColumnsShowFocus( true ); setSortingEnabled( false ); //setIconSize( QSize( 12, 12 ) ); setSelectionMode( QAbstractItemView::ExtendedSelection ); setSelectionBehavior( QAbstractItemView::SelectRows ); m_gridPen.setColor( palette().mid().color().light( 120 ) ); setAcceptDrops( true ); viewport()->installEventFilter( this ); connect( selectionModel(), SIGNAL( currentRowChanged( const QModelIndex&, const QModelIndex& ) ), this, SLOT( onCurrentRowChanged() ) ); } LinesWidget::~LinesWidget() { } void LinesWidget::closeEditor( QWidget* editor, QAbstractItemDelegate::EndEditHint hint ) { LinesItemDelegate::ExtendedEditHint ehint = (LinesItemDelegate::ExtendedEditHint)hint; QModelIndex editorIndex = currentIndex(); if ( ehint == LinesItemDelegate::EditUpperItem ) TreeView::closeEditor( editor, QAbstractItemDelegate::EditPreviousItem ); else if ( ehint == LinesItemDelegate::EditLowerItem ) TreeView::closeEditor( editor, QAbstractItemDelegate::EditNextItem ); else if ( m_translationMode ) { if ( ehint == LinesItemDelegate::EditNextItem ) TreeView::closeEditor( editor, editorIndex.column() != LinesModel::Text ? QAbstractItemDelegate::EditNextItem : QAbstractItemDelegate::NoHint ); else if ( ehint == LinesItemDelegate::EditPreviousItem ) TreeView::closeEditor( editor, editorIndex.column() == LinesModel::Text ? QAbstractItemDelegate::EditPreviousItem : QAbstractItemDelegate::NoHint ); else TreeView::closeEditor( editor, hint ); } else TreeView::closeEditor( editor, hint ); switch ( ehint ) { case LinesItemDelegate::NoHint: case LinesItemDelegate::SubmitModelCache: case LinesItemDelegate::RevertModelCache: break; case LinesItemDelegate::EditUpperItem: if ( editorIndex.row() > 0 ) editCurrentLineInPlace( editorIndex.column() == LinesModel::Text ); break; case LinesItemDelegate::EditLowerItem: if ( editorIndex.row() < model()->rowCount() - 1 ) editCurrentLineInPlace( editorIndex.column() == LinesModel::Text ); break; case LinesItemDelegate::EditPreviousItem: if ( editorIndex.row() > 0 || (m_translationMode && editorIndex.column() == LinesModel::Translation) ) editCurrentLineInPlace( editorIndex.column() != LinesModel::Text ); break; case LinesItemDelegate::EditNextItem: if ( editorIndex.row() < model()->rowCount() - 1 || (m_translationMode && editorIndex.column() == LinesModel::Text) ) editCurrentLineInPlace( editorIndex.column() != LinesModel::Text ); break; } } void LinesWidget::rowsAboutToBeRemoved( const QModelIndex& parent, int start, int end ) { TreeView::rowsAboutToBeRemoved( parent, start, end ); selectionModel()->select( model()->index( end + 1, 0, parent ), QItemSelectionModel::Rows|QItemSelectionModel::ClearAndSelect|QItemSelectionModel::Current ); scrollTo( model()->index( end + 1, 0, parent ), QAbstractItemView::EnsureVisible ); } void LinesWidget::rowsInserted( const QModelIndex& parent, int start, int end ) { TreeView::rowsInserted( parent, start, end ); if ( model()->rowCount() != (end - start + 1) ) // there were other rows previously { selectionModel()->select( QItemSelection( model()->index( start, 0, parent ), model()->index( end, 0, parent ) ), QItemSelectionModel::Rows|QItemSelectionModel::ClearAndSelect ); scrollTo( model()->index( start, 0, parent ), QAbstractItemView::EnsureVisible ); } selectionModel()->setCurrentIndex( model()->index( start, 0, parent ), QItemSelectionModel::Rows|QItemSelectionModel::SelectCurrent ); } void LinesWidget::editCurrentLineInPlace( bool primaryText ) { QModelIndex currentIndex = this->currentIndex(); if ( currentIndex.isValid() ) { currentIndex = model()->index( currentIndex.row(), primaryText || ! m_translationMode ? LinesModel::Text : LinesModel::Translation ); setCurrentIndex( currentIndex ); edit( currentIndex ); } } bool LinesWidget::showingContextMenu() { return m_showingContextMenu; } SubtitleLine* LinesWidget::currentLine() const { QModelIndex currentIndex = this->currentIndex(); return currentIndex.isValid() ? model()->subtitle()->line( currentIndex.row() ) : 0; } int LinesWidget::currentLineIndex() const { QModelIndex currentIndex = this->currentIndex(); return currentIndex.isValid() ? currentIndex.row() : -1; } int LinesWidget::firstSelectedIndex() const { QItemSelectionModel* selection = selectionModel(); for ( int row = 0, rowCount = model()->rowCount(); row < rowCount; ++row ) if ( selection->isSelected( model()->index( row, 0 ) ) ) return row; return -1; } int LinesWidget::lastSelectedIndex() const { QItemSelectionModel* selection = selectionModel(); for ( int row = model()->rowCount() - 1; row >= 0; --row ) if ( selection->isSelected( model()->index( row, 0 ) ) ) return row; return -1; } bool LinesWidget::selectionHasMultipleRanges() const { int selectionRanges = 0; QItemSelectionModel* selection = selectionModel(); int rangeFirstRow = -1, row = 0; for ( int rowCount = model()->rowCount(); row < rowCount; ++row ) { if ( selection->isSelected( model()->index( row, 0 ) ) ) { if ( rangeFirstRow == -1 ) // mark start of selected range { rangeFirstRow = row; selectionRanges++; if ( selectionRanges > 1 ) break; } } else { if ( rangeFirstRow != -1 ) rangeFirstRow = -1; } } return selectionRanges > 1; } RangeList LinesWidget::selectionRanges() const { RangeList ranges; QItemSelectionModel* selection = selectionModel(); int rangeFirstRow = -1, row = 0; for ( const int rowCount = model()->rowCount(); row < rowCount; ++row ) { if ( selection->isSelected( model()->index( row, 0 ) ) ) { if ( rangeFirstRow == -1 ) // mark start of selected range rangeFirstRow = row; } else { if ( rangeFirstRow != -1 ) { ranges << Range( rangeFirstRow, row - 1 ); rangeFirstRow = -1; } } } if ( rangeFirstRow != -1 ) ranges << Range( rangeFirstRow, row - 1 ); return ranges; } RangeList LinesWidget::targetRanges( int target ) const { switch ( target ) { case ActionWithTargetDialog::AllLines: return Range::full(); case ActionWithTargetDialog::Selection: return selectionRanges(); case ActionWithTargetDialog::FromSelected: { int index = firstSelectedIndex(); return index < 0 ? RangeList() : Range::upper( index ); } case ActionWithTargetDialog::UpToSelected: { int index = lastSelectedIndex(); return index < 0 ? RangeList() : Range::lower( index ); } default: return RangeList(); } } void LinesWidget::loadConfig() { KConfigGroup group( KGlobal::config()->group( "LinesWidget Settings" ) ); QByteArray state; QStringList strState = group.readXdgListEntry( "Columns State", QString( "" ).split( ' ' ) ); for ( QStringList::ConstIterator it = strState.begin(), end = strState.end(); it != end; ++it ) state.append( (char)(*it).toInt() ); header()->restoreState( state ); } void LinesWidget::saveConfig() { KConfigGroup group( KGlobal::config()->group( "LinesWidget Settings" ) ); QStringList strState; QByteArray state = header()->saveState(); for ( int index = 0, size = state.size(); index < size; ++index ) strState.append( QString::number( state[index] ) ); group.writeXdgListEntry( "Columns State", strState ); } void LinesWidget::setSubtitle( Subtitle* subtitle ) { model()->setSubtitle( subtitle ); } void LinesWidget::setTranslationMode( bool enabled ) { if ( m_translationMode != enabled ) { m_translationMode = enabled; QHeaderView* header = this->header(); if ( m_translationMode ) { int textColumnWidth = header->sectionSize( LinesModel::Text ); header->resizeSection( LinesModel::Text, textColumnWidth / 2 ); header->setSectionHidden( LinesModel::Translation, false ); header->resizeSection( LinesModel::Translation, textColumnWidth / 2 ); } else { int textColumnWidth = header->sectionSize( LinesModel::Text ); int translationColumnSize = header->sectionSize( LinesModel::Translation ); header->setSectionHidden( LinesModel::Translation, true ); header->resizeSection( LinesModel::Text, textColumnWidth + translationColumnSize ); } } } void LinesWidget::setCurrentLine( SubtitleLine* line, bool clearSelection ) { if ( line ) { selectionModel()->setCurrentIndex( model()->index( line->index(), 0 ), clearSelection ? QItemSelectionModel::Select | QItemSelectionModel::Rows | QItemSelectionModel::Clear : QItemSelectionModel::Select | QItemSelectionModel::Rows ); } } void LinesWidget::setPlayingLine( SubtitleLine* line ) { model()->setPlayingLine( line ); } void LinesWidget::mouseDoubleClickEvent( QMouseEvent* e ) { QModelIndex index = indexAt( viewport()->mapFromGlobal( e->globalPos() ) ); if ( index.isValid() ) emit lineDoubleClicked( model()->subtitle()->line( index.row() ) ); } bool LinesWidget::eventFilter( QObject* object, QEvent* event ) { if ( object == viewport() ) { if ( event->type() == QEvent::DragEnter ) { QDragEnterEvent* dragEnterEvent = static_cast( event ); KUrl::List urls = KUrl::List::fromMimeData( dragEnterEvent->mimeData() ); if ( ! urls.isEmpty() ) dragEnterEvent->accept(); else dragEnterEvent->ignore(); return true; } else if ( event->type() == QEvent::DragMove ) { return true; // eat event } else if ( event->type() == QEvent::Drop ) { QDropEvent* dropEvent = static_cast( event ); KUrl::List urls = KUrl::List::fromMimeData( dropEvent->mimeData() ); if ( ! urls.isEmpty() ) { for ( KUrl::List::ConstIterator it = urls.begin(), end = urls.end(); it != end; ++it ) { const KUrl& url = *it; if ( url.protocol() != "file" ) continue; app()->openSubtitle( *it ); break; } } return true; // eat event } else return TreeView::eventFilter( object, event ); // standard event processing } return TreeView::eventFilter( object, event ); } void LinesWidget::contextMenuEvent( QContextMenuEvent* e ) { SubtitleLine* referenceLine = 0; QItemSelectionModel* selection = selectionModel(); for ( int row = 0, rowCount = model()->rowCount(); row < rowCount; ++row ) { if ( selection->isSelected( model()->index( row, 0 ) ) ) { referenceLine = model()->subtitle()->line( row ); break; } } if ( ! referenceLine ) return; Application* app = Application::instance(); QAction* action; KMenu textsMenu( i18n( "Texts" ) ); textsMenu.addAction( i18n( "Break Lines..." ), app, SLOT( breakLines() ) ); textsMenu.addAction( m_translationMode ? i18n( "Unbreak Lines..." ) : i18n( "Unbreak Lines" ), app, SLOT( unbreakTexts() ) ); textsMenu.addAction( m_translationMode ? i18n( "Simplify Spaces..." ) : i18n( "Simplify Spaces" ), app, SLOT( simplifySpaces() ) ); textsMenu.addAction( i18n( "Change Case..." ), app, SLOT( changeCase() ) ); textsMenu.addAction( i18n( "Fix Punctuation..." ), app, SLOT( fixPunctuation() ) ); textsMenu.addAction( i18n( "Translate..." ), app, SLOT( translate() ) ); textsMenu.addSeparator(); textsMenu.addAction( KIcon( "tools-check-spelling" ), i18n( "Spelling..." ), app, SLOT( spellCheck() ) ); KMenu stylesMenu( i18n( "Styles" ) ); int styleFlags = referenceLine->primaryText().cummulativeStyleFlags() | referenceLine->secondaryText().cummulativeStyleFlags(); action = stylesMenu.addAction( KIcon( "format-text-bold" ), i18nc( "@action:inmenu Toggle bold style", "Bold" ), app, SLOT( toggleSelectedLinesBold() ) ); action->setCheckable( true ); action->setChecked( styleFlags & SString::Bold ); action = stylesMenu.addAction( KIcon( "format-text-italic" ), i18nc( "@action:inmenu Toggle italic style", "Italic" ), app, SLOT( toggleSelectedLinesItalic() ) ); action->setCheckable( true ); action->setChecked( styleFlags & SString::Italic ); action = stylesMenu.addAction( KIcon( "format-text-underline" ), i18nc( "@action:inmenu Toggle underline style", "Underline" ), app, SLOT( toggleSelectedLinesUnderline() ) ); action->setCheckable( true ); action->setChecked( styleFlags & SString::Underline ); action = stylesMenu.addAction( KIcon( "format-text-strikethrough" ), i18nc( "@action:inmenu Toggle strike through style", "Strike Through" ), app, SLOT( toggleSelectedLinesStrikeThrough() ) ); action->setCheckable( true ); action->setChecked( styleFlags & SString::StrikeThrough ); KMenu timesMenu( i18n( "Times" ) ); QString shiftMillis( app->generalConfig()->linesQuickShiftAmount() ); timesMenu.addAction( i18n( "Shift +%1 Milliseconds", shiftMillis ), app, SLOT( shiftSelectedLinesForwards() ) ); timesMenu.addAction( i18n( "Shift -%1 Milliseconds", shiftMillis ), app, SLOT( shiftSelectedLinesBackwards() ) ); timesMenu.addSeparator(); timesMenu.addAction( i18n( "Shift..." ), app, SLOT( shiftLines() ) ); timesMenu.addAction( i18n( "Sort" ), app, SLOT( sortLines() ) ); timesMenu.addAction( i18n( "Enforce Duration Limits..." ), app, SLOT( enforceDurationLimits() ) ); timesMenu.addAction( i18n( "Set Automatic Durations..." ), app, SLOT( setAutoDurations() ) ); timesMenu.addAction( i18n( "Maximize Durations" ), app, SLOT( maximizeDurations() ) ); timesMenu.addAction( i18n( "Fix Overlapping Times" ), app, SLOT( fixOverlappingLines() ) ); KMenu errorsMenu( i18n( "Errors" ) ); action = errorsMenu.addAction( i18n( "Mark" ), app, SLOT( toggleSelectedLinesMark() ) ); action->setCheckable( true ); action->setChecked( referenceLine->errorFlags() & SubtitleLine::UserMark ); errorsMenu.addSeparator(); errorsMenu.addAction( i18n( "Check Errors..." ), app, SLOT( checkErrors() ) ); errorsMenu.addAction( i18n( "Clear Errors..." ), app, SLOT( clearErrors() ) ); errorsMenu.addSeparator(); errorsMenu.addAction( i18n( "Show Errors..." ), app, SLOT( showErrors() ) ); KMenu menu; menu.addAction( i18n( "Select All" ), app, SLOT( selectAllLines() ) ); menu.addSeparator(); menu.addAction( i18n( "Remove" ), app, SLOT( removeSelectedLines() ) ); menu.addAction( i18n( "Insert Before" ), app, SLOT( insertBeforeCurrentLine() ) ); menu.addAction( i18n( "Insert After" ), app, SLOT( insertAfterCurrentLine() ) ); menu.addSeparator(); menu.addAction( i18n( "Join Lines" ), app, SLOT( joinSelectedLines() ) ); menu.addAction( i18n( "Split Lines" ), app, SLOT( splitSelectedLines() ) ); menu.addSeparator(); menu.addMenu( &textsMenu ); menu.addMenu( &stylesMenu ); menu.addMenu( ×Menu ); menu.addMenu( &errorsMenu ); m_showingContextMenu = true; menu.exec( e->globalPos() ); m_showingContextMenu = false; e->ignore(); TreeView::contextMenuEvent( e ); } void LinesWidget::onCurrentRowChanged() { QModelIndex current = this->currentIndex(); emit currentLineChanged( current.isValid() ? model()->subtitle()->line( current.row() ) : 0 ); } void LinesWidget::drawHorizontalDotLine( QPainter* painter, int x1, int x2, int y ) { static int aux; if ( x1 > x2 ) { aux = x1; x1 = x2; x2 = aux; } for ( int x = x1 + 1; x <= x2; x += 2 ) painter->drawPoint( x, y ); } void LinesWidget::drawVerticalDotLine( QPainter* painter, int x, int y1, int y2 ) { static int aux; if ( y1 > y2 ) { aux = y1; y1 = y2; y2 = aux; } for ( int y = y1 + 1; y <= y2; y += 2 ) painter->drawPoint( x, y ); } void LinesWidget::drawRow( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const { TreeView::drawRow( painter, option, index ); const int visibleColumns = m_translationMode ? LinesModel::ColumnCount : LinesModel::ColumnCount - 1; const int row = index.row(); const bool rowSelected = selectionModel()->isSelected( index ); const QPalette palette = this->palette(); const QRect rowRect = QRect( visualRect( model()->index( row, 0 ) ).topLeft(), visualRect( model()->index( row, visibleColumns - 1 ) ).bottomRight() ); // draw row grid painter->setPen( m_gridPen ); if ( ! rowSelected ) drawHorizontalDotLine( painter, rowRect.left(), rowRect.right(), rowRect.bottom() ); for ( int column = 0; column < visibleColumns - 1; ++column ) { const QRect cellRect = visualRect( model()->index( row, column ) ); drawVerticalDotLine( painter, cellRect.right(), rowRect.top(), rowRect.bottom() ); } if ( index.row() == currentIndex().row() ) { painter->setPen( palette.foreground().color() ); drawHorizontalDotLine( painter, rowRect.left(), rowRect.right(), rowRect.top() ); drawHorizontalDotLine( painter, rowRect.left(), rowRect.right(), rowRect.bottom() ); drawVerticalDotLine( painter, rowRect.left(), rowRect.top(), rowRect.bottom() ); drawVerticalDotLine( painter, rowRect.right(), rowRect.top(), rowRect.bottom() ); } } #include "lineswidget.moc" subtitlecomposer-0.5.3/src/main/application.h0000644000175000001440000002176311153660340020530 0ustar sergiousers#ifndef APPLICATION_H #define APPLICATION_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "mainwindow.h" #include "configs/generalconfig.h" #include "configs/spellingconfig.h" #include "configs/errorsconfig.h" #include "configs/playerconfig.h" #include "../core/subtitle.h" #include "../core/audiolevels.h" #include "../config/appconfig.h" #include #include #include #include class KComboBox; class KAction; class KToggleAction; class KRecentFilesActionExt; class KCodecAction; class KSelectAction; namespace SubtitleComposer { class Player; class AudioLevels; class AudioLevelsWidget; class PlayerWidget; class LinesWidget; class CurrentLineWidget; class ConfigDialog; class ErrorsDialog; class ErrorsWidget; class Finder; class Replacer; class ErrorFinder; class Speller; class ErrorTracker; class ScriptsManager; class Application : public KApplication { Q_OBJECT public: Application(); virtual ~Application(); static Application* instance(); Subtitle* subtitle() const; MainWindow* mainWindow() const; LinesWidget* linesWidget() const; bool translationMode() const; bool showingLinesContextMenu() const; void loadConfig(); void saveConfig(); GeneralConfig* generalConfig() { return static_cast( m_config.group( "General" ) ); } SpellingConfig* spellingConfig() { return static_cast( m_config.group( "Spelling" ) ); } ErrorsConfig* errorsConfig() { return static_cast( m_config.group( "Errors" ) ); } PlayerConfig* playerConfig() { return static_cast( m_config.group( "Player" ) ); } QAction* action( const char* actionName ); void triggerAction( const QKeySequence& keySequence ); const QStringList& availableEncodingNames() const; const KUrl& lastSubtitleDirectory() const; public slots: /// BEGIN ACTIONS HANDLERS void undo(); void redo(); void newSubtitle(); void openSubtitle(); void openSubtitle( const KUrl& url, bool warnClashingUrls=true ); bool saveSubtitle(); bool saveSubtitleAs(); bool closeSubtitle(); void newTrSubtitle(); void openTrSubtitle(); void openTrSubtitle( const KUrl& url, bool warnClashingUrls=true ); bool saveTrSubtitle(); bool saveTrSubtitleAs(); bool closeTrSubtitle(); void openSubtitleWithDefaultEncoding(); void changeSubtitlesEncoding( const QString& encoding ); void joinSubtitles(); void splitSubtitle(); void insertBeforeCurrentLine(); void insertAfterCurrentLine(); void removeSelectedLines(); void joinSelectedLines(); void splitSelectedLines(); void selectAllLines(); void gotoLine(); void find(); void findNext(); void findPrevious(); void replace(); void spellCheck(); void findError(); void findNextError(); void findPreviousError(); void retrocedeCurrentLine(); void advanceCurrentLine(); void checkErrors(); void recheckAllErrors(); void recheckSelectedErrors(); void clearErrors(); void clearSelectedErrors( bool includeMarks=false ); void clearSelectedMarks(); void showErrors(); void showErrorsConfig(); void toggleSelectedLinesMark(); void toggleSelectedLinesBold(); void toggleSelectedLinesItalic(); void toggleSelectedLinesUnderline(); void toggleSelectedLinesStrikeThrough(); void shiftLines(); void shiftSelectedLinesForwards(); void shiftSelectedLinesBackwards(); void adjustLines(); void sortLines(); void changeFrameRate(); void enforceDurationLimits(); void setAutoDurations(); void maximizeDurations(); void fixOverlappingLines(); void syncWithSubtitle(); void breakLines(); void unbreakTexts(); void simplifySpaces(); void changeCase(); void fixPunctuation(); void translate(); void openVideo(); void openVideo( const KUrl& url ); void toggleFullScreenMode(); void setFullScreenMode( bool enabled ); void seekBackwards(); void seekForwards(); void seekToPrevLine(); void seekToNextLine(); void setCurrentLineShowTimeFromVideo(); void setCurrentLineHideTimeFromVideo(); void shiftToVideoPosition(); void adjustToVideoPositionAnchorLast(); void adjustToVideoPositionAnchorFirst(); void openAudioLevels(); void openAudioLevels( const KUrl& url ); void saveAudioLevelsAs(); void closeAudioLevels(); void increaseAudioLevelsVZoom(); void decreaseAudioLevelsVZoom(); void increaseAudioLevelsHZoom(); void decreaseAudioLevelsHZoom(); /// END ACTIONS HANDLERS signals: void subtitleOpened( Subtitle* subtitle ); void subtitleClosed(); void audiolevelsOpened( AudioLevels* audiolevels ); void audiolevelsClosed(); void translationModeChanged( bool value ); void fullScreenModeChanged( bool value ); private: QString encodingForUrl( const KUrl& url ); bool acceptClashingUrls( const KUrl& subtitleUrl, const KUrl& subtitleTrUrl ); KUrl saveSplittedSubtitle( const Subtitle& subtitle, const KUrl& srcUrl, QString encoding, QString format, bool primary ); void setupActions(); Time videoPosition( bool compensate=false ); static const QString& buildMediaFilesFilter(); static const QString& buildLevelsFilesFilter(); bool applyTranslation( RangeList ranges, bool primary, int inputLanguage, int outputLanguage, int textTargets ); private slots: void updateTitle(); void updateUndoRedoToolTips(); void onLineDoubleClicked( SubtitleLine* line ); void onHighlightLine( SubtitleLine* line, bool primary=true, int firstIndex=-1, int lastIndex=-1 ); void onPlayingLineChanged( SubtitleLine* line ); void onLinkCurrentLineToVideoToggled( bool value ); void onPlayerFileOpened( const QString& filePath ); void onPlayerPlaying(); void onPlayerPaused(); void onPlayerStopped(); void onPlayerAudioStreamsChanged( const QStringList& audioStreams ); void onPlayerActiveAudioStreamChanged( int audioStream ); void onPlayerMuteChanged( bool muted ); void onPlayerOptionChanged( const QString& option, const QString& value ); void onGeneralOptionChanged( const QString& option, const QString& value ); void setActiveSubtitleStream( int subtitleStream ); void updateConfigFromDialog(); private: void toggleFullScreen( bool on ); AppConfig m_config; Subtitle* m_subtitle; KUrl m_subtitleUrl; QString m_subtitleFileName; QString m_subtitleEncoding; int m_subtitleEOL; QString m_subtitleFormat; bool m_translationMode; KUrl m_subtitleTrUrl; QString m_subtitleTrFileName; QString m_subtitleTrEncoding; int m_subtitleTrEOL; QString m_subtitleTrFormat; Player* m_player; SubtitleLine* m_lastFoundLine; //AudioLevels* m_audiolevels; // FIXME audio levels MainWindow* m_mainWindow; //AudioLevelsWidget* m_audiolevelsWidget; // FIXME audio levels PlayerWidget* m_playerWidget; LinesWidget* m_linesWidget; CurrentLineWidget* m_curLineWidget; ConfigDialog* m_configDialog; ErrorsDialog* m_errorsDialog; ErrorsWidget* m_errorsWidget; KUrl m_lastSubtitleUrl; KRecentFilesActionExt* m_recentSubtitlesAction; KRecentFilesActionExt* m_recentTrSubtitlesAction; KCodecAction* m_reloadSubtitleAsAction; KSelectAction* m_quickReloadSubtitleAsAction; Finder* m_finder; Replacer* m_replacer; ErrorFinder* m_errorFinder; Speller* m_speller; ErrorTracker* m_errorTracker; ScriptsManager* m_scriptsManager; KUrl m_lastVideoUrl; bool m_linkCurrentLineToPosition; KRecentFilesActionExt* m_recentVideosAction; KUrl m_lastAudioLevelsUrl; KRecentFilesActionExt* m_recentAudioLevelsAction; }; Application* app(); } #endif subtitlecomposer-0.5.3/src/main/main_tests.h0000644000175000001440000001063711151345061020367 0ustar sergiousers#ifndef MAIN_TESTS_H #define MAIN_TESTS_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "../core/range.h" #include "../core/rangelist.h" #include "../core/sstring.h" #include "../core/subtitle.h" #include "../core/subtitleline.h" #include "../core/subtitleiterator.h" #include "../core/audiolevels.h" #include #include #include using namespace SubtitleComposer; void showRanges( const RangeList& ranges ) { QString aux; for ( RangeList::ConstIterator it = ranges.begin(), end = ranges.end(); it != end; ++it ) aux += QString( " [%1,%2]" ).arg( (*it).start() ).arg( (*it).end() ); kDebug() << QString( "Showing ranges: %1" ).arg( aux.trimmed() ); } void showSubtitle( const Subtitle& subtitle ) { kDebug() << "Showing subtitle"; for ( int index = 0, size = subtitle.linesCount(); index < size; ++index ) kDebug() << QString( "Line: %1" ).arg( subtitle.line( index )->primaryText().richString() ); kDebug() << "--------------------------"; } void iterateSubtitle( const Subtitle& subtitle, const RangeList& ranges ) { showRanges( ranges ); // for ( int idx=0; idx < 3; ++idx ) { kDebug() << "Iterating subtitle forwards from ranges"; for ( SubtitleIterator it( subtitle, ranges ); it.current(); ++it ) kDebug() << QString( "Line: %1" ).arg( it.current()->primaryText().richString() ); kDebug() << "Iterating subtitle backwards from ranges"; for ( SubtitleIterator it( subtitle, ranges, true ); it.current(); --it ) kDebug() << QString( "Line: %1" ).arg( it.current()->primaryText().richString() ); } kDebug() << "--------------------------"; } void testSubtitleIterator() { Subtitle subtitle; for ( int index = 0; index < 20; ++index ) subtitle.insertLine( new SubtitleLine( QString( "Line %1" ).arg( index ) ) ); showSubtitle( subtitle ); iterateSubtitle( subtitle, Range::full() ); iterateSubtitle( subtitle, Range::lower( 10 ) ); iterateSubtitle( subtitle, Range::upper( 10 ) ); iterateSubtitle( subtitle, Range::lower( 50 ) ); iterateSubtitle( subtitle, Range::upper( 50 ) ); RangeList ranges; ranges << Range( 1, 3 ); ranges << Range( 5, 5 ); ranges << Range( 11, 17 ); iterateSubtitle( subtitle, ranges ); // SubtitleIterator it( subtitle, ranges, true ); // for ( int idx = 0; idx < 100; ++idx ) // ++it; // for ( int idx = 0; idx < 200; ++idx ) // --it; // SubtitleIterator it( subtitle, Range( 1, 50 ), true ); // for ( int idx = 0; idx < 100; ++idx ) // ++it; // for ( int idx = 0; idx < 200; ++idx ) // --it; /*QTime time; time.start(); for ( SubtitleIterator it( subtitle, Range::full(), true ); it.current(); --it ) it.current()->text(); kDebug() << time.elapsed(); for ( SubtitleIterator it( subtitle, Range::full(), true ); it.current(); --it ) it.current()->text(); kDebug() << time.elapsed();*/ } void testAudioLevels() { /* AudioLevels audiolevels; audiolevels.load( "/home/sergio/Desktop/scomp-trunk/SAMPLES/chasing.amy.cd1.wf" ); audiolevels.save( "/home/sergio/Desktop/scomp-trunk/SAMPLES/chasing.amy.cd1.2.wf", true );*/ } int main( int, char** ) { // testSubtitleIterator(); // testAudioLevels(); } #endif subtitlecomposer-0.5.3/src/main/subtitlecomposer.xml0000644000175000001440000000657111151345061022177 0ustar sergiousers SubStation Alpha subtitles SSA SubStation Alpha Advanced SubStation Alpha subtitles ASS Advanced SubStation MicroDVD subtitles MPSub subtitles MPSub MPlayer Subtitle MPLSub subtitles MPSub MPlayer Subtitle TMPlayer subtitles TMPlayer+ subtitles subtitlecomposer-0.5.3/src/main/errorswidget.h0000644000175000001440000001345111153643700020741 0ustar sergiousers#ifndef ERRORSWIDGET_H #define ERRORSWIDGET_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../core/rangelist.h" #include "../core/subtitle.h" #include "../widgets/treeview.h" #include #include class QTimer; namespace SubtitleComposer { class ErrorsModel; class ErrorsModelNode { public: ~ErrorsModelNode(); inline const ErrorsModel* model() const { return m_model; } inline const SubtitleLine* line() const { return m_line; } inline int errorCount() const { return m_errorCount; } inline bool isMarked() const { return m_marked; } inline bool isVisible() const { return m_errorCount; } private: ErrorsModelNode( ErrorsModel* model, const SubtitleLine* line ); void update(); private: ErrorsModel* m_model; const SubtitleLine* m_line; int m_errorCount; bool m_marked; friend class ErrorsModel; }; class ErrorsModel : public QAbstractItemModel { Q_OBJECT friend class ErrorsModelNode; public: enum { Number=0, ErrorCount, UserMark, ColumnCount }; explicit ErrorsModel( QObject* parent=0 ); virtual ~ErrorsModel(); int mapModelIndexToLineIndex( const QModelIndex& modelIndex ) const; int mapLineIndexToModelL1Row( int lineIndex ) const; int mapModelL1RowToLineIndex( int modelL1Row ) const; int mapModelL2RowToLineErrorID( int modelL2Row, int lineErrorFlags ) const; int mapModelL2RowToLineErrorFlag( int modelL2Row, int lineErrorFlags ) const; inline Subtitle* subtitle() const { return m_subtitle; }; void setSubtitle( Subtitle* subtitle ); inline const ErrorsModelNode* node( int lineIndex ) const { return m_nodes.at( lineIndex ); } inline int lineWithErrorsCount() const { return m_lineWithErrorsCount; }; inline int errorCount() const { return m_errorCount; }; inline int markCount() const { return m_markCount; }; virtual int rowCount( const QModelIndex& parent=QModelIndex() ) const; virtual int columnCount( const QModelIndex& parent=QModelIndex() ) const; virtual QModelIndex index( int row, int column, const QModelIndex& index=QModelIndex() ) const; virtual QModelIndex parent( const QModelIndex& index ) const; virtual QVariant headerData( int section, Qt::Orientation orientation, int role=Qt::DisplayRole ) const; virtual QVariant data( const QModelIndex& index, int role ) const; signals: void dataChanged(); void dataChanged( const QModelIndex& topLeft, const QModelIndex& bottomRight ); void statsChanged(); private slots: void onLinesInserted( int firstIndex, int lastIndex ); void onLinesRemoved( int firstIndex, int lastIndex ); void onLineErrorsChanged( SubtitleLine* line ); void emitDataChanged(); private: static const QIcon& markIcon(); static const QIcon& errorIcon(); void markLineChanged( int lineIndex ); void updateLineErrors( SubtitleLine* line, int errorFlags ); void incrementVisibleLinesCount( int delta ); void incrementErrorsCount( int delta ); void incrementMarksCount( int delta ); private: Subtitle* m_subtitle; const SubtitleLine LEVEL1_LINE; QList m_nodes; QTimer* m_statsChangedTimer; int m_lineWithErrorsCount; int m_errorCount; int m_markCount; QTimer* m_dataChangedTimer; int m_minChangedLineIndex; int m_maxChangedLineIndex; }; class ErrorsWidget : public TreeView { Q_OBJECT public: ErrorsWidget( QWidget* parent ); virtual ~ErrorsWidget(); void loadConfig(); void saveConfig(); SubtitleLine* currentLine(); int lineSelectedErrorFlags( int lineIndex ); RangeList selectionRanges() const; inline ErrorsModel* model() const { return static_cast( TreeView::model() ); } public slots: void setSubtitle( Subtitle* subtitle=0 ); void setCurrentLine( SubtitleLine* line, bool clearSelection=true ); void expandAll(); // reimplemented because currently calling QTreeView has many bad side effects signals: void currentLineChanged( SubtitleLine* line ); void lineDoubleClicked( SubtitleLine* line ); protected: virtual void contextMenuEvent( QContextMenuEvent* event ); virtual void mouseDoubleClickEvent( QMouseEvent* event ); virtual void keyPressEvent( QKeyEvent* event ); virtual void showEvent( QShowEvent* event ); virtual void hideEvent( QHideEvent* event ); protected slots: void onCurrentRowChanged( const QModelIndex& currentIndex ); private: Subtitle* m_subtitle; }; } #endif subtitlecomposer-0.5.3/src/main/currentlinewidget.cpp0000644000175000001440000004450311170303572022313 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "currentlinewidget.h" #include "application.h" #include "configs/spellingconfig.h" #include "actions/useractionnames.h" #include "../widgets/timeedit.h" #include "../widgets/simplerichtextedit.h" #include #include #include #include #include #include #include #include #include using namespace SubtitleComposer; QToolButton* CurrentLineWidget::createToolButton( const QString& text, const char* icon, QObject* receiver, const char* slot ) { QToolButton* toolButton = new QToolButton( this ); toolButton->setToolTip( text ); toolButton->setIcon( KIcon( icon ) ); toolButton->setMinimumSize( 20, 20 ); toolButton->setMaximumSize( 20, 20 ); toolButton->setCheckable( true ); toolButton->setAutoRaise( true ); toolButton->setFocusPolicy( Qt::NoFocus ); connect( toolButton, SIGNAL( clicked() ), receiver, slot ); return toolButton; } CurrentLineWidget::CurrentLineWidget( QWidget* parent ): QWidget( parent ), m_currentLine( 0 ), m_translationMode( false ), m_updateCurrentLine( true ), m_updateControls( true ), m_updateShorcutsTimer( new QTimer( this ) ) { QGroupBox* timesControlsGroupBox = new QGroupBox( this ); QLabel* showTimeLabel = new QLabel( timesControlsGroupBox ); showTimeLabel->setText( i18n( "Show" ) ); m_showTimeEdit = new TimeEdit( timesControlsGroupBox ); m_showTimeEdit->setFocusPolicy( Qt::ClickFocus ); QLabel* hideTimeLabel = new QLabel( timesControlsGroupBox ); hideTimeLabel->setText( i18n( "Hide" ) ); m_hideTimeEdit = new TimeEdit( timesControlsGroupBox ); m_hideTimeEdit->setFocusPolicy( Qt::ClickFocus ); QLabel* durationTimeLabel = new QLabel( timesControlsGroupBox ); durationTimeLabel->setText( i18n( "Duration" ) ); m_durationTimeEdit = new TimeEdit( timesControlsGroupBox ) ; m_durationTimeEdit->setFocusPolicy( Qt::ClickFocus ); QGridLayout* buttonsLayouts[2]; for ( int index = 0; index < 2; ++index ) { m_textLabels[index] = new QLabel( this ); m_textLabels[index]->setAlignment( Qt::AlignLeft|Qt::AlignVCenter ); m_textLabels[index]->setTextFormat( Qt::PlainText ); m_textLabels[index]->setWordWrap( true ); m_textEdits[index] = new SimpleRichTextEdit( this ); m_textEdits[index]->setTabChangesFocus( true ); m_boldButtons[index] = createToolButton( i18n( "Toggle Bold" ), "format-text-bold", m_textEdits[0], SLOT( toggleFontBold() ) ); m_italicButtons[index] = createToolButton( i18n( "Toggle Italic" ), "format-text-italic", m_textEdits[0], SLOT( toggleFontItalic() ) ); m_underlineButtons[index] = createToolButton( i18n( "Toggle Underline" ), "format-text-underline", m_textEdits[0], SLOT( toggleFontUnderline() ) ); m_strikeThroughButtons[index] = createToolButton( i18n( "Toggle Strike Through" ), "format-text-strikethrough", m_textEdits[0], SLOT( toggleFontStrikeOut() ) ); buttonsLayouts[index] = new QGridLayout(); //buttonsLayouts[index]->setMargin( 0 ); buttonsLayouts[index]->addWidget( m_boldButtons[index], 0, 0, Qt::AlignBottom ); buttonsLayouts[index]->addWidget( m_italicButtons[index], 0, 1, Qt::AlignBottom ); buttonsLayouts[index]->addWidget( m_underlineButtons[index], 0, 2, Qt::AlignBottom ); buttonsLayouts[index]->addWidget( m_strikeThroughButtons[index], 0, 3, Qt::AlignBottom ); } QFont font = m_textLabels[0]->font(); font.setPointSize( font.pointSize() - 1 ); m_textLabels[0]->setFont( font ); m_textLabels[1]->setFont( font ); QGridLayout* timesControlsLayout = new QGridLayout( timesControlsGroupBox ); timesControlsLayout->addWidget( showTimeLabel, 0, 0 ); timesControlsLayout->addWidget( m_showTimeEdit, 0, 1 ); timesControlsLayout->addWidget( hideTimeLabel, 1, 0 ); timesControlsLayout->addWidget( m_hideTimeEdit, 1, 1 ); timesControlsLayout->addWidget( durationTimeLabel, 2, 0 ); timesControlsLayout->addWidget( m_durationTimeEdit, 2, 1 ); m_mainLayout = new QGridLayout( this ); m_mainLayout->setMargin( 0 ); m_mainLayout->setSpacing( 0 ); m_mainLayout->setColumnMinimumWidth( 1, 5 ); m_mainLayout->setColumnMinimumWidth( 4, 0 ); m_mainLayout->setColumnStretch( 2, 1 ); m_mainLayout->addWidget( timesControlsGroupBox, 0, 0, 2, 1 ); m_mainLayout->addWidget( m_textLabels[0], 0, 2 ); m_mainLayout->addLayout( buttonsLayouts[0], 0, 3 ); m_mainLayout->addWidget( m_textEdits[0], 1, 2, 1, 2 ); m_mainLayout->addWidget( m_textLabels[1], 0, 5 ); m_mainLayout->addLayout( buttonsLayouts[1], 0, 6 ); m_mainLayout->addWidget( m_textEdits[1], 1, 5, 1, 2 ); int maxTextHeight = timesControlsGroupBox->minimumSizeHint().height() - m_boldButtons[0]->minimumSizeHint().height() + 4; m_textEdits[0]->setMaximumHeight( maxTextHeight ); m_textEdits[1]->setMaximumHeight( maxTextHeight ); timesControlsGroupBox->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); m_textEdits[0]->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ); m_textEdits[1]->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ); setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ); connect( m_textEdits[0], SIGNAL( selectionChanged() ), this, SLOT( onPrimaryTextEditSelectionChanged() ) ); connect( m_textEdits[0], SIGNAL( cursorPositionChanged() ), this, SLOT( onPrimaryTextEditSelectionChanged() ) ); connect( m_textEdits[0], SIGNAL( textChanged() ), this, SLOT( onPrimaryTextEditChanged() ) ); connect( m_textEdits[1], SIGNAL( selectionChanged() ), this, SLOT( onSecondaryTextEditSelectionChanged() ) ); connect( m_textEdits[1], SIGNAL( cursorPositionChanged() ), this, SLOT( onSecondaryTextEditSelectionChanged() ) ); connect( m_textEdits[1], SIGNAL( textChanged() ), this, SLOT( onSecondaryTextEditChanged() ) ); connect( m_showTimeEdit, SIGNAL( valueChanged(int) ), this, SLOT( onShowTimeEditChanged(int) ) ); connect( m_hideTimeEdit, SIGNAL( valueChanged(int) ), this, SLOT( onHideTimeEditChanged(int) ) ); connect( m_durationTimeEdit, SIGNAL( valueChanged(int) ), this, SLOT( onDurationTimeEditChanged(int) ) ); setTranslationMode( m_translationMode ); m_updateShorcutsTimer->setInterval( 1000 ); m_updateShorcutsTimer->setSingleShot( true ); connect( m_updateShorcutsTimer, SIGNAL( timeout() ), this, SLOT( updateShortcuts() ) ); connect( app()->spellingConfig(), SIGNAL(optionChanged(const QString&,const QString&)), this, SLOT(onSpellingOptionChanged(const QString&,const QString&)) ); } CurrentLineWidget::~CurrentLineWidget() { } QString CurrentLineWidget::focusedText() const { for ( int index = 0; index < 2; ++index ) if ( m_textEdits[index]->hasFocus() && m_textEdits[index]->hasSelection() ) return m_textEdits[index]->selectedText(); return QString(); } void CurrentLineWidget::loadConfig() { KConfigGroup group( KGlobal::config()->group( "Current Line Settings" ) ); m_textEdits[0]->setCheckSpellingEnabled( group.readEntry( "PrimaryCheckSpelling", false ) ); m_textEdits[1]->setCheckSpellingEnabled( group.readEntry( "TranslationCheckSpelling", false ) ); } void CurrentLineWidget::saveConfig() { KConfigGroup group( KGlobal::config()->group( "Current Line Settings" ) ); group.writeEntry( "PrimaryCheckSpelling", m_textEdits[0]->checkSpellingEnabled() ); group.writeEntry( "TranslationCheckSpelling", m_textEdits[1]->checkSpellingEnabled() ); } void CurrentLineWidget::setSubtitle( Subtitle* subtitle ) { if ( ! subtitle ) setCurrentLine( 0 ); } void CurrentLineWidget::setCurrentLine( SubtitleLine* line ) { if ( m_currentLine ) { disconnect( m_currentLine, SIGNAL( primaryTextChanged( const SString& ) ), this, SLOT( onLinePrimaryTextChanged( const SString& ) ) ); disconnect( m_currentLine, SIGNAL( secondaryTextChanged( const SString& ) ), this, SLOT( onLineSecondaryTextChanged( const SString& ) ) ); disconnect( m_currentLine, SIGNAL( showTimeChanged( const Time& ) ), this, SLOT( onLineShowTimeChanged( const Time& ) ) ); disconnect( m_currentLine, SIGNAL( hideTimeChanged( const Time& ) ), this, SLOT( onLineHideTimeChanged( const Time& ) ) ); } m_currentLine = line; if ( m_currentLine ) { connect( m_currentLine, SIGNAL( primaryTextChanged( const SString& ) ), this, SLOT( onLinePrimaryTextChanged( const SString& ) ) ); connect( m_currentLine, SIGNAL( secondaryTextChanged( const SString& ) ), this, SLOT( onLineSecondaryTextChanged( const SString& ) ) ); connect( m_currentLine, SIGNAL( showTimeChanged( const Time& ) ), this, SLOT( onLineShowTimeChanged( const Time& ) ) ); connect( m_currentLine, SIGNAL( hideTimeChanged( const Time& ) ), this, SLOT( onLineHideTimeChanged( const Time& ) ) ); } onLineShowTimeChanged( m_currentLine ? m_currentLine->showTime() : 0 ); onLineHideTimeChanged( m_currentLine ? m_currentLine->hideTime() : 0 ); if ( m_currentLine ) { onLinePrimaryTextChanged( m_currentLine->primaryText() ); onLineSecondaryTextChanged( m_currentLine->secondaryText() ); } else { m_updateCurrentLine = false; m_textLabels[0]->setText( i18n( "No current line" ) ); m_textEdits[0]->setRichText( SString() ); onPrimaryTextEditSelectionChanged(); if ( m_translationMode ) { m_textLabels[1]->setText( i18n( "No current line" ) ); m_textEdits[1]->setRichText( SString() ); onSecondaryTextEditSelectionChanged(); } m_updateCurrentLine = true; } setEnabled( m_currentLine != 0 ); } void CurrentLineWidget::setTranslationMode( bool enabled ) { m_translationMode = enabled; if ( m_translationMode ) { m_textLabels[1]->show(); m_textEdits[1]->show(); m_boldButtons[1]->show(); m_italicButtons[1]->show(); m_underlineButtons[1]->show(); m_strikeThroughButtons[1]->show(); m_mainLayout->setColumnMinimumWidth( 4, 5 ); m_mainLayout->setColumnStretch( 5, 1 ); } else { m_textLabels[1]->hide(); m_textEdits[1]->hide(); m_boldButtons[1]->hide(); m_italicButtons[1]->hide(); m_underlineButtons[1]->hide(); m_strikeThroughButtons[1]->hide(); m_mainLayout->setColumnMinimumWidth( 4, 0 ); m_mainLayout->setColumnStretch( 5, 0 ); } setCurrentLine( m_currentLine ); } void CurrentLineWidget::onPrimaryTextEditSelectionChanged() { m_boldButtons[0]->setChecked( m_textEdits[0]->fontBold() ); m_italicButtons[0]->setChecked( m_textEdits[0]->fontItalic() ); m_underlineButtons[0]->setChecked( m_textEdits[0]->fontUnderline() ); m_strikeThroughButtons[0]->setChecked( m_textEdits[0]->fontStrikeOut() ); } void CurrentLineWidget::onSecondaryTextEditSelectionChanged() { m_boldButtons[1]->setChecked( m_textEdits[1]->fontBold() ); m_italicButtons[1]->setChecked( m_textEdits[1]->fontItalic() ); m_underlineButtons[1]->setChecked( m_textEdits[1]->fontUnderline() ); m_strikeThroughButtons[1]->setChecked( m_textEdits[1]->fontStrikeOut() ); } void CurrentLineWidget::onPrimaryTextEditChanged() { if ( m_updateCurrentLine ) { m_updateControls = false; SString text( m_textEdits[0]->richText() ); m_currentLine->setPrimaryText( text ); m_textLabels[0]->setText( buildTextDescription( text.string() ) ); m_updateControls = true; } } void CurrentLineWidget::onSecondaryTextEditChanged() { if ( m_updateCurrentLine ) { m_updateControls = false; SString text( m_textEdits[1]->richText() ); m_currentLine->setSecondaryText( text ); m_textLabels[1]->setText( buildTextDescription( text.string() ) ); m_updateControls = true; } } void CurrentLineWidget::onShowTimeEditChanged( int showTime ) { if ( m_updateCurrentLine ) { m_updateControls = false; m_currentLine->setShowTime( showTime ); m_durationTimeEdit->setValue( m_hideTimeEdit->value() - showTime ); m_updateControls = true; } } void CurrentLineWidget::onHideTimeEditChanged( int hideTime ) { if ( m_updateCurrentLine ) { m_updateControls = false; m_currentLine->setHideTime( hideTime ); m_durationTimeEdit->setValue( hideTime - m_showTimeEdit->value() ); m_updateControls = true; } } void CurrentLineWidget::onDurationTimeEditChanged( int durationTime ) { if ( m_updateCurrentLine ) { m_updateControls = false; m_currentLine->setDurationTime( durationTime ); m_hideTimeEdit->setValue( m_showTimeEdit->value() + durationTime ); m_updateControls = true; } } QString CurrentLineWidget::buildTextDescription( const QString& text ) { static const QString currentLineText( i18n( "Current line:" ) ); QString expressionText( ' ' ); int characters = 0; QStringList lines = text.split( '\n' ); if ( ! lines.empty() ) { characters += lines.first().length(); if ( lines.size() > 1 ) { static const QString plus( " + " ); static const QString equals( " = " ); expressionText += QString::number( lines.first().length() ); for ( int index = 1, count = lines.size(); index < count; ++index ) { characters += lines[index].length(); expressionText += plus + QString::number( lines[index].length() ); } expressionText += equals; } } return currentLineText + expressionText + i18np( "1 character", "%1 characters", characters ); } void CurrentLineWidget::onLinePrimaryTextChanged( const SString& primaryText ) { if ( m_updateControls ) { m_updateCurrentLine = false; m_textLabels[0]->setText( buildTextDescription( primaryText.string() ) ); m_textEdits[0]->setRichText( primaryText ); onPrimaryTextEditSelectionChanged(); m_updateCurrentLine = true; } } void CurrentLineWidget::onLineSecondaryTextChanged( const SString& secondaryText ) { if ( m_updateControls && m_translationMode ) { m_updateCurrentLine = false; m_textLabels[1]->setText( buildTextDescription( secondaryText.string() ) ); m_textEdits[1]->setRichText( secondaryText ); onSecondaryTextEditSelectionChanged(); m_updateCurrentLine = true; } } void CurrentLineWidget::onLineShowTimeChanged( const Time& showTime ) { if ( m_updateControls ) { m_updateCurrentLine = false; m_showTimeEdit->setValue( showTime.toMillis() ); m_updateCurrentLine = true; } } void CurrentLineWidget::onLineHideTimeChanged( const Time& hideTime ) { if ( m_updateControls ) { m_updateCurrentLine = false; m_hideTimeEdit->setValue( hideTime.toMillis() ); m_durationTimeEdit->setValue( m_hideTimeEdit->value() - m_showTimeEdit->value() ); m_updateCurrentLine = true; } } void CurrentLineWidget::highlightPrimary( int startIndex, int endIndex ) { m_textEdits[1]->clearSelection(); m_textEdits[0]->setSelection( startIndex, endIndex ); m_textEdits[0]->setFocus(); } void CurrentLineWidget::highlightSecondary( int startIndex, int endIndex ) { m_textEdits[0]->clearSelection(); m_textEdits[1]->setSelection( startIndex, endIndex ); m_textEdits[1]->setFocus(); } void CurrentLineWidget::setupActions() { for ( int index = 0; index < 2; ++index ) { KAction* spellingAction = m_textEdits[index]->action( SimpleRichTextEdit::CheckSpelling ); spellingAction->disconnect(); connect( spellingAction, SIGNAL( triggered() ), app(), SLOT( spellCheck() ) ); } connect( app()->action( ACT_UNDO ), SIGNAL( changed() ), this, SLOT( markUpdateShortcuts() ) ); connect( app()->action( ACT_REDO ), SIGNAL( changed() ), this, SLOT( markUpdateShortcuts() ) ); connect( app()->action( ACT_SELECT_ALL_LINES ), SIGNAL( changed() ), this, SLOT( markUpdateShortcuts() ) ); connect( app()->action( ACT_TOGGLE_SELECTED_LINES_BOLD ), SIGNAL( changed() ), this, SLOT( markUpdateShortcuts() ) ); connect( app()->action( ACT_TOGGLE_SELECTED_LINES_ITALIC ), SIGNAL( changed() ), this, SLOT( markUpdateShortcuts() ) ); connect( app()->action( ACT_TOGGLE_SELECTED_LINES_UNDERLINE ), SIGNAL( changed() ), this, SLOT( markUpdateShortcuts() ) ); connect( app()->action( ACT_TOGGLE_SELECTED_LINES_STRIKETHROUGH ), SIGNAL( changed() ), this, SLOT( markUpdateShortcuts() ) ); } void CurrentLineWidget::markUpdateShortcuts() { if ( ! m_updateShorcutsTimer->isActive() ) m_updateShorcutsTimer->start(); } static void mapShortcuts( SimpleRichTextEdit* textEdit, int textEditActionID, const char* appActionID ) { KAction* textEditAction = textEdit->action( textEditActionID ); KAction* appAction = static_cast( app()->action( appActionID ) ); if ( textEditAction && appAction ) textEditAction->setShortcut( appAction->shortcut() ); } void CurrentLineWidget::onSpellingOptionChanged( const QString& option, const QString& value ) { if ( option == SpellingConfig::keyDefaultLanguage() ) { m_textEdits[0]->setSpellCheckingLanguage( value ); m_textEdits[1]->setSpellCheckingLanguage( value ); } } void CurrentLineWidget::updateShortcuts() { for ( int index = 0; index < 2; ++index ) { mapShortcuts( m_textEdits[index], SimpleRichTextEdit::Undo, ACT_UNDO ); mapShortcuts( m_textEdits[index], SimpleRichTextEdit::Redo, ACT_REDO ); // mapShortcuts( m_textEdits[index], SimpleRichTextEdit::SelectAll, ACT_SELECT_ALL_LINES ); mapShortcuts( m_textEdits[index], SimpleRichTextEdit::ToggleBold, ACT_TOGGLE_SELECTED_LINES_BOLD ); mapShortcuts( m_textEdits[index], SimpleRichTextEdit::ToggleItalic, ACT_TOGGLE_SELECTED_LINES_ITALIC ); mapShortcuts( m_textEdits[index], SimpleRichTextEdit::ToggleUnderline, ACT_TOGGLE_SELECTED_LINES_UNDERLINE ); mapShortcuts( m_textEdits[index], SimpleRichTextEdit::ToggleStrikeOut, ACT_TOGGLE_SELECTED_LINES_STRIKETHROUGH ); } } #include "currentlinewidget.moc" subtitlecomposer-0.5.3/src/main/errorsdialog.h0000644000175000001440000000401511171201202020674 0ustar sergiousers#ifndef ERRORSDIALOG_H #define ERRORSDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "errorswidget.h" #include class QLabel; class KPushButton; namespace SubtitleComposer { class ErrorsDialog : public KDialog { Q_OBJECT public: ErrorsDialog( QWidget* parent=0 ); ErrorsWidget* errorsWidget(); void loadConfig(); void saveConfig(); private slots: void onStatsChanged(); void onOptionChanged( const QString& option, const QString& value ); private: ErrorsWidget* m_errorsWidget; QLabel* m_statsLabel; KPushButton* m_clearFixedButton; KPushButton* m_clearErrorsButton; bool m_autoClearFixed; }; } #endif subtitlecomposer-0.5.3/src/main/configdialog.cpp0000644000175000001440000002100711171205370021172 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "configdialog.h" #include "configs/generalconfigwidget.h" #include "configs/spellingconfigwidget.h" #include "configs/errorsconfigwidget.h" #include "configs/playerconfigwidget.h" #include "../common/commondefs.h" #include "../player/player.h" #include "../player/playerbackend.h" #include #include #include #include #include #include #include #include using namespace SubtitleComposer; ConfigDialog::ConfigDialog( const AppConfig& config, QWidget* parent ): KPageDialog( parent ), m_acceptedConfig( config ), m_config( config ) { setCaption( i18n( "Configure" ) ); setFaceType( KPageDialog::List ); setButtons( KDialog::Ok | KDialog::Apply | KDialog::Cancel | KDialog::Default ); setDefaultButton( KDialog::Ok ); showButtonSeparator( true ); m_configWidgets.insert( General, new GeneralConfigWidget() ); m_pageWidgets.insert( General, addPage( m_configWidgets.at( General ), i18nc( "@title General settings", "General" ) ) ); m_pageWidgets.at( General )->setHeader( i18n( "General Settings" ) ); m_pageWidgets.at( General )->setIcon( KIcon( "preferences-other" ) ); m_configWidgets.insert( Errors, new ErrorsConfigWidget() ); m_pageWidgets.insert( Errors, addPage( m_configWidgets.at( Errors ), i18nc( "@title Error checks settings", "Error Checks" ) ) ); m_pageWidgets.at( Errors )->setHeader( i18n( "Error Checks Settings" ) ); m_pageWidgets.at( Errors )->setIcon( KIcon( "games-endturn" ) ); m_configWidgets.insert( Spelling, new SpellingConfigWidget() ); m_pageWidgets.insert( Spelling, addPage( m_configWidgets.at( Spelling ), i18nc( "@title Spelling settings", "Spelling" ) ) ); m_pageWidgets.at( Spelling )->setHeader( i18n( "Spelling Settings" ) ); m_pageWidgets.at( Spelling )->setIcon( KIcon( "tools-check-spelling" ) ); m_configWidgets.insert( Player, new PlayerConfigWidget() ); m_pageWidgets.insert( Player, addPage( m_configWidgets.at( Player ), i18nc( "@title Player settings", "Player" ) ) ); m_pageWidgets.at( Player )->setHeader( i18n( "Player Settings" ) ); m_pageWidgets.at( Player )->setIcon( KIcon( KIcon( "mediaplayer" ) ) ); unsigned idx = FirstBackend; QStringList backendNames( Player::instance()->backendNames() ); for ( QStringList::ConstIterator it = backendNames.begin(), end = backendNames.end(); it != end; ++it, ++idx ) { AppConfigGroupWidget* configWidget = Player::instance()->backend( *it )->newAppConfigGroupWidget( 0 ); if ( configWidget ) { m_configWidgets.append( configWidget ); m_pageWidgets.insert( idx, addPage( configWidget, *it ) ); m_pageWidgets.at( idx )->setHeader( i18nc( "@title Player backend settings", "%1 Backend Settings", *it ) ); m_pageWidgets.at( idx )->setIcon( KIcon( (*it).toLower() + "-logo" ) ); } else --idx; } setControlsFromConfig(); enableButtonApply( false ); connect( &config, SIGNAL( optionChanged( const QString&, const QString&, const QString& ) ), this, SLOT( onOptionChanged( const QString&, const QString&, const QString& ) ) ); connect( this, SIGNAL( applyClicked(void) ), this, SLOT( acceptConfig(void) ) ); connect( this, SIGNAL( okClicked(void) ), this, SLOT( acceptConfigAndClose(void) ) ); connect( this, SIGNAL( cancelClicked(void) ), this, SLOT( rejectConfigAndClose(void) ) ); connect( this, SIGNAL( defaultClicked(void) ), this, SLOT( setActivePageControlsFromDefaults(void) ) ); connect( this, SIGNAL( defaultClicked(void) ), this, SLOT( enableApply(void) ) ); // Apply button connections/setup connect( this, SIGNAL( defaultClicked(void) ), this, SLOT( enableApply(void) ) ); for ( QList::ConstIterator it = m_configWidgets.begin(), end = m_configWidgets.end(); it != end; ++it ) connect( *it, SIGNAL( settingsChanged() ), this, SLOT( enableApply(void) ) ); QSize size = minimumSizeHint(); resize( size.width() + 35, size.height() + 35 ); } ConfigDialog::~ConfigDialog() { } const AppConfig& ConfigDialog::config() const { return m_acceptedConfig; } void ConfigDialog::setConfig( const AppConfig& config ) { bool visible = isVisible(); if ( visible ) hide(); m_acceptedConfig = m_config = config; setControlsFromConfig(); enableButtonApply( false ); if ( visible ) show(); } void ConfigDialog::setCurrentPage( unsigned pageIndex ) { if ( pageIndex < (unsigned)m_pageWidgets.count() ) KPageDialog::setCurrentPage( m_pageWidgets.at( pageIndex ) ); } void ConfigDialog::show() { KPageDialog::show(); } void ConfigDialog::hide() { KPageDialog::hide(); } void ConfigDialog::setControlsFromConfig() { for ( int pageIndex = 0; pageIndex < m_configWidgets.count(); ++pageIndex ) setControlsFromConfig( pageIndex ); } void ConfigDialog::setControlsFromConfig( unsigned pageIndex ) { if ( pageIndex < (unsigned)m_configWidgets.count() ) { AppConfigGroup* configGroup = m_config.group( m_configWidgets.at( pageIndex )->config()->name() ); if ( configGroup ) { m_configWidgets.at( pageIndex )->setConfig( configGroup ); m_configWidgets.at( pageIndex )->setControlsFromConfig(); } } } void ConfigDialog::setActivePageControlsFromDefaults() { int activePageIndex = m_pageWidgets.indexOf( currentPage() ); if ( activePageIndex >= 0 ) setControlsFromDefaults( activePageIndex ); } void ConfigDialog::setControlsFromDefaults( unsigned pageIndex ) { if ( pageIndex < (unsigned)m_configWidgets.count() ) m_configWidgets.at( pageIndex )->setControlsFromDefaults(); } void ConfigDialog::setConfigFromControls() { for ( int pageIndex = 0; pageIndex < m_configWidgets.count(); ++pageIndex ) setConfigFromControls( pageIndex ); } void ConfigDialog::setConfigFromControls( unsigned pageIndex ) { if ( pageIndex < (unsigned)m_configWidgets.count() ) { m_configWidgets.at( pageIndex )->setConfigFromControls(); m_config.setGroup( m_configWidgets.at( pageIndex )->config()->clone() ); // replace the group } } void ConfigDialog::acceptConfig() { setConfigFromControls(); m_acceptedConfig = m_config; enableButtonApply( false ); emit accepted(); } void ConfigDialog::acceptConfigAndClose() { acceptConfig(); hide(); } void ConfigDialog::rejectConfig() { m_config = m_acceptedConfig; setControlsFromConfig(); enableButtonApply( false ); } void ConfigDialog::rejectConfigAndClose() { hide(); rejectConfig(); } void ConfigDialog::enableApply() { enableButtonApply( true ); } void ConfigDialog::onOptionChanged( const QString& groupName, const QString& optionName, const QString& value ) { if ( ! m_config.group( groupName ) ) return; m_config.group( groupName )->setOption( optionName, value ); m_acceptedConfig.group( groupName )->setOption( optionName, value ); bool wasApplyButtonEnabled = button( KDialog::Apply )->isEnabled(); for ( int pageIndex = 0; pageIndex < m_configWidgets.count(); ++pageIndex ) { if ( m_configWidgets.at( pageIndex )->config()->name() == groupName ) { AppConfigGroup* configGroup = m_acceptedConfig.group( groupName ); if ( configGroup ) { m_configWidgets.at( pageIndex )->setConfig( configGroup ); m_configWidgets.at( pageIndex )->setControlsFromConfig(); } break; } } if ( ! wasApplyButtonEnabled ) enableButtonApply( false ); } #include "configdialog.moc" subtitlecomposer-0.5.3/src/main/lineswidget.h0000644000175000001440000001526111153404630020535 0ustar sergiousers#ifndef LINESWIDGET_H #define LINESWIDGET_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../core/rangelist.h" #include "../core/subtitle.h" #include "../core/subtitleline.h" #include "../widgets/treeview.h" #include #include #include #include #include #include class QTextDocument; class QTimer; namespace SubtitleComposer { class LinesModel : public QAbstractListModel { Q_OBJECT public: enum { Number=0, ShowTime, HideTime, Text, Translation, ColumnCount }; enum { PlayingLineRole=Qt::UserRole, MarkedRole, ErrorRole }; explicit LinesModel( QObject* parent=0 ); Subtitle* subtitle() const; void setSubtitle( Subtitle* subtitle ); SubtitleLine* playingLine() const; void setPlayingLine( SubtitleLine* line ); virtual int rowCount( const QModelIndex& parent=QModelIndex() ) const; virtual int columnCount( const QModelIndex& parent=QModelIndex() ) const; virtual Qt::ItemFlags flags( const QModelIndex& index ) const; virtual QVariant headerData( int section, Qt::Orientation orientation, int role=Qt::DisplayRole ) const; virtual QVariant data( const QModelIndex& index, int role ) const; virtual bool setData( const QModelIndex& index, const QVariant& value, int role=Qt::EditRole ); private slots: void onLinesInserted( int firstIndex, int lastIndex ); void onLinesRemoved( int firstIndex, int lastIndex ); void onLineChanged( SubtitleLine* line ); void emitDataChanged(); private: static QString buildToolTip( SubtitleLine* line, bool primary ); private: Subtitle* m_subtitle; SubtitleLine* m_playingLine; QTimer* m_dataChangedTimer; int m_minChangedLineIndex; int m_maxChangedLineIndex; }; class LinesWidget; class LinesItemDelegate : public QStyledItemDelegate { public: typedef enum { NoHint = QAbstractItemDelegate::NoHint, EditNextItem = QAbstractItemDelegate::EditNextItem, EditPreviousItem = QAbstractItemDelegate::EditPreviousItem, SubmitModelCache = QAbstractItemDelegate::SubmitModelCache, RevertModelCache = QAbstractItemDelegate::RevertModelCache, EditUpperItem, EditLowerItem, } ExtendedEditHint; LinesItemDelegate( bool useStyle, bool singleLineMode, bool richTextMode, LinesWidget* parent ); virtual ~LinesItemDelegate(); inline LinesWidget* linesWidget() const { return qobject_cast( parent() ); } bool useStyle() const; void setUseStyle( bool useStyle ); bool singleLineMode() const; void setSingleLineMode( bool singleLineMode ); bool richTextMode() const; void setRichTextMode( bool richTextMode ); virtual QString displayText( const QVariant& value, const QLocale& locale ) const; static const QIcon& markIcon(); static const QIcon& errorIcon(); static const QPixmap& markPixmap(); static const QPixmap& errorPixmap(); protected: virtual bool eventFilter( QObject* object, QEvent* event ); virtual void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const; void drawBackgroundPrimitive( QPainter* painter, const QStyle* style, const QStyleOptionViewItemV4& option ) const; void drawTextPrimitive( QPainter* painter, const QStyle* style, const QStyleOptionViewItemV4& option, const QRect& rect, QPalette::ColorGroup cg ) const; private: bool m_useStyle; bool m_singleLineMode; QTextDocument* m_textDocument; }; class LinesWidget : public TreeView { Q_OBJECT public: explicit LinesWidget( QWidget* parent ); virtual ~LinesWidget(); bool showingContextMenu(); SubtitleLine* currentLine() const; int currentLineIndex() const; int firstSelectedIndex() const; int lastSelectedIndex() const; bool selectionHasMultipleRanges() const; RangeList selectionRanges() const; RangeList targetRanges( int target ) const; inline LinesModel* model() const { return static_cast( TreeView::model() ); } void loadConfig(); void saveConfig(); virtual bool eventFilter( QObject* object, QEvent* event ); public slots: void setSubtitle( Subtitle* subtitle=0 ); void setTranslationMode( bool enabled ); void setCurrentLine( SubtitleLine* line, bool clearSelection=true ); void setPlayingLine( SubtitleLine* line ); void editCurrentLineInPlace( bool primaryText=true ); signals: void currentLineChanged( SubtitleLine* line ); void lineDoubleClicked( SubtitleLine* line ); protected slots: virtual void closeEditor( QWidget* editor, QAbstractItemDelegate::EndEditHint hint ); virtual void rowsAboutToBeRemoved( const QModelIndex& parent, int start, int end ); virtual void rowsInserted( const QModelIndex& parent, int start, int end ); private: virtual void contextMenuEvent( QContextMenuEvent* e ); virtual void mouseDoubleClickEvent( QMouseEvent* e ); static void drawHorizontalDotLine( QPainter* painter, int x1, int x2, int y ); static void drawVerticalDotLine( QPainter* painter, int x, int y1, int y2 ); virtual void drawRow( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const; private slots: void onCurrentRowChanged(); private: bool m_translationMode; bool m_showingContextMenu; QPen m_gridPen; }; } #endif subtitlecomposer-0.5.3/src/main/mainwindow.h0000644000175000001440000000412211153657621020377 0ustar sergiousers#ifndef MAINWINDOW_H #define MAINWINDOW_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../core/subtitle.h" #include namespace SubtitleComposer { class PlayerWidget; class LinesWidget; class CurrentLineWidget; class AudioLevelsWidget; class MainWindow : public KXmlGuiWindow { Q_OBJECT friend class Application; public: MainWindow(); virtual ~MainWindow(); void loadConfig(); void saveConfig(); public slots: void setSubtitle( Subtitle* subtitle=0 ); protected: virtual bool queryClose(); protected: //AudioLevelsWidget* m_audiolevelsWidget; PlayerWidget* m_playerWidget; LinesWidget* m_linesWidget; CurrentLineWidget* m_curLineWidget; }; } #endif subtitlecomposer-0.5.3/src/main/playerwidget.cpp0000644000175000001440000007510111170303572021253 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "playerwidget.h" #include "application.h" #include "configs/playerconfig.h" #include "actions/useractionnames.h" #include "../common/commondefs.h" #include "../core/subtitleiterator.h" #include "../player/player.h" #include "../player/playerbackend.h" #include "../widgets/layeredwidget.h" #include "../widgets/textoverlaywidget.h" #include "../widgets/attachablewidget.h" #include "../widgets/pointingslider.h" #include "../widgets/timeedit.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace SubtitleComposer; // FIXME WTF is this!?? #define MAGIC_NUMBER -1 #define HIDE_MOUSE_MSECS 2000 #define UNKNOWN_LENGTH_STRING (" / " + Time().toString() + ' ') PlayerWidget::PlayerWidget( QWidget* parent ): QWidget( parent ), m_subtitle( 0 ), m_translationMode( false ), m_showTranslation( false ), m_overlayLine( 0 ), m_playingLine( 0 ), m_fullScreenMode( false ), m_player( Player::instance() ), m_lengthString( UNKNOWN_LENGTH_STRING ), m_updatePositionControls( 1 ), m_updateVideoPosition( false ), m_updateVolumeControls( true ), m_updatePlayerVolume( false ), m_showPositionTimeEdit( app()->playerConfig()->showPositionTimeEdit() ) { m_layeredWidget = new LayeredWidget( this ); m_layeredWidget->setAcceptDrops( true ); m_layeredWidget->installEventFilter( this ); m_layeredWidget->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); m_player->initialize( m_layeredWidget, app()->playerConfig()->backend() ); connect( m_player, SIGNAL(backendInitialized(PlayerBackend*)), this, SLOT( onPlayerBackendInitialized() ) ); m_textOverlay = new TextOverlayWidget( m_layeredWidget ); m_textOverlay->setRichTextMode( true ); m_textOverlay->setAlignment( Qt::AlignHCenter|Qt::AlignBottom ); m_seekSlider = new PointingSlider( Qt::Horizontal, this ); m_seekSlider->setTickPosition( QSlider::NoTicks ); m_seekSlider->setTracking( false ); m_seekSlider->setMinimum( 0 ); m_seekSlider->setMaximum( 1000 ); m_seekSlider->setPageStep( 10 ); m_seekSlider->setFocusPolicy( Qt::NoFocus ); m_infoControlsGroupBox = new QGroupBox( this ); m_infoControlsGroupBox->setAcceptDrops( true ); m_infoControlsGroupBox->installEventFilter( this ); QLabel* positionTagLabel = new QLabel( m_infoControlsGroupBox ); positionTagLabel->setText( i18n( "Position" ) ); positionTagLabel->installEventFilter( this ); m_positionLabel = new QLabel( m_infoControlsGroupBox ); m_positionEdit = new TimeEdit( m_infoControlsGroupBox ); m_positionEdit->setFocusPolicy( Qt::NoFocus ); QLabel* lengthTagLabel = new QLabel( m_infoControlsGroupBox ); lengthTagLabel->setText( i18n( "Length") ); lengthTagLabel->installEventFilter( this ); m_lengthLabel = new QLabel( m_infoControlsGroupBox ); QLabel* fpsTagLabel = new QLabel( m_infoControlsGroupBox ); fpsTagLabel->setText( i18n( "FPS") ); fpsTagLabel->installEventFilter( this ); m_fpsLabel = new QLabel( m_infoControlsGroupBox ); m_fpsLabel->setMinimumWidth( m_positionEdit->sizeHint().width() ); // sets the minimum width for the whole group m_volumeSlider = new PointingSlider( Qt::Vertical, this ); m_volumeSlider->setFocusPolicy( Qt::NoFocus ); m_volumeSlider->setTickPosition( QSlider::NoTicks ); // m_volumeSlider->setInvertedAppearance( true ); m_volumeSlider->setTracking( true ); m_volumeSlider->setPageStep( 5 ); m_volumeSlider->setMinimum( 0 ); m_volumeSlider->setMaximum( 100 ); m_volumeSlider->setFocusPolicy( Qt::NoFocus ); QGridLayout* videoControlsLayout = new QGridLayout(); videoControlsLayout->setMargin( 0 ); videoControlsLayout->setSpacing( 2 ); videoControlsLayout->addWidget( createToolButton( this, ACT_PLAY_PAUSE, 16 ), 0, 0 ); videoControlsLayout->addWidget( createToolButton( this, ACT_STOP, 16 ), 0, 1 ); videoControlsLayout->addWidget( createToolButton( this, ACT_SEEK_BACKWARDS, 16 ), 0, 2 ); videoControlsLayout->addWidget( createToolButton( this, ACT_SEEK_FORWARDS, 16 ), 0, 3 ); videoControlsLayout->addItem( new QSpacerItem( 2, 2 ), 0, 4 ); videoControlsLayout->addWidget( createToolButton( this, ACT_SEEK_TO_PREVIOUS_LINE, 16 ), 0, 5 ); videoControlsLayout->addWidget( createToolButton( this, ACT_SEEK_TO_NEXT_LINE, 16 ), 0, 6 ); videoControlsLayout->addItem( new QSpacerItem( 2, 2 ), 0, 7 ); videoControlsLayout->addWidget( createToolButton( this, ACT_SET_CURRENT_LINE_SHOW_TIME, 16 ), 0, 8 ); videoControlsLayout->addWidget( createToolButton( this, ACT_SET_CURRENT_LINE_HIDE_TIME, 16 ), 0, 9 ); videoControlsLayout->addItem( new QSpacerItem( 2, 2 ), 0, 10 ); videoControlsLayout->addWidget( createToolButton( this, ACT_CURRENT_LINE_FOLLOWS_VIDEO, 16 ), 0, 11 ); videoControlsLayout->addWidget( m_seekSlider, 0, 12 ); QGridLayout* audioControlsLayout = new QGridLayout(); audioControlsLayout->setMargin( 0 ); audioControlsLayout->addWidget( createToolButton( this, ACT_TOGGLE_MUTED, 16 ), 0, 0, Qt::AlignHCenter ); audioControlsLayout->addWidget( m_volumeSlider, 1, 0, Qt::AlignHCenter ); QGridLayout* infoControlsLayout = new QGridLayout( m_infoControlsGroupBox ); infoControlsLayout->setSpacing( 5 ); infoControlsLayout->addWidget( fpsTagLabel, 0, 0 ); infoControlsLayout->addWidget( m_fpsLabel, 1, 0 ); infoControlsLayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ), 2, 0 ); infoControlsLayout->addWidget( lengthTagLabel, 3, 0 ); infoControlsLayout->addWidget( m_lengthLabel, 4, 0 ); infoControlsLayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ), 5, 0 ); infoControlsLayout->addWidget( positionTagLabel, 6, 0 ); infoControlsLayout->addWidget( m_positionLabel, 7, 0 ); infoControlsLayout->addWidget( m_positionEdit, 8, 0 ); m_mainLayout = new QGridLayout( this ); m_mainLayout->setMargin( 0 ); m_mainLayout->setSpacing( 5 ); m_mainLayout->addWidget( m_infoControlsGroupBox, 0, 0, 2, 1 ); m_mainLayout->addWidget( m_layeredWidget, 0, 1 ); m_mainLayout->addLayout( audioControlsLayout, 0, 2 ); m_mainLayout->addLayout( videoControlsLayout, 1, 1 ); m_mainLayout->addWidget( createToolButton( this, ACT_TOGGLE_FULL_SCREEN, 16 ), 1, 2 ); m_fullScreenControls = new AttachableWidget( AttachableWidget::Bottom, 4, m_layeredWidget ); m_fullScreenControls->setAutoHide( true ); m_layeredWidget->setWidgetMode( m_fullScreenControls, LayeredWidget::IgnoreResize ); m_fsSeekSlider = new PointingSlider( Qt::Horizontal, m_fullScreenControls ); m_fsSeekSlider->setTickPosition( QSlider::NoTicks ); m_fsSeekSlider->setTracking( false ); m_fsSeekSlider->setMinimum( 0 ); m_fsSeekSlider->setMaximum( 1000 ); m_fsSeekSlider->setPageStep( 10 ); m_fsVolumeSlider = new PointingSlider( Qt::Horizontal, m_fullScreenControls ); m_fsVolumeSlider->setFocusPolicy( Qt::NoFocus ); m_fsVolumeSlider->setTickPosition( QSlider::NoTicks ); m_fsVolumeSlider->setTracking( true ); m_fsVolumeSlider->setPageStep( 5 ); m_fsVolumeSlider->setMinimum( 0 ); m_fsVolumeSlider->setMaximum( 100 ); m_fsPositionLabel = new QLabel( m_fullScreenControls ); QPalette fsPositionPalette; fsPositionPalette.setColor( m_fsPositionLabel->backgroundRole(), Qt::black ); fsPositionPalette.setColor( m_fsPositionLabel->foregroundRole(), Qt::white ); m_fsPositionLabel->setPalette( fsPositionPalette ); m_fsPositionLabel->setAutoFillBackground( true ); m_fsPositionLabel->setFrameShape( QFrame::Panel ); m_fsPositionLabel->setText( Time().toString( false ) + " / " + Time().toString( false ) ); m_fsPositionLabel->setAlignment( Qt::AlignRight|Qt::AlignVCenter ); m_fsPositionLabel->adjustSize(); m_fsPositionLabel->setMinimumWidth( m_fsPositionLabel->width() ); QHBoxLayout* fullScreenControlsLayout = new QHBoxLayout( m_fullScreenControls ); fullScreenControlsLayout->setMargin( 0 ); fullScreenControlsLayout->setSpacing( 0 ); fullScreenControlsLayout->addWidget( createToolButton( m_fullScreenControls, ACT_PLAY_PAUSE, 32 ) ); fullScreenControlsLayout->addWidget( createToolButton( m_fullScreenControls, ACT_STOP, 32 ) ); fullScreenControlsLayout->addWidget( createToolButton( m_fullScreenControls, ACT_SEEK_BACKWARDS, 32 ) ); fullScreenControlsLayout->addWidget( createToolButton( m_fullScreenControls, ACT_SEEK_FORWARDS, 32 ) ); fullScreenControlsLayout->addSpacing( 3 ); fullScreenControlsLayout->addWidget( createToolButton( m_fullScreenControls, ACT_SEEK_TO_PREVIOUS_LINE, 32 ) ); fullScreenControlsLayout->addWidget( createToolButton( m_fullScreenControls, ACT_SEEK_TO_NEXT_LINE, 32 ) ); fullScreenControlsLayout->addSpacing( 3 ); fullScreenControlsLayout->addWidget( m_fsSeekSlider, 9 ); // fullScreenControlsLayout->addSpacing( 1 ); fullScreenControlsLayout->addWidget( m_fsPositionLabel ); fullScreenControlsLayout->addWidget( m_fsVolumeSlider, 2 ); fullScreenControlsLayout->addWidget( createToolButton( m_fullScreenControls, ACT_TOGGLE_MUTED, 32 ) ); fullScreenControlsLayout->addWidget( createToolButton( m_fullScreenControls, ACT_TOGGLE_FULL_SCREEN, 32 ) ); m_fullScreenControls->adjustSize(); connect( m_volumeSlider, SIGNAL( valueChanged(int) ), this, SLOT(onVolumeSliderValueChanged(int)) ); connect( m_fsVolumeSlider, SIGNAL( valueChanged(int) ), this, SLOT(onVolumeSliderValueChanged(int)) ); connect( m_seekSlider, SIGNAL( valueChanged(int) ), this, SLOT(onSeekSliderValueChanged(int)) ); connect( m_seekSlider, SIGNAL( sliderMoved(int) ), this, SLOT(onSeekSliderMoved(int)) ); connect( m_seekSlider, SIGNAL( sliderPressed() ), this, SLOT(onSeekSliderPressed()) ); connect( m_seekSlider, SIGNAL( sliderReleased() ), this, SLOT(onSeekSliderReleased()) ); connect( m_fsSeekSlider, SIGNAL( valueChanged(int) ), this, SLOT(onSeekSliderValueChanged(int)) ); connect( m_fsSeekSlider, SIGNAL( sliderMoved(int) ), this, SLOT(onSeekSliderMoved(int)) ); connect( m_fsSeekSlider, SIGNAL( sliderPressed() ), this, SLOT(onSeekSliderPressed()) ); connect( m_fsSeekSlider, SIGNAL( sliderReleased() ), this, SLOT(onSeekSliderReleased()) ); connect( m_positionEdit, SIGNAL( valueChanged(int) ), this, SLOT(onPositionEditValueChanged(int)) ); connect( m_positionEdit, SIGNAL( valueEntered(int) ), this, SLOT(onPositionEditValueChanged(int)) ); connect( app()->playerConfig(), SIGNAL(optionChanged(const QString&,const QString&)), this, SLOT(onPlayerOptionChanged(const QString&,const QString&)) ); // Connect PlayerWidget observer slots to Player signals connect( m_player, SIGNAL(fileOpened(const QString&)), this, SLOT(onPlayerFileOpened(const QString&)) ); connect( m_player, SIGNAL(fileOpenError(const QString&)), this, SLOT(onPlayerFileOpenError(const QString&)) ); connect( m_player, SIGNAL(fileClosed()), this, SLOT(onPlayerFileClosed()) ); connect( m_player, SIGNAL(playbackError()), this, SLOT(onPlayerPlaybackError()) ); connect( m_player, SIGNAL(playing()), this, SLOT(onPlayerPlaying()) ); connect( m_player, SIGNAL(stopped()), this, SLOT(onPlayerStopped()) ); connect( m_player, SIGNAL(positionChanged(double)), this, SLOT(onPlayerPositionChanged(double)) ); connect( m_player, SIGNAL(lengthChanged(double)), this, SLOT(onPlayerLengthChanged(double)) ); connect( m_player, SIGNAL(framesPerSecondChanged(double)), this, SLOT(onPlayerFramesPerSecondChanged(double)) ); connect( m_player, SIGNAL(volumeChanged(double)), this, SLOT(onPlayerVolumeChanged(double)) ); connect( m_player, SIGNAL(leftClicked(const QPoint&)), this, SLOT(onPlayerLeftClicked(const QPoint&)) ); connect( m_player, SIGNAL(rightClicked(const QPoint&)), this, SLOT(onPlayerRightClicked(const QPoint&)) ); connect( m_player, SIGNAL(doubleClicked(const QPoint&)), this, SLOT(onPlayerDoubleClicked(const QPoint&)) ); setOverlayLine( 0 ); onPlayerFileClosed(); onPlayerOptionChanged( QString(), QString() ); // initializes the font } PlayerWidget::~PlayerWidget() { m_player->finalize(); } QToolButton* PlayerWidget::toolButton( QWidget* parent, const char* name ) { return parent->findChild( name ); } QToolButton* PlayerWidget::createToolButton( QWidget* parent, const char* name, int size ) { QToolButton* toolButton = new QToolButton( parent ); toolButton->setObjectName( name ); toolButton->setMinimumSize( size, size ); toolButton->setAutoRaise( true ); toolButton->setFocusPolicy( Qt::NoFocus ); return toolButton; } void PlayerWidget::loadConfig() { onPlayerVolumeChanged( m_player->volume() ); } void PlayerWidget::saveConfig() { } bool PlayerWidget::fullScreenMode() const { return m_fullScreenMode; } void PlayerWidget::setFullScreenMode( bool fullScreenMode ) { static int timerID = 0; if ( m_fullScreenMode != fullScreenMode ) { m_fullScreenMode = fullScreenMode; if ( m_fullScreenMode ) { increaseFontSize( 13 ); window()->hide(); m_layeredWidget->setParent( 0 ); // removes the widget from this window (and this m_mainLayout) m_layeredWidget->showFullScreen(); // krazy:exclude=c++/qmethods m_fullScreenControls->attach( m_layeredWidget ); timerID = startTimer( HIDE_MOUSE_MSECS ); } else { if ( timerID ) { killTimer( timerID ); timerID = 0; } decreaseFontSize( 13 ); m_fullScreenControls->dettach(); window()->show(); m_layeredWidget->setParent( this ); m_layeredWidget->showNormal(); // krazy:exclude=c++/qmethods m_mainLayout->addWidget( m_layeredWidget, 0, 1 ); } } } SubtitleLine* PlayerWidget::playingLine() { return m_playingLine; } SubtitleLine* PlayerWidget::overlayLine() { return m_overlayLine; } void PlayerWidget::plugActions() { toolButton( this, ACT_STOP )->setDefaultAction( app()->action( ACT_STOP ) ); toolButton( this, ACT_PLAY_PAUSE )->setDefaultAction( app()->action( ACT_PLAY_PAUSE ) ); toolButton( this, ACT_SEEK_BACKWARDS )->setDefaultAction( app()->action( ACT_SEEK_BACKWARDS ) ); toolButton( this, ACT_SEEK_FORWARDS )->setDefaultAction( app()->action( ACT_SEEK_FORWARDS ) ); toolButton( this, ACT_SEEK_TO_PREVIOUS_LINE )->setDefaultAction( app()->action( ACT_SEEK_TO_PREVIOUS_LINE ) ); toolButton( this, ACT_SEEK_TO_NEXT_LINE )->setDefaultAction( app()->action( ACT_SEEK_TO_NEXT_LINE ) ); toolButton( this, ACT_SET_CURRENT_LINE_SHOW_TIME )->setDefaultAction( app()->action( ACT_SET_CURRENT_LINE_SHOW_TIME ) ); toolButton( this, ACT_SET_CURRENT_LINE_HIDE_TIME )->setDefaultAction( app()->action( ACT_SET_CURRENT_LINE_HIDE_TIME ) ); toolButton( this, ACT_CURRENT_LINE_FOLLOWS_VIDEO )->setDefaultAction( app()->action( ACT_CURRENT_LINE_FOLLOWS_VIDEO ) ); toolButton( this, ACT_TOGGLE_MUTED )->setDefaultAction( app()->action( ACT_TOGGLE_MUTED ) ); toolButton( this, ACT_TOGGLE_FULL_SCREEN )->setDefaultAction( app()->action( ACT_TOGGLE_FULL_SCREEN ) ); toolButton( m_fullScreenControls, ACT_STOP )->setDefaultAction( app()->action( ACT_STOP ) ); toolButton( m_fullScreenControls, ACT_PLAY_PAUSE )->setDefaultAction( app()->action( ACT_PLAY_PAUSE ) ); toolButton( m_fullScreenControls, ACT_SEEK_BACKWARDS )->setDefaultAction( app()->action( ACT_SEEK_BACKWARDS ) ); toolButton( m_fullScreenControls, ACT_SEEK_FORWARDS )->setDefaultAction( app()->action( ACT_SEEK_FORWARDS ) ); toolButton( m_fullScreenControls, ACT_SEEK_TO_PREVIOUS_LINE )->setDefaultAction( app()->action( ACT_SEEK_TO_PREVIOUS_LINE ) ); toolButton( m_fullScreenControls, ACT_SEEK_TO_NEXT_LINE )->setDefaultAction( app()->action( ACT_SEEK_TO_NEXT_LINE ) ); toolButton( m_fullScreenControls, ACT_TOGGLE_MUTED )->setDefaultAction( app()->action( ACT_TOGGLE_MUTED ) ); toolButton( m_fullScreenControls, ACT_TOGGLE_FULL_SCREEN )->setDefaultAction( app()->action( ACT_TOGGLE_FULL_SCREEN ) ); } void PlayerWidget::timerEvent( QTimerEvent* /*event*/ ) { if ( m_cursorPos != m_lastCursorPos ) m_lastCursorPos = m_cursorPos; else if ( m_layeredWidget->cursor().shape() != Qt::BlankCursor ) m_layeredWidget->setCursor( QCursor( Qt::BlankCursor ) ); } bool PlayerWidget::eventFilter( QObject* object, QEvent* event ) { if ( object == m_layeredWidget ) { if ( event->type() == QEvent::DragEnter ) { QDragEnterEvent* dragEnterEvent = static_cast( event ); KUrl::List urls = KUrl::List::fromMimeData( dragEnterEvent->mimeData() ); if ( ! urls.isEmpty() ) dragEnterEvent->accept(); else dragEnterEvent->ignore(); return true; } else if ( event->type() == QEvent::DragMove ) { return true; // eat event } else if ( event->type() == QEvent::Drop ) { QDropEvent* dropEvent = static_cast( event ); KUrl::List urls = KUrl::List::fromMimeData( dropEvent->mimeData() ); if ( ! urls.isEmpty() ) { for ( KUrl::List::ConstIterator it = urls.begin(), end = urls.end(); it != end; ++it ) { const KUrl& url = *it; if ( url.protocol() != "file" ) continue; app()->openVideo( url ); break; } } return true; // eat event } else if ( event->type() == QEvent::KeyPress ) { // NOTE: when on full screen mode, the keyboard input is received but // for some reason it doesn't trigger the correct actions automatically // so we process the event and handle the issue ourselves. QKeyEvent* keyEvent = static_cast( event ); app()->triggerAction( QKeySequence( (keyEvent->modifiers() & ~Qt::KeypadModifier) + keyEvent->key() ) ); return true; // eat event } else if ( event->type() == QEvent::MouseMove ) { QMouseEvent* mouseEvent = static_cast( event ); m_cursorPos = mouseEvent->pos(); if ( m_layeredWidget->cursor().shape() == Qt::BlankCursor ) m_layeredWidget->setCursor( Qt::ArrowCursor ); } } else if ( object == m_infoControlsGroupBox || object->parent() == m_infoControlsGroupBox ) { if ( event->type() != QEvent::MouseButtonRelease ) return QWidget::eventFilter( object, event ); QMouseEvent* mouseEvent = static_cast( event ); if ( mouseEvent->button() != Qt::RightButton ) return QWidget::eventFilter( object, event ); KMenu menu; QAction* action = menu.addAction( i18n( "Show editable position control" ) ); action->setCheckable( true ); action->setChecked( app()->playerConfig()->showPositionTimeEdit() ); if ( menu.exec( mouseEvent->globalPos() ) == action ) app()->playerConfig()->toggleShowPositionTimeEdit(); return true; // eat event } return QWidget::eventFilter( object, event ); } void PlayerWidget::setSubtitle( Subtitle* subtitle ) { if ( m_subtitle ) { disconnect( m_subtitle, SIGNAL(linesInserted(int,int)), this, SLOT(invalidateOverlayLine()) ); disconnect( m_subtitle, SIGNAL(linesRemoved(int,int)), this, SLOT(invalidateOverlayLine()) ); m_subtitle = 0; // has to be set to 0 for invalidateOverlayLine invalidateOverlayLine(); setPlayingLine( 0 ); } m_subtitle = subtitle; if ( m_subtitle ) { connect( m_subtitle, SIGNAL(linesInserted(int,int)), this, SLOT(invalidateOverlayLine()) ); connect( m_subtitle, SIGNAL(linesRemoved(int,int)), this, SLOT(invalidateOverlayLine()) ); } } void PlayerWidget::setTranslationMode( bool enabled ) { m_translationMode = enabled; if ( ! m_translationMode ) setShowTranslation( false ); } void PlayerWidget::setShowTranslation( bool showTranslation ) { if ( m_showTranslation != showTranslation ) { m_showTranslation = showTranslation; invalidateOverlayLine(); setPlayingLine( 0 ); } } void PlayerWidget::increaseFontSize( int points ) { app()->playerConfig()->incFontPointSize( points ); } void PlayerWidget::decreaseFontSize( int points ) { app()->playerConfig()->incFontPointSize( -points ); } void PlayerWidget::updateOverlayLine( const Time& videoPosition ) { if ( ! m_subtitle ) return; bool seekedBackwards = m_lastCheckedTime > videoPosition; m_lastCheckedTime = videoPosition; if ( m_overlayLine ) { if ( ! seekedBackwards && videoPosition <= m_overlayLine->hideTime() ) { // m_overlayLine is the line to show or the next line to show if ( videoPosition >= m_overlayLine->showTime() ) // m_overlayLine is the line to show { const SString& text = m_showTranslation ? m_overlayLine->secondaryText() : m_overlayLine->primaryText(); m_textOverlay->setText( text.richString( SString::Verbose ) ); setPlayingLine( m_overlayLine ); } return; } else { // m_overlayLine is no longer the line to show nor the next line to show m_textOverlay->setText( QString() ); setOverlayLine( 0 ); } } if ( seekedBackwards || m_lastSearchedLineToShowTime > videoPosition ) { // search the next line to show for ( SubtitleIterator it( *m_subtitle ); it.current(); ++it ) { if ( videoPosition <= it.current()->hideTime() ) { m_lastSearchedLineToShowTime = videoPosition; setOverlayLine( it.current() ); if ( m_overlayLine->showTime() <= videoPosition && videoPosition <= m_overlayLine->hideTime() ) { const SString& text = m_showTranslation ? m_overlayLine->secondaryText() : m_overlayLine->primaryText(); m_textOverlay->setText( text.richString( SString::Verbose ) ); setPlayingLine( m_overlayLine ); } return; } } setPlayingLine( 0 ); } } void PlayerWidget::invalidateOverlayLine() { m_textOverlay->setText( QString() ); setOverlayLine( 0 ); if ( m_player->position() >= 0.0 ) updateOverlayLine( (long)(m_player->position()*1000) ); } void PlayerWidget::setOverlayLine( SubtitleLine* line ) { if ( m_overlayLine ) { disconnect( m_overlayLine, SIGNAL(showTimeChanged(const Time&)), this, SLOT(invalidateOverlayLine()) ); disconnect( m_overlayLine, SIGNAL(hideTimeChanged(const Time&)), this, SLOT(invalidateOverlayLine()) ); } m_overlayLine = line; if ( m_overlayLine ) { connect( m_overlayLine, SIGNAL(showTimeChanged(const Time&)), this, SLOT(invalidateOverlayLine()) ); connect( m_overlayLine, SIGNAL(hideTimeChanged(const Time&)), this, SLOT(invalidateOverlayLine()) ); } else m_lastSearchedLineToShowTime = Time::MaxMseconds; } void PlayerWidget::setPlayingLine( SubtitleLine* line ) { if ( ! line || m_playingLine != line ) { m_playingLine = line; emit playingLineChanged( m_playingLine ); } } void PlayerWidget::updatePositionEditVisibility() { if ( m_showPositionTimeEdit && (m_player->state() == Player::Playing || m_player->state() == Player::Paused) ) m_positionEdit->show(); else m_positionEdit->hide(); } void PlayerWidget::onVolumeSliderValueChanged( int value ) { if ( m_updatePlayerVolume ) { m_updatePlayerVolume = false; m_updateVolumeControls = false; if ( sender() == m_fsVolumeSlider ) m_volumeSlider->setValue( value ); else m_fsVolumeSlider->setValue( value ); m_player->setVolume( value ); m_updateVolumeControls = true; m_updatePlayerVolume = true; } } void PlayerWidget::onSeekSliderPressed() { m_updatePositionControls = 0; } void PlayerWidget::onSeekSliderReleased() { m_updatePositionControls = MAGIC_NUMBER; } void PlayerWidget::onSeekSliderValueChanged( int value ) { if ( m_updateVideoPosition ) { m_updatePositionControls = MAGIC_NUMBER; m_player->seek( m_player->length()*value/1000.0, true ); } } void PlayerWidget::onSeekSliderMoved( int value ) { m_player->seek( m_player->length()*value/1000.0, false ); Time time( (long)(m_player->length()*value) ); m_positionLabel->setText( time.toString() ); m_fsPositionLabel->setText( time.toString( false ) + m_lengthString ); if ( m_showPositionTimeEdit ) m_positionEdit->setValue( time.toMillis() ); } void PlayerWidget::onPositionEditValueChanged( int position ) { if ( m_positionEdit->hasFocus() ) { m_updatePositionControls = MAGIC_NUMBER; m_player->seek( position/1000.0, true ); } } void PlayerWidget::onPlayerOptionChanged( const QString& option, const QString& value ) { if ( option == PlayerConfig::keyBackend() ) { m_player->setActiveBackend( value ); } else if ( option == PlayerConfig::keyShowPositionTimeEdit() ) { m_showPositionTimeEdit = (value == "true"); updatePositionEditVisibility(); } else { m_textOverlay->setPrimaryColor( app()->playerConfig()->fontColor() ); m_textOverlay->setFamily( app()->playerConfig()->fontFamily() ); m_textOverlay->setPointSize( app()->playerConfig()->fontPointSize() ); m_textOverlay->setOutlineColor( app()->playerConfig()->outlineColor() ); m_textOverlay->setOutlineWidth( app()->playerConfig()->outlineWidth() ); } } void PlayerWidget::onPlayerFileOpened( const QString& /*filePath*/ ) { m_infoControlsGroupBox->setEnabled( true ); updatePositionEditVisibility(); m_positionLabel->setText( i18n( "Unknown" ) ); m_lengthLabel->setText( i18n( "Unknown" ) ); m_fpsLabel->setText( i18n( "Unknown" ) ); m_lengthString = UNKNOWN_LENGTH_STRING; m_fsPositionLabel->setText( Time().toString( false ) + m_lengthString ); } void PlayerWidget::onPlayerFileOpenError( const QString& filePath ) { KMessageBox::sorry( this, i18n( "There was an error opening file
%1
", filePath ) ); } void PlayerWidget::onPlayerFileClosed() { m_lastCheckedTime = 0; m_infoControlsGroupBox->setEnabled( false ); updatePositionEditVisibility(); m_positionEdit->setValue( 0 ); m_positionLabel->setText( QString() ); m_lengthLabel->setText( QString() ); m_fpsLabel->setText( QString() ); m_lengthString = UNKNOWN_LENGTH_STRING; m_fsPositionLabel->setText( Time().toString( false ) + m_lengthString ); m_seekSlider->setEnabled( false ); m_fsSeekSlider->setEnabled( false ); } void PlayerWidget::onPlayerPlaybackError() { KMessageBox::sorry( this, i18n( "Unexpected error while playing file." ) ); //onPlayerFileClosed(); } void PlayerWidget::onPlayerPlaying() { m_seekSlider->setEnabled( true ); m_fsSeekSlider->setEnabled( true ); updatePositionEditVisibility(); } void PlayerWidget::onPlayerPositionChanged( double seconds ) { if ( m_updatePositionControls > 0 ) { if ( seconds >= 0 ) { Time videoPosition( (long)(seconds*1000) ); m_positionLabel->setText( videoPosition.toString() ); m_fsPositionLabel->setText( videoPosition.toString( false ) + m_lengthString ); if ( m_showPositionTimeEdit && ! m_positionEdit->hasFocus() ) m_positionEdit->setValue( videoPosition.toMillis() ); updateOverlayLine( videoPosition ); int sliderValue = (int)((seconds/m_player->length())*1000); m_updateVideoPosition = false; m_seekSlider->setValue( sliderValue ); m_fsSeekSlider->setValue( sliderValue ); m_updateVideoPosition = true; } else { m_positionLabel->setText( i18n( "Unknown" ) ); m_fsPositionLabel->setText( Time().toString( false ) + m_lengthString ); } } else if ( m_updatePositionControls < 0 ) m_updatePositionControls += 2; } void PlayerWidget::onPlayerLengthChanged( double seconds ) { if ( seconds > 0 ) { m_lengthLabel->setText( Time( (long)(seconds*1000) ).toString() ); m_lengthString = " / " + m_lengthLabel->text().left( 8 ) + ' '; } else { m_lengthLabel->setText( i18n( "Unknown" ) ); m_lengthString = UNKNOWN_LENGTH_STRING; } } void PlayerWidget::onPlayerFramesPerSecondChanged( double fps ) { m_fpsLabel->setText( fps > 0 ? QString::number( fps, 'f', 3 ) : i18n( "Unknown" ) ); } void PlayerWidget::onPlayerStopped() { onPlayerPositionChanged( 0 ); m_seekSlider->setEnabled( false ); m_fsSeekSlider->setEnabled( false ); setPlayingLine( 0 ); updatePositionEditVisibility(); } void PlayerWidget::onPlayerVolumeChanged( double volume ) { if ( m_updateVolumeControls ) { m_updatePlayerVolume = false; m_volumeSlider->setValue( (int)(volume + 0.5) ); m_fsVolumeSlider->setValue( (int)(volume + 0.5) ); m_updatePlayerVolume = true; } } void PlayerWidget::onPlayerLeftClicked( const QPoint& /*point*/ ) { m_player->togglePlayPaused(); } void PlayerWidget::onPlayerRightClicked( const QPoint& point ) { static KMenu* menu = new KMenu( this ); menu->clear(); menu->addAction( app()->action( ACT_OPEN_VIDEO ) ); menu->addAction( app()->action( ACT_CLOSE_VIDEO ) ); menu->addSeparator(); menu->addAction( app()->action( ACT_TOGGLE_FULL_SCREEN ) ); menu->addSeparator(); menu->addAction( app()->action( ACT_STOP ) ); menu->addAction( app()->action( ACT_PLAY_PAUSE ) ); menu->addAction( app()->action( ACT_SEEK_BACKWARDS ) ); menu->addAction( app()->action( ACT_SEEK_FORWARDS ) ); menu->addSeparator(); menu->addAction( app()->action( ACT_SEEK_TO_PREVIOUS_LINE ) ); menu->addAction( app()->action( ACT_SEEK_TO_NEXT_LINE ) ); menu->addSeparator(); menu->addAction( app()->action( ACT_SET_ACTIVE_AUDIO_STREAM ) ); menu->addAction( app()->action( ACT_INCREASE_VOLUME ) ); menu->addAction( app()->action( ACT_DECREASE_VOLUME ) ); menu->addAction( app()->action( ACT_TOGGLE_MUTED ) ); menu->addSeparator(); if ( m_translationMode ) menu->addAction( app()->action( ACT_SET_ACTIVE_SUBTITLE_STREAM ) ); menu->addAction( app()->action( ACT_INCREASE_SUBTITLE_FONT ) ); menu->addAction( app()->action( ACT_DECREASE_SUBTITLE_FONT ) ); // NOTE do not use popup->exec() here!!! it freezes the application // when using the mplayer backend. i think it's related to the fact // that exec() creates a different event loop and the mplayer backend // depends on the main loop for catching synchronization signals menu->popup( point ); } void PlayerWidget::onPlayerDoubleClicked( const QPoint& /*point*/ ) { app()->toggleFullScreenMode(); } void PlayerWidget::onPlayerBackendInitialized() { // NOTE when the player backend is initialized the video widget // is created in front of the text overlay, so we have to raise // it to make it visible again m_textOverlay->raise(); } #include "playerwidget.moc" subtitlecomposer-0.5.3/src/main/images/0000755000175000001440000000000011206423743017313 5ustar sergiouserssubtitlecomposer-0.5.3/src/main/images/CMakeLists.txt0000644000175000001440000000032611171201753022050 0ustar sergiousersFILE( GLOB png_images *.png ) FILE( GLOB sgvz_images *.svgz ) INSTALL( FILES ${png_images} ${sgvz_images} DESTINATION ${DATA_INSTALL_DIR}/subtitlecomposer/pics ) KDE4_INSTALL_ICONS( ${ICON_INSTALL_DIR} ) subtitlecomposer-0.5.3/src/main/images/hisc-action-zone-end.svgz0000644000175000001440000000270211141673002024136 0ustar sergiousersY[o6~ϯԗh/nbk@=l S@R~mIEZt#D<@rL& ,y%{j> Y'9*^l_Vi u_$xR$\xU$<}$X)C*R_FEH&J\m+nAM.MT=t KOZliƐ|^$`N0|{Q{{T0$ΟP0z?hV#'i k7߫tt&%QaĔHM;5(-2P6U5zd<3CAo-gE;=0#A=0;^pW` JqL\= fѶ'0#>Ar>s4 q%p_]eF~Vyė^g 89GTV՗mfe7=7i\{"Wey[v_[[> q*$J j'V5ˢxm c ohTG( ޴#KjTsʉNcv}h)}q믮7unGg-8u2Os*m `reB[ 6Ͻn|53S7R#[;P! &$oQcuKO.IG,Ǘy!(8%6Xs 0DL@RJЮg2 Ae!eXQXi?)huU?u tmNĂg6c>plw)9=~YIr{P4Kz*Vy$S…0H_"M  n6ϳs=r"j`4W2l^Vw%[;o8]\.kIo%4hHJ#yA¸9$UhfI~Wd[ {f' \l?GDY8n\J3i(sWTW?qUOZdskNɚhQiBnNa԰ͨiXw)mPViAa4,x?=$ԧ!0d$ڽ"TH0058&3p 3b۲[)r^)ED5V3,8}@b8Az+>eH Eo JVpJ._55ά]׸vzu74subtitlecomposer-0.5.3/src/main/images/hi48-action-set-show-time.png0000644000175000001440000000534511172153130024552 0ustar sergiousersPNG  IHDR00WsRGBbKGD pHYs11(RtIME  ,0 eIDATh޽Zmh\U~νw̝d4]G"+E6E؂AR5~"V-!mmŊXV MpW$m23w8pÙ;3Iۤ=pdry\ADXxhLo^mW `7#p?4nMYcB#;wx3D4`@@DR"0 !Bݵk{U<& LJ Q!"a(ym0 ˲`<7 ~0l~_2":` ) @}#8T*qNJjZ"HmضD"D" !` `>{vy晵uụP y 7ވ^zrFR$~W$ R)Ȳ,ض !$W `׮]DbJb ]\Ni5Hj<σyT*/¶miضL&AD>sl;w D0 *2z{{qw㦛nB2D*B2Tybuq:u fm*F d;vXKDQ]u]xuaժUHRH 4i erYeLLL?G.C&Qk ! |^ڿ ۷ u]ׅ6mˑNNaYdCg.)%|GX/I|'0 lT i$ջw>SO=eѿ5EݍL&.J)Jaۡ/.SpT JyX` "r={(5bjjzB\(i蜯?|AϳBB<_EdZZ'rYV}݇;\NiqXSJ`ݕ@Y! C͡T*ԩSϐ8D}Y+`)吔r}R7ߌիW+3۰tRs'='?d2L&;p]# C0P m۶)eVCVƍNUt }9L |1{J06 A ?QyեLOe_V"[A>㠫 v* KءDQ}s 64:|_ K0{QYS/m'p~fݍ|>|SO|__qm]]]*B,۶mr2YհbŊb_HTw X|y:ݐRc:cmbϝV\,)egA 7 gfK%>te9>Zp tk\5X}]Ӵ?z[vo!N3qYcrr) tjaB삺y]P.?7T;]"z|@jv, nv܊̭ V8f3ݒu]È(dEGFF.^PuިV!k__offU{Pu_  cDo!j뮻Fe!LqiF:::zWLQA"-܂+WbժUjxpE={Ν!hAۗRJ9x+@ 6~P\H*(( M+~-׬\5$A!0-kw(:ڵ% Сǖ-[2D4$"l&DBLD{{kǖ-[n G 6#":&8266vm^hu!D@MuEn%W_ަIENDB`subtitlecomposer-0.5.3/src/main/images/hi16-action-time-from-video.png0000644000175000001440000000156311172153352025047 0ustar sergiousersPNG  IHDRasRGBbKGD pHYs B(xtIME+í.IDAT8]k\ed3JȘX1$ `%,KjIGRW ,.RE̦DBɧ.:Ѥ3sg.nPY>p~3߼r3o}_'A033A6OdwwTtEN w ՗ƯT?1?KK)M ܸq+abzvާP(PID^CDO3a_i.:ju4/0|0:t*ac#OY&]h Rx* .'ms&)X1 a'tQ8;{"{QRT&Se\fcW&1*XC*bcc}D㡢,,^;otC/;?(?s9QƵOna%cǹxq Q'MmVWp! 'fvvۼmo^!l*0շ)ܾb/1L_}~IR fz46BDsKt*>EU)P>«9>>fddw)om_%c x"ȩ GGG|u ~4M>XA=äW"sNp.Nm~<yxDb $mDq.Y>{'f@Q_ ʩ@'"NU=e>A-7IENDB`subtitlecomposer-0.5.3/src/main/images/hi32-app-subtitlecomposer.png0000644000175000001440000000154511151345060024744 0ustar sergiousersPNG  IHDR szz pHYs  IDATX?Haw%MLH$BAZ`IũCR7tuv["C%n8ءҤcrך;18{}NBJ-~CpH߅ }ti!4 ! _ d2L ͒NriVVV*_2-Tu Tϣ9.|f:'O~'xC!N77 ?}a l ܿWWAeuu8QU*p8{/_b;=\8Niygʩv ` "R $ sw_w7X O<ݻsOV>c^6 R"H.A\۷9Ç?oF"Q.EzS.u QZZ?~7z{ Q\X 0:SB吝.ʇX;;zzmZ{{DUW{;6mq0;0PlmaQUw>1TUOH+?UU06V + f>BǑ^$C&֗/ a066qc~RHcdE! &'q}INTmA!޹+!(}(&'tvr=1*,OplAg;_ePf/5NTb!hn?jf8c5H$hF"+dm#q,DMSUίQ ZEJ@ x`aIENDB`subtitlecomposer-0.5.3/src/main/images/README0000644000175000001440000000043311171207236020171 0ustar sergiousershi48-app-mediaplayer.png modified from KDE4 Oxygen theme hi48-app-mediaplayer-closed.png.png modified from KDE4 Oxygen theme hi16-action-time-from-video.png modified from KDE4 Oxygen theme hisc-action-zone-end.svgz taken from kdenlive hisc-action-zone-start.svgz taken from kdenlive subtitlecomposer-0.5.3/src/main/images/hi48-app-mediaplayer-closed.png0000644000175000001440000001101111171206505025102 0ustar sergiousersPNG  IHDR@@iqsRGBbKGD pHYs B(xtIME IDATxk\qξZCB^$zV`$a R(EA%]2qH( 1cIp])CU"BB H J9uνwV<=̙}? {}_ ] K, Gu ,YL6?Bx>ZNT cz z T ǽ7tIb3lYkJn( 8!_l69u\E&TXo]*O8/3{v疖6&&'(]Fx8~.8+1wn'w-uOYXt`іzŢ֚F'9>ƞw ihOHkk 4T,x>n+<39Y8vw+/Oq:1ҫs66ACC=? ~Ƈd2lp+̂ q,E(X͟m(/۷N}C)wk iiiJ]t8N!q(\2s7|bHXLʹ d3Ymm,[vΌ{Ssvݳ*Kg&RrKSU~+MJ҇?˔)HRD HC jinn`nW'Jyb(]`U(b4(&<E.Tz$-C"H8.{{ 5i=qS@mm pe*@)e+P 'TN-+c J( PS~A9eB!*z0k=Rw1WWo_},_;2o_֘8K|4Ww"=W໎XMfO(AyZVH'ߎE- ӻYg!*\ S,NubG ɝO6yP0Z4z|]TJ5Cӊ_@D(,k\Նg8moR(toG%v]",-;#A>c:-&ĄٳgSS3Gt';rHbs-֌'|XDNTF(P֚1O 0 J@jr^&=ESc'R(DaЉ›}s +)L{ɰX~Pd% jå/gzj}}$-׾Ds@+   Q8@"BsC19 {H"S+; Q;(B촽f255"Z MZ< HAkk+gNNoGHQC#Vչtv"`ʟ|kq2BTwB&BZkrр"fMYL&*JO=4> D11JGuūϿf;v2B[)Ff q {rd7e qhLQZRspvz|>W\gay=803Kf>#ftt[qfL3JYgW_m/_`/m7PdkZR(n;]׳ xW'C)%= kw%`lxcm΍7]ρdkϡh]L04k֬>o.AS*H"-Jd]Ũ@(TZ&ZPP4in :;;{dG0A7Ɋ֚iO2664ݟYg-`rr\M:#;=PZ<x YPOF@!Z߉ټB{6CA.]A÷0F5BBaR^z uu<ø˞=- eUd~1 +aZpepM7f0QH]"jͼysˁAB-3](rr$SS1j;P޽|(/ b2R_ߐ…~$yPm_7܊<ع˘[cx8ܹv.ώq,ZH/0>~R P,(JE䘩v]na|#7om{Ji Eb@U7 .m fTrG]lm$֗~NrTD)pCk#4'PI)3mf&VWq7^& $jr0@6ɑ+$im|l1aB^Fh}0!*HX؝"VOTIT\{MTikIDyE^.a*-e+4s 5=$ U.y^-a53y<2|e\":LJ RQ8r0lYi1'`t>0⼆XNU{55+ܞX~3{~*61HncQn@5:@p|QOwŌ*fX]DV&GZ$OPX~/~ݻ%$LU*ۑ!n.YEBә2<1NW EGd* ?`*$.*DHMEspg*T1Nf NX"'4?8oɜ$.bj$-Z[+!D@0B/##/l ?3 P#9G@z:04ܹ~"p^.EP`6t;YYy4KC c-.\6׀`E E@Z ?23ˈ1 q /O/M˶UUI9WW4%FF}}mfNsU\&!Sa]_$-g~Tli[~ \m)1ؖnW7sqF>%d$e__x;.,%I&N;(ZZWDњ>r6N]IwHsJ{Sp9f {N:1gfL|eVed;;Vkh 꽿 < B(!&ುJJ *r$%reRRkӎkאI+?$A**{ $&܅f;{W^w/b+QZ k>`khM}MdorO]WC2L`֚eV $`p0T80h&/77{xo* ==23@[ rd3s폓HR,T2UP0=]MQue~Ȗp^M4*um`XM;!)gի|cww`T\6㽔Pd?-Y†M&ta!ә&dYҦGl`y0(C!\5vLYH}B>%xx9W{ eiT*W8Ѥ8;5&hk׼%Kԟ1?!Έt:bQ^o ּS'S~ 23i RRbV_,ub"؜*.Vt&'GQq7O|''XtFjBeqJ%CFMm&2DZ|Τơp>A ,f0(׬a YY:fJB;VeXa!!!!!!!!!!148n*IENDB`subtitlecomposer-0.5.3/src/main/images/hi48-app-xine-logo.png0000644000175000001440000000302611172152775023261 0ustar sergiousersPNG  IHDR00WsBIT|d pHYs11(RtEXtSoftwarewww.inkscape.org<IDATxmlSU: EDڽtst9]:LQ` 7F"IL!'?٦tǧ>v6?_n{sy~s]3!. . .?$)p)J4!q帼I'0-2KhxKMx侕ϓs$Ow$ = zQ0td~CV*Qu}3uY6Wkc~) w}>x %^OP*,r``2f:( FJ-SK]BцVUGFvF{] oOmHGD&KS JD83 a( ^2="oa@D P[CR 3D-W]|knsIsKZ'܇^d." [֥ۋa$}5 p/@A_D--ީ/g}FQ(-r,7ˢ: ħBA׃&8V]*Twm@ )`Kt[}.0>>:J"w塛.@o!:y 4kSa8Is;T^Y{UR?:nz&Wgh q [ *q^\&FػݤcS]gM\d$7|_6 ";&i dw]KWrdBtF\AH2"U=1a܄!­5xBhb O&"7汩|5[j gaKDZxX6ĭD"a#2b&"RxL(ba'r4bV < ix;W\I:DΩV0881Cwno !&C#^|9MJZ,%{?a"HXy?HL8pƶ-[… AhQ*`yk$Ȅ3H ߻?p }mz֗###o} 1am[ts* __(V !&9}ℿIW b}??'A& !&y!}C4L0::Jք6$}{{'O&]H%zo JRvlٻ_@S*+_ 2! /E|&:::~W~{Gyę 11/俺k ,yҥKC 11b+/ܵ . 8 B/^ +VwÇUV079+@$;;wЅ IW rM^8s ;ڵk#nb^۵߱s'݄E Q.a͚5~zXt)yM q /gϝK*A@kk+_~a&8˯N*A0{6nHD7 ;w7aDXt)l޼V^M/俴c\g "S [뮻9ǐCooݶDimm |ABB3N8ῴc|- Ü9s{ 6 ;vtU!+VwnXz==Hsۺ Ihiiw.Hs qWw僚 Yd ,_9Ðg?ٲ.]tUHbwu7< $g?߷?݌ED~xVD1H3;-۶HU!"xI3 qFG^MInx{z r !N1S̳қP<شq|2t+ݻZ0A,\}Qz8ŐgIW P.{u/q !!N۶nTդBČ3<. b> j5}zc%֞*hVZ{}0w\AB"w}AX$,B* @\---kddFGGa||&&&`rr&''azz*R): ~Q+E??:&]B :;;bx,Di6ꪚv|2 LNN6<;'ypצF@B0ַI!+# Z[[FŔ'2ѵ%ʲnٳgʕ+066Z Ţa G?QXha BB {ӵRVP(@ww7‚ .[t+v8\Vappʕ+055ES) >íko%1N>^zU!BTU(0gXx15 cyqxLQDgӧO c)P({6#}8Hcu%]'puAkk+DוcuQF+¼px}8{, t9,_~~8fHcs?wܤѴ/a3 CE6"0mIW#o;w.tM3<_q-׵{}}߇'Nc`ݺu#4Ub<~www%jaժUjʴtg*wPҢ̊;~8ŝ:u ;xKay$!!@pg4ͩPT`ʕpB-6Eئ۸N,EQ4,]UpEi8J%ۡWItuG? 6n$Af@B́DM .wqnjGD#ʼpxT*ARR4n,mlx<6-v{ fMOy"N}m{z_`pe~̡X,$Ƴ !f@"̦VU`ٲeV*T*k<`iM~lyrlSޮ( 7mMG}ݻw453R > 6l 1ABDx6Cww7lܸqƫY«"*bZZZ\.7_V: U-:{fyXf!Pa,Jw̠RyΙ+V&A|k_};`ܹk~+ʬ7\a0O,/U :&@ռ, TEZ&Vd(ӫ*022y^Ȇ#K"Iz&"lcd˅ `tꂯ|M)M)_)ߧ4>_~tG\niiicEUx",FPEKGxvj^yu^xĸOqmL.XeթP(41zX~9zW_}.]\nJ NȕG/ٯr7R,ޔe:5x7TE಼]Ua% RYq-*uhQ:+^1lZ-SN000,v87B~3twwՈ 󠽽6o@fJɶe606N٨z*y铓ϧbGG_L>r-psTW tvvΚf=bEe"׶7h6ش ^5/ED6"#(3ɲ]ңiw_buVVzfJtWx¯B=z7nyVejZZZf܃p H U7#Yy;Vl*`cѝVיmcEi&SӼ|qzyuHV3)ĿۿJ+RagU׃o ck[EYlY^ Bpm1"ĩ ҰBcQ?Y1qz q=saV|X VaAU򪤫 MWGmx/9Uߢe*?|Ӽ:kb)!~'4{6p]wAUT*9&,E2.V=l#-^,MGl16m 1"2/X%M6Meu`SM2#yF@^u M hkkNfGdh*W/(LN]oQAF2[4ƶ~.׼cj*]>]z{ctf,]tz֬Y39aƊkoo6PzeA)Rq q tثNXUeyMĘg{0}Rt{/6Iq"B3ZOO,[D[xal)'/_ݝ+ɧژU=4t<"MuUTaYƱʒaA%ZFxիWMܹv wU9;::\.@|"+6ODV8-ze#b0m4EcVڪUKt3O<"6!q*VXZ2㑧"J7SlY*l62\ 26"=ZGNXE`KP~^iXcWPToVYFbظ9+ a^ǧ#"T:8E0+Æ0d0+bZ],>1/"}z] KVC-]]]3^ԡ"60эՅ۴3YW1q%ȪIUU󫈱\貎K1^b7?u׻Kky3ޜ4xIHEd"l5(-;]a^־uL]<{Ս[qy{~۶1b{4d-Jq}9lFָXʋKYɚ@kFpTom;{gϞ\9sO[QaWWTtSF4N6΅#l<a_a8Ӵo Xv4Gx렌w ۷oWG0].6LWh|U )ΘLhQUE[Fvΰ/mi2'7ꤙyzzz4ci˪__yUE& 70W4+6#_4na"?`U;[Zc0˳ 4bL3*įccc6Lb~; y` OI¨J>ؘ[\"l"Ȧc|rtDV/T:ZXtcE\xV<>vm#ed#8')XCI b)4Hta ^%x=01kB޽ax2 /b::: %YY9,L;$W"lK[uI ̇=ʼnUUQi%&y6:iؼ&Z ̞"]t)}1$٥z{{+;g|0Afū&JgDK1Ɣk*ؼAHtYm_f"<߱fud-i#!~eN'Nxz{mb}2l 2sh"&+1V=W]3FPmlcYҥKsqm!~6;---0|u"ߠM TYUHRǏ lړʈ[xmVXb oL+7mi q ^Zkpkk+|ʋi&eapMXVUMWGq YQ&m!ޗ7EX|9\ᴨ7N!dJPuzC$EXg[+.]w-!>|?88h.l2_X,o8jgD\̶F?6 _$ĘgkC1u .O]zŞu~_0iKK߯Eua6٦`RO'J;Xch9|b͛=&yGݛ<,^XyNy2Zv4mc_#xcM*V&ܿ> [yߟ=CCpSj#7򎤼aG20-. \bųzɪ^1+ ===ߑft8wK@KKXBas.aWBp"-Xl6Fp*­nL+3B廥=σou][[f,L+^w<- (q kiXGF.\)_$/^.)h"{8o#qzü iǕZ+"XG%KpW?+ OKkmmbP W4"Vf#myk׮5 _+5oL-vZ0.KoXWt$ u xݻ9%5F #Gk"wYYa^$a&&9ol٠[5lob-/.ZVxɒ%MuZz-pJX^,APFyªb%DR=hDE#f%ė.\?*Xx1Oh:%e-Kg;.Q%&wDªzk֬=I*ѣ0==.N}nV-O8XZ[[&. ҊꔗuXԨB{{w~QJgpgxžw&R4#Ny&&H&^1Ng[.]iCG jW&ixNLKG.\4,v$&d~ℽLw c] a%Q%w~e˄c+|YuaůZJR ?~}ѣ}ʕ+F^wN=gEi=丼cz籿ċǔ]c+?6L8/_(FGGCVȥG\.Fg}8m+y឴xŦe؞9= `\!>~V7²)_TMK\zǮ &=lt8P˲LOžezzZv+ǎ_^S. P.y1؞fw!$ ae؊g;q0OpSq1?ylGQ[&l"&`H keCi&"/ P ɓq `ڴ7 00AƶˋW[mv,[ ],w+q -Rb(}j|"MBI̓mv9=-l&N̜p?qDf[Zb>6M=ncq_Ym>e.:yqǔ0z r#J2C)\|ꌲ]MKتt]ԇ t` VُxO9pBDͳSO ]+t4\ի0>>Eq1-s:D /}c8A˗sSVa @F8|}|599 ócUl44"HJij5UӉ<#Խf $b_t8>uյ$1ER8-| 2Ko&b,!>}8X,rlc¼8upY? `2יx<{)ܹsO;6[yye\;U=>>z]j/JKzZ ~yeL9+β0.Ҧ0񥁁L>4|F5yPVattZZZPii{<#KreS4(+ͳxLY;g$Qcz(066ZmFljF%g4Az$5@m{n]o}3>/ጾQkΜ9ɔ,4}I'#E3D9mmCly幜q{l&D[hXaVA^RRIj\A$K0c~D%\hQ/> Ң/T}Z[[sÉꡍykv4jLMMAVڏAe+<&LnՅWڙ!ė\ILueij!Ȫ-$ \OKcI ̬a+JC>rtxDCei6-wPf`F-ֶi+}jPVݧMH ">\7.A{wXir[itYm; kWՠV͚&a$T~D6sO/lI0Ǘ.^G"qiclZ!BA A$,d"؏4E²hZOO\|YX/eHJ6 "*CpuEOkvN IDAT6,(!0pm? AXlI.FS!||<(}F,'(ԣ{ɾg2Ap5CeI2Mk  \b[fS0:Be4i&vX;?O5:kqF8x,bl a/Y:AVs.e3Y*lB&*3 غF,ŦpQ&y<غaK7C~M4 W^M2Y [׈Nr064eMDIAʢ)$]ev5-Ti>ٵd Cnزq>lLy^Tt%5 M A&BFG-\ΠG,KVod-A$a?yYBls& $yW`غoh(-Օ9 kĭaK \r9n`bb"z(K՝Ҙt|i; h.m@ZMBl"2fA᲍'͌~/KΜ>ɉNnZZu뤻 8 3۵>O,~`ILQ< $ߖeqRHpYa<ׇ*ʌm@HDao)Y7::_H.$M1Uc9 x:7jB׭Ai$hg}Ӂ WEEysp8ύ lt~qVkYx6A4YolPfw3j58`..H{و1~+X,fXjZuP7"pMZJlE8 L[ZB tulB]y2Kuc #dfdMѣy8 યOkfkA}Z[[6 >$#m^+Aat H%*BW\drjZ]AD~ɲFFR&rx鐘M 26@,߀dmϜjQ*W*3?{d8,ۖنaM)[U[ 쓥5&WfFɬG*6 JZ qOEۜinM;9s$]-pC\]am5ԦЬpۛt=|2~U'yAI}NZ8oۿER\4a]1r U> pG3Z껳~}࿅ ^q}i8~2?ؾ%:}x֟! q___b||u7UlGsxq .f.\7+4xN8@\?6 I- ORsq@H͛d=jGTdL|+ޘUlt &xq=Vb͗ŗyDOٳ`6alZG#!q%#K\1y _ *5nߟN|hh|_ Z*iato#NAaU?'G$"qZI ϟd= %й yebˋ&"^m]^M1y̙Lwgx: !;o ?¤+N:T:N3K*dI: JMduPT;AV,VS;U=88Oډ>bO< o)<\y$,. 5)  s5f KƜ>}x*ZCۜ&&jòs=U3<< ZMZPF\ Bu1"MJߟ6& β y6elG.ѵ!AĉQ Gؘf`HQ|r%lcM.ac~%K@0+:u8}4DBVI la쪣,S*,ף_^A'5^0/8qB2Soᆸa˗/KElXate$%AWLǏ EB|cF=bg y xeӍWDa;['Ko_OU&gHwxڵq oW6 G녍'QfDk^|"MbLd5/f[etNQ\pAsdz:ir-f/lc"O螗纭4fm?b[&kR^{^q&aҌѣGaʕW]bfzK k?6D."ndNhx+<8ŠÇ3=Pי;+5<&&.:#g^qD\@c]YWEg-4Vpܛo SSScG`ƍ+W\si8:11fdlׁcOYI-!^v-ۮKlxv풞 ؑɉ'-S"1&9Is1xymE66'NiiM!X^w`ppTO6b q&1&lal{,`zlڴhISW_U:id'Rgd-ĘhLCsԆӴ?IlqCCCp%ߘL⍛6y]]F;OB06,QV92LDĘ+.?JS)CQyyq˄Y\bm!|&VݻQ9xaLG& [0ygzh~~ `Fm4mddΞ==͂m#1= Z }Rk`0D Ťњ c"-M16k ˱YΝ;3[ ˖y7Ze.055՘1\a`i::$DEEi&풕U2&wK 1xy뭷Z*l%6fF!ʋc $-¬8͇ۢ7TM?^/yoxwB[[I2== ;w nV9XmYϤlDcĖĘP%)fىڙ`-k[Ede(G׼py'eiamYcc\CE&/`QGCĪ_t>Gv?U:UEFEmT: Y 1aMlqp l+MpY=؞,׼!?AZ8#"!5rXFEbĔӵڹ8lomr;o<îz޸q 'Tt1vN[bjG.T kZdV1,ϩSq%$΄vWʙ3gĉZ'h2\V4取 c6*v\_6DX>uTU۶I>ui_D^xΑ.aB=?Xkɾ؄ uc4i6DQ[6*vTA6k f["l҇꿢ˋ/ccccL gB J%7f'hQ&V#cYi:qtXva[ewcжιma }F}߇ .Ç!/ <|"1رcp9U&@Gtcl:Š(AX 0vXضoղ}{.77hŅS!?Jnb^֭['%  0$X%]ƕ ({\ N&Nz"**}(_xٵk uA/X硇\&6FFF`ǎ“QeȲPkT:aV'ĩͪK9DQͧ_芬kVX۷s ΅> ---q*8.]2=1qy0emuE5@G狮"}JxmITN$ygV wI{{)-K^-[m tl-揆y˴aW㢌,:?MP̓U)O\ٚĉc#l/8p{iX$!xG-9ŋsNhD5XLXH:Ynxbڠl4ĤMlæIۑٚ.Xq1:: g qߜ9^^޶w^(3дbmEtŽ[wQY=yKOZ^챶hC0hyl6GVtUhL+V>KHB [pav4< @u5ּ펎u"tEÖ4κeߘsH'+_fms01:[p)%b}cIꫯ*)iޝF#TV W):":Otn cul[MU L,ð}Y?X$&ě6mn[6;__eDl:f?8:¬rDvFdCllX}eIDAT?.7ɯc/:7T5QX.X6(+&=rkZnUļa8$`߿QInWǹ0+0TuT,`CuB{ڒ C^yz"@B|òeϽ=IV SSS}cf-zt:6òTCh&dU MQc۶,z$Ni 1G>=px4Y@}TNu ØN,w薅Ulb7SPwyؽ{wfcIޠ&q!3[fMp±c`Z7d6bKW ꮒƠ+2]o뺙cڍ8Q CTqO~ҸIpCB {IW ;vϣDM1I _STISJx勖4*۪i*(,kei^Ï~#<o %B ~z< LNNj5VCcL+/+ec# mnZ-Iʹ v8&ÆykYSi8'kKm.]y# 7hIӟ.]t50>>?ЙVyHјtdp*,Jft:We,){Ç!0b 6@\NN|2<3F#kDh*:inAؖu:ü`wa=T¼[}a@IxU`yaΝ0iJ: UBKK^^N:/"!bMt>Iic[d3wҊ?Y6&gcӰaZFdi8KT*J8mhhnݚ4oxi< Q.ۡP(yy7YZ7 ˶UlYۦq.q;kq&4V֌xLm^6 f :?3iR?ZZZ3*?Nj;mQ@|^0o Jcm`eiyw^eq6用ɖpIElٲ ϤYR,w<{oo316SZbt$:!FU;a,/KgV(NlZc mۭlx/";v dI̝;7*8ell _b'jp8@_Eyya޶(יD4L:.nTUqrMUdmt- کJ[gc8x`k (5k|Ҙ; 6Y-ֹ+Zh17Y ";^OuTi"4]clxNk]f㼑ȀG bŊLt`&\|?-޶4+ @ ]DEòm^&,c  t æ*۲4sV->}? Ʋem۷)D8Kd#x'~3CPËx*1/>lK։Ǧ ?ىhUyz-m՗s`E 坬xbO}SիWs-Z>t G֦̅@Gmmĉei*660i粼DY7NW©b+]VVM= ?|<%tڵkX,&] 9s?xmE &ֶJ&~1SYL{iq<{E쮽lr Cc10 *.E}bLLPIAZmӖ^ʲݺNr̙ݝ+9ϙv~\VssCb]]]p6ّW1|G˗ތxbl޼YjZ Vf9}1SNf?G~-*pٜLLcdh#v>}3B$ߪa E o~ƍ7#+,X=eeٕ4 gK SE^k#"Uʥ$%0T~=,E?h4{%l #[jXbnN97k5lw+_;ɚp:~%={r^N455ҟ[n/Ķmۦyjj_Lcvic(Zh}ErVYDN9cn:qx<3~UŢce2>ӿPcy(6[Ev17qq;֪Rʢcոq|׸usZh'heR"O?T矃ތDObժUU5=4Um BɫZGj*nS^eU0}rI' ;v a㠑B1z{{{ЛuYn`+dUۼ]۬6.+Y VVmѼ؏pq>L!I(cęb:::0::d bٲeRUj$)3)*em͇ouTHYj{El:0>>n*&a #6㩧߿:t(T/P]ى [n8MW7VRIވrvyٶ~VcƊ d~Xש M./^_+AOJ2t0 [lܹs v3m rYDr2c^e*bQ储v9U~P0P"O>D?w\ЛX 6l+<S.Bm!+\/> [ *̾,peo{&)T ,b8pfi%yI`engnLL&s#]ي͸\K5,S;U"cV}}}8qD(OJS \[oa.jlٲEEEV"N3nb^*V1A/"]јJتB* _ʔ^:={P(t !ɓ'?d2M R<쳨~UVtllY&'ҷŝrUPbQ:<&''p(ظqL&GLLFGGq1[4mƙԲ26X17v~1w7_.XEv+^WVSSS1222$I&xZ~j I4777nD,_o&U1^mJ|}.2sb+ɚOV躎#GB05_x1xoa$B,bطoJތ@u,]O?4UUv}c;wj;EUTnq*dU,*\c_RsL,a "{aɌb]+WT.^7BvʥQ!eU..w;V}=el'̶X*N$8q|!3.a"ٳG4 ƍQVV"6;Ōy\ƿE$gˎ>r2ҵy]ܹsx"&''MB E?(b1466AL_FFNbnnǩDtW!c?LTƾ)뺎۷oԩS{f( =DEWW?f011V\v 6mBEE Iu|sƘoo3kW,oDdϐ"[VncN5.ݴ Y"™3g_=8Š8w}Wꚾ=h4իWcݺu\k۸T1%G%DlEP2[,&#a|ry]f@8xM[PZZ|\?LJc}VKS҅"L2q7M/97Rӧqƍ@g8rMpС|ElW͝ɆyaÆ ʩjXDf4~KثE[vrY*/[vq4779CDdlذ%%%B/Z;V4&DF^r*15RƲ]ʶ3c^|2Ο?1PvP68p@Űf466Z&;b"̥U,7հPy-%cU1-ۋ3g 1cq8zjW*V^%eD{2YԴY봴?<<c"P{zgg'e,ȬYc.%_Y9eǩFĚVU *E###hnnF__$`%,E,ݻu!Nyy9l2G]̘sk1mGPč8[SԪH$܌ XJXXݻw\̙3ׯǒ%K*KUl׶傀 7U٩L&΄k塈]g~Q$MMM<=-Y:Df}]D22H.L&/"vE쒽{+]ifϞ5k֠~:ZV9cj=h[cmw+cj,rj,fDkk+xɢ{(aPطw>n)))ի裏"&c-w; STXV*n;w(aoPyѠ7#bX|9-ҷU"Zż8Sf1WҥKXw(bz"z3MӰxb466b…129uƘeb~VȲ2v[!~W\v <0ۉ(bE:sT uuuN炜mc"1Bn+e\ىK.͛<Z!:(bݻwyI!H-BCCjjj\UVNIdg5^߿~ #Pjo#F80%`LI-l }阰j,*nkk˗qm>A "^{MO$|# MPUU+V~ԵS̮픳ƻُ8iK$$Z^\z}}}$"ccc)D"̛7uuuXj+)N91VJ!LblllJ099 LNN pA(;wy"!Dѣ|SA8p!B40s"NE>q@!Bd8 !"PEPȄ34MÇ)<"S(cBH&8ϡ !p~C1!. (7!$PE\B&p @ )x{†".pv0!y \P!B&$4!"2!pA;vjBr 8P!1!n(bB!0(bLHvI&1L?P XB! AG(dBA(b" L0"&:dB̡(b V$躎/&(d6(` (e׮]:_S3Q EL|U2)X?J& _ (bUX%|&ل"&KHAIP$((_ P$d7/5(bR&|I.C'yY(_/P$/^K=r84 GxICb.\8L <sB0@A1&a pHYs  IDATxKLk)C-HJU-zŝ[xYx ]iQC$nEt!5jN H4^b%QRn,D9,4f:3Z:=+foڇoQ`b2XXa  @8,qXa  @8,qXrA(# ry  @8,qdJ Ȯ1at<  @8,q% }`F8,qX( ?3zw{ga  @8Byyx>7Juz ` -UT bKDWRssyg| 'f]s~>UUΞ=^:J |Nv; ±c,Ӧ=v:x++>"؈ݻuup/_/W"vtuWWll#Q?\p֤: iFiOq15k=eeΝ\kjB 9?9s_0FCyySz"Q4voVI؊0h:"4oۆ۷᫮FՌ 0~:SZZ>A@ غUI |} +W iRJXǏ}bx1%po/hmUKVKICU t AGsgHK64 snd(F߻fUĬ,dWTz#3C(ƒɸիЀ,joߢP+ 4 ⾠ϧ/!=F3y97o+W֬A־}L}=F)SGQQqF"ş~cĜ?~8199cc(ZgZ1%x6mBE۞=u]lH_\8;FC͛)1P:&6#yׯ| )>{/Νғ%hj>3#I&!ߩSףyv eиn/_W] cVSf6ӓ?LtLFL-HI*aXY^-[sEݧe"3)p?  SX(_.>(I4E Z0T1#vxۓZ zԛ42heetTU:~*Rcumzԛ428d($L Νy/иvWv%?>($&\.| f ΝCKi)^eܴ:~|g}QILJve%R5-BAm-7nEEbV7l@am!C%`\&\&P2aCn @^0a  @8,q?_1  @]x[4q89x  @8,qX(f B8  @E C  @8,qXa  @8,qXa  @8% hIENDB`subtitlecomposer-0.5.3/src/main/images/hisc-action-zone-start.svgz0000644000175000001440000000273411141673002024532 0ustar sergiousersYKo8WpK H49|ʍShQ{ T[vU@R~mICjWMK!8΋CMJYSx9]͒b}&ɋh92x˕ 8*Okno>ncr~]&"]es838# 2cg5&܋c#v)Baђ`GOf5v8Y\u?ML<˨ v̆fG&dA(wӝPm!7KEx>eR 8xM㿗xS-*x7Q%g/q`}N qF!Vs @=2Tf[ U!ES)O)t_I.Q{pFKK4.r󑋼Xn?q64ʫyNj$U6~$PXycj>ctc 0 kP({lS9 t4Qͽ[?޿{}^S5,wKI覠% ﴠҧU:/ S!(j+jm*%?ZĊRt@i,{)SϜS=}siLt |`ZTnc6@>=bж;&<]҄HJ=u}qO/ϷB1|p_=0iYzaeUD|)6O"Κ绫4*J=FwyD˿һ-r{-u5|"TȝET'uYXm$IkrH ojTG*Ve$yGV{zFVMtc[EcJѼ|qOxCP\'dw;XfB@3f3NVŶwoμ߱?:ԧ7D)9eVVuSb4~jz''uStz(^3ھBLc|[w9W܇ AnĂr;.n~01HBBXlb˷ni3&4{﬍^q`LHi] 8 !m t|wF/N rr-civWԾl3O#po~ WL AS 4%#->sݠ,_q־hV|ebS}).} |-hutWD(*H&[6[\4^Q~I5AD'G=%㷖 z=S`çQԉXw2oPCCCm\!5H oQuxym,1*oRԄWjHg6RS`a[Cךf}_8kwn-IWlÀ׍?r$W$ˍ d?fqҟiV|Aqzysubtitlecomposer-0.5.3/src/main/images/hi16-action-select-stream.png0000644000175000001440000000144411172153315024611 0ustar sergiousersPNG  IHDRasRGBbKGD pHYs  tIME u~IDAT8]MU}{3sm/ ɏ[(N%$Hp\-\IpSvme  !-wIDT$}]νޯ}9epϝ8uX`;;l-j f( 9Vٹ9rl/yX+O7*}@}"1Q)_ 7\P!j%%__yf6vx`X^5Am6eOx[+kn0UMV!;b+Rk1S AJA:]&k=Zt\z[0m ,a/JuFϋ˷r^ٸ[o`D@ B@BD8\A;i68/ ĿoQzL""R$do$q}%&7x\&zT=*9K^wu܁L|pM!X* vb`ưFLD3G]:u^"Yj1y#t:cJT=T!{/VݦZؓ3'~u)q1 DlquQ<̗ fh?Ec'T+= U4,X VЪ?Z`Jd N KI(`_bvXV[12a6#kA`IENDB`subtitlecomposer-0.5.3/src/main/images/hi48-action-set-hide-time.png0000644000175000001440000000537011172153145024507 0ustar sergiousersPNG  IHDR00WsRGBbKGD pHYs11(RtIME  ZA xIDATh޽Zmh\U~3NWQ3mJ.eڦP -nwՂŅ ~E-mXJ dC-Q( ]VW#m|ܹssgnfj$8f=sޏ}s 70Ç[1=V>`eIDc{駫Xࠛp[yoO'p3ff030D{Tx!hweGȳ>[Y/r<=rA > P%)X a !B`>x7g)fV{.\ׅy, De!LlFZ8V0Mxxi4Mh !,\ׅJ`qynVtuuaڵHR ;+JT)|w0MDB2 C7CD^z /FDO]T*p]mu]`ӦMH&H$H$hkk}1P*0>>> xdRi~CD8p`}SSSHӰ, ivy=Bc̬T*(Jq#N#!N. |ob6ٳg166D"T*LQHDg 820<.vmf*vAZ }ض ۶_ɓB J)$"|'(xGdrJd2P(/F4qTPT*0bX& FbXJ|Zmعs':;;dfb&j>&|;[oEo 3?1婧B 23yqP,qbÆ d2Xl PQm[{$X!4Lħ~4\o_ov@8_TՅM6)[4 CMiQݗ.$!JaXf lFV," ~|bZZ_xiX i^SJ"`HN$H&ضmG:|{E>f0 y*y%9nDf iY%:Ck.2= zzzA$0&* `ݺu ,PQQvՅi=:3&IrVǢ(f輡rHR D* 'e5u-Dţ- cNSz%fr1o"Z:tVLa"NWVnb1xה#L&44BC"k\rqb 4Q՚^W(afOW[TiY!V&*CTIF"K@i+&]Q,zpV\ g۶r(0 =FGMAAr5 f/Ibd2mSSSKn>zpz*"l3b&''uh(S76 aI ŋnк6ҩ]k .(fıc~ak}=}KZr9|WzoYuu> sQ X,5er;($*h0<,qLOO7%ݵBBQr˗/?Tel23Cx7)Y8qjUui(KeTǏW8244}CW" JmmmOpix妜z0Q唚՛`ll }SW!6苞;wk֬A{{; P6mDӎfL.|VÅ 088?<<iĥKP.UGYjEjC lu ED?$ϝ믿IeLLLׯ?ID\8:::fl6J~5=DFH9<^}UZubK099yeSD^yqXvGADg3usӶm:u "$ y__kl^n "ڬ̌sҥK0Mij'4r׿ W<P(#{5"zBfcزe oߎ\.θ$ݷ:hsss8q>! BƏxG!2%WƝwމ7bHzԹz*Ξ=/AP(!U#适 @6E:F6UoXTkbihGu~*ݻa!f^ъZzuCDWy ;/DVZӤ]Sf#Dtddddi^5}}}0."HX RD.3'GFF~=m*f > 237n322mQx*)_hIENDB`subtitlecomposer-0.5.3/src/main/images/hi16-app-subtitlecomposer.png0000644000175000001440000000070711151345060024745 0ustar sergiousersPNG  IHDRa pHYs  yIDAT8œJ`/$O *Ay NŹ7!tFC7SK&hI?֡=y9('e (`eQ6p>xL$}0C[usEqp8D 9;9i6|%h?W |qC^_,f377{|%X?= d6Cza.2N A@b:r],QZr{˟MP=asRGBbKGD pHYs B(xtIME 76ud IDATx}yxeﯪz_B:+`-% @px3%̸ EAtˆ Wg8Gۙ(aY0!fO:t:IwU?tWy~G55ƪ)b8Kow,VefgWXaZ>q $ JEQxt6gtGӝ-3ghE\]ƺ;;xi}|~ap70DtAwd:Sg5 *{:ihjaYvM|h EQp$ɏ/]T~Æa 09B7,ohXzG v,-˲r*!.nw@kΉMMݝK^F4MW_}; Tv$u/_U P׳ee?$7n0 :V\LW=rtwg,{9]:hbbbAzza(/+ӝ={絗/?5cݽRƇQ7Th4z_-維cǎx?c~{{[]]c0LpHHHX_ ǣ_9,ޟ zC_bbW323nl޼9$?d^M'b`0j( F<8.6zAOO^UiӖ˹t੧zno0;$ADx!  vnn>oPj;cy䑃%VXA[,-FI tIV+bcct:aZLW`  !X 9phiiAKKˠiպ:--O?} VXat8oQu`Hz||<R|H1? ˲atttMMM6O$t:ݪ7+VZ 䁖dƂÅR/<`?cƌM3a |555AAy 5k$ u:݀1?** 7|3N't:]C̥iE(t:QuSgg'q`ٲe Xy@&-- ǏH6EQi4Ml6fd2T/5ěocǎkCEEn$&&J_.F`\rETח2g ڳw/{M0gg9|*R'/331117 7xeQYY @׫ ) ?Btt4ק=0̴UO?0t4tM6m,Kz=l6VkH'TZ< ::}6|>̚5i1 |Awww$㜙3g,..jx駳8|Uk;55ƍ`H>M0Lp80 /9mkҰm@VVF-`9"߯/ $'syѣ=Xv^)$$Iݻ۶mSdsYEii)nL&Mf@stih l2=5kHĻIeff">>>F_rG+&׿Fggvvuuv#''G6$v;L& eÃsVϘ1#;zQQQ1_J6mڄSNn7|iӦ!99Y1(oSSV./**:;XzN1AF-j?+++„ Taؾ}dYNŋ#.VMMMZ}u( 4-_FFFڧ( fQQQa^*ĒA_z5<evyy!@"懶IEEE0[zzzǫ} 2'&rg?<"[^^ QS lb/p8ק5:2{Ңo55U1a„|)5/w(P+R,Z!IrN'>YQ͜={pLWrct"===$7L/'0bZ^:䊐:;;܌+BN~lhhВ1KfN|ϛ[ZnW{g^`>?>CԾ\\ ;_Gkk+>:tHƫIT3&3W>}zE%vDM(:rxsB J2eJ ?TTT441{`0ظq#nt|B bcc1n8U|rX9[dffqZ;:rH8}vf9&!I|ycc#|Ub "˅;C/1?BSSRYf_RRҩX|}$ܼ^zLQL&,lȦV ;cӦMhkk`G}={(blSNIj5L@3 :vΤI`X _WXJΝ;j0زe e=~%#Rh$''kiz*N17~UHs8HJJ An|)Y__[j.믿.TR 0WFQ &@krݻ3kTWN<9PGQF#L&*闊>_Ԛ1 o>YK@)fNd„ 4y"=wGAXLL B,%4FP.RXXZ0ؼy3\.WX@Ԇct3f L&Z-jժQ@IqLEE^ww7&ݛ HXVX," 5j_L#466bժU#%~o%(8~FT-9D̙3? /]f5WBlllBVkHlX/|MTpAY@*/3HM{94UUU &Ə0 #rvݻ1T^>ʥ~B`9@͍;vBQ}.힯M&CBp b~CCx %Wm$e;RRZ@S]շH9B a^pN ~1(???0V DbX,S\rD?|pڱe6CfffKMMň#o*~ԩSŦ&?VG `a}q\UY$~IHLLDuu.bŊm۶USxr Z֐A`U)lő#G|@FGGcҤI!`1B~ ~[1̙oΝ;Rxi:t ,|` h>..$IzN{tvuMS~tuu8fEޮP_r~ĉ!uK F8Slnl4vwwOP>x<Ň )? 7tuS,++kSƹ9COODmJ&\+4Qۜ@>P$0 ajU93  )l}ggZA%].Wn>-թpNX?k)}=j( L%H앙I%BƲlȬ$mtuJvttn(g5"xezfQf W˥vG'ȌhVfYmmm[J1^~f@iOa.FVHywY2{Μ2ɤJwً5DS͇[Sl[ e lߪiDSSS (3RZaP8 t/d>4M죫v a8(x^o+++Pi2.55|uuu8yd .~s9|i'0!{l6ܹSS2GN`NUF_ⅫH֮]Z|Q[[tVM'?EѨjg~fiu, ֯_x:)33s,Jض^W˒9x:iBKKKԵ9iXtff+R#\jlpj*/ ..c5!… *I- I<=#:uU2 __ŎE+83Q52xElN9`(1 B`ٰq@iP[o5D3uJBJriY6g|Y3ftSJGh1( Ox`H1`0෿m  pQ ٳgvUwB )))ŗCp%Ax'6dnݺ5JD}ܿ===8wڦ#>큈 8*1s ׉F/MYYYeM D;?~*++$?d$wɎ=:_b 崀ddd7LشihKr?z(//W9ۄ@ıffTUU"Ui/zZ7OZr%&M,NRLs=s挖~aQX̛7\||^4$" ᥆KW͆^z隘L,]T󁄟 P:::pi-M~[Co]~rBkXV ،XVlذ!2?ajITqb,QF}ckWΒsV\oݾG}SN [)>^QzW é~ߏ"j;*d?M4i رchnngÄ@z)3B'x˗ʴ;痲~.]BEE&_]?&L"9)#wؿ?CP̿J1 !;jbZ6S KӧOԽT#\j7 R*x>//OFvez >Зuuu1 z^tvv"99Yv};1u.e]BB|>JKKf۷oYUH Ӄ> Z]?(Ғܮ8"1Skq(I(يV^k ,`z|>8puuuZ`AyyySb&"EmK`6t:9rr)x:zɓ'O>Q;Yeddॗ^Rp_hyGII Ξ=QCŋΝ;=q}jkkp8$7uPņɓ?":::M)o_|>8q"h<%} nz8 ** QQQpQ)}ZM@n^^7JJ;VmXEuu5l6[rNI!io(¸q駟^lYy?~ؘ@II w}noo󙴀 F*O|嗪T{Q/W c~II N<̨=;vxLT={󭭭!Z|>$$$(jkJqڵkqb~OO8H|z9sg7o^K+bڊ#Glt U*.9Eaػwo*3gb͚5(C ӅގZS<XcǎZz͛7jkkr\^r 1110͊LP HbLL (±c$c۱uVl6UwJrһ$yV;v h{fgg{) Lz?A 666$p&@&MBYYL$n:-x^u^/P\\jĎ;3 "ѣGiӧ$"eY˨ )2\Y#'Nľ}l<裢!z=WWW>CMM@$(Μ9k(++΃}}?3Hx7ߠNS2ZF0M!cv/B`ϝpZprȑ#8~8n+AXcǎw Dkrrrv;IȨ,qt:8~.7:\F&U{8n8TTTA`ժU?UX~8u8Xatǎ؀tR,˾˲uͨ(c„ i:dsF/_'xذaC`{)m [QQ2M7ʩ} 8Ppɰ{~b)S0qDX~nc+!O”)S-e(QYY -6zP~ ʚl˖-^;}}}iFRR&N#GB׫b'5e0ӽ^/jkkqYG<(`0x5h=Cqqٌ$$%%aȑ0L bS0 <P]]˗/WK*3|_:X7U-ZEdI>Et"!!p: ??  hllD[[5Ywơ\e9(ټ$ɕh\%iQQQX,p80L0 (*RpAgg')lϖLRIDAT|5nvUe]dBH ,??uC|3gΜMKK{@)P/^ռ5[yɒ%(H~~kрk4wnnRo_F sss( Z[l/((] sssGX` 킂Ҩ!;Cnnn+Z!yS?g[PP58;677w{{1 `mECׅd-^b X`y C-зץj`W0WV> /CCQߐD29H0i[t۬|7[zvŋ;|Q8^a8(((`o~ C7GIENDB`subtitlecomposer-0.5.3/src/main/images/hi48-app-mediaplayer.png0000644000175000001440000001341011172153256023645 0ustar sergiousersPNG  IHDR``w8 pHYs B(xIDATxyŝ?0' (r(!(Y5y"bl&$&FBD 1F#dJ41Q#1$ur # 0{uw]];yz_UQQQQQqGz;}cޝ[hnz0+f} (@3g}Qe. aPRRB6gfRRx짱ᖈk:,}ml{ヒH4ضadz_#>@Ԟ8<%KSNe_>o+%LSZs'zܾA%YRJ,4Mn_x+?1DҒ2eG_9d?X͌u^B_$Gŵ~QF-رu{eʔ$u۶,\.eY8)-)c˖JK˼4qri6lXw{w?{m@al6m[RN>$~E(8ܶmVG}v̳,r F<~A{>ʒdY2mm,F hw_I(/$>)->b7nl*4d(?de}U8p[b%m:RR]8RJL#i떫9qyR;:Sms^̀{rAB^gҊiM# \3*N;m<˱|Sӏ.^Yen0wu'O.WJ;vr7nbަ<7"L0< !I9%t GWͼNnys5TUWfqq4-ظ3 D?v,[.G}JcH d39,&Ja!W't,][om4MJKKXWL{>Q"MJL;;;[*Xf-RJ* 3$~޽M̝{w˲贩d/YRΌ[-[sa %JSOsF2Y{͜?BC?K/W]#d=KC@a±Y3ؽw?$:˖-3f豏8}}_xBh@pɲ$Cٯz/b} [n%Tד˫WebY6 HP?t(x]_nР!fmJuq%r"8$k\At~SO9CxxuΎTהl2˻7~k? ؅0vrV$Q⋧z/>ϰq.>yhT4'4A}2d)L ҙ:eg*ZWT,rVA T48]?~=Y'OoO"rcI^U_?y7}1cF!@0mfƌkشoܸ<أjy45_pufS>4ooK-_ߴurܰ=4M.\mضm#1ǀ? ؼm'9K6jرEt啟npGc<)ߝXk۞y70|0Bmmh>Ç㢋w8 '׀OC1wTT+=Ld֬kdzhwza!F!;f8/3]޽MZUsΤ8aåX`i`i|1\~?ffy8ó8$Ko~j!?~dik,EwgȤ2wn!HuR;U[N3twa&B=@0 ghki$m舺G!uQ%(X2,##ǡP, (OR]] 1C…QM/.~z!Ё!"YVjz䶹}CqRk9={+xЯ_9@B B1"!v$J]Kj`]7vr?|xc>4c,xG!e_Cojg KzY<b($\)s(|.pXRgj ;A817y-$t ;|E(ڻg- 67iD~_ϣhѮnAIKnp( /rQ'dk߅HĈ,9w+GwWw{9?D>Rh6kR#1::;Y`q€ALsb`ssMMm-qhmmSu%Rz戀 :3|&MTW`;-. +><3hJw>\<(UU.B F^(/"ΰrK6DI*G-pޅNYreyE$q2 ZZ.0TzkxA` 4B/$G*,yRRs !pBs 9['^'/ar9֭[5).b9 H$J?.g5 ҉\~'|),y's׮S3իת HS:4i4:zhf庂8g<-PX4݉ O\cʎXv\p4FY3xOؾѻ't+ -u !f 47cAܼ/lzLf2 2LVx?ytK43I, 028p`- !xWCKB0144!,v+I5js\OKK++W+/e{Cc~A#)RoY6LT:Ygߣ=Yu  i"H*F|G)`Q%d TOt_P__o$0%2rSa[;j9d= UU}n_p7;wV&{$Z^xa%OnL :;XI'@ct{ !l akpDDHG}Ai}Zx_j˧SQџWb[&M{B\Wm,)F' ~ႋ.d-۸2!CIGGI&n)޼͛"ض>٫`_ۛ 60L䞻öذa##FeҤ EtvF-ccipιgpmm c;Cg^@HRԞض%f-3fa`Y6 ?:Aw3qN=S=cs>w)OIw[‡x&jv; LVHvD3pF7> mi-WOZzհ5 k^ >?|2'tܱW^YM:& ԕ5I)1yuyuSΑ_6ܲ͞O7NOAyaomBW?,a-X/b8/uA18,E7'f)Z]?B*:D낲k dzCH/vt?q<՛K?/R>^AB3-W}1?WLl ΞiMQF`Y6io@Jرٹk7jkBI*߭V7Abښ(RC mfi;] ;Gtׅ~Գx=zD={˯0 TUW~cسg/55 v,iFBO8L|\ Hz&Gw_4$3+2ZUW}͛RU]IW졣H3;е8m[ ޢa>HAp_9%Gg+RwރA>)CҮFh7p)`- NUj1R͍|ǩ#o 1\\OQ$jH(do{KIhX >f:P^. OH|irml4A>p+s1Iy  b)v &zh8"3T(H|@i#U-#K0闠r@L7 l\xMwDP(^bӨR2SIw1.Ca9:>s _=Vvi=U ϭv[m)W\ڷd'v$0X#V%|7MD>s8Gp׀i~C":mh[UGcyE}XS@`zBf(pѰ4:;۞8mo}У \u/'Jt/5C+P}b2wYKH*fRP a~ÑQT#|PH+zY WIx" p_"|虺1CݙBQwd:Sb 7V=T1b8h,◘J.4q4yl{gQh [Ee*E!t)",K Xv5Hr ('"Ptq{VQQp-爴ubn 9Ԙgx)h h!Xj|(!(N$;"6HW!, i %%@ 1 ;"p6-1Z`ئ{g5_e}/e[ch2a%4m/L,:(]7EcXv7VdŽ |A4ܨĶG|a2Z !W"$ %1#F'=dq{i]_FՊeT<͢yozB:?q/p|?mVj cE"SG?T)@#D6),Հ->\6È6 ۼ\V.[οJn w˨e,.[X5iYF$yO>Hko?`<_Le( $1Յ[`[ˁθ3̄Fa!nQv\ fAt1 Mli:3mћTؑH茈ynTJ՛v@Du_=H8p ̔] b / >:p1 ~vcl# #Z(\_}=mK镓G,F}(1%ջ&9-4V,} ,@RDG#CPUݸ!j@4` ƧwyI4O`zO#X2ᗍlI.NMHLQ,4S̝>~/"FhrZ=۹X;:8AOl< ? m(6KfH;FU:  LA4miu+q>;;, s[brN,oJX, x4$}*#xn^x%UE{IA0^!m;楝C-)XZAceO0/?`^!}8a!z-wnkWV2ا&G/y*玧xXlywe j(]nݛ_1EVSpNo%]1I̦H]dEV0+,?77EuwiZ%R.u26QXXo;tF$1l}sI',li?HkGW@{04h!]Y_}@ K@1vtn(b~_d(a~M 猕?+$ExC3H!t7sU%o8b)n]$6g1;t&=5f{@ .\[pvoȾ|5"NK+7y"P)[:}vb1K#GƠ#+?@\fgfca.Vo+aN )8u6򁮬HVn`^V;Y <܋Aܾ5ᐛ'ڒUlMɹ 5aijYU42:$λ̕ ]m>M~:w UK9shoԡp%ɮOa~ STquyc勞g( <#Z9[]GGO⊙Լn7m1t [jLZբeLw¾|eQ}!9uVd7J~TD.2'ZڶwFN{SWLIss}A4x+F %phj)Dmg4qGHF6 br v9ۈIW F\ZX6a2[C:}RL7IcXH1_Z392+}^ͳ3W"QZ"Oǎ8~0Q@t–?Vr׿\gF7YگݙZ8-hc5Ǿt ܘY5fZ{?-mkIӻØSmߜ쵴Gw8#ϟvxk<ƀ\x&N1A\Z9ǹC|P;Y@r&6>seGz 3M+il>4ks5xV:}d H)&ӯ1 @ڀ4XωZ3;ӊ(ܹ!Dz{y%fEY]:Ua O%Ӻާ.z5wCiEJGR!^0h&҅v"Tsc>i<_ӚOۅ~F^5zFD|}aCU歸nF|0̥s>a3tk"n=y!qơЦ&GFr#! Cyݦ9ӇzQWfVDEo PL?}j(m5iȄ+ٗ~,~FZ$~mmgÿdGeyV/Qom,٧,1O}n$h8E-杢iV":AXXfrkDO-ye†7{9r C (Z䍌դdZ6@GGlWF|c۞3{zf;מ וxK=r]9gu _>tQ{=l5#F7\>֨^=%ުXvͿoY2 Zӵ4fPL=lk~&`5-u`%Q@GtwGSK,ҧi=gE0=$K>n`43|9k ӗe L}ʯ_xX}/aٛZx,6#pSO{B7d ^PI"!~a2.yN7}0D..:1r2*]}.4"BbgNGH1L!;Mp*u,6,oP|%O7x1wKVkT#VP敡~l D3)ʹF<|U{P]4 -&q~GF )meuܺp=0zJPPӏEh1c)L$Ii\6D\">kL:#BL9[;IJ a<+j HͧgVC8#5#%NI=gE`d^IENDB`subtitlecomposer-0.5.3/src/main/scripting/0000755000175000001440000000000011206423743020050 5ustar sergiouserssubtitlecomposer-0.5.3/src/main/scripting/CMakeLists.txt0000644000175000001440000000125011206335421022601 0ustar sergiousersADD_SUBDIRECTORY( examples ) SET( main_scripting_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/scripting_rangesmodule.cpp ${CMAKE_CURRENT_SOURCE_DIR}/scripting_stringsmodule.cpp ${CMAKE_CURRENT_SOURCE_DIR}/scripting_subtitlemodule.cpp ${CMAKE_CURRENT_SOURCE_DIR}/scripting_subtitlelinemodule.cpp ${CMAKE_CURRENT_SOURCE_DIR}/scripting_list.cpp ${CMAKE_CURRENT_SOURCE_DIR}/scripting_range.cpp ${CMAKE_CURRENT_SOURCE_DIR}/scripting_rangelist.cpp ${CMAKE_CURRENT_SOURCE_DIR}/scripting_sstring.cpp ${CMAKE_CURRENT_SOURCE_DIR}/scripting_subtitle.cpp ${CMAKE_CURRENT_SOURCE_DIR}/scripting_subtitleline.cpp ${CMAKE_CURRENT_SOURCE_DIR}/scriptsmanager.cpp CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/main/scripting/scripting_subtitle.cpp0000644000175000001440000002326411206332657024503 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "scripting_subtitle.h" #include "scripting_subtitleline.h" #include "scripting_range.h" #include "scripting_rangelist.h" #include "../application.h" using namespace SubtitleComposer; Scripting::Subtitle::Subtitle( SubtitleComposer::Subtitle* backend, QObject* parent ): QObject( parent ), m_backend( backend ) { } double Scripting::Subtitle::framesPerSecond() const { return m_backend->framesPerSecond(); } void Scripting::Subtitle::setFramesPerSecond( double framesPerSecond ) { return m_backend->setFramesPerSecond( framesPerSecond ); } void Scripting::Subtitle::changeFramesPerSecond( double toFramesPerSecond, double fromFramesPerSecond ) { return m_backend->changeFramesPerSecond( toFramesPerSecond, fromFramesPerSecond ); } bool Scripting::Subtitle::isEmpty() const { return m_backend->isEmpty(); } int Scripting::Subtitle::linesCount() const { return m_backend->linesCount(); } int Scripting::Subtitle::lastIndex() const { return m_backend->lastIndex(); } QObject* Scripting::Subtitle::line( int index ) { if ( index < 0 || index > (m_backend->lastIndex()) ) return 0; return new Scripting::SubtitleLine( m_backend->line( index ), this ); } QObject* Scripting::Subtitle::firstLine() { if ( m_backend->isEmpty() ) return 0; return new Scripting::SubtitleLine( m_backend->firstLine(), this ); } QObject* Scripting::Subtitle::lastLine() { if ( m_backend->isEmpty() ) return 0; return new Scripting::SubtitleLine( m_backend->lastLine(), this ); } SubtitleComposer::RangeList Scripting::Subtitle::toRangesList( const QObject* object ) { const Scripting::Range* range = qobject_cast( object ); if ( range ) return range->m_backend; const Scripting::RangeList* rangeList = qobject_cast( object ); if ( rangeList ) return rangeList->m_backend; return SubtitleComposer::RangeList(); } static SubtitleComposer::Subtitle::TextTarget toTextTarget( int value, int opDefault ) { if ( value < SubtitleComposer::Subtitle::Primary || value >= SubtitleComposer::Subtitle::TextTargetSIZE ) return (SubtitleComposer::Subtitle::TextTarget)opDefault; return (SubtitleComposer::Subtitle::TextTarget)value; } Scripting::SubtitleLine* Scripting::Subtitle::insertNewLine( int index, bool timeAfter, int target ) { if ( index > m_backend->linesCount() ) return 0; static const int opDefault = SubtitleComposer::Subtitle::Both; return new Scripting::SubtitleLine( m_backend->insertNewLine( index, timeAfter, toTextTarget( target, opDefault ) ), this ); } void Scripting::Subtitle::removeLine( int index, int target ) { if ( index < 0 || index >= m_backend->linesCount() ) return; static const int opDefault = SubtitleComposer::Subtitle::Both; m_backend->removeLines( SubtitleComposer::Range( index ), toTextTarget( target, opDefault ) ); } void Scripting::Subtitle::removeLines( const QObject* ranges, int target ) { static const int opDefault = SubtitleComposer::Subtitle::Both; m_backend->removeLines( toRangesList( ranges ), toTextTarget( target, opDefault ) ); } void Scripting::Subtitle::swapTexts( const QObject* ranges ) { m_backend->swapTexts( toRangesList( ranges ) ); } void Scripting::Subtitle::splitLines( const QObject* ranges ) { m_backend->splitLines( toRangesList( ranges ) ); } void Scripting::Subtitle::joinLines( const QObject* ranges ) { m_backend->joinLines( toRangesList( ranges ) ); } void Scripting::Subtitle::shiftLines( const QObject* ranges, int msecs ) { m_backend->shiftLines( toRangesList( ranges ), msecs ); } void Scripting::Subtitle::adjustLines( const QObject* object, int firstTime, int lastTime ) { if ( const Scripting::Range* range = qobject_cast( object ) ) m_backend->adjustLines( range->m_backend, firstTime, lastTime ); } void Scripting::Subtitle::sortLines( const QObject* object ) { if ( const Scripting::Range* range = qobject_cast( object ) ) m_backend->sortLines( range->m_backend ); } void Scripting::Subtitle::applyDurationLimits( const QObject* ranges, int minDuration, int maxDuration, bool canOverlap ) { m_backend->applyDurationLimits( toRangesList( ranges ), minDuration, maxDuration, canOverlap ); } void Scripting::Subtitle::setMaximumDurations( const QObject* ranges ) { m_backend->setMaximumDurations( toRangesList( ranges ) ); } void Scripting::Subtitle::setAutoDurations( const QObject* ranges, int msecsPerChar, int msecsPerWord, int msecsPerLine, bool canOverlap, int calculationTarget ) { const int opDefault = app()->translationMode() ? SubtitleComposer::Subtitle::Both : SubtitleComposer::Subtitle::Primary; m_backend->setAutoDurations( toRangesList( ranges ), msecsPerChar, msecsPerWord, msecsPerLine, canOverlap, toTextTarget( calculationTarget, opDefault ) ); } void Scripting::Subtitle::fixOverlappingLines( const QObject* ranges, int minInterval ) { m_backend->fixOverlappingLines( toRangesList( ranges ), minInterval ); } void Scripting::Subtitle::fixPunctuation( const QObject* ranges, bool spaces, bool quotes, bool englishI, bool ellipsis, int target ) { const int opDefault = app()->translationMode() ? SubtitleComposer::Subtitle::Both : SubtitleComposer::Subtitle::Primary; m_backend->fixPunctuation( toRangesList( ranges ), spaces, quotes, englishI, ellipsis, toTextTarget( target, opDefault ) ); } void Scripting::Subtitle::lowerCase( const QObject* ranges, int target ) { const int opDefault = app()->translationMode() ? SubtitleComposer::Subtitle::Both : SubtitleComposer::Subtitle::Primary; m_backend->lowerCase( toRangesList( ranges ), toTextTarget( target, opDefault ) ); } void Scripting::Subtitle::upperCase( const QObject* ranges, int target ) { const int opDefault = app()->translationMode() ? SubtitleComposer::Subtitle::Both : SubtitleComposer::Subtitle::Primary; m_backend->upperCase( toRangesList( ranges ), toTextTarget( target, opDefault ) ); } void Scripting::Subtitle::titleCase( const QObject* ranges, bool lowerFirst, int target ) { const int opDefault = app()->translationMode() ? SubtitleComposer::Subtitle::Both : SubtitleComposer::Subtitle::Primary; m_backend->titleCase( toRangesList( ranges ), lowerFirst, toTextTarget( target, opDefault ) ); } void Scripting::Subtitle::sentenceCase( const QObject* ranges, bool lowerFirst, int target ) { const int opDefault = app()->translationMode() ? SubtitleComposer::Subtitle::Both : SubtitleComposer::Subtitle::Primary; m_backend->sentenceCase( toRangesList( ranges ), lowerFirst, toTextTarget( target, opDefault ) ); } void Scripting::Subtitle::breakLines( const QObject* ranges, int minLengthForLineBreak, int target ) { const int opDefault = app()->translationMode() ? SubtitleComposer::Subtitle::Both : SubtitleComposer::Subtitle::Primary; m_backend->breakLines( toRangesList( ranges ), minLengthForLineBreak, toTextTarget( target, opDefault ) ); } void Scripting::Subtitle::unbreakTexts( const QObject* ranges, int target ) { const int opDefault = app()->translationMode() ? SubtitleComposer::Subtitle::Both : SubtitleComposer::Subtitle::Primary; m_backend->unbreakTexts( toRangesList( ranges ), toTextTarget( target, opDefault ) ); } void Scripting::Subtitle::simplifyTextWhiteSpace( const QObject* ranges, int target ) { const int opDefault = app()->translationMode() ? SubtitleComposer::Subtitle::Both : SubtitleComposer::Subtitle::Primary; m_backend->simplifyTextWhiteSpace( toRangesList( ranges ), toTextTarget( target, opDefault ) ); } void Scripting::Subtitle::setMarked( const QObject* ranges, bool value ) { m_backend->setMarked( toRangesList( ranges ), value ); } void Scripting::Subtitle::clearErrors( const QObject* ranges, int errorFlags ) { m_backend->clearErrors( toRangesList( ranges ), errorFlags ); } void Scripting::Subtitle::checkErrors( const QObject* ranges, int errorFlags, int minDuration, int maxDuration, int minDurationPerChar, int maxDurationPerChar, int maxChars, int maxLines ) { m_backend->checkErrors( toRangesList( ranges ), errorFlags, minDuration, maxDuration, minDurationPerChar, maxDurationPerChar, maxChars, maxLines ); } void Scripting::Subtitle::recheckErrors( const QObject* ranges, int minDuration, int maxDuration, int minDurationPerChar, int maxDurationPerChar, int maxChars, int maxLines ) { m_backend->recheckErrors( toRangesList( ranges ), minDuration, maxDuration, minDurationPerChar, maxDurationPerChar, maxChars, maxLines ); } #include "scripting_subtitle.moc" subtitlecomposer-0.5.3/src/main/scripting/scripting_rangesmodule.cpp0000644000175000001440000000560611206334466025335 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "scripting_rangesmodule.h" #include "scripting_rangelist.h" #include "scripting_range.h" #include "../application.h" #include "../lineswidget.h" using namespace SubtitleComposer; Scripting::RangesModule::RangesModule( QObject* parent ): QObject( parent ) { } QObject* Scripting::RangesModule::newRange( int firstIndex, int lastIndex ) { if ( firstIndex > lastIndex || firstIndex < 0 || lastIndex < 0 ) return 0; return new Scripting::Range( SubtitleComposer::Range( firstIndex, lastIndex ), this ); } QObject* Scripting::RangesModule::newLowerRange( int index ) { return new Scripting::Range( SubtitleComposer::Range::lower( index ), this ); } QObject* Scripting::RangesModule::newUpperRange( int index ) { return new Scripting::Range( SubtitleComposer::Range::upper( index ), this ); } QObject* Scripting::RangesModule::newUptoLastSelectedRange() { int index = app()->linesWidget()->lastSelectedIndex(); return index < 0 ? 0 : new Scripting::Range( SubtitleComposer::Range::lower( index ), this ); } QObject* Scripting::RangesModule::newFromFirstSelectedRange() { int index = app()->linesWidget()->firstSelectedIndex(); return index < 0 ? 0 : new Scripting::Range( SubtitleComposer::Range::upper( index ), this ); } QObject* Scripting::RangesModule::newEmptyRangeList() { return new Scripting::RangeList( SubtitleComposer::RangeList(), this ); } QObject* Scripting::RangesModule::newSelectionRangeList() { return new Scripting::RangeList( app()->linesWidget()->selectionRanges(), this ); } #include "scripting_rangesmodule.moc" subtitlecomposer-0.5.3/src/main/scripting/scripting_subtitleline.cpp0000644000175000001440000002531311206334063025341 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "scripting_subtitleline.h" #include "scripting_sstring.h" #include "../application.h" #include using namespace SubtitleComposer; static SubtitleComposer::SubtitleLine::TextTarget toTextTarget( int value, int opDefault ) { if ( value < SubtitleComposer::SubtitleLine::Primary || value >= SubtitleComposer::SubtitleLine::TextTargetSIZE ) return (SubtitleComposer::SubtitleLine::TextTarget)opDefault; return (SubtitleComposer::SubtitleLine::TextTarget)value; } Scripting::SubtitleLine::SubtitleLine( SubtitleComposer::SubtitleLine* backend, QObject* parent ): QObject( parent ), m_backend( backend ) { } int Scripting::SubtitleLine::number() const { return m_backend->number(); } int Scripting::SubtitleLine::index() const { return m_backend->index(); } QObject* Scripting::SubtitleLine::prevLine() const { if ( ! m_backend->prevLine() ) return 0; return new Scripting::SubtitleLine( m_backend->prevLine(), const_cast( this ) ); } QObject* Scripting::SubtitleLine::nextLine() const { if ( ! m_backend->nextLine() ) return 0; return new Scripting::SubtitleLine( m_backend->nextLine(), const_cast( this ) ); } int Scripting::SubtitleLine::primaryCharacters() const { return m_backend->primaryCharacters(); } int Scripting::SubtitleLine::primaryWords() const { return m_backend->primaryWords(); } int Scripting::SubtitleLine::primaryLines() const { return m_backend->primaryLines(); } QObject* Scripting::SubtitleLine::primaryText() const { return new Scripting::SString( m_backend->primaryText(), const_cast( this ) ); } void Scripting::SubtitleLine::setPrimaryText( const QObject* object ) { const Scripting::SString* string = qobject_cast( object ); if ( string ) m_backend->setPrimaryText( string->m_backend ); } QString Scripting::SubtitleLine::plainPrimaryText() const { return m_backend->primaryText().string(); } void Scripting::SubtitleLine::setPlainPrimaryText( const QString& plainText ) { m_backend->setPrimaryText( plainText ); } QString Scripting::SubtitleLine::richPrimaryText() const { return m_backend->primaryText().richString(); } void Scripting::SubtitleLine::setRichPrimaryText( const QString& richText ) { SubtitleComposer::SString text; text.setRichString( richText ); m_backend->setPrimaryText( text ); } int Scripting::SubtitleLine::secondaryCharacters() const { return m_backend->secondaryCharacters(); } int Scripting::SubtitleLine::secondaryWords() const { return m_backend->secondaryWords(); } int Scripting::SubtitleLine::secondaryLines() const { return m_backend->secondaryLines(); } QObject* Scripting::SubtitleLine::secondaryText() const { return new Scripting::SString( m_backend->secondaryText(), const_cast( this ) ); } void Scripting::SubtitleLine::setSecondaryText( const QObject* object ) { if ( app()->translationMode() ) { const Scripting::SString* string = qobject_cast( object ); if ( string ) m_backend->setSecondaryText( string->m_backend ); } } QString Scripting::SubtitleLine::plainSecondaryText() const { return m_backend->secondaryText().string(); } void Scripting::SubtitleLine::setPlainSecondaryText( const QString& plainText ) { if ( app()->translationMode() ) m_backend->setSecondaryText( plainText ); } QString Scripting::SubtitleLine::richSecondaryText() const { return m_backend->secondaryText().richString(); } void Scripting::SubtitleLine::setRichSecondaryText( const QString& richText ) { if ( app()->translationMode() ) { SubtitleComposer::SString text; text.setRichString( richText ); m_backend->setSecondaryText( text ); } } void Scripting::SubtitleLine::breakText( int minLengthForBreak, int target ) { const int opDefault = app()->translationMode() ? SubtitleComposer::SubtitleLine::Both : SubtitleComposer::SubtitleLine::Primary; m_backend->breakText( minLengthForBreak, toTextTarget( target, opDefault ) ); } void Scripting::SubtitleLine::unbreakText( int target ) { const int opDefault = app()->translationMode() ? SubtitleComposer::SubtitleLine::Both : SubtitleComposer::SubtitleLine::Primary; m_backend->unbreakText( toTextTarget( target, opDefault ) ); } void Scripting::SubtitleLine::simplifyTextWhiteSpace( int target ) { const int opDefault = app()->translationMode() ? SubtitleComposer::SubtitleLine::Both : SubtitleComposer::SubtitleLine::Primary; m_backend->simplifyTextWhiteSpace( toTextTarget( target, opDefault ) ); } int Scripting::SubtitleLine::showTime() const { return m_backend->showTime().toMillis(); } void Scripting::SubtitleLine::setShowTime( int showTime ) { m_backend->setShowTime( showTime ); } int Scripting::SubtitleLine::hideTime() const { return m_backend->hideTime().toMillis(); } void Scripting::SubtitleLine::setHideTime( int hideTime ) { m_backend->setHideTime( hideTime ); } int Scripting::SubtitleLine::durationTime() const { return m_backend->durationTime().toMillis(); } void Scripting::SubtitleLine::setDurationTime( int durationTime ) { m_backend->setDurationTime( durationTime ); } int Scripting::SubtitleLine::autoDuration( int msecsPerChar, int msecsPerWord, int msecsPerLine, int calculationTarget ) { const int opDefault = app()->translationMode() ? SubtitleComposer::SubtitleLine::Both : SubtitleComposer::SubtitleLine::Primary; return m_backend->autoDuration( msecsPerChar, msecsPerWord, msecsPerLine, toTextTarget( calculationTarget, opDefault ) ).toMillis(); } void Scripting::SubtitleLine::shiftTimes( int mseconds ) { m_backend->shiftTimes( mseconds ); } void Scripting::SubtitleLine::adjustTimes( int shiftMseconds, double scaleFactor ) { m_backend->adjustTimes( shiftMseconds, scaleFactor ); } int Scripting::SubtitleLine::errorCount() const { return m_backend->errorCount(); } int Scripting::SubtitleLine::errorFlags() const { return m_backend->errorFlags(); } void Scripting::SubtitleLine::setErrorFlags( int errorFlags ) { m_backend->setErrorFlags( errorFlags ); } void Scripting::SubtitleLine::setErrorFlags( int errorFlags, bool value ) { m_backend->setErrorFlags( errorFlags, value ); } bool Scripting::SubtitleLine::checkEmptyPrimaryText( bool update ) { return m_backend->checkEmptyPrimaryText( update ); } bool Scripting::SubtitleLine::checkEmptySecondaryText( bool update ) { return m_backend->checkEmptySecondaryText( update ); } bool Scripting::SubtitleLine::checkUntranslatedText( bool update ) { return m_backend->checkUntranslatedText( update ); } bool Scripting::SubtitleLine::checkOverlapsWithNext( bool update ) { return m_backend->checkOverlapsWithNext( update ); } bool Scripting::SubtitleLine::checkMinDuration( int minMsecs, bool update ) { return m_backend->checkMinDuration( minMsecs, update ); } bool Scripting::SubtitleLine::checkMaxDuration( int maxMsecs, bool update ) { return m_backend->checkMaxDuration( maxMsecs, update ); } bool Scripting::SubtitleLine::checkMinDurationPerPrimaryChar( int minMsecsPerChar, bool update ) { return m_backend->checkMinDurationPerPrimaryChar( minMsecsPerChar, update ); } bool Scripting::SubtitleLine::checkMinDurationPerSecondaryChar( int minMsecsPerChar, bool update ) { return m_backend->checkMinDurationPerSecondaryChar( minMsecsPerChar, update ); } bool Scripting::SubtitleLine::checkMaxDurationPerPrimaryChar( int maxMsecsPerChar, bool update ) { return m_backend->checkMaxDurationPerPrimaryChar( maxMsecsPerChar, update ); } bool Scripting::SubtitleLine::checkMaxDurationPerSecondaryChar( int maxMsecsPerChar, bool update ) { return m_backend->checkMaxDurationPerSecondaryChar( maxMsecsPerChar, update ); } bool Scripting::SubtitleLine::checkMaxPrimaryChars( int maxCharacters, bool update ) { return m_backend->checkMaxPrimaryChars( maxCharacters, update ); } bool Scripting::SubtitleLine::checkMaxSecondaryChars( int maxCharacters, bool update ) { return m_backend->checkMaxSecondaryChars( maxCharacters, update ); } bool Scripting::SubtitleLine::checkMaxPrimaryLines( int maxLines, bool update ) { return m_backend->checkMaxPrimaryLines( maxLines, update ); } bool Scripting::SubtitleLine::checkMaxSecondaryLines( int maxLines, bool update ) { return m_backend->checkMaxSecondaryLines( maxLines, update ); } bool Scripting::SubtitleLine::checkPrimaryUnneededSpaces( bool update ) { return m_backend->checkPrimaryUnneededSpaces( update ); } bool Scripting::SubtitleLine::checkSecondaryUnneededSpaces( bool update ) { return m_backend->checkSecondaryUnneededSpaces( update ); } bool Scripting::SubtitleLine::checkPrimaryCapitalAfterEllipsis( bool update ) { return m_backend->checkPrimaryCapitalAfterEllipsis( update ); } bool Scripting::SubtitleLine::checkSecondaryCapitalAfterEllipsis( bool update ) { return m_backend->checkSecondaryCapitalAfterEllipsis( update ); } bool Scripting::SubtitleLine::checkPrimaryUnneededDash( bool update ) { return m_backend->checkPrimaryUnneededDash( update ); } bool Scripting::SubtitleLine::checkSecondaryUnneededDash( bool update ) { return m_backend->checkSecondaryUnneededDash( update ); } int Scripting::SubtitleLine::check( int errorFlagsToCheck, int minDuration, int maxDuration, int minDurationPerChar, int maxDurationPerChar, int maxChars, int maxLines, bool update ) { return m_backend->check( errorFlagsToCheck, minDuration, maxDuration, minDurationPerChar, maxDurationPerChar, maxChars, maxLines, update ); } #include "scripting_subtitleline.moc" subtitlecomposer-0.5.3/src/main/scripting/scripting_range.h0000644000175000001440000000400311206310204023357 0ustar sergiousers#ifndef SCRIPTING_RANGE_H #define SCRIPTING_RANGE_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../core/range.h" #include namespace SubtitleComposer { namespace Scripting { class Range : public QObject { Q_OBJECT public slots: int start() const; int end() const; int length() const; bool contains( int index ) const; bool contains( const QObject* range ) const; private: friend class RangesModule; friend class RangeList; friend class Subtitle; Range( const SubtitleComposer::Range& range, QObject* parent ); SubtitleComposer::Range m_backend; }; } } #endif subtitlecomposer-0.5.3/src/main/scripting/scriptsmanager.cpp0000644000175000001440000004126211206401162023572 0ustar sergiousers /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "scriptsmanager.h" #include "scripting_rangesmodule.h" #include "scripting_stringsmodule.h" #include "scripting_subtitlemodule.h" #include "scripting_subtitlelinemodule.h" #include "../application.h" #include "../actions/useraction.h" #include "../actions/useractionnames.h" #include "../dialogs/inputdialog.h" #include "../../common/fileloadhelper.h" #include "../../common/filetrasher.h" #include "../../widgets/treeview.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace SubtitleComposer { class InstalledScriptsModel : public QStringListModel { public: InstalledScriptsModel( QObject* parent=0 ):QStringListModel( parent ) {} virtual ~InstalledScriptsModel() {} virtual QVariant headerData( int /*section*/, Qt::Orientation orientation, int role ) const { if ( role != Qt::DisplayRole || orientation == Qt::Vertical ) return QVariant(); return i18n( "Installed Scripts" ); } virtual Qt::ItemFlags flags( const QModelIndex& index ) const { return QAbstractItemModel::flags( index ); } }; } using namespace SubtitleComposer; Debug::Debug() {} Debug::~Debug() {} void Debug::information( const QString& message ) { KMessageBox::information( app()->mainWindow(), message, i18n( "Information" ) ); kDebug() << message; } void Debug::warning( const QString& message ) { KMessageBox::sorry( app()->mainWindow(), message, i18n( "Warning" ) ); kWarning() << message; } void Debug::error( const QString& message ) { KMessageBox::error( app()->mainWindow(), message, i18n( "Error" ) ); kWarning() << message; } ScriptsManager::ScriptsManager( QObject* parent ): QObject( parent ) { //kDebug() << "KROSS interpreters:" << Kross::Manager::self().interpreters(); KGlobal::dirs()->addResourceType( "script", "appdata", "scripts" ); m_dialog = new KDialog( app()->mainWindow() ); m_dialog->setCaption( i18n( "Scripts Manager" ) ); m_dialog->setButtons( 0 ); m_dialog->setMainWidget( new QWidget( m_dialog ) ); QWidget* mainWidget = m_dialog->mainWidget(); m_scriptsWidget = new TreeView( mainWidget ); m_scriptsWidget->installEventFilter( this ); m_scriptsWidget->setModel( new InstalledScriptsModel ); m_scriptsWidget->setRootIsDecorated( false ); m_scriptsWidget->setSortingEnabled( false ); QWidget* buttonsWidget = new QWidget( mainWidget ); KPushButton* createScriptButton = new KPushButton( buttonsWidget ); createScriptButton->setText( i18n( "Create..." ) ); createScriptButton->setWhatsThis( i18n( "Creates a new script file." ) ); createScriptButton->setIcon( KIcon( "document-new" ) ); connect( createScriptButton, SIGNAL( clicked() ), this, SLOT( createScript() ) ); KPushButton* addScriptButton = new KPushButton( buttonsWidget ); addScriptButton->setText( i18n( "Add..." ) ); addScriptButton->setWhatsThis( i18n( "Copies an existing script from a specified location." ) ); addScriptButton->setIcon( KIcon( "document-open" ) ); connect( addScriptButton, SIGNAL( clicked() ), this, SLOT( addScript() ) ); KPushButton* removeScriptButton = new KPushButton( buttonsWidget ); removeScriptButton->setText( i18n( "Remove" ) ); removeScriptButton->setWhatsThis( i18n( "Sends the selected script to the trash." ) ); removeScriptButton->setIcon( KIcon( "user-trash" ) ); connect( removeScriptButton, SIGNAL( clicked() ), this, SLOT( removeScript() ) ); KPushButton* editScriptButton = new KPushButton( buttonsWidget ); editScriptButton->setText( i18n( "Edit" ) ); editScriptButton->setWhatsThis( i18n( "Opens the selected script with an external editor." ) ); editScriptButton->setIcon( KIcon( "document-edit" ) ); connect( editScriptButton, SIGNAL( clicked() ), this, SLOT( editScript() ) ); m_runScriptButton = new KPushButton( buttonsWidget ); m_runScriptButton->setEnabled( false ); m_runScriptButton->setText( i18n( "Run" ) ); m_runScriptButton->setWhatsThis( i18n( "Executes the selected script." ) ); m_runScriptButton->setIcon( KIcon( "media-playback-start" ) ); connect( m_runScriptButton, SIGNAL( clicked() ), this, SLOT( runScript() ) ); KPushButton* reloadScriptsButton = new KPushButton( buttonsWidget ); reloadScriptsButton->setText( i18n( "Refresh" ) ); reloadScriptsButton->setWhatsThis( i18n( "Reloads the installed scripts list." ) ); reloadScriptsButton->setIcon( KIcon( "view-refresh" ) ); connect( reloadScriptsButton, SIGNAL( clicked() ), this, SLOT( reloadScripts() ) ); QGridLayout* buttonsLayout = new QGridLayout( buttonsWidget ); buttonsLayout->setContentsMargins( 0, 0, 0, 0 ); buttonsLayout->addWidget( createScriptButton, 0, 0 ); buttonsLayout->addWidget( addScriptButton, 1, 0 ); buttonsLayout->addWidget( removeScriptButton, 2, 0 ); buttonsLayout->addWidget( editScriptButton, 3, 0 ); buttonsLayout->addWidget( new KSeparator( mainWidget ), 4, 0 ); buttonsLayout->addWidget( m_runScriptButton, 5, 0 ); buttonsLayout->addWidget( new KSeparator( mainWidget ), 6, 0 ); buttonsLayout->addWidget( reloadScriptsButton, 7, 0 ); buttonsLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ), 8, 0 ); QGridLayout* mainLayout = new QGridLayout( mainWidget ); mainLayout->setSpacing( 5 ); mainLayout->setContentsMargins( 0, 0, 0, 0 ); mainLayout->addWidget( m_scriptsWidget, 0, 0 ); mainLayout->addWidget( buttonsWidget, 0, 1 ); m_dialog->resize( 350, 10 ); } ScriptsManager::~ScriptsManager() { } void ScriptsManager::setSubtitle( Subtitle* subtitle ) { m_runScriptButton->setEnabled( subtitle != 0 ); } void ScriptsManager::showDialog() { m_dialog->show(); } QString ScriptsManager::currentScriptName() const { QModelIndex currentIndex = m_scriptsWidget->currentIndex(); return currentIndex.isValid() ? m_scriptsWidget->model()->data( currentIndex, Qt::DisplayRole ).toString() : 0; } QStringList ScriptsManager::scriptNames() const { return m_scripts.keys(); } void ScriptsManager::createScript( const QString& sN ) { QString scriptName = sN; while ( scriptName.isEmpty() || m_scripts.contains( scriptName ) ) { if ( m_scripts.contains( scriptName ) && KMessageBox::questionYesNo( app()->mainWindow(), i18n( "You must enter an unused name to continue.\nWould you like to enter another name?" ), i18n( "Name Already Used" ), KStandardGuiItem::cont(), KStandardGuiItem::cancel() ) != KMessageBox::Yes ) return; TextInputDialog nameDlg( i18n( "Create New Script" ), i18n( "Script name:" ) ); if ( nameDlg.exec() != QDialog::Accepted ) return; scriptName = nameDlg.value(); } QString scriptPath = KStandardDirs::locateLocal( "script", scriptName, true ); QFile scriptFile( scriptPath ); if ( ! scriptFile.open( QIODevice::WriteOnly|QIODevice::Text ) ) { KMessageBox::sorry( app()->mainWindow(), i18n( "There was an error creating the file %1.", scriptPath ) ); return; } QTextStream outputStream( &scriptFile ); QString scriptExtension = QFileInfo( scriptName ).suffix().toLower(); if ( scriptExtension == "rb" ) outputStream << "#!/usr/bin/env ruby"; else if ( scriptExtension == "py" ) outputStream << "#!/usr/bin/env python"; outputStream << "\n"; scriptFile.close(); reloadScripts(); editScript( scriptName ); } const QStringList& ScriptsManager::mimeTypes() { static QStringList mimeTypes; if ( mimeTypes.isEmpty() ) { QHash infos = Kross::Manager::self().interpreterInfos(); for ( QHash::ConstIterator it = infos.begin(), end = infos.end(); it != end; ++it ) { QStringList intMimeTypes = it.value()->mimeTypes(); for ( QStringList::ConstIterator it = intMimeTypes.begin(), end = intMimeTypes.end(); it != end; ++it ) mimeTypes << *it; } } return mimeTypes; } void ScriptsManager::addScript( const KUrl& sSU ) { KUrl srcScriptUrl = sSU; if ( srcScriptUrl.isEmpty() ) { KFileDialog fileDialog( KUrl(), QString(), m_dialog ); fileDialog.setCaption( i18n( "Select Existing Script" ) ); fileDialog.setOperationMode( KFileDialog::Opening ); fileDialog.setMimeFilter( mimeTypes() ); fileDialog.setMode( KFile::File|KFile::ExistingOnly ); fileDialog.setModal( true ); if ( QDialog::Accepted != fileDialog.exec() ) return; srcScriptUrl = fileDialog.selectedUrl(); } QString scriptName = QFileInfo( srcScriptUrl.fileName() ).fileName(); while ( m_scripts.contains( scriptName ) ) { if ( m_scripts.contains( scriptName ) && KMessageBox::questionYesNo( app()->mainWindow(), i18n( "You must enter an unused name to continue.\nWould you like to enter another name?" ), i18n( "Name Already Used" ), KStandardGuiItem::cont(), KStandardGuiItem::cancel() ) != KMessageBox::Yes ) return; TextInputDialog nameDlg( i18n( "Rename Script" ), i18n( "Script name:" ) ); if ( nameDlg.exec() != QDialog::Accepted ) return; scriptName = nameDlg.value(); } QString scriptPath = KStandardDirs::locateLocal( "script", scriptName, true ); FileLoadHelper fileLoadHelper( srcScriptUrl ); if ( ! fileLoadHelper.open() ) { KMessageBox::sorry( app()->mainWindow(), i18n( "There was an error opening the file %1.", srcScriptUrl.prettyUrl() ) ); return; } if ( ! fileLoadHelper.file()->copy( scriptPath ) ) { KMessageBox::sorry( app()->mainWindow(), i18n( "There was an error copying the file to %1.", scriptPath ) ); return; } reloadScripts(); } void ScriptsManager::removeScript( const QString& sN ) { QString scriptName = sN.isEmpty() ? currentScriptName() : sN; if ( scriptName.isEmpty() || ! m_scripts.contains( scriptName ) ) { kWarning() << "unknow script specified"; return; } if ( KMessageBox::warningContinueCancel( app()->mainWindow(), i18n( "Do you really want to send file %1 to the trash?", scriptName ), i18n( "Move to Trash" ) ) != KMessageBox::Continue ) return; if ( ! FileTrasher( m_scripts[scriptName] ).exec() ) { KMessageBox::sorry( app()->mainWindow(), i18n( "There was an error removing the file %1.", m_scripts[scriptName] ) ); return; } reloadScripts(); } void ScriptsManager::editScript( const QString& sN ) { QString scriptName = sN.isEmpty() ? currentScriptName() : sN; if ( scriptName.isEmpty() || ! m_scripts.contains( scriptName ) ) { kWarning() << "unknow script specified"; return; } if ( ! KRun::runUrl( KUrl( m_scripts[scriptName] ), "text/plain", app()->mainWindow(), false, false ) ) KMessageBox::sorry( app()->mainWindow(), i18n( "Could not launch external editor.\n" ) ); } void ScriptsManager::runScript( const QString& sN ) { if ( ! app()->subtitle() ) { kWarning() << "attempt to run script without a working subtitle"; return; } QString scriptName = sN; if ( scriptName.isEmpty() ) { scriptName = currentScriptName(); if ( scriptName.isEmpty() ) return; } if ( ! m_scripts.contains( scriptName ) ) { kWarning() << "unknow script file specified"; return; } Kross::Action krossAction( 0, "Kross::Action" ); Scripting::RangesModule* rangesModule = new Scripting::RangesModule; Scripting::StringsModule* stringsModule = new Scripting::StringsModule; Scripting::SubtitleModule* subtitleModule = new Scripting::SubtitleModule; Scripting::SubtitleLineModule* subtitleLineModule = new Scripting::SubtitleLineModule; Debug* debug = new Debug(); krossAction.addObject( rangesModule, "ranges" ); krossAction.addObject( stringsModule, "strings" ); krossAction.addObject( subtitleModule, "subtitle" ); krossAction.addObject( subtitleLineModule, "subtitleline" ); krossAction.addObject( debug, "debug" ); krossAction.setFile( m_scripts[scriptName] ); // default javascript interpreter has weird (crash inducing) bugs if ( krossAction.interpreter() == "javascript" ) krossAction.setInterpreter( "qtscript" ); { // everything done by the script will be undoable in a single step SubtitleCompositeActionExecutor executor( *(app()->subtitle()), scriptName ); // execute the script file krossAction.trigger(); } delete rangesModule; delete stringsModule; delete subtitleModule; delete subtitleLineModule; delete debug; if ( krossAction.hadError() ) { if( krossAction.errorTrace().isNull() ) KMessageBox::error( app()->mainWindow(), krossAction.errorMessage(), i18n( "Error Running Script" ) ); else KMessageBox::detailedError( app()->mainWindow(), krossAction.errorMessage(), krossAction.errorTrace(), i18n( "Error Running Script" ) ); } } QMenu* ScriptsManager::toolsMenu() { static QMenu* toolsMenu = 0; if ( ! toolsMenu ) { toolsMenu = app()->mainWindow()->findChild( "tools" ); if ( ! toolsMenu ) { toolsMenu = app()->mainWindow()->menuBar()->addMenu( i18n( "Tools" ) ); toolsMenu->setObjectName( "tools" ); } connect( toolsMenu, SIGNAL( triggered( QAction* ) ), this, SLOT( onToolsMenuActionTriggered( QAction* ) ) ); } return toolsMenu; } void ScriptsManager::reloadScripts() { QMenu* toolsMenu = ScriptsManager::toolsMenu(); KActionCollection* actionCollection = app()->mainWindow()->actionCollection(); UserActionManager* actionManager = UserActionManager::instance(); QString selectedPath = m_scriptsWidget->model()->rowCount() && ! currentScriptName().isEmpty() ? m_scripts[currentScriptName()] : QString(); m_scripts.clear(); // deletes all actions toolsMenu->clear(); toolsMenu->addAction( app()->action( ACT_SCRIPTS_MANAGER ) ); toolsMenu->addSeparator(); QStringList scriptNames; QStringList scriptPaths = KGlobal::dirs()->findAllResources( "script" ); scriptPaths.sort(); int index = 0, newCurrentIndex = -1; for ( QStringList::ConstIterator it = scriptPaths.begin(), end = scriptPaths.end(); it != end; ++it ) { QString scriptName = QFileInfo( *it ).fileName(); if ( ! m_scripts.contains( scriptName ) ) { scriptNames << scriptName; if ( newCurrentIndex < 0 && *it == selectedPath ) newCurrentIndex = index; m_scripts[scriptName] = *it; QAction* scriptAction = toolsMenu->addAction( scriptName ); scriptAction->setObjectName( scriptName ); actionCollection->addAction( scriptName, scriptAction ); actionManager->addAction( scriptAction, UserAction::SubOpened|UserAction::FullScreenOff ); index++; } } static_cast( m_scriptsWidget->model() )->setStringList( scriptNames ); if ( ! scriptNames.isEmpty() ) { QModelIndex currentIndex = m_scriptsWidget->model()->index( newCurrentIndex < 0 ? 0 : newCurrentIndex, 0 ); m_scriptsWidget->setCurrentIndex( currentIndex ); } } void ScriptsManager::onToolsMenuActionTriggered( QAction* triggeredAction ) { if ( triggeredAction == app()->action( ACT_SCRIPTS_MANAGER ) ) return; runScript( triggeredAction->objectName() ); } bool ScriptsManager::eventFilter( QObject* object, QEvent* event ) { if ( object == m_scriptsWidget ) { if ( event->type() == QEvent::KeyPress ) { QKeyEvent* keyEvent = static_cast( event ); if ( keyEvent->matches( QKeySequence::Delete ) ) { removeScript(); return true; // eat event } } } return QObject::eventFilter( object, event ); } #include "scriptsmanager.moc" subtitlecomposer-0.5.3/src/main/scripting/scripting_range.cpp0000644000175000001440000000421011153105275023725 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "scripting_range.h" using namespace SubtitleComposer; /// RANGE IMPLEMENTATION /// ==================== Scripting::Range::Range( const SubtitleComposer::Range& range, QObject* parent ): QObject( parent ), m_backend( range ) { } int Scripting::Range::start() const { return m_backend.start(); } int Scripting::Range::end() const { return m_backend.end(); } int Scripting::Range::length() const { return m_backend.length(); } bool Scripting::Range::contains( int index ) const { return m_backend.contains( index ); } bool Scripting::Range::contains( const QObject* object ) const { if ( const Scripting::Range* range = qobject_cast( object ) ) return m_backend.contains( range->m_backend ); else return false; } #include "scripting_range.moc" subtitlecomposer-0.5.3/src/main/scripting/scripting_list.cpp0000644000175000001440000000612411206335766023623 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "scripting_list.h" using namespace SubtitleComposer; Scripting::List::List( const char* contentClass, QObject* parent ): QObject( parent ), m_contentClass( contentClass ) { } Scripting::List::List( const QList& backend, const char* contentClass, QObject* parent ): QObject( parent ), m_contentClass( contentClass ), m_backend( backend ) { } bool Scripting::List::isEmpty() const { return m_backend.isEmpty(); } int Scripting::List::length() const { return m_backend.count(); } int Scripting::List::count() const { return m_backend.count(); } int Scripting::List::size() const { return m_backend.size(); } QObject* Scripting::List::at( int index ) const { if ( index < 0 || index >= m_backend.count() ) return 0; return m_backend.at( index ); } void Scripting::List::insert( int index, QObject* object ) { if ( ! object || index < 0 || index > m_backend.count() || strcmp( object->metaObject()->className(), m_contentClass ) ) return; m_backend.insert( index, object ); } void Scripting::List::append( QObject* object ) { if ( ! object || strcmp( object->metaObject()->className(), m_contentClass ) ) return; m_backend.append( object ); } void Scripting::List::prepend( QObject* object ) { if ( object && ! strcmp( object->metaObject()->className(), m_contentClass ) ) m_backend.prepend( object ); } void Scripting::List::removeFirst() { if ( ! m_backend.isEmpty() ) return m_backend.removeFirst(); } void Scripting::List::removeLast() { if ( ! m_backend.isEmpty() ) m_backend.removeLast(); } void Scripting::List::removeAt( int index ) { if ( index >= 0 && index < m_backend.count() ) m_backend.removeAt( index ); } void Scripting::List::clear() { m_backend.clear(); } #include "scripting_list.moc" subtitlecomposer-0.5.3/src/main/scripting/scripting_subtitlelinemodule.cpp0000644000175000001440000000312711206334466026555 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "scripting_subtitlelinemodule.h" #include using namespace SubtitleComposer; Scripting::SubtitleLineModule::SubtitleLineModule( QObject* parent ): QObject( parent ) { } #include "scripting_subtitlelinemodule.moc" subtitlecomposer-0.5.3/src/main/scripting/scriptsmanager.h0000644000175000001440000000555111206400677023252 0ustar sergiousers#ifndef SCRIPTSMANAGER_H #define SCRIPTSMANAGER_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include class QAction; class QMenu; class TreeView; class KAction; class KDialog; class KPushButton; namespace SubtitleComposer { class Subtitle; class ScriptsManager : public QObject { Q_OBJECT public: explicit ScriptsManager( QObject* parent=0 ); virtual ~ScriptsManager(); QString currentScriptName() const; QStringList scriptNames() const; virtual bool eventFilter( QObject* object, QEvent* event ); public slots: void setSubtitle( Subtitle* subtitle=0 ); void showDialog(); void createScript( const QString& scriptName=QString() ); void addScript( const KUrl& srcScriptUrl=KUrl() ); void removeScript( const QString& scriptName=QString() ); void editScript( const QString& scriptName=QString() ); void runScript( const QString& scriptName=QString() ); void reloadScripts(); private: static const QStringList& mimeTypes(); QMenu* toolsMenu(); private slots: void onToolsMenuActionTriggered( QAction* action ); private: QMap m_scripts; // name => path TreeView* m_scriptsWidget; KPushButton* m_runScriptButton; KDialog* m_dialog; }; class Debug : public QObject { Q_OBJECT public: Debug(); ~Debug(); public slots: void information( const QString& message ); void warning( const QString& message ); void error( const QString& message ); }; } #endif subtitlecomposer-0.5.3/src/main/scripting/scripting_subtitlemodule.cpp0000644000175000001440000000352111206333227025675 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "scripting_subtitlemodule.h" #include "scripting_subtitle.h" #include "../application.h" using namespace SubtitleComposer; Scripting::SubtitleModule::SubtitleModule( QObject* parent ): QObject( parent ) { } QObject* Scripting::SubtitleModule::instance() { return app()->subtitle() ? new Scripting::Subtitle( app()->subtitle(), this ) : 0; } bool Scripting::SubtitleModule::translationMode() { return app()->translationMode(); } #include "scripting_subtitlemodule.moc" subtitlecomposer-0.5.3/src/main/scripting/scripting_stringsmodule.h0000644000175000001440000000415611206335766025217 0ustar sergiousers#ifndef SCRIPTING_STRINGSMODULE_H #define SCRIPTING_STRINGSMODULE_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../core/sstring.h" #include "scripting_list.h" #include #include namespace SubtitleComposer { namespace Scripting { class StringsModule : public QObject { Q_OBJECT Q_ENUMS( StyleFlag ) public: typedef enum { Bold = SubtitleComposer::SString::Bold, Italic = SubtitleComposer::SString::Italic, Underline = SubtitleComposer::SString::Underline, StrikeThrough = SubtitleComposer::SString::StrikeThrough, } StyleFlag; StringsModule( QObject* parent=0 ); public slots: QObject* newString( const QString& text=QString() ); }; } } #endif subtitlecomposer-0.5.3/src/main/scripting/scripting_subtitleline.h0000644000175000001440000001221411206333731025003 0ustar sergiousers#ifndef SCRIPTING_SUBTITLELINE_H #define SCRIPTING_SUBTITLELINE_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../core/subtitleline.h" #include #include namespace SubtitleComposer { namespace Scripting { class SubtitleLine : public QObject { Q_OBJECT public slots: /// NOTE: target defaults to an invalid value, which means using and operation /// defined default value, generaly dependant on translationMode value. /// Also, setSecondaryText is a noop is ! translationMode int number() const; int index() const; QObject* prevLine() const; QObject* nextLine() const; int primaryCharacters() const; int primaryWords() const; int primaryLines() const; QObject* primaryText() const; void setPrimaryText( const QObject* text ); QString plainPrimaryText() const; void setPlainPrimaryText( const QString& plainText ); QString richPrimaryText() const; void setRichPrimaryText( const QString& richText ); int secondaryCharacters() const; int secondaryWords() const; int secondaryLines() const; QObject* secondaryText() const; void setSecondaryText( const QObject* text ); QString plainSecondaryText() const; void setPlainSecondaryText( const QString& plainText ); QString richSecondaryText() const; void setRichSecondaryText( const QString& richText ); void breakText( int minLengthForBreak, int target=-1 ); void unbreakText( int target=-1 ); void simplifyTextWhiteSpace( int target=-1 ); /// all times or durations are specified in milliseconds int showTime() const; void setShowTime( int showTime ); int hideTime() const; void setHideTime( int hideTime ); int durationTime() const; void setDurationTime( int durationTime ); int autoDuration( int msecsPerChar, int msecsPerWord, int msecsPerLine, int calculationTarget=-1 ); void shiftTimes( int mseconds ); void adjustTimes( int shiftMseconds, double scaleFactor ); int errorCount() const; int errorFlags() const; void setErrorFlags( int errorFlags ); void setErrorFlags( int errorFlags, bool value ); bool checkEmptyPrimaryText( bool update=true ); bool checkEmptySecondaryText( bool update=true ); bool checkUntranslatedText( bool update=true ); bool checkOverlapsWithNext( bool update=true ); bool checkMinDuration( int minMsecs, bool update=true ); bool checkMaxDuration( int maxMsecs, bool update=true ); bool checkMinDurationPerPrimaryChar( int minMsecsPerChar, bool update=true ); bool checkMinDurationPerSecondaryChar( int minMsecsPerChar, bool update=true ); bool checkMaxDurationPerPrimaryChar( int maxMsecsPerChar, bool update=true ); bool checkMaxDurationPerSecondaryChar( int maxMsecsPerChar, bool update=true ); bool checkMaxPrimaryChars( int maxCharacters, bool update=true ); bool checkMaxSecondaryChars( int maxCharacters, bool update=true ); bool checkMaxPrimaryLines( int maxLines, bool update=true ); bool checkMaxSecondaryLines( int maxLines, bool update=true ); bool checkPrimaryUnneededSpaces( bool update=true ); bool checkSecondaryUnneededSpaces( bool update=true ); bool checkPrimaryCapitalAfterEllipsis( bool update=true ); bool checkSecondaryCapitalAfterEllipsis( bool update=true ); bool checkPrimaryUnneededDash( bool update=true ); bool checkSecondaryUnneededDash( bool update=true ); int check( int errorFlagsToCheck, int minDuration, int maxDuration, int minDurationPerChar, int maxDurationPerChar, int maxChars, int maxLines, bool update=true ); private: friend class Subtitle; SubtitleLine( SubtitleComposer::SubtitleLine* backend, QObject* parent=0 ); SubtitleComposer::SubtitleLine* m_backend; }; } } #endif subtitlecomposer-0.5.3/src/main/scripting/scripting_sstring.h0000644000175000001440000000747311206341372024004 0ustar sergiousers#ifndef SCRIPTING_SSTRING_H #define SCRIPTING_SSTRING_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../core/sstring.h" #include "scripting_list.h" #include #include namespace SubtitleComposer { namespace Scripting { class SString : public QObject { Q_OBJECT public slots: bool isEmpty() const; int count() const; int size() const; int length() const; QString plainText() const; void setPlainText( const QString& string, int styleFlags=0 ); QString richText() const; void setRichText( const QString& string ); const QChar charAt( int index ); void setCharAt( int index, const QChar& chr ); int styleFlagsAt( int index ) const; void setStyleFlagsAt( int index, int styleFlags ) const; int cummulativeStyleFlags() const; bool hasStyleFlags( int styleFlags ) const; void setStyleFlags( int index, int len, int styleFlags ); void setStyleFlags( int index, int len, int styleFlags, bool on ); void clear(); void truncate( int size ); QObject* insert( int index, QObject* str ); QObject* insertPlain( int index, const QString& str ); QObject* append( QObject* str ); QObject* appendPlain( const QString& str ); QObject* prepend( QObject* str ); QObject* prependPlain( const QString& str ); QObject* remove( int index, int len ); QObject* removeAll( const QString& str, bool regExp=false, bool caseSensitive=true ); QObject* replace( int index, int len, QObject* replacement ); QObject* replacePlain( int index, int len, const QString& replacement ); QObject* replaceAll( const QString& before, QObject* after, bool regExp=false, bool caseSensitive=true ); QObject* replaceAllPlain( const QString& before, const QString& after, bool regExp=false, bool caseSensitive=true ); List* split( const QString& sep, bool regExp, bool caseSensitive=true ) const; QObject* left( int len ) const; QObject* right( int len ) const; QObject* mid( int index, int len=-1 ) const; QObject* toLower() const; QObject* toUpper() const; QObject* simplified() const; QObject* trimmed() const; int compareTo( QObject* string ) const; int compareToPlain( const QString& string ) const; private: friend class StringsModule; friend class SubtitleLine; SString( const SubtitleComposer::SString& backend, QObject* parent ); SubtitleComposer::SString m_backend; }; } } #endif subtitlecomposer-0.5.3/src/main/scripting/scripting_rangelist.cpp0000644000175000001440000000717211206331165024631 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "scripting_rangelist.h" #include "scripting_range.h" #include "../application.h" #include "../lineswidget.h" using namespace SubtitleComposer; Scripting::RangeList::RangeList( const SubtitleComposer::RangeList& backend, QObject* parent ): QObject( parent ), m_backend( backend ) { } QObject* Scripting::RangeList::complement() const { return new Scripting::RangeList( m_backend.complement(), const_cast( this ) ); } QObject* Scripting::RangeList::range( int rangeIndex ) const { if ( rangeIndex < 0 || rangeIndex >= m_backend.rangesCount() ) return 0; return new Scripting::Range( m_backend.range( rangeIndex ), const_cast( this ) ); } bool Scripting::RangeList::contains( int index ) const { return m_backend.contains( index ); } bool Scripting::RangeList::isEmpty() const { return m_backend.isEmpty(); } int Scripting::RangeList::rangesCount() const { return m_backend.rangesCount(); } int Scripting::RangeList::indexesCount() const { return m_backend.indexesCount(); } int Scripting::RangeList::firstIndex() const { return m_backend.firstIndex(); } int Scripting::RangeList::lastIndex() const { return m_backend.lastIndex(); } void Scripting::RangeList::clear() { m_backend.clear(); } void Scripting::RangeList::trimToIndex( int index ) { m_backend.trimToIndex( index ); } void Scripting::RangeList::trimToRange( const QObject* object ) { if ( const Scripting::Range* range = qobject_cast( object ) ) m_backend.trimToRange( range->m_backend ); } QObject* Scripting::RangeList::addIndex( int index ) { if ( index >= 0 ) m_backend << SubtitleComposer::Range( index ); return this; } QObject* Scripting::RangeList::addRange( const QObject* object ) { if ( const Scripting::Range* range = qobject_cast( object ) ) m_backend << range->m_backend; return this; } void Scripting::RangeList::shiftIndexesForwards( int fromIndex, int delta, bool fillSplitGap ) { if ( fromIndex >= 0 && delta > 0 ) m_backend.shiftIndexesForwards( fromIndex, delta, fillSplitGap ); } void Scripting::RangeList::shiftIndexesBackwards( int fromIndex, int delta ) { if ( fromIndex >= 0 && delta > 0 ) m_backend.shiftIndexesBackwards( fromIndex, delta ); } #include "scripting_rangelist.moc" subtitlecomposer-0.5.3/src/main/scripting/scripting_subtitlemodule.h0000644000175000001440000000377611206333317025356 0ustar sergiousers#ifndef SCRIPTING_SUBTITLEMODULE_H #define SCRIPTING_SUBTITLEMODULE_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include "../../core/subtitle.h" namespace SubtitleComposer { namespace Scripting { class SubtitleModule : public QObject { Q_OBJECT Q_ENUMS( TextTarget ) public: typedef enum { Primary = SubtitleComposer::Subtitle::Primary, Secondary = SubtitleComposer::Subtitle::Secondary, Both = SubtitleComposer::Subtitle::Both, } TextTarget; SubtitleModule( QObject* parent=0 ); public slots: QObject* instance(); bool translationMode(); }; } } #endif subtitlecomposer-0.5.3/src/main/scripting/scripting_subtitle.h0000644000175000001440000001066011206332642024136 0ustar sergiousers#ifndef SCRIPTING_SUBTITLE_H #define SCRIPTING_SUBTITLE_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "scripting_subtitleline.h" #include "../../core/subtitle.h" #include "../../core/rangelist.h" #include namespace SubtitleComposer { class Subtitle; namespace Scripting { class Subtitle : public QObject { Q_OBJECT public slots: /// NOTE: target defaults to an invalid value, which means using and operation /// defined default value, generaly dependant on translationMode value. double framesPerSecond() const; void setFramesPerSecond( double framesPerSecond ); bool isEmpty() const; int linesCount() const; int lastIndex() const; QObject* firstLine(); QObject* lastLine(); QObject* line( int index ); void changeFramesPerSecond( double toFramesPerSecond, double fromFramesPerSecond=-1.0 ); SubtitleLine* insertNewLine( int index, bool timeAfter, int target=-1 ); void removeLine( int index, int target=-1 ); void removeLines( const QObject* ranges, int target=-1 ); void swapTexts( const QObject* ranges ); void splitLines( const QObject* ranges ); void joinLines( const QObject* ranges ); void shiftLines( const QObject* ranges, int msecs ); void adjustLines( const QObject* range, int firstTime, int lastTime ); void sortLines( const QObject* range ); void applyDurationLimits( const QObject* ranges, int minDuration, int maxDuration, bool canOverlap ); void setMaximumDurations( const QObject* ranges ); void setAutoDurations( const QObject* ranges, int msecsPerChar, int msecsPerWord, int msecsPerLine, bool canOverlap, int calculationTarget=-1 ); void fixOverlappingLines( const QObject* ranges, int minInterval=100 ); void fixPunctuation(const QObject* ranges, bool spaces, bool quotes, bool englishI, bool ellipsis, int target=-1); void lowerCase( const QObject* ranges, int target=-1 ); void upperCase( const QObject* ranges, int target=-1 ); void titleCase( const QObject* ranges, bool lowerFirst, int target=-1 ); void sentenceCase( const QObject* ranges, bool lowerFirst, int target=-1 ); void breakLines( const QObject* ranges, int minLengthForLineBreak, int target=-1 ); void unbreakTexts( const QObject* ranges, int target=-1 ); void simplifyTextWhiteSpace( const QObject* ranges, int target=-1 ); void setMarked( const QObject* ranges, bool value ); void clearErrors( const QObject* ranges, int errorFlags ); void checkErrors( const QObject* ranges, int errorFlags, int minDuration, int maxDuration, int minDurationPerChar, int maxDurationPerChar, int maxChars, int maxLines ); void recheckErrors( const QObject* ranges, int minDuration, int maxDuration, int minDurationPerChar, int maxDurationPerChar, int maxChars, int maxLines ); private: static SubtitleComposer::RangeList toRangesList( const QObject* object ); friend class SubtitleModule; Subtitle( SubtitleComposer::Subtitle* backend, QObject* parent ); SubtitleComposer::Subtitle* m_backend; }; } } #endif subtitlecomposer-0.5.3/src/main/scripting/scripting_rangelist.h0000644000175000001440000000464011206333345024275 0ustar sergiousers#ifndef SCRIPTING_RANGELIST_H #define SCRIPTING_RANGELIST_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../core/rangelist.h" #include namespace SubtitleComposer { namespace Scripting { class RangeList : public QObject { Q_OBJECT public slots: QObject* complement() const; bool isEmpty() const; int rangesCount() const; int indexesCount() const; int firstIndex() const; int lastIndex() const; QObject* range( int rangeIndex ) const; bool contains( int index ) const; void clear(); void trimToIndex( int index ); void trimToRange( const QObject* range ); QObject* addIndex( int index ); QObject* addRange( const QObject* range ); void shiftIndexesForwards( int fromIndex, int delta, bool fillSplitGap ); void shiftIndexesBackwards( int fromIndex, int delta ); private: friend class RangesModule; friend class Subtitle; RangeList( const SubtitleComposer::RangeList& backend, QObject* parent ); SubtitleComposer::RangeList m_backend; }; } } #endif subtitlecomposer-0.5.3/src/main/scripting/scripting_sstring.cpp0000644000175000001440000002150211206341603024321 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "scripting_sstring.h" #include using namespace SubtitleComposer; Scripting::SString::SString( const SubtitleComposer::SString& backend, QObject* parent ): QObject( parent ), m_backend( backend ) { } bool Scripting::SString::isEmpty() const { return m_backend.isEmpty(); } int Scripting::SString::length() const { return m_backend.length(); } int Scripting::SString::count() const { return m_backend.length(); } int Scripting::SString::size() const { return m_backend.length(); } QString Scripting::SString::plainText() const { return m_backend.string(); } void Scripting::SString::setPlainText( const QString& string, int styleFlags ) { m_backend.setString( string, styleFlags ); } QString Scripting::SString::richText() const { return m_backend.richString(); } void Scripting::SString::setRichText( const QString& string ) { m_backend.setRichString( string ); } const QChar Scripting::SString::charAt( int index ) { if ( index < 0 || index >= m_backend.count() ) return '\0'; return m_backend.at( index ); } void Scripting::SString::setCharAt( int index, const QChar& chr ) { if ( index >= 0 && index < m_backend.count() ) m_backend[index] = chr; } int Scripting::SString::styleFlagsAt( int index ) const { if ( index < 0 || index >= m_backend.count() ) return 0; return m_backend.styleFlagsAt( index ); } void Scripting::SString::setStyleFlagsAt( int index, int styleFlags ) const { if ( index >= 0 && index < m_backend.count() ) m_backend.setStyleFlagsAt( index, styleFlags ); } int Scripting::SString::cummulativeStyleFlags() const { return m_backend.cummulativeStyleFlags(); } bool Scripting::SString::hasStyleFlags( int styleFlags ) const { return m_backend.hasStyleFlags( styleFlags ); } void Scripting::SString::setStyleFlags( int index, int len, int styleFlags ) { if ( index < 0 || index >= m_backend.count() ) return; m_backend.setStyleFlags( index, len, styleFlags ); } void Scripting::SString::setStyleFlags( int index, int len, int styleFlags, bool on ) { if ( index < 0 || index >= m_backend.count() ) return; m_backend.setStyleFlags( index, len, styleFlags, on ); } void Scripting::SString::clear() { m_backend.clear(); } void Scripting::SString::truncate( int size ) { if ( size >= 0 ) m_backend.truncate( size ); } QObject* Scripting::SString::insert( int index, QObject* object ) { if ( index >= 0 && index <= m_backend.count() ) { if ( const Scripting::SString* str = qobject_cast( object ) ) m_backend.insert( index, str->m_backend ); } return this; } QObject* Scripting::SString::insertPlain( int index, const QString& str ) { if ( index >= 0 && index <= m_backend.count() ) m_backend.insert( index, str ); return this; } QObject* Scripting::SString::append( QObject* object ) { if ( const Scripting::SString* str = qobject_cast( object ) ) m_backend.append( str->m_backend ); return this; } QObject* Scripting::SString::appendPlain( const QString& str ) { m_backend.append( str ); return this; } QObject* Scripting::SString::prepend( QObject* object ) { if ( const Scripting::SString* str = qobject_cast( object ) ) m_backend.prepend( str->m_backend ); return this; } QObject* Scripting::SString::prependPlain( const QString& str ) { m_backend.prepend( str ); return this; } QObject* Scripting::SString::remove( int index, int len ) { if ( index >= 0 && index < m_backend.count() ) m_backend.remove( index, len ); return this; } QObject* Scripting::SString::removeAll( const QString& str, bool regExp, bool caseSensitive ) { if ( regExp ) m_backend.remove( QRegExp( str, caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive ) ); else m_backend.remove( str, caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive ); return this; } QObject* Scripting::SString::replace( int index, int len, QObject* object ) { if ( const Scripting::SString* replacement = qobject_cast( object ) ) { if ( index >= 0 && index < m_backend.count() ) m_backend.replace( index, len, replacement->m_backend ); } return this; } QObject* Scripting::SString::replacePlain( int index, int len, const QString& replacement ) { if ( index >= 0 && index < m_backend.count() ) m_backend.replace( index, len, replacement ); return this; } QObject* Scripting::SString::replaceAll( const QString& before, QObject* object, bool regExp, bool caseSensitive ) { if ( const Scripting::SString* after = qobject_cast( object ) ) { if ( regExp ) m_backend.replace( QRegExp( before, caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive ), after->m_backend ); else m_backend.replace( before, after->m_backend, caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive ); } return this; } QObject* Scripting::SString::replaceAllPlain( const QString& before, const QString& after, bool regExp, bool caseSensitive ) { if ( regExp ) m_backend.replace( QRegExp( before, caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive ), after ); else m_backend.replace( before, after, caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive ); return this; } Scripting::List* Scripting::SString::split( const QString& sep, bool regExp, bool caseSensitive ) const { SStringList tokens; if ( regExp ) tokens = m_backend.split( QRegExp( sep, caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive ), QString::KeepEmptyParts ); else tokens = m_backend.split( sep, QString::KeepEmptyParts, caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive ); Scripting::SString* parent = const_cast( this ); QList list; for ( SStringList::ConstIterator it = tokens.begin(), end = tokens.end(); it != end; ++it ) list.append( new Scripting::SString( *it, parent ) ); return new Scripting::List( list, Scripting::SString::staticMetaObject.className(), parent ); } QObject* Scripting::SString::left( int len ) const { return new SString( m_backend.left( len ), const_cast( this ) ); } QObject* Scripting::SString::right( int len ) const { return new SString( m_backend.right( len ), const_cast( this ) ); } QObject* Scripting::SString::mid( int index, int len ) const { if ( index < 0 || index >= m_backend.count() ) return new SString( SubtitleComposer::SString(), const_cast( this ) ); return new SString( m_backend.mid( index, len ), const_cast( this ) ); } QObject* Scripting::SString::toLower() const { return new SString( m_backend.toLower(), const_cast( this ) ); } QObject* Scripting::SString::toUpper() const { return new SString( m_backend.toUpper(), const_cast( this ) ); } QObject* Scripting::SString::simplified() const { return new SString( m_backend.simplified(), const_cast( this ) ); } QObject* Scripting::SString::trimmed() const { return new SString( m_backend.trimmed(), const_cast( this ) ); } int Scripting::SString::compareTo( QObject* object ) const { const Scripting::SString* string = qobject_cast( object ); if ( ! string ) return -2; if ( m_backend < string->m_backend ) return -1; else if ( m_backend == string->m_backend ) return 0; else return 1; } int Scripting::SString::compareToPlain( const QString& string ) const { if ( m_backend < string ) return -1; else if ( m_backend == string ) return 0; else return 1; } #include "scripting_sstring.moc" subtitlecomposer-0.5.3/src/main/scripting/scripting_subtitlelinemodule.h0000644000175000001440000001024311206334422026207 0ustar sergiousers#ifndef SCRIPTING_SUBTITLELINEMODULE_H #define SCRIPTING_SUBTITLELINEMODULE_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../core/subtitleline.h" #include namespace SubtitleComposer { namespace Scripting { class SubtitleLineModule : public QObject { Q_OBJECT Q_ENUMS( TextTarget ) Q_ENUMS( ErrorFlag ) public: typedef enum { Primary = SubtitleComposer::SubtitleLine::Primary, Secondary = SubtitleComposer::SubtitleLine::Secondary, Both = SubtitleComposer::SubtitleLine::Both } TextTarget; typedef enum { EmptyPrimaryText = SubtitleComposer::SubtitleLine::EmptyPrimaryText, EmptySecondaryText = SubtitleComposer::SubtitleLine::EmptySecondaryText, MaxPrimaryChars = SubtitleComposer::SubtitleLine::MaxPrimaryChars, MaxSecondaryChars = SubtitleComposer::SubtitleLine::MaxSecondaryChars, MaxPrimaryLines = SubtitleComposer::SubtitleLine::MaxPrimaryLines, MaxSecondaryLines = SubtitleComposer::SubtitleLine::MaxSecondaryLines, PrimaryUnneededSpaces = SubtitleComposer::SubtitleLine::PrimaryUnneededSpaces, SecondaryUnneededSpaces = SubtitleComposer::SubtitleLine::SecondaryUnneededSpaces, PrimaryUnneededDash = SubtitleComposer::SubtitleLine::PrimaryUnneededDash, SecondaryUnneededDash = SubtitleComposer::SubtitleLine::SecondaryUnneededDash, PrimaryCapitalAfterEllipsis = SubtitleComposer::SubtitleLine::PrimaryCapitalAfterEllipsis, SecondaryCapitalAfterEllipsis = SubtitleComposer::SubtitleLine::SecondaryCapitalAfterEllipsis, MinDurationPerPrimaryChar = SubtitleComposer::SubtitleLine::MinDurationPerPrimaryChar, MinDurationPerSecondaryChar = SubtitleComposer::SubtitleLine::MinDurationPerSecondaryChar, MaxDurationPerPrimaryChar = SubtitleComposer::SubtitleLine::MaxDurationPerPrimaryChar, MaxDurationPerSecondaryChar = SubtitleComposer::SubtitleLine::MaxDurationPerSecondaryChar, MinDuration = SubtitleComposer::SubtitleLine::MinDuration, MaxDuration = SubtitleComposer::SubtitleLine::MaxDuration, OverlapsWithNext = SubtitleComposer::SubtitleLine::OverlapsWithNext, UntranslatedText = SubtitleComposer::SubtitleLine::UntranslatedText, UserMark = SubtitleComposer::SubtitleLine::UserMark, PrimaryOnlyErrors = SubtitleComposer::SubtitleLine::PrimaryOnlyErrors, SecondaryOnlyErrors = SubtitleComposer::SubtitleLine::SecondaryOnlyErrors, SharedErrors = SubtitleComposer::SubtitleLine::SharedErrors, AllErrors = SubtitleComposer::SubtitleLine::AllErrors, TimesErrors = SubtitleComposer::SubtitleLine::TimesErrors, TextErrors = SubtitleComposer::SubtitleLine::TextErrors, } ErrorFlag; SubtitleLineModule( QObject* parent=0 ); }; } } #endif subtitlecomposer-0.5.3/src/main/scripting/scripting_stringsmodule.cpp0000644000175000001440000000336311206332576025545 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "scripting_stringsmodule.h" #include "scripting_sstring.h" #include using namespace SubtitleComposer; Scripting::StringsModule::StringsModule( QObject* parent ): QObject( parent ) { } QObject* Scripting::StringsModule::newString( const QString& text ) { return new SString( SubtitleComposer::SString( text ), this ); } #include "scripting_stringsmodule.moc" subtitlecomposer-0.5.3/src/main/scripting/scripting_list.h0000644000175000001440000000432511206335617023264 0ustar sergiousers#ifndef SCRIPTING_LIST_H #define SCRIPTING_LIST_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include namespace SubtitleComposer { namespace Scripting { class List : public QObject { Q_OBJECT public: List( const char* contentClass, QObject* parent ); List( const QList& backend, const char* contentClass, QObject* parent ); public slots: bool isEmpty() const; int length() const; int size() const; int count() const; QObject* at( int index ) const; void insert( int index, QObject* object ); void append( QObject* object ); void prepend( QObject* object ); void removeFirst(); void removeLast(); void removeAt( int index ); void clear(); private: const char* m_contentClass; QList m_backend; }; } } #endif subtitlecomposer-0.5.3/src/main/scripting/scripting_rangesmodule.h0000644000175000001440000000375011206334773025001 0ustar sergiousers#ifndef SCRIPTING_RANGESMODULE_H #define SCRIPTING_RANGESMODULE_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include namespace SubtitleComposer { namespace Scripting { class RangesModule : public QObject { Q_OBJECT public: RangesModule( QObject* parent=0 ); public slots: QObject* newRange( int firstIndex, int lastIndex ); QObject* newLowerRange( int index ); QObject* newUpperRange( int index ); QObject* newUptoLastSelectedRange(); QObject* newFromFirstSelectedRange(); QObject* newEmptyRangeList(); QObject* newSelectionRangeList(); }; } } #endif subtitlecomposer-0.5.3/src/main/scripting/examples/0000755000175000001440000000000011206423743021666 5ustar sergiouserssubtitlecomposer-0.5.3/src/main/scripting/examples/CMakeLists.txt0000644000175000001440000000043211206350033024414 0ustar sergiousersADD_SUBDIRECTORY( api ) FILE( GLOB ruby_examples *.rb ) FILE( GLOB python_examples *.rb ) FILE( GLOB javascript_examples *.js ) INSTALL( FILES ${ruby_examples} ${python_examples} ${javascript_examples} README DESTINATION ${DATA_INSTALL_DIR}/subtitlecomposer/scripts ) subtitlecomposer-0.5.3/src/main/scripting/examples/example_capitalize_all_lines.rb0000644000175000001440000000203711206414723030075 0ustar sergiousers#!/usr/bin/env ruby # Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. require "ranges" require "subtitle" subtitle = Subtitle.instance() for line_index in 0..subtitle.linesCount()-1 line = subtitle.line( line_index ) text = line.primaryText() line.setPrimaryText( text.left( 1 ).toUpper().append( text.mid( 1 ) ) ) end subtitlecomposer-0.5.3/src/main/scripting/examples/example_trim_to_selection.rb0000644000175000001440000000162611206414707027455 0ustar sergiousers#!/usr/bin/env ruby # Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. require "ranges" require "subtitle" Subtitle.instance().removeLines( Ranges.newSelectionRangeList().complement() ) subtitlecomposer-0.5.3/src/main/scripting/examples/README0000644000175000001440000000333011206407375022550 0ustar sergiousersSUBTITLE COMPOSER SCRIPTING README ================================== There's currently no real documentation but the examples and the included API (see 'api' directory) should give you enough information to get started. Besides the corresponding interpreter framework and Kross defined modules (i18n, forms, etc.), scripts can access some modules specific to Subtitle Composer that provide methods to access global objects, enum values and/or create other objects: ranges: contains methods to create ranges and ranges lists, including a range list describing the current selection ranges. strings: contains only one method for creating styled string objects and provides access to the StyleFlag enum values, used to get/set styling information (see SString class *StyleFlag* methods). subtitle: contains methods to access the subtitle instance and query the translation mode state (true when there's an open translation, false otherwise). It also provides access to TextTarget enum values, used to specify the target (primary text, secondary text/translation, or both) in subtitle operations that modify text (i.e., lowerCase(...) or breakLines(...) methods). subtitleline: provides access to the ErrorFlag enum values, used to specify errors bits in error manipulation methods on both Subtitle and SubtitleLine classes. debug: contains three functions (information, warning and error) that can be used while debuging scripts Using these modules you can access objects to do pretty much anything the main application can do. Included are some basic examples showcasing some of the things you can do. If you have other scripts you consider worth sharing then send them to me and I'll consider them for inclusion with the program. subtitlecomposer-0.5.3/src/main/scripting/examples/example_capitalize_all_lines.py0000644000175000001440000000204211206414646030122 0ustar sergiousers#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. import ranges import subtitle s = subtitle.instance() for line_index in range( 0, s.linesCount() ): line = s.line( line_index ) text = line.primaryText() line.setPrimaryText( text.left( 1 ).toUpper().append( text.mid( 1 ) ) ) subtitlecomposer-0.5.3/src/main/scripting/examples/example_remove_impair_lines.py0000644000175000001440000000201511206414670030000 0ustar sergiousers#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. import subtitle s = subtitle.instance() reversed_indexes = range( 0, s.linesCount() ); reversed_indexes.reverse() for line_index in reversed_indexes: if ( line_index % 2 == 0 ): s.removeLine( line_index ) subtitlecomposer-0.5.3/src/main/scripting/examples/example_remove_impair_lines.rb0000644000175000001440000000172711206414713027762 0ustar sergiousers#!/usr/bin/env ruby # Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. require "subtitle" subtitle = Subtitle.instance() for line_index in (0..subtitle.linesCount()-1).to_a().reverse() subtitle.removeLine( line_index ) if ( line_index % 2 == 0 ) end subtitlecomposer-0.5.3/src/main/scripting/examples/api/0000755000175000001440000000000011206423743022437 5ustar sergiouserssubtitlecomposer-0.5.3/src/main/scripting/examples/api/CMakeLists.txt0000644000175000001440000000020311206341776025177 0ustar sergiousersFILE( GLOB header_files *.h ) INSTALL( FILES ${header_files} DESTINATION ${DATA_INSTALL_DIR}/subtitlecomposer/scripts/api ) subtitlecomposer-0.5.3/src/main/scripting/examples/api/scripting_range.h0000777000175000001440000000000011206423673031742 2../../scripting_range.hustar sergiouserssubtitlecomposer-0.5.3/src/main/scripting/examples/api/scripting_stringsmodule.h0000777000175000001440000000000011206423673035350 2../../scripting_stringsmodule.hustar sergiouserssubtitlecomposer-0.5.3/src/main/scripting/examples/api/scripting_subtitleline.h0000777000175000001440000000000011206423673034760 2../../scripting_subtitleline.hustar sergiouserssubtitlecomposer-0.5.3/src/main/scripting/examples/api/scripting_sstring.h0000777000175000001440000000000011206423673032734 2../../scripting_sstring.hustar sergiouserssubtitlecomposer-0.5.3/src/main/scripting/examples/api/scripting_subtitlemodule.h0000777000175000001440000000000011206423673035654 2../../scripting_subtitlemodule.hustar sergiouserssubtitlecomposer-0.5.3/src/main/scripting/examples/api/scripting_subtitle.h0000777000175000001440000000000011206423673033240 2../../scripting_subtitle.hustar sergiouserssubtitlecomposer-0.5.3/src/main/scripting/examples/api/scripting_rangelist.h0000777000175000001440000000000011206423673033532 2../../scripting_rangelist.hustar sergiouserssubtitlecomposer-0.5.3/src/main/scripting/examples/api/scripting_subtitlelinemodule.h0000777000175000001440000000000011206423673037374 2../../scripting_subtitlelinemodule.hustar sergiouserssubtitlecomposer-0.5.3/src/main/scripting/examples/api/scripting_list.h0000777000175000001440000000000011206423673031500 2../../scripting_list.hustar sergiouserssubtitlecomposer-0.5.3/src/main/scripting/examples/api/scripting_rangesmodule.h0000777000175000001440000000000011206423673034724 2../../scripting_rangesmodule.hustar sergiouserssubtitlecomposer-0.5.3/src/main/scripting/examples/example_trim_to_selection.py0000644000175000001440000000165211206414664027503 0ustar sergiousers#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. import ranges import subtitle subtitle.instance().removeLines( ranges.newSelectionRangeList().complement() ) subtitlecomposer-0.5.3/src/main/scripting/examples/example_remove_impair_lines.js0000644000175000001440000000301111206414373027761 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ s = subtitle.instance(); for ( var lineIndex = s.linesCount() - 1; lineIndex >= 0; --lineIndex ) { if ( lineIndex % 2 == 0 ) s.removeLine( lineIndex ); } subtitlecomposer-0.5.3/src/main/scripting/examples/example_trim_to_selection.js0000644000175000001440000000267411206414425027467 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ subtitle.instance().removeLines( ranges.newSelectionRangeList().complement() ); subtitlecomposer-0.5.3/src/main/scripting/examples/example_iterate_selection.py0000644000175000001440000000304111206414675027457 0ustar sergiousers#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. import ranges import subtitle import debug def each_range( range_list, forward=True ): r = range( 0, range_list.rangesCount() ) if not forward: r.reverse() for range_index in r: yield range_list.range( range_index ) def each_line( range_list, forward=True ): for r in each_range( range_list, forward ): r2 = range( r.start(), r.end() + 1 ) if not forward: r2.reverse() for line_index in r2: yield subtitle.instance().line( line_index ) for r in each_range( ranges.newSelectionRangeList(), True ): debug.information( str( r.start() ) + ":" + str( r.end() ) ) for l in each_line( ranges.newSelectionRangeList(), False ): debug.information( "Plain text: " + l.plainPrimaryText() + "\n\nRich Text: " + l.richPrimaryText() ) subtitlecomposer-0.5.3/src/main/scripting/examples/example_iterate_selection.js0000644000175000001440000000710411206425372027443 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ function RangesIterator( rangeList, forward ) { this.forward = typeof( forward ) == "undefined" ? true : forward; this.rangeList = rangeList; this.rangeIndex = this.forward ? -1 : this.rangeList.rangesCount() this.current = function() { return this.rangeIndex >= 0 && this.rangeIndex < this.rangeList.rangesCount() ? this.rangeList.range( this.rangeIndex ) : null; }; this.hasNext = function() { return this.forward ? this.rangeIndex < this.rangeList.rangesCount() - 1 : this.rangeIndex > 0; }; this.next = function() { this.rangeIndex += this.forward ? 1 : -1; return this.current(); }; } function LinesIterator( rangeList, forward ) { this.forward = typeof( forward ) == "undefined" ? true : forward; this.rangesIt = new RangesIterator( rangeList, this.forward ); this.lineIndex = -1; this.subtitle = subtitle.instance(); this.current = function() { var range = this.rangesIt.current(); return range != null && this.lineIndex >= range.start() && this.lineIndex < range.end()? this.subtitle.line( this.lineIndex ) : null; }; this.hasNext = function() { return this.rangesIt.hasNext() || (this.rangesIt.current() && (this.forward ? this.lineIndex < this.rangesIt.current().end() : this.lineIndex > this.rangesIt.current().start())); }; this.next = function() { var currentRange = this.rangesIt.current(); if ( currentRange == null || (forward && this.lineIndex == currentRange.end()) || (! forward && this.lineIndex == currentRange.start()) ) { if ( ! this.rangesIt.hasNext() ) return null; currentRange = this.rangesIt.next(); this.lineIndex = this.forward ? currentRange.start() : currentRange.end(); } else this.lineIndex += this.forward ? 1 : -1; return this.subtitle.line( this.lineIndex ) }; } var rangesIt = new RangesIterator( ranges.newSelectionRangeList(), true ); while ( rangesIt.hasNext() ) { var range = rangesIt.next(); debug.information( range.start().toString() + ":" + range.end().toString() ); } var linesIt = new LinesIterator( ranges.newSelectionRangeList(), false ); while ( linesIt.hasNext() ) { var line = linesIt.next(); debug.information( "Plain text: " + line.plainPrimaryText() + "\n\nRich Text: " + line.richPrimaryText() ); } subtitlecomposer-0.5.3/src/main/scripting/examples/example_capitalize_all_lines.js0000644000175000001440000000316011206414353030103 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ s = subtitle.instance(); for ( var lineIndex = 0, linesCount = s.linesCount(); lineIndex < linesCount; ++lineIndex ) { var line = s.line( lineIndex ); var text = line.primaryText(); line.setPrimaryText( text.left( 1 ).toUpper().append( text.mid( 1 ) ) ); } subtitlecomposer-0.5.3/src/main/scripting/examples/example_iterate_selection.rb0000644000175000001440000000323311206414716027431 0ustar sergiousers#!/usr/bin/env ruby # Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. require "ranges" require "subtitle" require "debug" def each_range( range_list, forward=true ) range_indexes = 0..range_list.rangesCount()-1 range_indexes = range_indexes.to_a().reverse() if ! forward for range_index in range_indexes yield range_list.range( range_index ) end end def each_line( range_list, forward=true ) subtitle = Subtitle.instance() each_range( range_list, forward ) do |range| line_indexes = range.start()..range.end() line_indexes = line_indexes.to_a().reverse() if ! forward for line_index in line_indexes yield subtitle.line( line_index ) end end end each_range( Ranges.newSelectionRangeList(), true ) do |range| Debug.information( "#{range.start}:#{range.end}") end each_line( Ranges.newSelectionRangeList(), false ) do |line| Debug.information( "Plain text: " + line.plainPrimaryText() + "\n\nRich Text: " + line.richPrimaryText() ) end subtitlecomposer-0.5.3/src/main/application.cpp0000644000175000001440000036050011206323534021056 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "application.h" #include "mainwindow.h" #include "audiolevelswidget.h" #include "playerwidget.h" #include "lineswidget.h" #include "currentlinewidget.h" #include "configdialog.h" #include "errorswidget.h" #include "errorsdialog.h" #include "actions/useraction.h" #include "actions/useractionnames.h" #include "actions/krecentfilesactionext.h" #include "configs/generalconfig.h" #include "configs/spellingconfig.h" #include "configs/playerconfig.h" #include "configs/errorsconfig.h" #include "dialogs/opensubtitledialog.h" #include "dialogs/savesubtitledialog.h" #include "dialogs/joinsubtitlesdialog.h" #include "dialogs/splitsubtitledialog.h" #include "dialogs/actionwithtargetdialog.h" #include "dialogs/shifttimesdialog.h" #include "dialogs/adjusttimesdialog.h" #include "dialogs/durationlimitsdialog.h" #include "dialogs/autodurationsdialog.h" #include "dialogs/changetextscasedialog.h" #include "dialogs/fixoverlappingtimesdialog.h" #include "dialogs/fixpunctuationdialog.h" #include "dialogs/translatedialog.h" #include "dialogs/smarttextsadjustdialog.h" #include "dialogs/changeframeratedialog.h" #include "dialogs/syncsubtitlesdialog.h" #include "dialogs/checkerrorsdialog.h" #include "dialogs/clearerrorsdialog.h" #include "dialogs/insertlinedialog.h" #include "dialogs/removelinesdialog.h" #include "dialogs/inputdialog.h" #include "utils/finder.h" #include "utils/replacer.h" #include "utils/errorfinder.h" #include "utils/speller.h" #include "utils/errortracker.h" #include "utils/translator.h" #include "scripting/scriptsmanager.h" #include "../common/commondefs.h" #include "../common/fileloadhelper.h" #include "../common/filesavehelper.h" #include "../core/subtitleiterator.h" #include "../formats/formatmanager.h" #include "../player/player.h" #include "../player/playerbackend.h" #include "../profiler.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace SubtitleComposer; Application* SubtitleComposer::app() { return Application::instance(); } Application::Application(): KApplication(), m_config(), m_subtitle( 0 ), m_subtitleUrl(), m_subtitleFileName(), m_subtitleEncoding(), m_subtitleEOL( -1 ), m_subtitleFormat(), m_translationMode( false ), m_subtitleTrUrl(), m_subtitleTrFileName(), m_subtitleTrEncoding(), m_subtitleTrEOL( -1 ), m_subtitleTrFormat(), m_player( Player::instance() ), m_lastFoundLine( 0 ), // m_audiolevels( 0 ), // FIXME audio levels m_lastSubtitleUrl( QDir::homePath() ), m_lastVideoUrl( QDir::homePath() ), m_linkCurrentLineToPosition( false ) { // The config object has to be filled first with all the groups and default data... m_config.setGroup( new GeneralConfig() ); m_config.setGroup( new SpellingConfig() ); m_config.setGroup( new ErrorsConfig() ); m_config.setGroup( new PlayerConfig() ); QStringList backendNames( m_player->backendNames() ); for ( QStringList::ConstIterator it = backendNames.begin(), end = backendNames.end(); it != end; ++it ) m_config.setGroup( m_player->backend( *it )->config()->clone() ); // ...only then can be loaded m_config.readFrom( KGlobal::config().constData() ); // and feed to the player backends for ( QStringList::ConstIterator it = backendNames.begin(), end = backendNames.end(); it != end; ++it ) m_player->backend( *it )->setConfig( m_config.group( *it ) ); m_mainWindow = new MainWindow(); // m_audiolevelsWidget = m_mainWindow->m_audiolevelsWidget; // FIXME audio levels m_playerWidget = m_mainWindow->m_playerWidget; m_linesWidget = m_mainWindow->m_linesWidget; m_curLineWidget = m_mainWindow->m_curLineWidget; m_configDialog = new ConfigDialog( m_config, m_mainWindow ); m_errorsDialog = new ErrorsDialog( m_mainWindow ); m_errorsWidget = m_errorsDialog->errorsWidget(); m_finder = new Finder( m_linesWidget ); m_replacer = new Replacer( m_linesWidget ); m_errorFinder = new ErrorFinder( m_linesWidget ); m_speller = new Speller( m_linesWidget ); m_errorTracker = new ErrorTracker( this ); m_scriptsManager = new ScriptsManager( this ); UserActionManager* actionManager = UserActionManager::instance(); connect( playerConfig(), SIGNAL( optionChanged( const QString&, const QString& ) ), this, SLOT( onPlayerOptionChanged( const QString&, const QString& ) ) ); connect( generalConfig(), SIGNAL( optionChanged( const QString&, const QString& ) ), this, SLOT( onGeneralOptionChanged( const QString&, const QString& ) ) ); connect( m_player, SIGNAL( fileOpened( const QString& ) ), this, SLOT( onPlayerFileOpened( const QString& ) ) ); connect( m_player, SIGNAL( playing() ), this, SLOT(onPlayerPlaying() ) ); connect( m_player, SIGNAL( paused() ), this, SLOT(onPlayerPaused() ) ); connect( m_player, SIGNAL( stopped() ), this, SLOT(onPlayerStopped() ) ); connect( m_player, SIGNAL( audioStreamsChanged( const QStringList&) ), this, SLOT( onPlayerAudioStreamsChanged( const QStringList& ) ) ); connect( m_player, SIGNAL( activeAudioStreamChanged( int ) ), this, SLOT( onPlayerActiveAudioStreamChanged( int ) ) ); connect( m_player, SIGNAL( muteChanged( bool ) ), this, SLOT( onPlayerMuteChanged( bool ) ) ); QList listeners; listeners << actionManager << m_mainWindow << m_playerWidget << m_linesWidget << m_curLineWidget << m_errorsWidget // << m_audiolevelsWidget /*/*// FIXME audio levels*/*/ << m_finder << m_replacer << m_errorFinder << m_speller << m_errorTracker << m_scriptsManager; for ( QList::ConstIterator it = listeners.begin(), end = listeners.end(); it != end; ++it ) { connect( this, SIGNAL( subtitleOpened(Subtitle*) ), *it, SLOT( setSubtitle(Subtitle*) ) ); connect( this, SIGNAL( subtitleClosed() ), *it, SLOT( setSubtitle() ) ); } listeners.clear(); listeners << actionManager << m_playerWidget << m_linesWidget << m_curLineWidget << m_finder << m_replacer << m_errorFinder << m_speller; for ( QList::ConstIterator it = listeners.begin(), end = listeners.end(); it != end; ++it ) connect( this, SIGNAL( translationModeChanged(bool) ), *it, SLOT( setTranslationMode(bool) ) ); connect( this, SIGNAL( fullScreenModeChanged(bool) ), actionManager, SLOT( setFullScreenMode(bool) ) ); // FIXME audio levels // connect( this, SIGNAL( audiolevelsOpened(AudioLevels*) ), actionManager, SLOT( setAudioLevels(AudioLevels*) ) ); // connect( this, SIGNAL( audiolevelsOpened(AudioLevels*) ), m_audiolevelsWidget, SLOT( setAudioLevels(AudioLevels*) ) ); // // connect( this, SIGNAL( audiolevelsClosed() ), actionManager, SLOT( setAudioLevels() ) ); // connect( this, SIGNAL( audiolevelsClosed() ), m_audiolevelsWidget, SLOT( setAudioLevels() ) ); connect( m_configDialog, SIGNAL( accepted() ), this, SLOT( updateConfigFromDialog() ) ); connect( m_linesWidget, SIGNAL( currentLineChanged(SubtitleLine*) ), m_curLineWidget, SLOT( setCurrentLine(SubtitleLine*)) ); connect( m_linesWidget, SIGNAL( lineDoubleClicked(SubtitleLine*) ), this, SLOT( onLineDoubleClicked(SubtitleLine*) ) ); connect( m_linesWidget, SIGNAL(currentLineChanged(SubtitleLine*)), m_errorsWidget, SLOT(setCurrentLine(SubtitleLine*)) ); connect( m_errorsWidget, SIGNAL(lineDoubleClicked(SubtitleLine*)), m_linesWidget, SLOT(setCurrentLine(SubtitleLine*)) ); connect( m_playerWidget, SIGNAL(playingLineChanged(SubtitleLine*)), this, SLOT(onPlayingLineChanged(SubtitleLine*)) ); connect( m_finder, SIGNAL( found(SubtitleLine*,bool,int,int) ), this, SLOT( onHighlightLine(SubtitleLine*,bool,int,int) ) ); connect( m_replacer, SIGNAL( found(SubtitleLine*,bool,int,int) ), this, SLOT( onHighlightLine(SubtitleLine*,bool,int,int) ) ); connect( m_errorFinder, SIGNAL( found(SubtitleLine*) ), this, SLOT( onHighlightLine(SubtitleLine*) ) ); connect( m_speller, SIGNAL( misspelled(SubtitleLine*,bool,int,int) ), this, SLOT( onHighlightLine(SubtitleLine*,bool,int,int) ) ); actionManager->setLinesWidget( m_linesWidget ); actionManager->setPlayer( m_player ); actionManager->setFullScreenMode( false ); setupActions(); m_playerWidget->plugActions(); m_curLineWidget->setupActions(); m_mainWindow->setupGUI(); m_scriptsManager->reloadScripts(); loadConfig(); } Application::~Application() { // NOTE: The Application destructor is called after all widgets are destroyed // (NOT BEFORE). Therefore is not possible to save the program settings (nor do // pretty much anything) at this point. //delete m_mainWindow; the windows is destroyed when it's closed delete m_subtitle; // delete m_audiolevels; // FIXME audio levels } Application* Application::instance() { return static_cast( kapp ); } Subtitle* Application::subtitle() const { return m_subtitle; } MainWindow* Application::mainWindow() const { return m_mainWindow; } LinesWidget* Application::linesWidget() const { return m_linesWidget; } bool Application::translationMode() const { return m_translationMode; } bool Application::showingLinesContextMenu() const { return m_linesWidget->showingContextMenu(); } void Application::loadConfig() { KConfigGroup group( KGlobal::config()->group( "Application Settings" ) ); m_lastSubtitleUrl = KUrl( group.readPathEntry( "LastSubtitleUrl", QDir::homePath() ) ); m_recentSubtitlesAction->loadEntries( KGlobal::config()->group( "Recent Subtitles" ) ); m_recentTrSubtitlesAction->loadEntries( KGlobal::config()->group( "Recent Translation Subtitles" ) ); m_lastAudioLevelsUrl = KUrl( group.readPathEntry( "LastAudioLevelsUrl", QDir::homePath() ) ); // m_recentAudioLevelsAction->loadEntries( group, "Recent Audio Levels" ); // FIXME audio levels m_lastVideoUrl = KUrl( group.readPathEntry( "LastVideoUrl", QDir::homePath() ) ); m_recentVideosAction->loadEntries( KGlobal::config()->group( "Recent Videos" ) ); m_player->setMuted( group.readEntry( "Muted", false ) ); m_player->setVolume( group.readEntry( "Volume", 100.0 ) ); ((KToggleAction*)action( ACT_TOGGLE_MUTED ))->setChecked( m_player->isMuted() ); m_mainWindow->loadConfig(); // m_audiolevelsWidget->loadConfig(); // FIXME audio levels m_playerWidget->loadConfig(); m_linesWidget->loadConfig(); m_curLineWidget->loadConfig(); m_errorsDialog->loadConfig(); } void Application::saveConfig() { m_config.writeTo( KGlobal::config().data() ); KConfigGroup group( KGlobal::config()->group( "Application Settings" ) ); group.writePathEntry( "LastSubtitleUrl", m_lastSubtitleUrl.prettyUrl() ); m_recentSubtitlesAction->saveEntries( KGlobal::config()->group( "Recent Subtitles" ) ); m_recentTrSubtitlesAction->saveEntries( KGlobal::config()->group( "Recent Translation Subtitles" ) ); group.writePathEntry( "LastAudioLevelsUrl", m_lastAudioLevelsUrl.prettyUrl() ); // m_recentAudioLevelsAction->saveEntries( KGlobal::config()->group( "Recent Audio Levels" ) ); // FIXME audio levels group.writePathEntry( "LastVideoUrl", m_lastVideoUrl.prettyUrl() ); m_recentVideosAction->saveEntries( KGlobal::config()->group( "Recent Videos" ) ); group.writeEntry( "Muted", m_player->isMuted() ); group.writeEntry( "Volume", m_player->volume() ); m_mainWindow->saveConfig(); // m_audiolevelsWidget->saveConfig(); // FIXME audio levels m_playerWidget->saveConfig(); m_linesWidget->saveConfig(); m_curLineWidget->saveConfig(); m_errorsDialog->saveConfig(); } QAction* Application::action( const char* actionName ) { return m_mainWindow->actionCollection()->action( actionName ); } void Application::triggerAction( const QKeySequence& keySequence ) { QList actions = m_mainWindow->actionCollection()->actions(); for ( QList::ConstIterator it = actions.begin(), end = actions.end(); it != end; ++it ) { if ( (*it)->isEnabled() ) { try { KAction* action = dynamic_cast( *it ); KShortcut shortcut = action->shortcut(); if ( shortcut.primary() == keySequence || shortcut.alternate() == keySequence ) { action->trigger(); return; } } catch( const std::bad_cast& ) { if ( (*it)->shortcut() == keySequence ) { (*it)->trigger(); return; } } } } } const QStringList& Application::availableEncodingNames() const { static QStringList encodingNames; if ( encodingNames.empty() ) { QStringList encodings( KGlobal::charsets()->availableEncodingNames() ); for ( QStringList::Iterator it = encodings.begin(); it != encodings.end(); ++it ) { bool found = false; QTextCodec* codec = KGlobal::charsets()->codecForName( *it, found ); if ( found ) encodingNames.append( codec->name().toUpper() ); } encodingNames.sort(); } return encodingNames; } const KUrl& Application::lastSubtitleDirectory() const { return m_lastSubtitleUrl; } const QString& Application::buildMediaFilesFilter() { static QString filter; if ( filter.isEmpty() ) { QString mediaExtensions; QString videoExtensions; QStringList videoExts( QString( "avi flv mkv mov mpg mpeg mp4 wmv ogm ogv rmvb ts vob" ).split( ' ' ) ); for ( QStringList::ConstIterator it = videoExts.begin(), end = videoExts.end(); it != end; ++it ) // videoExtensions += " *." + *it /*+ " *." + (*it).toUpper()*/; videoExtensions += " *." + *it + " *." + (*it).toUpper(); mediaExtensions += videoExtensions; filter += '\n' + videoExtensions.trimmed() + '|' + i18n( "Video Files" ); QString audioExtensions; QStringList audioExts( QString( "aac ac3 ape flac la m4a mac mp2 mp3 mp4 mp+ mpc mpp ofr oga ogg pac ra spx tta wav wma wv" ).split( ' ' ) ); for ( QStringList::ConstIterator it = audioExts.begin(), end = audioExts.end(); it != end; ++it ) // audioExtensions += " *." + *it /*+ " *." + (*it).toUpper()*/; audioExtensions += " *." + *it + " *." + (*it).toUpper(); mediaExtensions += audioExtensions; filter += '\n' + audioExtensions.trimmed() + '|' + i18n( "Audio Files" ); filter = mediaExtensions + '|' + i18n( "Media Files" ) + filter; filter += "\n*|" + i18n( "All Files" ); } return filter; } const QString& Application::buildLevelsFilesFilter() { static QString filter; if ( filter.isEmpty() ) { QString levelsExtensions; QStringList videoExts( QString( "wf" ).split( ' ' ) ); for ( QStringList::ConstIterator it = videoExts.begin(), end = videoExts.end(); it != end; ++it ) levelsExtensions += " *." + *it + " *." + (*it).toUpper(); filter += '\n' + levelsExtensions.trimmed() + '|' + i18n( "Audio Levels Files" ); filter += buildMediaFilesFilter(); } return filter; } void Application::setupActions() { KActionCollection* actionCollection = m_mainWindow->actionCollection(); UserActionManager* actionManager = UserActionManager::instance(); KAction* quitAction = KStandardAction::quit( m_mainWindow, SLOT( close() ), actionCollection ); quitAction->setStatusTip( i18n( "Exit the application" ) ); KAction* prefsAction = KStandardAction::preferences( m_configDialog, SLOT( show() ), actionCollection ); prefsAction->setStatusTip( i18n( "Configure Subtitle Composer" ) ); KAction* newSubtitleAction = new KAction( actionCollection ); newSubtitleAction->setIcon( KIcon( "document-new" ) ); newSubtitleAction->setText( i18nc( "@action:inmenu Create a new subtitle", "New" ) ); newSubtitleAction->setStatusTip( i18n( "Create an empty subtitle" ) ); newSubtitleAction->setShortcut( KStandardShortcut::openNew(), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( newSubtitleAction, SIGNAL( triggered() ), this, SLOT( newSubtitle() ) ); actionCollection->addAction( ACT_NEW_SUBTITLE, newSubtitleAction ); actionManager->addAction( newSubtitleAction, UserAction::FullScreenOff ); KAction* openSubtitleAction = new KAction( actionCollection ); openSubtitleAction->setIcon( KIcon( "document-open" ) ); openSubtitleAction->setText( i18nc( "@action:inmenu Open subtitle file", "Open..." ) ); openSubtitleAction->setStatusTip( i18n( "Open subtitle file" ) ); openSubtitleAction->setShortcut( KStandardShortcut::open(), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( openSubtitleAction, SIGNAL( triggered() ), this, SLOT( openSubtitle() ) ); actionCollection->addAction( ACT_OPEN_SUBTITLE, openSubtitleAction ); actionManager->addAction( openSubtitleAction, 0 ); m_recentSubtitlesAction = new KRecentFilesActionExt( actionCollection ); m_recentSubtitlesAction->setIcon( KIcon( "document-open" ) ); m_recentSubtitlesAction->setText( i18nc( "@action:inmenu Open rencently used subtitle file", "Open &Recent" ) ); m_recentSubtitlesAction->setStatusTip( i18n( "Open subtitle file" ) ); connect( m_recentSubtitlesAction, SIGNAL(urlSelected(const KUrl&)), this, SLOT(openSubtitle(const KUrl&)) ); actionCollection->addAction( ACT_RECENT_SUBTITLES, m_recentSubtitlesAction ); KAction* saveSubtitleAction = new KAction( actionCollection ); saveSubtitleAction->setIcon( KIcon( "document-save" ) ); saveSubtitleAction->setText( i18n( "Save" ) ); saveSubtitleAction->setStatusTip( i18n( "Save opened subtitle" ) ); saveSubtitleAction->setShortcut( KStandardShortcut::save(), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( saveSubtitleAction, SIGNAL( triggered() ), this, SLOT( saveSubtitle() ) ); actionCollection->addAction( ACT_SAVE_SUBTITLE, saveSubtitleAction ); actionManager->addAction( saveSubtitleAction, UserAction::SubPDirty|UserAction::FullScreenOff ); KAction* saveSubtitleAsAction = new KAction( actionCollection ); saveSubtitleAsAction->setIcon( KIcon( "document-save-as" ) ); saveSubtitleAsAction->setText( i18n( "Save As..." ) ); saveSubtitleAsAction->setStatusTip( i18n( "Save opened subtitle with different settings" ) ); connect( saveSubtitleAsAction, SIGNAL( triggered() ), this, SLOT( saveSubtitleAs() ) ); actionCollection->addAction( ACT_SAVE_SUBTITLE_AS, saveSubtitleAsAction ); actionManager->addAction( saveSubtitleAsAction, UserAction::SubOpened|UserAction::FullScreenOff ); KAction* closeSubtitleAction = new KAction( actionCollection ); closeSubtitleAction->setIcon( KIcon( "window-close" ) ); closeSubtitleAction->setText( i18n( "Close" ) ); closeSubtitleAction->setStatusTip( i18n( "Close opened subtitle" ) ); closeSubtitleAction->setShortcut( KStandardShortcut::close(), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( closeSubtitleAction, SIGNAL( triggered() ), this, SLOT( closeSubtitle() ) ); actionCollection->addAction( ACT_CLOSE_SUBTITLE, closeSubtitleAction ); actionManager->addAction( closeSubtitleAction, UserAction::SubOpened|UserAction::FullScreenOff ); KAction* newTrSubtitleAction = new KAction( actionCollection ); newTrSubtitleAction->setIcon( KIcon( "document-new" ) ); newTrSubtitleAction->setText( i18n( "New Translation" ) ); newTrSubtitleAction->setStatusTip( i18n( "Create an empty translation subtitle" ) ); newTrSubtitleAction->setShortcut( KShortcut( "Ctrl+Shift+N" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( newTrSubtitleAction, SIGNAL( triggered() ), this, SLOT( newTrSubtitle() ) ); actionCollection->addAction( ACT_NEW_TR_SUBTITLE, newTrSubtitleAction ); actionManager->addAction( newTrSubtitleAction, UserAction::SubOpened|UserAction::FullScreenOff ); KAction* openTrSubtitleAction = new KAction( actionCollection ); openTrSubtitleAction->setIcon( KIcon( "document-open" ) ); openTrSubtitleAction->setText( i18n( "Open Translation..." ) ); openTrSubtitleAction->setStatusTip( i18n( "Open translation subtitle file" ) ); openTrSubtitleAction->setShortcut( KShortcut( "Ctrl+Shift+O" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( openTrSubtitleAction, SIGNAL( triggered() ), this, SLOT( openTrSubtitle() ) ); actionCollection->addAction( ACT_OPEN_TR_SUBTITLE, openTrSubtitleAction ); actionManager->addAction( openTrSubtitleAction, UserAction::SubOpened ); m_recentTrSubtitlesAction = new KRecentFilesActionExt( actionCollection ); m_recentTrSubtitlesAction->setIcon( KIcon( "document-open" ) ); m_recentTrSubtitlesAction->setText( i18n( "Open &Recent Translation" ) ); m_recentTrSubtitlesAction->setStatusTip( i18n( "Open translation subtitle file" ) ); connect( m_recentTrSubtitlesAction, SIGNAL(urlSelected(const KUrl&)), this, SLOT(openTrSubtitle(const KUrl&)) ); actionCollection->addAction( ACT_RECENT_TR_SUBTITLES, m_recentTrSubtitlesAction ); actionManager->addAction( m_recentTrSubtitlesAction, UserAction::SubOpened|UserAction::FullScreenOff ); KAction* saveTrSubtitleAction = new KAction( actionCollection ); saveTrSubtitleAction->setIcon( KIcon( "document-save" ) ); saveTrSubtitleAction->setText( i18n( "Save Translation" ) ); saveTrSubtitleAction->setStatusTip( i18n( "Save opened translation subtitle" ) ); saveTrSubtitleAction->setShortcut( KShortcut( "Ctrl+Shift+S" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( saveTrSubtitleAction, SIGNAL( triggered() ), this, SLOT( saveTrSubtitle() ) ); actionCollection->addAction( ACT_SAVE_TR_SUBTITLE, saveTrSubtitleAction ); actionManager->addAction( saveTrSubtitleAction, UserAction::SubSDirty|UserAction::FullScreenOff ); KAction* saveTrSubtitleAsAction = new KAction( actionCollection ); saveTrSubtitleAsAction->setIcon( KIcon( "document-save-as" ) ); saveTrSubtitleAsAction->setText( i18n( "Save Translation As..." ) ); saveTrSubtitleAsAction->setStatusTip( i18n( "Save opened translation subtitle with different settings" ) ); connect( saveTrSubtitleAsAction, SIGNAL( triggered() ), this, SLOT( saveTrSubtitleAs() ) ); actionCollection->addAction( ACT_SAVE_TR_SUBTITLE_AS, saveTrSubtitleAsAction ); actionManager->addAction( saveTrSubtitleAsAction, UserAction::SubTrOpened|UserAction::FullScreenOff ); KAction* closeTrSubtitleAction = new KAction( actionCollection ); closeTrSubtitleAction->setIcon( KIcon( "window-close" ) ); closeTrSubtitleAction->setText( i18n( "Close Translation" ) ); closeTrSubtitleAction->setStatusTip( i18n( "Close opened translation subtitle" ) ); closeTrSubtitleAction->setShortcut( KShortcut( "Ctrl+Shift+F4; Ctrl+Shift+W" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( closeTrSubtitleAction, SIGNAL( triggered() ), this, SLOT( closeTrSubtitle() ) ); actionCollection->addAction( ACT_CLOSE_TR_SUBTITLE, closeTrSubtitleAction ); actionManager->addAction( closeTrSubtitleAction, UserAction::SubTrOpened|UserAction::FullScreenOff ); m_reloadSubtitleAsAction = new KCodecAction( actionCollection ); m_reloadSubtitleAsAction->setIcon( KIcon( "view-refresh" ) ); m_reloadSubtitleAsAction->setText( i18n( "Reload As..." ) ); m_reloadSubtitleAsAction->setStatusTip( i18n( "Reload opened file with a different encoding" ) ); connect( m_reloadSubtitleAsAction, SIGNAL( triggered(const QString&) ), this, SLOT( changeSubtitlesEncoding(const QString&) ) ); connect( m_reloadSubtitleAsAction, SIGNAL( defaultItemTriggered() ), this, SLOT( openSubtitleWithDefaultEncoding() ) ); actionCollection->addAction( ACT_CHANGE_SUBTITLE_ENCODING, m_reloadSubtitleAsAction ); actionManager->addAction( m_reloadSubtitleAsAction, UserAction::SubPClean|UserAction::SubSClean|UserAction::FullScreenOff ); m_quickReloadSubtitleAsAction = new KSelectAction( actionCollection ); m_quickReloadSubtitleAsAction->setItems( availableEncodingNames() ); m_quickReloadSubtitleAsAction->setCurrentAction( generalConfig()->defaultSubtitlesEncoding() ); m_quickReloadSubtitleAsAction->setIcon( KIcon( "view-refresh" ) ); m_quickReloadSubtitleAsAction->setText( i18n( "Quick Reload As..." ) ); m_quickReloadSubtitleAsAction->setStatusTip( i18n( "Reload opened file with a different encoding" ) ); connect( m_quickReloadSubtitleAsAction, SIGNAL( triggered(const QString&) ), this, SLOT( changeSubtitlesEncoding(const QString&) ) ); actionCollection->addAction( ACT_QUICK_CHANGE_SUBTITLE_ENCODING, m_quickReloadSubtitleAsAction ); actionManager->addAction( m_quickReloadSubtitleAsAction, UserAction::SubPClean|UserAction::SubSClean|UserAction::FullScreenOff ); KAction* undoAction = new KAction( actionCollection ); undoAction->setIcon( KIcon( "edit-undo" ) ); undoAction->setText( i18n( "Undo" ) ); undoAction->setStatusTip( i18n( "Undo" ) ); undoAction->setShortcut( KStandardShortcut::undo(), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( undoAction, SIGNAL( triggered() ), this, SLOT( undo() ) ); actionCollection->addAction( ACT_UNDO, undoAction ); actionManager->addAction( undoAction, UserAction::SubHasUndo ); KAction* redoAction = new KAction( actionCollection ); redoAction->setIcon( KIcon( "edit-redo" ) ); redoAction->setText( i18n( "Redo" ) ); redoAction->setStatusTip( i18n( "Redo" ) ); redoAction->setShortcut( KStandardShortcut::redo(), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( redoAction, SIGNAL( triggered() ), this, SLOT( redo() ) ); actionCollection->addAction( ACT_REDO, redoAction ); actionManager->addAction( redoAction, UserAction::SubHasRedo ); KAction* splitSubtitleAction = new KAction( actionCollection ); splitSubtitleAction->setText( i18n( "Split Subtitle..." ) ); splitSubtitleAction->setStatusTip( i18n( "Split the opened subtitle in two parts" ) ); connect( splitSubtitleAction, SIGNAL( triggered() ), this, SLOT( splitSubtitle() ) ); actionCollection->addAction( ACT_SPLIT_SUBTITLE, splitSubtitleAction ); actionManager->addAction( splitSubtitleAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* joinSubtitlesAction = new KAction( actionCollection ); joinSubtitlesAction->setText( i18n( "Join Subtitles..." ) ); joinSubtitlesAction->setStatusTip( i18n( "Append to the opened subtitle another one" ) ); connect( joinSubtitlesAction, SIGNAL( triggered() ), this, SLOT( joinSubtitles() ) ); actionCollection->addAction( ACT_JOIN_SUBTITLES, joinSubtitlesAction ); actionManager->addAction( joinSubtitlesAction, UserAction::SubOpened|UserAction::FullScreenOff ); KAction* insertBeforeCurrentLineAction = new KAction( actionCollection ); insertBeforeCurrentLineAction->setText( i18n( "Insert Before" ) ); insertBeforeCurrentLineAction->setStatusTip( i18n( "Insert empty line before current one" ) ); insertBeforeCurrentLineAction->setShortcut( KShortcut( "Ctrl+Insert" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( insertBeforeCurrentLineAction, SIGNAL( triggered() ), this, SLOT( insertBeforeCurrentLine() ) ); actionCollection->addAction( ACT_INSERT_BEFORE_CURRENT_LINE, insertBeforeCurrentLineAction ); actionManager->addAction( insertBeforeCurrentLineAction, UserAction::SubOpened|UserAction::FullScreenOff ); KAction* insertAfterCurrentLineAction = new KAction( actionCollection ); insertAfterCurrentLineAction->setText( i18n( "Insert After" ) ); insertAfterCurrentLineAction->setStatusTip( i18n( "Insert empty line after current one" ) ); insertAfterCurrentLineAction->setShortcut( KShortcut( "Insert" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( insertAfterCurrentLineAction, SIGNAL( triggered() ), this, SLOT( insertAfterCurrentLine() ) ); actionCollection->addAction( ACT_INSERT_AFTER_CURRENT_LINE, insertAfterCurrentLineAction ); actionManager->addAction( insertAfterCurrentLineAction, UserAction::SubOpened|UserAction::FullScreenOff ); KAction* removeSelectedLinesAction = new KAction( actionCollection ); removeSelectedLinesAction->setText( i18n( "Remove" ) ); removeSelectedLinesAction->setStatusTip( i18n( "Remove selected lines" ) ); removeSelectedLinesAction->setShortcut( KShortcut( "Delete" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( removeSelectedLinesAction, SIGNAL( triggered() ), this, SLOT( removeSelectedLines() ) ); actionCollection->addAction( ACT_REMOVE_SELECTED_LINES, removeSelectedLinesAction ); actionManager->addAction( removeSelectedLinesAction, UserAction::HasSelection|UserAction::FullScreenOff ); KAction* splitSelectedLinesAction = new KAction( actionCollection ); splitSelectedLinesAction->setText( i18n( "Split Lines" ) ); splitSelectedLinesAction->setStatusTip( i18n( "Split selected lines" ) ); connect( splitSelectedLinesAction, SIGNAL( triggered() ), this, SLOT( splitSelectedLines() ) ); actionCollection->addAction( ACT_SPLIT_SELECTED_LINES, splitSelectedLinesAction ); actionManager->addAction( splitSelectedLinesAction, UserAction::HasSelection|UserAction::FullScreenOff ); KAction* joinSelectedLinesAction = new KAction( actionCollection ); joinSelectedLinesAction->setText( i18n( "Join Lines" ) ); joinSelectedLinesAction->setStatusTip( i18n( "Join selected lines" ) ); connect( joinSelectedLinesAction, SIGNAL( triggered() ), this, SLOT( joinSelectedLines() ) ); actionCollection->addAction( ACT_JOIN_SELECTED_LINES, joinSelectedLinesAction ); actionManager->addAction( joinSelectedLinesAction, UserAction::HasSelection|UserAction::FullScreenOff ); KAction* selectAllLinesAction = new KAction( actionCollection ); selectAllLinesAction->setText( i18n( "Select All" ) ); selectAllLinesAction->setStatusTip( i18n( "Select all lines" ) ); selectAllLinesAction->setShortcut( KStandardShortcut::selectAll(), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( selectAllLinesAction, SIGNAL( triggered() ), this, SLOT( selectAllLines() ) ); actionCollection->addAction( ACT_SELECT_ALL_LINES, selectAllLinesAction ); actionManager->addAction( selectAllLinesAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* gotoLineAction = new KAction( actionCollection ); gotoLineAction->setText( i18n( "Go to Line..." ) ); gotoLineAction->setStatusTip( i18n( "Go to specified line" ) ); gotoLineAction->setShortcut( KStandardShortcut::gotoLine(), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( gotoLineAction, SIGNAL( triggered() ), this, SLOT( gotoLine() ) ); actionCollection->addAction( ACT_GOTO_LINE, gotoLineAction ); actionManager->addAction( gotoLineAction, UserAction::SubHasLines ); KAction* findAction = new KAction( actionCollection ); findAction->setIcon( KIcon( "edit-find" ) ); findAction->setText( i18n( "Find..." ) ); findAction->setStatusTip( i18n( "Find occurrences of strings or regular expressions" ) ); findAction->setShortcut( KStandardShortcut::find(), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( findAction, SIGNAL( triggered() ), this, SLOT( find() ) ); actionCollection->addAction( ACT_FIND, findAction ); actionManager->addAction( findAction, UserAction::SubHasLine ); KAction* findNextAction = new KAction( actionCollection ); // findNextAction->setIcon( KIcon( "go-down" ) ); findNextAction->setIcon( KIcon( "go-down-search" ) ); findNextAction->setText( i18n( "Find Next" ) ); findNextAction->setStatusTip( i18n( "Find next occurrence of string or regular expression" ) ); findNextAction->setShortcut( KStandardShortcut::findNext(), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( findNextAction, SIGNAL( triggered() ), this, SLOT( findNext() ) ); actionCollection->addAction( ACT_FIND_NEXT, findNextAction ); actionManager->addAction( findNextAction, UserAction::SubHasLine ); KAction* findPreviousAction = new KAction( actionCollection ); // findPreviousAction->setIcon( KIcon( "go-up" ) ); findPreviousAction->setIcon( KIcon( "go-up-search" ) ); findPreviousAction->setText( i18n( "Find Previous" ) ); findPreviousAction->setStatusTip( i18n( "Find previous occurrence of string or regular expression" ) ); findPreviousAction->setShortcut( KStandardShortcut::findPrev(), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( findPreviousAction, SIGNAL( triggered() ), this, SLOT( findPrevious() ) ); actionCollection->addAction( ACT_FIND_PREVIOUS, findPreviousAction ); actionManager->addAction( findPreviousAction, UserAction::SubHasLine ); KAction* replaceAction = new KAction( actionCollection ); replaceAction->setText( i18n( "Replace..." ) ); replaceAction->setStatusTip( i18n( "Replace occurrences of strings or regular expressions" ) ); replaceAction->setShortcut( KStandardShortcut::replace(), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( replaceAction, SIGNAL( triggered() ), this, SLOT( replace() ) ); actionCollection->addAction( ACT_REPLACE, replaceAction ); actionManager->addAction( replaceAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* retrocedeCurrentLineAction = new KAction( actionCollection ); retrocedeCurrentLineAction->setIcon( KIcon( "go-down" ) ); retrocedeCurrentLineAction->setText( i18n( "Retrocede current line" ) ); retrocedeCurrentLineAction->setStatusTip( i18n( "Makes the line before the current one active" ) ); retrocedeCurrentLineAction->setShortcut( KShortcut( "Alt+Up" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( retrocedeCurrentLineAction, SIGNAL( triggered() ), this, SLOT( retrocedeCurrentLine() ) ); actionCollection->addAction( ACT_RETROCEDE_CURRENT_LINE, retrocedeCurrentLineAction ); actionManager->addAction( retrocedeCurrentLineAction, UserAction::SubHasLines|UserAction::HasSelection ); KAction* advanceCurrentLineAction = new KAction( actionCollection ); advanceCurrentLineAction->setIcon( KIcon( "go-down" ) ); advanceCurrentLineAction->setText( i18n( "Advance current line" ) ); advanceCurrentLineAction->setStatusTip( i18n( "Makes the line after the current one active" ) ); advanceCurrentLineAction->setShortcut( KShortcut( "Alt+Down" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( advanceCurrentLineAction, SIGNAL( triggered() ), this, SLOT( advanceCurrentLine() ) ); actionCollection->addAction( ACT_ADVANCE_CURRENT_LINE, advanceCurrentLineAction ); actionManager->addAction( advanceCurrentLineAction, UserAction::SubHasLines|UserAction::HasSelection ); KAction* checkErrorsAction = new KAction( actionCollection ); checkErrorsAction->setText( i18n( "Check Errors..." ) ); checkErrorsAction->setStatusTip( i18n( "Check for errors in the current subtitle" ) ); checkErrorsAction->setShortcut( KShortcut( "Ctrl+E" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( checkErrorsAction, SIGNAL( triggered() ), this, SLOT( checkErrors() ) ); actionCollection->addAction( ACT_CHECK_ERRORS, checkErrorsAction ); actionManager->addAction( checkErrorsAction, UserAction::HasSelection|UserAction::FullScreenOff ); KAction* clearErrorsAction = new KAction( actionCollection ); clearErrorsAction->setText( i18n( "Clear Errors..." ) ); clearErrorsAction->setStatusTip( i18n( "Clear errors from selected lines" ) ); connect( clearErrorsAction, SIGNAL( triggered() ), this, SLOT( clearErrors() ) ); actionCollection->addAction( ACT_CLEAR_ERRORS, clearErrorsAction ); actionManager->addAction( clearErrorsAction, UserAction::HasSelection|UserAction::FullScreenOff ); KAction* showErrorsAction = new KAction( actionCollection ); showErrorsAction->setText( i18n( "Show Errors..." ) ); showErrorsAction->setStatusTip( i18n( "Show errors information for the current subtitle" ) ); showErrorsAction->setShortcut( KShortcut( "Shift+E" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( showErrorsAction, SIGNAL( triggered() ), this, SLOT( showErrors() ) ); actionCollection->addAction( ACT_SHOW_ERRORS, showErrorsAction ); actionManager->addAction( showErrorsAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* findErrorAction = new KAction( actionCollection ); findErrorAction->setIcon( KIcon( "edit-find" ) ); findErrorAction->setText( i18n( "Find Error..." ) ); findErrorAction->setStatusTip( i18n( "Find lines with specified errors" ) ); findErrorAction->setShortcut( KShortcut( "Ctrl+Shift+E" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( findErrorAction, SIGNAL( triggered() ), this, SLOT( findError() ) ); actionCollection->addAction( ACT_FIND_ERROR, findErrorAction ); actionManager->addAction( findErrorAction, UserAction::SubHasLine ); KAction* findNextErrorAction = new KAction( actionCollection ); // findNextErrorAction->setIcon( KIcon( "go-down" ) ); findNextErrorAction->setIcon( KIcon( "go-down-search" ) ); findNextErrorAction->setText( i18n( "Find Next Error" ) ); findNextErrorAction->setStatusTip( i18n( "Find next line with specified errors" ) ); findNextErrorAction->setShortcut( KShortcut( "F4" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( findNextErrorAction, SIGNAL( triggered() ), this, SLOT( findNextError() ) ); actionCollection->addAction( ACT_FIND_NEXT_ERROR, findNextErrorAction ); actionManager->addAction( findNextErrorAction, UserAction::SubHasLine ); KAction* findPreviousErrorAction = new KAction( actionCollection ); // findPreviousErrorAction->setIcon( KIcon( "go-up" ) ); findPreviousErrorAction->setIcon( KIcon( "go-up-search" ) ); findPreviousErrorAction->setText( i18n( "Find Previous Error" ) ); findPreviousErrorAction->setStatusTip( i18n( "Find previous line with specified errors" ) ); findPreviousErrorAction->setShortcut( KShortcut( "Shift+F4" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( findPreviousErrorAction, SIGNAL( triggered() ), this, SLOT( findPreviousError() ) ); actionCollection->addAction( ACT_FIND_PREVIOUS_ERROR, findPreviousErrorAction ); actionManager->addAction( findPreviousErrorAction, UserAction::SubHasLine ); KAction* spellCheckAction = new KAction( actionCollection ); spellCheckAction->setIcon( KIcon( "tools-check-spelling" ) ); spellCheckAction->setText( i18n( "Spelling..." ) ); spellCheckAction->setStatusTip( i18n( "Check lines spelling" ) ); connect( spellCheckAction, SIGNAL( triggered() ), this, SLOT( spellCheck() ) ); actionCollection->addAction( ACT_SPELL_CHECK, spellCheckAction ); actionManager->addAction( spellCheckAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* toggleSelectedLinesMarkAction = new KAction( actionCollection ); toggleSelectedLinesMarkAction->setText( i18n( "Toggle Mark" ) ); toggleSelectedLinesMarkAction->setStatusTip( i18n( "Toggle selected lines mark" ) ); toggleSelectedLinesMarkAction->setShortcut( KShortcut( "Ctrl+M" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( toggleSelectedLinesMarkAction, SIGNAL( triggered() ), this, SLOT( toggleSelectedLinesMark() ) ); actionCollection->addAction( ACT_TOGGLE_SELECTED_LINES_MARK, toggleSelectedLinesMarkAction ); actionManager->addAction( toggleSelectedLinesMarkAction, UserAction::HasSelection|UserAction::FullScreenOff ); KAction* toggleSelectedLinesBoldAction = new KAction( actionCollection ); toggleSelectedLinesBoldAction->setIcon( KIcon( "format-text-bold" ) ); toggleSelectedLinesBoldAction->setText( i18n( "Toggle Bold" ) ); toggleSelectedLinesBoldAction->setStatusTip( i18n( "Toggle selected lines bold attribute" ) ); toggleSelectedLinesBoldAction->setShortcut( KShortcut( "Ctrl+B" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( toggleSelectedLinesBoldAction, SIGNAL( triggered() ), this, SLOT( toggleSelectedLinesBold() ) ); actionCollection->addAction( ACT_TOGGLE_SELECTED_LINES_BOLD, toggleSelectedLinesBoldAction ); actionManager->addAction( toggleSelectedLinesBoldAction, UserAction::HasSelection|UserAction::FullScreenOff ); KAction* toggleSelectedLinesItalicAction = new KAction( actionCollection ); toggleSelectedLinesItalicAction->setIcon( KIcon( "format-text-italic" ) ); toggleSelectedLinesItalicAction->setText( i18n( "Toggle Italic" ) ); toggleSelectedLinesItalicAction->setStatusTip( i18n( "Toggle selected lines italic attribute" ) ); toggleSelectedLinesItalicAction->setShortcut( KShortcut( "Ctrl+I" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( toggleSelectedLinesItalicAction, SIGNAL( triggered() ), this, SLOT( toggleSelectedLinesItalic() ) ); actionCollection->addAction( ACT_TOGGLE_SELECTED_LINES_ITALIC, toggleSelectedLinesItalicAction ); actionManager->addAction( toggleSelectedLinesItalicAction, UserAction::HasSelection|UserAction::FullScreenOff ); KAction* toggleSelectedLinesUnderlineAction = new KAction( actionCollection ); toggleSelectedLinesUnderlineAction->setIcon( KIcon( "format-text-underline" ) ); toggleSelectedLinesUnderlineAction->setText( i18n( "Toggle Underline" ) ); toggleSelectedLinesUnderlineAction->setStatusTip( i18n( "Toggle selected lines underline attribute" ) ); toggleSelectedLinesUnderlineAction->setShortcut( KShortcut( "Ctrl+U" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( toggleSelectedLinesUnderlineAction, SIGNAL( triggered() ), this, SLOT( toggleSelectedLinesUnderline() ) ); actionCollection->addAction( ACT_TOGGLE_SELECTED_LINES_UNDERLINE, toggleSelectedLinesUnderlineAction ); actionManager->addAction( toggleSelectedLinesUnderlineAction, UserAction::HasSelection|UserAction::FullScreenOff ); KAction* toggleSelectedLinesStrikeThroughAction = new KAction( actionCollection ); toggleSelectedLinesStrikeThroughAction->setIcon( KIcon( "format-text-strikethrough" ) ); toggleSelectedLinesStrikeThroughAction->setText( i18n( "Toggle Strike Through" ) ); toggleSelectedLinesStrikeThroughAction->setStatusTip( i18n( "Toggle selected lines strike through attribute" ) ); toggleSelectedLinesStrikeThroughAction->setShortcut( KShortcut( "Ctrl+T" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( toggleSelectedLinesStrikeThroughAction, SIGNAL( triggered() ), this, SLOT( toggleSelectedLinesStrikeThrough() ) ); actionCollection->addAction( ACT_TOGGLE_SELECTED_LINES_STRIKETHROUGH, toggleSelectedLinesStrikeThroughAction ); actionManager->addAction( toggleSelectedLinesStrikeThroughAction, UserAction::HasSelection|UserAction::FullScreenOff ); KAction* shiftAction = new KAction( actionCollection ); shiftAction->setText( i18n( "Shift..." ) ); shiftAction->setStatusTip( i18n( "Shift lines an specified amount of time" ) ); shiftAction->setShortcut( KShortcut( "Ctrl+D" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( shiftAction, SIGNAL( triggered() ), this, SLOT( shiftLines() ) ); actionCollection->addAction( ACT_SHIFT, shiftAction ); actionManager->addAction( shiftAction, UserAction::SubHasLine|UserAction::FullScreenOff ); QString shiftTimeMillis( generalConfig()->linesQuickShiftAmount() ); KAction* shiftSelectedLinesFwdAction = new KAction( actionCollection ); shiftSelectedLinesFwdAction->setShortcut( KShortcut( "Shift++" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( shiftSelectedLinesFwdAction, SIGNAL( triggered() ), this, SLOT( shiftSelectedLinesForwards() ) ); actionCollection->addAction( ACT_SHIFT_SELECTED_LINES_FORWARDS, shiftSelectedLinesFwdAction ); actionManager->addAction( shiftSelectedLinesFwdAction, UserAction::HasSelection|UserAction::FullScreenOff ); KAction* shiftSelectedLinesBwdAction = new KAction( actionCollection ); shiftSelectedLinesBwdAction->setShortcut( KShortcut( "Shift+-" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( shiftSelectedLinesBwdAction, SIGNAL( triggered() ), this, SLOT( shiftSelectedLinesBackwards() ) ); actionCollection->addAction( ACT_SHIFT_SELECTED_LINES_BACKWARDS, shiftSelectedLinesBwdAction ); actionManager->addAction( shiftSelectedLinesBwdAction, UserAction::HasSelection|UserAction::FullScreenOff ); // update shiftSelectedLinesFwdAction and shiftSelectedLinesBwdAction texts and status tips onGeneralOptionChanged( GeneralConfig::keyLinesQuickShiftAmount(), QString::number( generalConfig()->linesQuickShiftAmount() ) ); KAction* adjustAction = new KAction( actionCollection ); adjustAction->setText( i18n( "Adjust..." ) ); adjustAction->setStatusTip( i18n( "Linearly adjust all lines to a specified interval" ) ); adjustAction->setShortcut( KShortcut( "Ctrl+J" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( adjustAction, SIGNAL( triggered() ), this, SLOT( adjustLines() ) ); actionCollection->addAction( ACT_ADJUST, adjustAction ); actionManager->addAction( adjustAction, UserAction::SubHasLines|UserAction::FullScreenOff ); KAction* sortLinesAction = new KAction( actionCollection ); sortLinesAction->setText( i18n( "Sort..." ) ); sortLinesAction->setStatusTip( i18n( "Sort lines based on their show time" ) ); connect( sortLinesAction, SIGNAL( triggered() ), this, SLOT( sortLines() ) ); actionCollection->addAction( ACT_SORT_LINES, sortLinesAction ); actionManager->addAction( sortLinesAction, UserAction::SubHasLines|UserAction::FullScreenOff ); KAction* changeFrameRateAction = new KAction( actionCollection ); changeFrameRateAction->setText( i18n( "Change Frame Rate..." ) ); changeFrameRateAction->setStatusTip( i18n( "Retime subtitle lines by reinterpreting its frame rate" ) ); connect( changeFrameRateAction, SIGNAL( triggered() ), this, SLOT( changeFrameRate() ) ); actionCollection->addAction( ACT_CHANGE_FRAME_RATE, changeFrameRateAction ); actionManager->addAction( changeFrameRateAction, UserAction::SubOpened|UserAction::FullScreenOff ); KAction* durationLimitsAction = new KAction( actionCollection ); durationLimitsAction->setText( i18n( "Enforce Duration Limits..." ) ); durationLimitsAction->setStatusTip( i18n( "Enforce lines minimum and/or maximum duration limits" ) ); durationLimitsAction->setShortcut( KShortcut( "Ctrl+L" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( durationLimitsAction, SIGNAL( triggered() ), this, SLOT( enforceDurationLimits() ) ); actionCollection->addAction( ACT_DURATION_LIMITS, durationLimitsAction ); actionManager->addAction( durationLimitsAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* autoDurationsAction = new KAction( actionCollection ); autoDurationsAction->setText( i18n( "Set Automatic Durations..." ) ); autoDurationsAction->setStatusTip( i18n( "Set lines durations based on amount of letters, words and line breaks" ) ); connect( autoDurationsAction, SIGNAL( triggered() ), this, SLOT( setAutoDurations() ) ); actionCollection->addAction( ACT_AUTOMATIC_DURATIONS, autoDurationsAction ); actionManager->addAction( autoDurationsAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* maximizeDurationsAction = new KAction( actionCollection ); maximizeDurationsAction->setText( i18n( "Maximize Durations..." ) ); maximizeDurationsAction->setStatusTip( i18n( "Extend lines durations up to their next lines show time" ) ); connect( maximizeDurationsAction, SIGNAL( triggered() ), this, SLOT( maximizeDurations() ) ); actionCollection->addAction( ACT_MAXIMIZE_DURATIONS, maximizeDurationsAction ); actionManager->addAction( maximizeDurationsAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* fixOverlappingLinesAction = new KAction( actionCollection ); fixOverlappingLinesAction->setText( i18n( "Fix Overlapping Times..." ) ); fixOverlappingLinesAction->setStatusTip( i18n( "Fix lines overlapping times" ) ); connect( fixOverlappingLinesAction, SIGNAL( triggered() ), this, SLOT( fixOverlappingLines() ) ); actionCollection->addAction( ACT_FIX_OVERLAPPING_LINES, fixOverlappingLinesAction ); actionManager->addAction( fixOverlappingLinesAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* syncWithSubtitleAction = new KAction( actionCollection ); syncWithSubtitleAction->setText( i18n( "Synchronize with Subtitle..." ) ); syncWithSubtitleAction->setStatusTip( i18n( "Copy timing information from another subtitle" ) ); connect( syncWithSubtitleAction, SIGNAL( triggered() ), this, SLOT( syncWithSubtitle() ) ); actionCollection->addAction( ACT_SYNC_WITH_SUBTITLE, syncWithSubtitleAction ); actionManager->addAction( syncWithSubtitleAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* breakLinesAction = new KAction( actionCollection ); breakLinesAction->setText( i18n( "Break Lines..." ) ); breakLinesAction->setStatusTip( i18n( "Automatically set line breaks" ) ); connect( breakLinesAction, SIGNAL( triggered() ), this, SLOT( breakLines() ) ); actionCollection->addAction( ACT_ADJUST_TEXTS, breakLinesAction ); actionManager->addAction( breakLinesAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* unbreakTextsAction = new KAction( actionCollection ); unbreakTextsAction->setText( i18n( "Unbreak Lines..." ) ); unbreakTextsAction->setStatusTip( i18n( "Remove line breaks from lines" ) ); connect( unbreakTextsAction, SIGNAL( triggered() ), this, SLOT( unbreakTexts() ) ); actionCollection->addAction( ACT_UNBREAK_TEXTS, unbreakTextsAction ); actionManager->addAction( unbreakTextsAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* simplifySpacesAction = new KAction( actionCollection ); simplifySpacesAction->setText( i18n( "Simplify Spaces..." ) ); simplifySpacesAction->setStatusTip( i18n( "Remove unneeded spaces from lines" ) ); connect( simplifySpacesAction, SIGNAL( triggered() ), this, SLOT( simplifySpaces() ) ); actionCollection->addAction( ACT_SIMPLIFY_SPACES, simplifySpacesAction ); actionManager->addAction( simplifySpacesAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* changeCaseAction = new KAction( actionCollection ); changeCaseAction->setText( i18n( "Change Case..." ) ); changeCaseAction->setStatusTip( i18n( "Change lines text to upper, lower, title or sentence case" ) ); connect( changeCaseAction, SIGNAL( triggered() ), this, SLOT( changeCase() ) ); actionCollection->addAction( ACT_CHANGE_CASE, changeCaseAction ); actionManager->addAction( changeCaseAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* fixPunctuationAction = new KAction( actionCollection ); fixPunctuationAction->setText( i18n( "Fix Punctuation..." ) ); fixPunctuationAction->setStatusTip( i18n( "Fix punctuation errors in lines" ) ); connect( fixPunctuationAction, SIGNAL( triggered() ), this, SLOT( fixPunctuation() ) ); actionCollection->addAction( ACT_FIX_PUNCTUATION, fixPunctuationAction ); actionManager->addAction( fixPunctuationAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* translateAction = new KAction( actionCollection ); translateAction->setText( i18n( "Translate..." ) ); translateAction->setStatusTip( i18n( "Translate lines texts using Google services" ) ); connect( translateAction, SIGNAL( triggered() ), this, SLOT( translate() ) ); actionCollection->addAction( ACT_TRANSLATE, translateAction ); actionManager->addAction( translateAction, UserAction::SubHasLine|UserAction::FullScreenOff ); KAction* editCurrentLineInPlaceAction = new KAction( actionCollection ); editCurrentLineInPlaceAction->setText( i18n( "Edit Line in Place" ) ); editCurrentLineInPlaceAction->setStatusTip( i18n( "Edit current line text in place" ) ); editCurrentLineInPlaceAction->setShortcut( KShortcut( "F2" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( editCurrentLineInPlaceAction, SIGNAL( triggered() ), m_linesWidget, SLOT( editCurrentLineInPlace() ) ); actionCollection->addAction( ACT_EDIT_CURRENT_LINE_IN_PLACE, editCurrentLineInPlaceAction ); actionManager->addAction( editCurrentLineInPlaceAction, UserAction::HasSelection|UserAction::FullScreenOff ); KAction* openVideoAction = new KAction( actionCollection ); openVideoAction->setIcon( KIcon( "document-open" ) ); openVideoAction->setText( i18n( "Open Video..." ) ); openVideoAction->setStatusTip( i18n( "Open video file" ) ); connect( openVideoAction, SIGNAL( triggered() ), this, SLOT( openVideo() ) ); actionCollection->addAction( ACT_OPEN_VIDEO, openVideoAction ); m_recentVideosAction = new KRecentFilesActionExt( actionCollection ); m_recentVideosAction->setIcon( KIcon( "document-open" ) ); m_recentVideosAction->setText( i18n( "Open &Recent Video" ) ); m_recentVideosAction->setStatusTip( i18n( "Open video file" ) ); connect( m_recentVideosAction, SIGNAL(urlSelected(const KUrl&)), this, SLOT(openVideo(const KUrl&)) ); actionCollection->addAction( ACT_RECENT_VIDEOS, m_recentVideosAction ); KAction* closeVideoAction = new KAction( actionCollection ); closeVideoAction->setIcon( KIcon( "window-close" ) ); closeVideoAction->setText( i18n( "Close Video" ) ); closeVideoAction->setStatusTip( i18n( "Close video file" ) ); connect( closeVideoAction, SIGNAL( triggered() ), m_player, SLOT( closeFile() ) ); actionCollection->addAction( ACT_CLOSE_VIDEO, closeVideoAction ); actionManager->addAction( closeVideoAction, UserAction::VideoOpened ); KToggleAction* fullScreenAction = new KToggleAction( actionCollection ); // fullScreenAction->setChecked( false ) fullScreenAction->setIcon( KIcon( "view-fullscreen" ) ); fullScreenAction->setText( i18n( "Full Screen Mode" ) ); fullScreenAction->setStatusTip( i18n( "Toggle full screen mode" ) ); fullScreenAction->setShortcut( KStandardShortcut::fullScreen(), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( fullScreenAction, SIGNAL( toggled(bool) ), this, SLOT( setFullScreenMode(bool) ) ); actionCollection->addAction( ACT_TOGGLE_FULL_SCREEN, fullScreenAction ); KAction* stopAction = new KAction( actionCollection ); stopAction->setIcon( KIcon( "media-playback-stop" ) ); stopAction->setText( i18n( "Stop" ) ); stopAction->setStatusTip( i18n( "Stop video playback" ) ); connect( stopAction, SIGNAL( triggered() ), m_player, SLOT( stop() ) ); actionCollection->addAction( ACT_STOP, stopAction ); actionManager->addAction( stopAction, UserAction::VideoPlaying ); KAction* playPauseAction = new KAction( actionCollection ); playPauseAction->setIcon( KIcon( "media-playback-start" ) ); playPauseAction->setText( i18n( "Play" ) ); playPauseAction->setStatusTip( i18n( "Toggle video playing/paused" ) ); connect( playPauseAction, SIGNAL( triggered() ), m_player, SLOT( togglePlayPaused() ) ); actionCollection->addAction( ACT_PLAY_PAUSE, playPauseAction ); actionManager->addAction( playPauseAction, UserAction::VideoOpened ); KAction* seekBackwardsAction = new KAction( actionCollection ); seekBackwardsAction->setIcon( KIcon( "media-seek-backward" ) ); seekBackwardsAction->setText( i18n( "Seek Backwards" ) ); seekBackwardsAction->setShortcut( KShortcut( "Left" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( seekBackwardsAction, SIGNAL( triggered() ), this, SLOT( seekBackwards() ) ); actionCollection->addAction( ACT_SEEK_BACKWARDS, seekBackwardsAction ); actionManager->addAction( seekBackwardsAction, UserAction::VideoPlaying ); KAction* seekForwardsAction = new KAction( actionCollection ); seekForwardsAction->setIcon( KIcon( "media-seek-forward" ) ); seekForwardsAction->setText( i18n( "Seek Forwards" ) ); seekForwardsAction->setShortcut( KShortcut( "Right" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( seekForwardsAction, SIGNAL( triggered() ), this, SLOT( seekForwards() ) ); actionCollection->addAction( ACT_SEEK_FORWARDS, seekForwardsAction ); actionManager->addAction( seekForwardsAction, UserAction::VideoPlaying ); // update seekBackwardsAction and seekForwardsAction status tip onPlayerOptionChanged( PlayerConfig::keySeekJumpLength(), QString::number( playerConfig()->seekJumpLength() ) ); KAction* seekToPrevLineAction = new KAction( actionCollection ); seekToPrevLineAction->setIcon( KIcon( "media-skip-backward" ) ); seekToPrevLineAction->setText( i18n( "Jump to Previous Line" ) ); seekToPrevLineAction->setStatusTip( i18n( "Seek to previous subtitle line show time" ) ); seekToPrevLineAction->setShortcut( KShortcut( "Shift+Left" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( seekToPrevLineAction, SIGNAL( triggered() ), this, SLOT( seekToPrevLine() ) ); actionCollection->addAction( ACT_SEEK_TO_PREVIOUS_LINE, seekToPrevLineAction ); actionManager->addAction( seekToPrevLineAction, UserAction::SubHasLine|UserAction::VideoPlaying ); KAction* seekToNextLineAction = new KAction( actionCollection ); seekToNextLineAction->setIcon( KIcon( "media-skip-forward" ) ); seekToNextLineAction->setText( i18n( "Jump to Next Line" ) ); seekToNextLineAction->setStatusTip( i18n( "Seek to next subtitle line show time" ) ); seekToNextLineAction->setShortcut( KShortcut( "Shift+Right" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( seekToNextLineAction, SIGNAL( triggered() ), this, SLOT( seekToNextLine() ) ); actionCollection->addAction( ACT_SEEK_TO_NEXT_LINE, seekToNextLineAction ); actionManager->addAction( seekToNextLineAction, UserAction::SubHasLine|UserAction::VideoPlaying ); KAction* setCurrentLineShowTimeFromVideoAction = new KAction( actionCollection ); // setCurrentLineShowTimeFromVideoAction->setIcon( KIcon( "set-show-time" ) ); setCurrentLineShowTimeFromVideoAction->setIcon( KIcon( "zone-start" ) ); setCurrentLineShowTimeFromVideoAction->setText( i18n( "Set Current Line Show Time" ) ); setCurrentLineShowTimeFromVideoAction->setStatusTip( i18n( "Set current line show time to video position" ) ); setCurrentLineShowTimeFromVideoAction->setShortcut( KShortcut( "Shift+Z" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( setCurrentLineShowTimeFromVideoAction, SIGNAL( triggered() ), this, SLOT( setCurrentLineShowTimeFromVideo() ) ); actionCollection->addAction( ACT_SET_CURRENT_LINE_SHOW_TIME, setCurrentLineShowTimeFromVideoAction ); actionManager->addAction( setCurrentLineShowTimeFromVideoAction, UserAction::HasSelection|UserAction::VideoPlaying ); KAction* setCurrentLineHideTimeFromVideoAction = new KAction( actionCollection ); // setCurrentLineHideTimeFromVideoAction->setIcon( KIcon( "set-hide-time" ) ); setCurrentLineHideTimeFromVideoAction->setIcon( KIcon( "zone-end" ) ); setCurrentLineHideTimeFromVideoAction->setText( i18n( "Set Current Line Hide Time" ) ); setCurrentLineHideTimeFromVideoAction->setStatusTip( i18n( "Set current line hide time to video position" ) ); setCurrentLineHideTimeFromVideoAction->setShortcut( KShortcut( "Shift+X" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( setCurrentLineHideTimeFromVideoAction, SIGNAL( triggered() ), this, SLOT( setCurrentLineHideTimeFromVideo() ) ); actionCollection->addAction( ACT_SET_CURRENT_LINE_HIDE_TIME, setCurrentLineHideTimeFromVideoAction ); actionManager->addAction( setCurrentLineHideTimeFromVideoAction, UserAction::HasSelection|UserAction::VideoPlaying ); KToggleAction* currentLineFollowsVideoAction = new KToggleAction( actionCollection ); currentLineFollowsVideoAction->setIcon( KIcon( "current-line-follows-video" ) ); currentLineFollowsVideoAction->setText( i18n( "Current Line Follows Video" ) ); currentLineFollowsVideoAction->setStatusTip( i18n( "Make current line follow the playing video position" ) ); connect( currentLineFollowsVideoAction, SIGNAL( toggled(bool) ), this, SLOT( onLinkCurrentLineToVideoToggled(bool) ) ); actionCollection->addAction( ACT_CURRENT_LINE_FOLLOWS_VIDEO, currentLineFollowsVideoAction ); KToggleAction* toggleMuteAction = new KToggleAction( actionCollection ); toggleMuteAction->setIcon( KIcon( "audio-volume-muted" ) ); toggleMuteAction->setText( i18nc( "@action:inmenu Toggle audio muted", "Mute" ) ); // toggleMuteAction->setText( i18n( "Mute" ), i18n( "Unmute" ) ); toggleMuteAction->setStatusTip( i18n( "Enable/disable playback sound" ) ); toggleMuteAction->setShortcut( KShortcut( "/" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( toggleMuteAction, SIGNAL( toggled(bool) ), m_player, SLOT( setMuted(bool) ) ); actionCollection->addAction( ACT_TOGGLE_MUTED, toggleMuteAction ); KAction* increaseVolumeAction = new KAction( actionCollection ); increaseVolumeAction->setIcon( KIcon( "audio-volume-high" ) ); increaseVolumeAction->setText( i18n( "Increase Volume" ) ); increaseVolumeAction->setStatusTip( i18n( "Increase volume by 5%" ) ); increaseVolumeAction->setShortcut( Qt::Key_Plus, KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( increaseVolumeAction, SIGNAL( triggered() ), m_player, SLOT( increaseVolume() ) ); actionCollection->addAction( ACT_INCREASE_VOLUME, increaseVolumeAction ); KAction* decreaseVolumeAction = new KAction( actionCollection ); decreaseVolumeAction->setIcon( KIcon( "audio-volume-low" ) ); decreaseVolumeAction->setText( i18n( "Decrease Volume" ) ); decreaseVolumeAction->setStatusTip( i18n( "Decrease volume by 5%" ) ); decreaseVolumeAction->setShortcut( Qt::Key_Minus, KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( decreaseVolumeAction, SIGNAL( triggered() ), m_player, SLOT( decreaseVolume() ) ); actionCollection->addAction( ACT_DECREASE_VOLUME, decreaseVolumeAction ); KSelectAction* setActiveAudioStreamAction = new KSelectAction( actionCollection ); setActiveAudioStreamAction->setIcon( KIcon( "select-stream" ) ); setActiveAudioStreamAction->setText( i18n( "Audio Streams" ) ); setActiveAudioStreamAction->setStatusTip( i18n( "Select active audio stream" ) ); connect( setActiveAudioStreamAction, SIGNAL(triggered(int)), m_player, SLOT(setActiveAudioStream(int)) ); actionCollection->addAction( ACT_SET_ACTIVE_AUDIO_STREAM, setActiveAudioStreamAction ); actionManager->addAction( setActiveAudioStreamAction, UserAction::VideoOpened ); KAction* increaseSubtitleFontAction = new KAction( actionCollection ); increaseSubtitleFontAction->setIcon( KIcon( "format-font-size-more" ) ); increaseSubtitleFontAction->setText( i18n( "Increase Font Size" ) ); increaseSubtitleFontAction->setStatusTip( i18n( "Increase subtitles font size by 1 point" ) ); increaseSubtitleFontAction->setShortcut( KShortcut( "Alt++" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( increaseSubtitleFontAction, SIGNAL( triggered() ), m_playerWidget, SLOT( increaseFontSize() ) ); actionCollection->addAction( ACT_INCREASE_SUBTITLE_FONT, increaseSubtitleFontAction ); KAction* decreaseSubtitleFontAction = new KAction( actionCollection ); decreaseSubtitleFontAction->setIcon( KIcon( "format-font-size-less" ) ); decreaseSubtitleFontAction->setText( i18n( "Decrease Font Size" ) ); decreaseSubtitleFontAction->setStatusTip( i18n( "Decrease subtitles font size by 1 point" ) ); decreaseSubtitleFontAction->setShortcut( KShortcut( "Alt+-" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( decreaseSubtitleFontAction, SIGNAL( triggered() ), m_playerWidget, SLOT( decreaseFontSize() ) ); actionCollection->addAction( ACT_DECREASE_SUBTITLE_FONT, decreaseSubtitleFontAction ); KSelectAction* setActiveSubtitleStreamAction = new KSelectAction( actionCollection ); setActiveSubtitleStreamAction->setIcon( KIcon( "select-stream" ) ); setActiveSubtitleStreamAction->setText( i18n( "Subtitle Streams" ) ); setActiveSubtitleStreamAction->setStatusTip( i18n( "Select active subtitle stream" ) ); connect( setActiveSubtitleStreamAction, SIGNAL(triggered(int)), this, SLOT(setActiveSubtitleStream(int)) ); actionCollection->addAction( ACT_SET_ACTIVE_SUBTITLE_STREAM, setActiveSubtitleStreamAction ); actionManager->addAction( setActiveSubtitleStreamAction, UserAction::SubTrOpened ); KAction* shiftToVideoPositionAction = new KAction( actionCollection ); shiftToVideoPositionAction->setText( i18n( "Shift to Video Position" ) ); shiftToVideoPositionAction->setStatusTip( i18n( "Set current line show time to video position by equally shifting all lines" ) ); shiftToVideoPositionAction->setShortcut( KShortcut( "Shift+A" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( shiftToVideoPositionAction, SIGNAL( triggered() ), this, SLOT( shiftToVideoPosition() ) ); actionCollection->addAction( ACT_SHIFT_TO_VIDEO_POSITION, shiftToVideoPositionAction ); actionManager->addAction( shiftToVideoPositionAction, UserAction::HasSelection|UserAction::VideoPlaying|UserAction::FullScreenOff ); KAction* adjustToVideoPositionAnchorLastAction = new KAction( actionCollection ); adjustToVideoPositionAnchorLastAction->setText( i18n( "Adjust to Video Position (Anchor Last Line)" ) ); adjustToVideoPositionAnchorLastAction->setStatusTip( i18n( "Set current line to video position by fixing the last line and linearly adjusting the other ones" ) ); adjustToVideoPositionAnchorLastAction->setShortcut( KShortcut( "Alt+Z" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( adjustToVideoPositionAnchorLastAction, SIGNAL( triggered() ), this, SLOT( adjustToVideoPositionAnchorLast() ) ); actionCollection->addAction( ACT_ADJUST_TO_VIDEO_POSITION_A_L, adjustToVideoPositionAnchorLastAction ); actionManager->addAction( adjustToVideoPositionAnchorLastAction, UserAction::HasSelection|UserAction::VideoPlaying|UserAction::FullScreenOff ); KAction* adjustToVideoPositionAnchorFirstAction = new KAction( actionCollection ); adjustToVideoPositionAnchorFirstAction->setText( i18n( "Adjust to Video Position (Anchor First Line)" ) ); adjustToVideoPositionAnchorFirstAction->setStatusTip( i18n( "Set current line to video position by fixing the first line and linearly adjusting the other ones" ) ); adjustToVideoPositionAnchorFirstAction->setShortcut( KShortcut( "Alt+X" ), KAction::DefaultShortcut|KAction::ActiveShortcut ); connect( adjustToVideoPositionAnchorFirstAction, SIGNAL( triggered() ), this, SLOT( adjustToVideoPositionAnchorFirst() ) ); actionCollection->addAction( ACT_ADJUST_TO_VIDEO_POSITION_A_F, adjustToVideoPositionAnchorFirstAction ); actionManager->addAction( adjustToVideoPositionAnchorFirstAction, UserAction::HasSelection|UserAction::VideoPlaying|UserAction::FullScreenOff ); KAction* scriptsManagerAction = new KAction( actionCollection ); scriptsManagerAction->setIcon( KIcon( "folder-development" ) ); scriptsManagerAction->setText( i18nc( "@action:inmenu Manage user scripts", "Scripts Manager..." ) ); scriptsManagerAction->setStatusTip( i18n( "Manage user scripts" ) ); connect( scriptsManagerAction, SIGNAL( triggered() ), m_scriptsManager, SLOT( showDialog() ) ); actionCollection->addAction( ACT_SCRIPTS_MANAGER, scriptsManagerAction ); actionManager->addAction( scriptsManagerAction, UserAction::FullScreenOff ); // KAction* openAudioLevelsAction = new KAction( actionCollection ); // openAudioLevelsAction->setIcon( "fileopen" ); // openAudioLevelsAction->setText( i18n( "Open Levels..." ) ); // openAudioLevelsAction->setStatusTip( i18n( "Open audio levels file" ) ); // connect( openAudioLevelsAction, SIGNAL( triggered() ), this, SLOT( openAudioLevels() ) ); // actionCollection->addAction( ACT_OPEN_WAVEFORM, openAudioLevelsAction ); // // // m_recentAudioLevelsAction = new KRecentFilesActionExt( actionCollection ); // m_recentAudioLevelsAction->setIcon( "fileopen" ); // m_recentAudioLevelsAction->setText( i18n( "Open &Recent Levels" ) ); // m_recentAudioLevelsAction->setStatusTip( i18n( "Open audio levels file" ) ); // connect( m_recentAudioLevelsAction, SIGNAL(urlSelected(const KUrl&)), this, SLOT(openAudioLevels(const KUrl&)) ); // actionCollection->addAction( ACT_RECENT_WAVEFORMS, m_recentAudioLevelsAction ); // // // KAction* saveAudioLevelsAsAction = new KAction( actionCollection ); // saveAudioLevelsAsAction->setIcon( "filesaveas" ); // saveAudioLevelsAsAction->setText( i18n( "Save Levels As..." ) ); // saveAudioLevelsAsAction->setStatusTip( i18n( "Save audio levels file" ) ); // connect( saveAudioLevelsAsAction, SIGNAL( triggered() ), this, SLOT( saveAudioLevelsAs() ) ); // actionCollection->addAction( ACT_SAVE_LEVELS_AS, saveAudioLevelsAsAction ); // actionManager->addAction( saveAudioLevelsAsAction, UserAction::AudioLevelsOpened ); // // // KAction* closeAudioLevelsAction = new KAction( actionCollection ); // closeAudioLevelsAction->setIcon( "fileclose" ); // closeAudioLevelsAction->setText( i18n( "Close Levels" ) ); // closeAudioLevelsAction->setStatusTip( i18n( "Close audio levels file" ) ); // connect( closeAudioLevelsAction, SIGNAL( triggered() ), this, SLOT( closeAudioLevels() ) ); // actionCollection->addAction( ACT_CLOSE_WAVEFORM, closeAudioLevelsAction ); // actionManager->addAction( closeAudioLevelsAction, UserAction::AudioLevelsOpened ); // // // KAction* increaseAudioLevelsVZoomAction = new KAction( actionCollection ); // increaseAudioLevelsVZoomAction->setIcon( "viewmag+" ); // increaseAudioLevelsVZoomAction->setText( i18n( "Increase Vertical Zoom" ) ); // increaseAudioLevelsVZoomAction->setStatusTip( i18n( "Increase audio levels vertical zoom" ) ); // connect( increaseAudioLevelsVZoomAction, SIGNAL( triggered() ), this, SLOT( increaseAudioLevelsVZoom() ) ); // actionCollection->addAction( ACT_INCREASE_LEVELS_V_ZOOM, increaseAudioLevelsVZoomAction ); // actionManager->addAction( increaseAudioLevelsVZoomAction, UserAction::AudioLevelsOpened ); // // // KAction* decreaseAudioLevelsVZoomAction = new KAction( actionCollection ); // decreaseAudioLevelsVZoomAction->setIcon( "viewmag-" ); // decreaseAudioLevelsVZoomAction->setText( i18n( "Decrease Vertical Zoom" ) ); // decreaseAudioLevelsVZoomAction->setStatusTip( i18n( "Decrease audio levels vertical zoom" ) ); // connect( decreaseAudioLevelsVZoomAction, SIGNAL( triggered() ), this, SLOT( decreaseAudioLevelsVZoom() ) ); // actionCollection->addAction( ACT_DECREASE_LEVELS_V_ZOOM, decreaseAudioLevelsVZoomAction ); // actionManager->addAction( decreaseAudioLevelsVZoomAction, UserAction::AudioLevelsOpened ); // // // KAction* increaseAudioLevelsHZoomAction = new KAction( actionCollection ); // increaseAudioLevelsHZoomAction->setIcon( "viewmag+" ); // increaseAudioLevelsHZoomAction->setText( i18n( "Increase Horizontal Zoom" ) ); // increaseAudioLevelsHZoomAction->setStatusTip( i18n( "Increase audio levels horizontal zoom" ) ); // connect( increaseAudioLevelsHZoomAction, SIGNAL( triggered() ), this, SLOT( increaseAudioLevelsHZoom() ) ); // actionCollection->addAction( ACT_INCREASE_LEVELS_H_ZOOM, increaseAudioLevelsHZoomAction ); // actionManager->addAction( increaseAudioLevelsHZoomAction, UserAction::AudioLevelsOpened ); // // // KAction* decreaseAudioLevelsHZoomAction = new KAction( actionCollection ); // decreaseAudioLevelsHZoomAction->setIcon( "viewmag-" ); // decreaseAudioLevelsHZoomAction->setText( i18n( "Decrease Horizontal Zoom" ) ); // decreaseAudioLevelsHZoomAction->setStatusTip( i18n( "Decrease audio levels horizontal zoom" ) ); // connect( decreaseAudioLevelsHZoomAction, SIGNAL( triggered() ), this, SLOT( decreaseAudioLevelsHZoom() ) ); // actionCollection->addAction( ACT_DECREASE_LEVELS_H_ZOOM, decreaseAudioLevelsHZoomAction ); // actionManager->addAction( decreaseAudioLevelsHZoomAction, UserAction::AudioLevelsOpened ); } /// BEGIN ACTION HANDLERS Time Application::videoPosition( bool compensate ) { if ( compensate && ! m_player->isPaused() ) return Time( (long)(m_player->position()*1000) - generalConfig()->grabbedPositionCompensation() ); else return Time( (long)(m_player->position()*1000) ); } void Application::undo() { if ( m_subtitle ) m_subtitle->actionManager().undo(); } void Application::redo() { if ( m_subtitle ) m_subtitle->actionManager().redo(); } QString Application::encodingForUrl( const KUrl& url ) { QString encoding = m_recentSubtitlesAction->encodingForUrl( url ); if ( encoding.isEmpty() ) { encoding = m_recentTrSubtitlesAction->encodingForUrl( url ); if ( encoding.isEmpty() ) encoding = generalConfig()->defaultSubtitlesEncoding(); } return encoding; } bool Application::acceptClashingUrls( const KUrl& subtitleUrl, const KUrl& subtitleTrUrl ) { KUrl url( subtitleUrl ); url.setFileEncoding( QString() ); KUrl trUrl( subtitleTrUrl ); trUrl.setFileEncoding( QString() ); if ( url != trUrl || url.isEmpty() || trUrl.isEmpty() ) return true; return KMessageBox::Continue == KMessageBox::warningContinueCancel( m_mainWindow, i18n( "The requested action would make the subtitle and its translation share the same file, possibly resulting in loss of information when saving.\nAre you sure you want to continue?" ), i18n( "Conflicting Subtitle Files" ) ); } void Application::newSubtitle() { if ( ! closeSubtitle() ) return; m_subtitle = new Subtitle(); emit subtitleOpened( m_subtitle ); connect( m_subtitle, SIGNAL( primaryDirtyStateChanged(bool) ), this, SLOT( updateTitle() ) ); connect( m_subtitle, SIGNAL( secondaryDirtyStateChanged(bool) ), this, SLOT( updateTitle() ) ); connect( &m_subtitle->actionManager(), SIGNAL( stateChanged() ), this, SLOT( updateUndoRedoToolTips() ) ); updateTitle(); } void Application::openSubtitle() { OpenSubtitleDialog openDlg( true, m_lastSubtitleUrl.prettyUrl(), generalConfig()->defaultSubtitlesEncoding() ); if ( openDlg.exec() == QDialog::Accepted ) { if ( ! acceptClashingUrls( openDlg.selectedUrl(), m_subtitleTrUrl ) ) return; if ( ! closeSubtitle() ) return; m_lastSubtitleUrl = openDlg.selectedUrl(); KUrl fileUrl = m_lastSubtitleUrl; fileUrl.setFileEncoding( openDlg.selectedEncoding() ); openSubtitle( fileUrl ); } } void Application::openSubtitle( const KUrl& url, bool warnClashingUrls ) { if ( warnClashingUrls && ! acceptClashingUrls( url, m_subtitleTrUrl ) ) return; if ( ! closeSubtitle() ) return; QString fileEncoding = url.fileEncoding(); if ( fileEncoding.isEmpty() ) fileEncoding = encodingForUrl( url ); KUrl fileUrl = url; fileUrl.setFileEncoding( QString() ); bool codecFound = true; QTextCodec* codec = KGlobal::charsets()->codecForName( fileEncoding, codecFound ); if ( ! codecFound ) codec = KGlobal::locale()->codecForEncoding(); m_subtitle = new Subtitle(); if ( FormatManager::instance().readSubtitle( *m_subtitle, true, fileUrl, codec, (Format::NewLine*)&m_subtitleEOL, &m_subtitleFormat ) ) { // The loading of the subtitle shouldn't be an undoable action as there's no state before it m_subtitle->actionManager().clearHistory(); m_subtitle->clearPrimaryDirty(); m_subtitle->clearSecondaryDirty(); emit subtitleOpened( m_subtitle ); m_subtitleUrl = fileUrl; m_subtitleFileName = QFileInfo( m_subtitleUrl.path() ).fileName(); m_subtitleEncoding = codec->name(); fileUrl.setFileEncoding( codec->name() ); m_recentSubtitlesAction->addUrl( fileUrl ); m_reloadSubtitleAsAction->setCurrentCodec( codec ); m_quickReloadSubtitleAsAction->setCurrentAction( fileEncoding.toUpper() ); connect( m_subtitle, SIGNAL( primaryDirtyStateChanged(bool) ), this, SLOT( updateTitle() ) ); connect( m_subtitle, SIGNAL( secondaryDirtyStateChanged(bool) ), this, SLOT( updateTitle() ) ); connect( &m_subtitle->actionManager(), SIGNAL( stateChanged() ), this, SLOT( updateUndoRedoToolTips() ) ); updateTitle(); if ( m_subtitleUrl.isLocalFile() && generalConfig()->automaticVideoLoad() ) { static const QStringList videoExtensions( QString( "avi ogm mkv mpeg mpg mp4 rv wmv" ).split( ' ' ) ); QFileInfo subtitleFileInfo( m_subtitleUrl.path() ); QString subtitleFileName = m_subtitleFileName.toLower(); QString videoFileName = QFileInfo( m_player->filePath() ).completeBaseName().toLower(); if ( videoFileName.isEmpty() || subtitleFileName.indexOf( videoFileName ) != 0 ) { QStringList subtitleDirFiles = subtitleFileInfo.dir().entryList( QDir::Files|QDir::Readable ); for ( QStringList::ConstIterator it = subtitleDirFiles.begin(), end = subtitleDirFiles.end(); it != end; ++it ) { QFileInfo fileInfo( *it ); if ( videoExtensions.contains( fileInfo.suffix().toLower() ) ) { if ( subtitleFileName.indexOf( fileInfo.completeBaseName().toLower() ) == 0 ) { KUrl auxUrl; auxUrl.setProtocol( "file" ); auxUrl.setPath( subtitleFileInfo.dir().filePath( *it ) ); openVideo( auxUrl ); break; } } } } } } else { delete m_subtitle; m_subtitle = 0; KMessageBox::sorry( m_mainWindow, i18n( "Could not parse the subtitle file.
This may have been caused by usage of the wrong encoding.
" ) ); } } bool Application::saveSubtitle() { if ( m_subtitleUrl.isEmpty() || m_subtitleEncoding.isEmpty() || ! FormatManager::instance().hasOutput( m_subtitleFormat ) ) return saveSubtitleAs(); bool codecFound = true; QTextCodec* codec = KGlobal::charsets()->codecForName( m_subtitleEncoding, codecFound ); if ( ! codecFound ) codec = KGlobal::locale()->codecForEncoding(); if ( FormatManager::instance().writeSubtitle( *m_subtitle, true, m_subtitleUrl, codec, (Format::NewLine)m_subtitleEOL, m_subtitleFormat, true ) ) { m_subtitle->clearPrimaryDirty(); KUrl recentUrl = m_subtitleUrl; recentUrl.setFileEncoding( codec->name() ); m_recentSubtitlesAction->addUrl( recentUrl ); m_reloadSubtitleAsAction->setCurrentCodec( codec ); m_quickReloadSubtitleAsAction->setCurrentAction( codec->name().toUpper() ); updateTitle(); return true; } else { KMessageBox::sorry( m_mainWindow, i18n( "There was an error saving the subtitle." ) ); return false; } } bool Application::saveSubtitleAs() { SaveSubtitleDialog saveDlg( true, m_subtitleUrl.prettyUrl(), m_subtitleEncoding.isEmpty() ? generalConfig()->defaultSubtitlesEncoding() : m_subtitleEncoding, m_subtitleEOL, m_subtitleFormat ); if ( saveDlg.exec() == QDialog::Accepted ) { if ( ! acceptClashingUrls( saveDlg.selectedUrl(), m_subtitleTrUrl ) ) return false; m_subtitleUrl = saveDlg.selectedUrl(); m_subtitleFileName = QFileInfo( m_subtitleUrl.path() ).completeBaseName(); m_subtitleEncoding = saveDlg.selectedEncoding(); m_subtitleFormat = saveDlg.selectedFormat(); m_subtitleEOL = saveDlg.selectedNewLine(); return saveSubtitle(); } return false; } bool Application::closeSubtitle() { if ( m_subtitle ) { if ( m_translationMode && m_subtitle->isSecondaryDirty() ) { int result = KMessageBox::warningYesNoCancel( 0, i18n( "Currently opened translation subtitle has unsaved changes.\nDo you want to save them?" ), i18n( "Close Translation Subtitle" ) + " - SubtitleComposer" ); if ( result == KMessageBox::Cancel ) return false; else if ( result == KMessageBox::Yes ) if ( ! saveTrSubtitle() ) return false; } if ( m_subtitle->isPrimaryDirty() ) { int result = KMessageBox::warningYesNoCancel( 0, i18n( "Currently opened subtitle has unsaved changes.\nDo you want to save them?" ), i18n( "Close Subtitle" ) + " - SubtitleComposer" ); if ( result == KMessageBox::Cancel ) return false; else if ( result == KMessageBox::Yes ) if ( ! saveSubtitle() ) return false; } if ( m_translationMode ) { m_translationMode = false; emit translationModeChanged( false ); } emit subtitleClosed(); delete m_subtitle; m_subtitle = 0; m_subtitleUrl = KUrl(); m_subtitleFileName.clear(); m_subtitleEncoding.clear(); m_subtitleFormat.clear(); m_subtitleTrUrl = KUrl(); m_subtitleTrFileName.clear(); m_subtitleTrEncoding.clear(); m_subtitleTrFormat.clear(); updateTitle(); } return true; } void Application::newTrSubtitle() { if ( ! closeTrSubtitle() ) return; m_translationMode = true; emit translationModeChanged( true ); updateTitle(); } void Application::openTrSubtitle() { if ( ! m_subtitle ) return; OpenSubtitleDialog openDlg( false, m_lastSubtitleUrl.prettyUrl(), generalConfig()->defaultSubtitlesEncoding() ); if ( openDlg.exec() == QDialog::Accepted ) { if ( ! acceptClashingUrls( m_subtitleUrl, openDlg.selectedUrl() ) ) return; if ( ! closeTrSubtitle() ) return; m_lastSubtitleUrl = openDlg.selectedUrl(); KUrl fileUrl = m_lastSubtitleUrl; fileUrl.setFileEncoding( openDlg.selectedEncoding() ); openTrSubtitle( fileUrl ); } } void Application::openTrSubtitle( const KUrl& url, bool warnClashingUrls ) { if ( ! m_subtitle ) return; if ( warnClashingUrls && ! acceptClashingUrls( m_subtitleUrl, url ) ) return; if ( ! closeTrSubtitle() ) return; QString fileEncoding = url.fileEncoding(); if ( fileEncoding.isEmpty() ) fileEncoding = encodingForUrl( url ); KUrl fileUrl = url; fileUrl.setFileEncoding( QString() ); bool codecFound = true; QTextCodec* codec = KGlobal::charsets()->codecForName( fileEncoding, codecFound ); if ( ! codecFound ) codec = KGlobal::locale()->codecForEncoding(); if ( FormatManager::instance().readSubtitle( *m_subtitle, false, fileUrl, codec, (Format::NewLine*)&m_subtitleTrEOL, &m_subtitleTrFormat ) ) { m_subtitleTrUrl = fileUrl; m_subtitleTrFileName = QFileInfo( m_subtitleTrUrl.path() ).fileName(); m_subtitleTrEncoding = codec->name(); fileUrl.setFileEncoding( codec->name() ); m_recentTrSubtitlesAction->addUrl( fileUrl ); QStringList subtitleStreams; subtitleStreams.append( i18nc( "@item:inmenu Display primary text in video player", "Primary" ) ); subtitleStreams.append( i18nc( "@item:inmenu Display translation text in video player", "Translation" ) ); KSelectAction* activeSubtitleStreamAction = (KSelectAction*)action( ACT_SET_ACTIVE_SUBTITLE_STREAM ); activeSubtitleStreamAction->setItems( subtitleStreams ); activeSubtitleStreamAction->setCurrentItem( 0 ); m_translationMode = true; updateTitle(); } else KMessageBox::sorry( m_mainWindow, i18n( "Could not parse the subtitle file." ) ); // After the loading of the translation subtitle we must clear the history or (from // a user POV) it would be possible to execute (undo) actions which would result in an // unexpected state. m_subtitle->actionManager().clearHistory(); // We don't clear the primary dirty state because the loading of the translation // only changes it when actually needed (i.e., when the translation had more lines) m_subtitle->clearSecondaryDirty(); if ( m_translationMode ) emit translationModeChanged( true ); } bool Application::saveTrSubtitle() { if ( m_subtitleTrUrl.isEmpty() || m_subtitleTrEncoding.isEmpty() || ! FormatManager::instance().hasOutput( m_subtitleTrFormat ) ) return saveTrSubtitleAs(); bool codecFound = true; QTextCodec* codec = KGlobal::charsets()->codecForName( m_subtitleTrEncoding, codecFound ); if ( ! codecFound ) codec = KGlobal::locale()->codecForEncoding(); if ( FormatManager::instance().writeSubtitle( *m_subtitle, false, m_subtitleTrUrl, codec, (Format::NewLine)m_subtitleTrEOL, m_subtitleTrFormat, true ) ) { m_subtitle->clearSecondaryDirty(); KUrl recentUrl = m_subtitleTrUrl; recentUrl.setFileEncoding( codec->name() ); m_recentTrSubtitlesAction->addUrl( recentUrl ); updateTitle(); return true; } else { KMessageBox::sorry( m_mainWindow, i18n( "There was an error saving the translation subtitle." ) ); return false; } } bool Application::saveTrSubtitleAs() { SaveSubtitleDialog saveDlg( false, m_subtitleTrUrl.prettyUrl(), m_subtitleTrEncoding.isEmpty() ? generalConfig()->defaultSubtitlesEncoding() : m_subtitleTrEncoding, m_subtitleTrEOL, m_subtitleTrFormat ); if ( saveDlg.exec() == QDialog::Accepted ) { if ( ! acceptClashingUrls( m_subtitleUrl, saveDlg.selectedUrl() ) ) return false; m_subtitleTrUrl = saveDlg.selectedUrl(); m_subtitleTrFileName = QFileInfo( m_subtitleTrUrl.path() ).completeBaseName(); m_subtitleTrEncoding = saveDlg.selectedEncoding(); m_subtitleTrFormat = saveDlg.selectedFormat(); m_subtitleTrEOL = saveDlg.selectedNewLine(); return saveTrSubtitle(); } return false; } bool Application::closeTrSubtitle() { if ( m_subtitle && m_translationMode ) { if ( m_translationMode && m_subtitle->isSecondaryDirty() ) { int result = KMessageBox::warningYesNoCancel( 0, i18n( "Currently opened translation subtitle has unsaved changes.\nDo you want to save them?" ), i18n( "Close Translation Subtitle" ) + " - SubtitleComposer" ); if ( result == KMessageBox::Cancel ) return false; else if ( result == KMessageBox::Yes ) if ( ! saveTrSubtitle() ) return false; } m_translationMode = false; emit translationModeChanged( false ); updateTitle(); m_linesWidget->setUpdatesEnabled( false ); int oldUndoCount = m_subtitle->actionManager().undoCount(); m_subtitle->clearSecondaryTextData(); // The cleaning of the translations texts shouldn't be an undoable action so if // such action was stored by m_subtitle->clearSecondaryTextData() we remove it if ( m_subtitle->actionManager().undoCount() != oldUndoCount ) m_subtitle->actionManager().popUndo(); m_linesWidget->setUpdatesEnabled( true ); } return true; } void Application::openSubtitleWithDefaultEncoding() { changeSubtitlesEncoding( generalConfig()->defaultSubtitlesEncoding() ); } void Application::changeSubtitlesEncoding( const QString& encoding ) { bool wasTranslationMode = m_translationMode; KUrl wasSubtitleTrUrl = m_subtitleTrUrl; if ( m_subtitleUrl.isEmpty() ) m_subtitleEncoding = encoding; else { if ( m_subtitleEncoding != encoding ) { KUrl fileUrl = m_subtitleUrl; fileUrl.setFileEncoding( encoding ); openSubtitle( fileUrl ); } } if ( wasTranslationMode && m_subtitle /*openSubtitle can fail, so we check that there is indeed a subtitle loaded*/ ) { if ( wasSubtitleTrUrl.isEmpty() ) { newTrSubtitle(); m_subtitleTrEncoding = encoding; } else { KUrl fileUrl = wasSubtitleTrUrl; fileUrl.setFileEncoding( encoding ); openTrSubtitle( fileUrl ); } } } void Application::joinSubtitles() { static JoinSubtitlesDialog* dlg = new JoinSubtitlesDialog( generalConfig()->defaultSubtitlesEncoding(), m_mainWindow ); dlg->setDefaultEncoding( generalConfig()->defaultSubtitlesEncoding() ); if ( dlg->exec() == QDialog::Accepted ) { bool codecFound; QTextCodec* codec = KGlobal::charsets()->codecForName( dlg->subtitleEncoding(), codecFound ); if ( ! codecFound ) codec = KGlobal::locale()->codecForEncoding(); Subtitle secondSubtitle; bool primary = dlg->selectedTextsTarget() != Subtitle::Secondary; if ( FormatManager::instance().readSubtitle( secondSubtitle, primary, dlg->subtitlePath(), codec ) ) { if ( dlg->selectedTextsTarget() == Subtitle::Both ) secondSubtitle.setSecondaryData( secondSubtitle, true ); m_subtitle->appendSubtitle( secondSubtitle, dlg->shiftTime().toMillis() ); } else KMessageBox::sorry( m_mainWindow, i18n( "Could not read the subtitle file to append." ) ); } } KUrl Application::saveSplittedSubtitle( const Subtitle& subtitle, const KUrl& srcUrl, QString encoding, QString format, bool primary ) { KUrl dstUrl; if ( subtitle.linesCount() ) { QFileInfo dstFileInfo = srcUrl.isEmpty() ? QFileInfo( QDir( System::tempDir() ), primary ? "untitled.srt" : "untitled-translation.srt" ) : srcUrl.path(); dstUrl = srcUrl; dstUrl.setPath( dstFileInfo.path() ); dstUrl = System::newUrl( dstUrl, dstFileInfo.completeBaseName() + " - splitted", dstFileInfo.suffix() ); if ( encoding.isEmpty() ) encoding = "UTF-8"; bool codecFound; QTextCodec* codec = KGlobal::charsets()->codecForName( encoding, codecFound ); if ( ! codecFound ) codec = KGlobal::locale()->codecForEncoding(); if ( format.isEmpty() ) format = "SubRip"; bool success = FormatManager::instance().writeSubtitle( subtitle, primary, dstUrl, codec, (Format::NewLine)(primary ? m_subtitleEOL : m_subtitleTrEOL), format, false ); if ( success ) dstUrl.setFileEncoding( codec->name() ); else dstUrl = KUrl(); } if ( dstUrl.path().isEmpty() ) { KMessageBox::sorry( m_mainWindow, primary ? i18n( "Could not write the splitted subtitle file." ) : i18n( "Could not write the splitted subtitle translation file." ) ); } return dstUrl; } void Application::splitSubtitle() { static SplitSubtitleDialog* dlg = new SplitSubtitleDialog( m_mainWindow ); if ( dlg->exec() != QDialog::Accepted ) return; Subtitle newSubtitle; m_subtitle->splitSubtitle( newSubtitle, dlg->splitTime().toMillis(), dlg->shiftNewSubtitle() ); if ( ! newSubtitle.linesCount() ) { KMessageBox::information( m_mainWindow, i18n( "The specified time does not split the subtitles." ) ); return; } KUrl splittedUrl = saveSplittedSubtitle( newSubtitle, m_subtitleUrl.prettyUrl(), m_subtitleEncoding, m_subtitleFormat, true ); if ( splittedUrl.path().isEmpty() ) { // there was an error saving the splitted part, undo the splitting of m_subtitle m_subtitle->actionManager().undo(); return; } KUrl splittedTrUrl; if ( m_translationMode ) { splittedTrUrl = saveSplittedSubtitle( newSubtitle, m_subtitleTrUrl, m_subtitleTrEncoding, m_subtitleTrFormat, false ); if ( splittedTrUrl.path().isEmpty() ) { // there was an error saving the splitted part, undo the splitting of m_subtitle m_subtitle->actionManager().undo(); return; } } QStringList args; args << splittedUrl.prettyUrl(); if ( m_translationMode ) args << splittedTrUrl.prettyUrl(); if ( ! QProcess::startDetached( KCmdLineArgs::aboutData()->appName(), args ) ) { KMessageBox::sorry( m_mainWindow, m_translationMode ? i18n( "Could not open a new Subtitle Composer window.\n" "The splitted part was saved as %1.", splittedUrl.path() ) : i18n( "Could not open a new Subtitle Composer window.\n" "The splitted parts were saved as %1 and %2.", splittedUrl.path(), splittedTrUrl.path() ) ); } } void Application::insertBeforeCurrentLine() { static InsertLineDialog* dlg = new InsertLineDialog( true, m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) { SubtitleLine* currentLine = m_linesWidget->currentLine(); m_subtitle->insertNewLine( currentLine ? currentLine->index() : 0, false, dlg->selectedTextsTarget() ); } } void Application::insertAfterCurrentLine() { static InsertLineDialog* dlg = new InsertLineDialog( false, m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) { SubtitleLine* currentLine = m_linesWidget->currentLine(); m_subtitle->insertNewLine( currentLine ? currentLine->index() + 1 : 0, true, dlg->selectedTextsTarget() ); } } void Application::removeSelectedLines() { static RemoveLinesDialog* dlg = new RemoveLinesDialog( m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) { RangeList selectionRanges = m_linesWidget->selectionRanges(); if ( selectionRanges.isEmpty() ) return; m_subtitle->removeLines( selectionRanges, dlg->selectedTextsTarget() ); int firstIndex = selectionRanges.firstIndex(); if ( firstIndex < m_subtitle->linesCount() ) m_linesWidget->setCurrentLine( m_subtitle->line( firstIndex ), true ); else if ( firstIndex - 1 < m_subtitle->linesCount() ) m_linesWidget->setCurrentLine( m_subtitle->line( firstIndex - 1 ), true ); } } void Application::joinSelectedLines() { const RangeList& ranges = m_linesWidget->selectionRanges(); // if ( ranges.count() > 1 && KMessageBox::Continue != KMessageBox::warningContinueCancel( // m_mainWindow, // i18n( "Current selection has multiple ranges.\nContinuing will join them all." ), // i18n( "Join Lines" ) ) ) // return; m_subtitle->joinLines( ranges ); } void Application::splitSelectedLines() { m_subtitle->splitLines( m_linesWidget->selectionRanges() ); } void Application::selectAllLines() { m_linesWidget->selectAll(); } void Application::gotoLine() { IntInputDialog gotoLineDlg( i18n( "Go to Line" ), i18n( "&Go to line:" ), 1, m_subtitle->linesCount(), m_linesWidget->currentLineIndex() + 1 ); if ( gotoLineDlg.exec() == QDialog::Accepted ) m_linesWidget->setCurrentLine( m_subtitle->line( gotoLineDlg.value() - 1 ), true ); } void Application::find() { m_lastFoundLine = 0; m_finder->find( m_linesWidget->selectionRanges(), m_linesWidget->currentLineIndex(), m_curLineWidget->focusedText(), false ); } void Application::findNext() { if ( ! m_finder->findNext() ) { m_lastFoundLine = 0; m_finder->find( m_linesWidget->selectionRanges(), m_linesWidget->currentLineIndex(), m_curLineWidget->focusedText(), false ); } } void Application::findPrevious() { if ( ! m_finder->findPrevious() ) { m_lastFoundLine = 0; m_finder->find( m_linesWidget->selectionRanges(), m_linesWidget->currentLineIndex(), m_curLineWidget->focusedText(), true ); } } void Application::replace() { m_replacer->replace( m_linesWidget->selectionRanges(), m_linesWidget->currentLineIndex(), m_curLineWidget->focusedText() ); } void Application::spellCheck() { m_speller->spellCheck( m_linesWidget->currentLineIndex() ); } void Application::findError() { m_lastFoundLine = 0; m_errorFinder->find( m_linesWidget->selectionRanges(), m_linesWidget->currentLineIndex(), false ); } void Application::findNextError() { if ( ! m_errorFinder->findNext() ) { m_lastFoundLine = 0; m_errorFinder->find( m_linesWidget->selectionRanges(), m_linesWidget->currentLineIndex(), false ); } } void Application::findPreviousError() { if ( ! m_errorFinder->findPrevious() ) { m_lastFoundLine = 0; m_errorFinder->find( m_linesWidget->selectionRanges(), m_linesWidget->currentLineIndex(), true ); } } void Application::retrocedeCurrentLine() { SubtitleLine* currentLine = m_linesWidget->currentLine(); if ( currentLine && currentLine->prevLine() ) m_linesWidget->setCurrentLine( currentLine->prevLine(), true ); } void Application::advanceCurrentLine() { SubtitleLine* currentLine = m_linesWidget->currentLine(); if ( currentLine && currentLine->nextLine() ) m_linesWidget->setCurrentLine( currentLine->nextLine(), true ); } void Application::checkErrors() { static CheckErrorsDialog* dlg = new CheckErrorsDialog( m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) { SubtitleCompositeActionExecutor executor( *m_subtitle, i18n( "Check Lines Errors" ) ); RangeList targetRanges( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ) ); if ( dlg->clearOtherErrors() ) { int flagsToClear = SubtitleLine::AllErrors & (~dlg->selectedErrorFlags() & ~SubtitleLine::UserMark); m_subtitle->clearErrors( targetRanges, flagsToClear ); } if ( dlg->clearMarks() ) m_subtitle->setMarked( targetRanges, false ); m_subtitle->checkErrors( targetRanges, dlg->selectedErrorFlags(), errorsConfig()->minDuration(), errorsConfig()->maxDuration(), errorsConfig()->minDurationPerChar(), errorsConfig()->maxDurationPerChar(), errorsConfig()->maxCharacters(), errorsConfig()->maxLines() ); } } void Application::recheckAllErrors() { m_subtitle->recheckErrors( Range::full(), errorsConfig()->minDuration(), errorsConfig()->maxDuration(), errorsConfig()->minDurationPerChar(), errorsConfig()->maxDurationPerChar(), errorsConfig()->maxCharacters(), errorsConfig()->maxLines() ); } void Application::recheckSelectedErrors() { // NOTE we can't just use Subtitle::recheckErrors() with the selected lines ranges // because this slots handles the error dialog action where the user can not only // select lines but can also select (or unselect) specific errors SubtitleCompositeActionExecutor executor( *m_subtitle, i18n( "Check Lines Errors" ) ); for ( SubtitleIterator it( *m_subtitle, m_errorsWidget->selectionRanges() ); it.current(); ++it ) { it.current()->check( m_errorsWidget->lineSelectedErrorFlags( it.current()->index() ), errorsConfig()->minDuration(), errorsConfig()->maxDuration(), errorsConfig()->minDurationPerChar(), errorsConfig()->maxDurationPerChar(), errorsConfig()->maxCharacters(), errorsConfig()->maxLines() ); } } void Application::clearErrors() { static ClearErrorsDialog* dlg = new ClearErrorsDialog( m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) { SubtitleCompositeActionExecutor executor( *m_subtitle, i18n( "Clear Lines Errors" ) ); RangeList targetRanges( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ) ); m_subtitle->clearErrors( targetRanges, dlg->selectedErrorFlags() ); } } void Application::clearSelectedErrors( bool includeMarks ) { SubtitleCompositeActionExecutor executor( *m_subtitle, i18n( "Clear Lines Errors" ) ); for ( SubtitleIterator it( *m_subtitle, m_errorsWidget->selectionRanges() ); it.current(); ++it ) { SubtitleLine* line = it.current(); int errorFlags = m_errorsWidget->lineSelectedErrorFlags( line->index() ); if ( ! includeMarks ) errorFlags = errorFlags & ~SubtitleLine::UserMark; line->setErrorFlags( errorFlags, false ); } } void Application::clearSelectedMarks() { m_subtitle->setMarked( m_errorsWidget->selectionRanges(), false ); } void Application::showErrors() { if ( m_errorsDialog->isHidden() ) m_errorsDialog->show(); } void Application::showErrorsConfig() { m_configDialog->setCurrentPage( ConfigDialog::Errors ); m_configDialog->show(); } void Application::toggleSelectedLinesMark() { m_subtitle->toggleMarked( m_linesWidget->selectionRanges() ); } void Application::toggleSelectedLinesBold() { m_subtitle->toggleStyleFlag( m_linesWidget->selectionRanges(), SString::Bold ); } void Application::toggleSelectedLinesItalic() { m_subtitle->toggleStyleFlag( m_linesWidget->selectionRanges(), SString::Italic ); } void Application::toggleSelectedLinesUnderline() { m_subtitle->toggleStyleFlag( m_linesWidget->selectionRanges(), SString::Underline ); } void Application::toggleSelectedLinesStrikeThrough() { m_subtitle->toggleStyleFlag( m_linesWidget->selectionRanges(), SString::StrikeThrough ); } void Application::shiftLines() { static ShiftTimesDialog* dlg = new ShiftTimesDialog( m_mainWindow ); dlg->resetShiftTime(); if ( dlg->exec() == QDialog::Accepted ) { m_subtitle->shiftLines( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), dlg->shiftTimeMillis() ); } } void Application::shiftSelectedLinesForwards() { m_subtitle->shiftLines( m_linesWidget->selectionRanges(), generalConfig()->linesQuickShiftAmount() ); } void Application::shiftSelectedLinesBackwards() { m_subtitle->shiftLines( m_linesWidget->selectionRanges(), - generalConfig()->linesQuickShiftAmount() ); } void Application::adjustLines() { static AdjustTimesDialog* dlg = new AdjustTimesDialog( m_mainWindow ); dlg->setFirstLineTime( m_subtitle->firstLine()->showTime() ); dlg->setLastLineTime( m_subtitle->lastLine()->showTime() ); if ( dlg->exec() == QDialog::Accepted ) { m_subtitle->adjustLines( Range::full(), dlg->firstLineTime().toMillis(), dlg->lastLineTime().toMillis() ); } } void Application::sortLines() { static ActionWithLinesTargetDialog* dlg = new ActionWithLinesTargetDialog( i18n( "Sort" ), m_mainWindow ); PROFILE(); dlg->setLinesTargetEnabled( ActionWithTargetDialog::Selection, true ); if ( m_linesWidget->selectionHasMultipleRanges() ) { if ( m_linesWidget->showingContextMenu() ) { KMessageBox::sorry( m_mainWindow, i18n( "Can not perform sort on selection with multiple ranges." ) ); return; } else { dlg->setLinesTargetEnabled( ActionWithTargetDialog::Selection, false ); dlg->setSelectedLinesTarget( ActionWithTargetDialog::AllLines ); } } if ( dlg->exec() == QDialog::Accepted ) { RangeList targetRanges( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ) ); if ( ! targetRanges.isEmpty() ) { m_subtitle->sortLines( *targetRanges.begin() ); } } } void Application::changeFrameRate() { static ChangeFrameRateDialog* dlg = new ChangeFrameRateDialog( m_subtitle->framesPerSecond(), m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) { m_subtitle->changeFramesPerSecond( dlg->toFramesPerSecond(), dlg->fromFramesPerSecond() ); } } void Application::enforceDurationLimits() { static DurationLimitsDialog* dlg = new DurationLimitsDialog( errorsConfig()->minDuration(), errorsConfig()->maxDuration(), m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) { m_subtitle->applyDurationLimits( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), dlg->enforceMinDuration() ? dlg->minDuration() : 0, dlg->enforceMaxDuration() ? dlg->maxDuration() : Time::MaxMseconds, ! dlg->preventOverlap() ); } } void Application::setAutoDurations() { static AutoDurationsDialog* dlg = new AutoDurationsDialog( 60, 50, 50, m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) { m_subtitle->setAutoDurations( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), dlg->charMillis(), dlg->wordMillis(), dlg->lineMillis(), ! dlg->preventOverlap(), dlg->calculationMode() ); } } void Application::maximizeDurations() { static ActionWithLinesTargetDialog* dlg = new ActionWithLinesTargetDialog( i18n( "Maximize Durations" ), m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) m_subtitle->setMaximumDurations( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ) ); } void Application::fixOverlappingLines() { static FixOverlappingTimesDialog* dlg = new FixOverlappingTimesDialog( m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) m_subtitle->fixOverlappingLines( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), dlg->minimumInterval() ); } void Application::syncWithSubtitle() { static SyncSubtitlesDialog* dlg = new SyncSubtitlesDialog( generalConfig()->defaultSubtitlesEncoding(), m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) { bool codecFound = true; QTextCodec* codec = KGlobal::charsets()->codecForName( dlg->subtitleEncoding(), codecFound ); if ( ! codecFound ) codec = KGlobal::locale()->codecForEncoding(); Subtitle referenceSubtitle; if ( FormatManager::instance().readSubtitle( referenceSubtitle, true, dlg->subtitlePath(), codec ) ) { if ( dlg->adjustToReferenceSubtitle() ) { if ( referenceSubtitle.linesCount() <= 1 ) KMessageBox::sorry( m_mainWindow, i18n( "The reference subtitle must have more than one line to proceed." ) ); else m_subtitle->adjustLines( Range::full(), referenceSubtitle.firstLine()->showTime().toMillis(), referenceSubtitle.lastLine()->showTime().toMillis() ); } else // if ( dlg->synchronizeToReferenceTimes() ) m_subtitle->syncWithSubtitle( referenceSubtitle ); } else KMessageBox::sorry( m_mainWindow, i18n( "Could not parse the reference subtitle file." ) ); } } void Application::breakLines() { static SmartTextsAdjustDialog* dlg = new SmartTextsAdjustDialog( 30, m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) m_subtitle->breakLines( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), dlg->minLengthForLineBreak(), dlg->selectedTextsTarget() ); } void Application::unbreakTexts() { static ActionWithLinesAndTextsTargetDialog* dlg = new ActionWithLinesAndTextsTargetDialog( i18n( "Unbreak Lines" ), m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) m_subtitle->unbreakTexts( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), dlg->selectedTextsTarget() ); } void Application::simplifySpaces() { static ActionWithLinesAndTextsTargetDialog* dlg = new ActionWithLinesAndTextsTargetDialog( i18n( "Simplify Spaces" ), m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) m_subtitle->simplifyTextWhiteSpace( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), dlg->selectedTextsTarget() ); } void Application::changeCase() { static ChangeTextsCaseDialog* dlg = new ChangeTextsCaseDialog( m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) { switch ( dlg->caseOperation() ) { case ChangeTextsCaseDialog::Upper: m_subtitle->upperCase( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), dlg->selectedTextsTarget() ); break; case ChangeTextsCaseDialog::Lower: m_subtitle->lowerCase( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), dlg->selectedTextsTarget() ); break; case ChangeTextsCaseDialog::Title: m_subtitle->titleCase( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), dlg->lowerFirst(), dlg->selectedTextsTarget() ); break; case ChangeTextsCaseDialog::Sentence: m_subtitle->sentenceCase( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), dlg->lowerFirst(), dlg->selectedTextsTarget() ); break; } } } void Application::fixPunctuation() { static FixPunctuationDialog* dlg = new FixPunctuationDialog( m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) { m_subtitle->fixPunctuation( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), dlg->spaces(), dlg->quotes(), dlg->englishI(), dlg->ellipisis(), dlg->selectedTextsTarget() ); } } bool Application::applyTranslation( RangeList ranges, bool primary, int inputLanguage, int outputLanguage, int textTargets ) { Translator translator; QString inputLanguageName = Language::name( (Language::Value)inputLanguage ); QString outputLanguageName = Language::name( (Language::Value)outputLanguage ); ProgressDialog progressDialog( i18n( "Translate" ), i18n( "Translating text (%1 to %2)...", inputLanguageName, outputLanguageName ), true, m_mainWindow ); if ( textTargets == SubtitleLine::Both ) { progressDialog.setDescription( primary ? i18n( "Translating primary text (%1 to %2)...", inputLanguageName, outputLanguageName ) : i18n( "Translating secondary text (%1 to %2)...", inputLanguageName, outputLanguageName ) ); } QString inputText; QRegExp ellipsisRegExp( "(^ *\\.\\.\\.|\\.\\.\\. *$)" ); for ( SubtitleIterator it( *m_subtitle, ranges ); it.current(); ++it ) { QString lineText = it.current()->primaryText().richString(); lineText.remove( ellipsisRegExp ).replace( '\n', ' ' ).replace( '-', "- " ); inputText += "()()" + lineText + '\n'; } translator.syncTranslate( inputText, (Language::Value)inputLanguage, (Language::Value)outputLanguage, &progressDialog ); if ( translator.isAborted() ) return false; // ended with error QStringList outputLines; QString errorMessage; if ( translator.isFinishedWithError() ) errorMessage = translator.errorMessage(); else { outputLines = translator.outputText().split( QRegExp( "\n? *\\(\\) *\\(\\) *" ) ); if ( outputLines.count() != ranges.indexesCount() + 1 ) { if ( outputLines.count() == ranges.indexesCount() ) outputLines << ""; else errorMessage = i18n( "Unable to perform texts synchronization (sent and received lines count do not match)." ); } } if ( errorMessage.isEmpty() ) { SubtitleCompositeActionExecutor executor( *m_subtitle, primary ? i18n( "Translate Primary Text" ) : i18n( "Translate Secondary Text" ) ); int index = 0; QRegExp tagsRegExp( "()" ); for ( SubtitleIterator it( *m_subtitle, ranges ); it.current(); ++it ) { SString text; text.setRichString( QString( outputLines.at( ++index ) ).replace( tagsRegExp, "\\1\\2" ) ); it.current()->setPrimaryText( text.trimmed() ); } } else { KMessageBox::sorry( m_mainWindow, i18n( "There was an error performing the translation:\n\n%1", errorMessage ) ); } return errorMessage.isEmpty(); } void Application::translate() { static TranslateDialog* dlg = new TranslateDialog( m_mainWindow ); if ( dlg->exec() == QDialog::Accepted ) { if ( dlg->selectedTextsTarget() == Subtitle::Primary || dlg->selectedTextsTarget() == Subtitle::Both ) { if ( ! applyTranslation( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), true, dlg->inputLanguage(), dlg->outputLanguage(), dlg->selectedTextsTarget() ) ) return; // skip secondary translation on previous error (most likely a connection/service issue) } if ( dlg->selectedTextsTarget() == Subtitle::Secondary || dlg->selectedTextsTarget() == Subtitle::Both ) { applyTranslation( m_linesWidget->targetRanges( dlg->selectedLinesTarget() ), false, dlg->inputLanguage(), dlg->outputLanguage(), dlg->selectedTextsTarget() ); } } } void Application::openVideo( const KUrl& url ) { if ( url.protocol() != "file" ) return; m_player->closeFile(); m_player->openFile( url.path() ); } void Application::openVideo() { KFileDialog openDlg( m_lastVideoUrl, buildMediaFilesFilter(), m_mainWindow ); openDlg.setModal( true ); openDlg.setCaption( i18n( "Open Video" ) ); if ( openDlg.exec() == QDialog::Accepted ) { m_lastVideoUrl = openDlg.selectedUrl(); openVideo( openDlg.selectedUrl() ); } } void Application::toggleFullScreenMode() { setFullScreenMode( ! m_playerWidget->fullScreenMode() ); } void Application::setFullScreenMode( bool enabled ) { if ( enabled != m_playerWidget->fullScreenMode() ) { m_playerWidget->setFullScreenMode( enabled ); KToggleAction* toggleFullScreenAction = (KToggleAction*)action( ACT_TOGGLE_FULL_SCREEN ); toggleFullScreenAction->setChecked( enabled ); emit fullScreenModeChanged( enabled ); } } void Application::seekBackwards() { double position = m_player->position() - playerConfig()->seekJumpLength(); m_player->seek( position > 0.0 ? position : 0.0, false ); } void Application::seekForwards() { double position = m_player->position() + playerConfig()->seekJumpLength(); m_player->seek( position <= m_player->length() ? position : m_player->length(), false ); } void Application::seekToPrevLine() { SubtitleLine* overlayLine = m_playerWidget->overlayLine(); if ( overlayLine ) { SubtitleLine* prevLine = overlayLine->prevLine(); if ( prevLine ) { m_player->seek( (prevLine->showTime().toMillis()) / 1000.0, true ); m_linesWidget->setCurrentLine( prevLine ); m_curLineWidget->setCurrentLine( prevLine ); } } } void Application::seekToNextLine() { SubtitleLine* overlayLine = m_playerWidget->overlayLine(); if ( overlayLine ) { SubtitleLine* nextLine = overlayLine->nextLine(); if ( nextLine ) { m_player->seek( (nextLine->showTime().toMillis()) / 1000.0, true ); m_linesWidget->setCurrentLine( nextLine ); m_curLineWidget->setCurrentLine( nextLine ); } } } void Application::setCurrentLineShowTimeFromVideo() { SubtitleLine* currentLine = m_linesWidget->currentLine(); if ( currentLine ) currentLine->setShowTime( videoPosition( true ) ); } void Application::setCurrentLineHideTimeFromVideo() { SubtitleLine* currentLine = m_linesWidget->currentLine(); if ( currentLine ) { currentLine->setHideTime( videoPosition( true ) ); SubtitleLine* nextLine = currentLine->nextLine(); if ( nextLine ) m_linesWidget->setCurrentLine( nextLine, true ); } } void Application::setActiveSubtitleStream( int subtitleStream ) { KSelectAction* activeSubtitleStreamAction = (KSelectAction*)action( ACT_SET_ACTIVE_SUBTITLE_STREAM ); activeSubtitleStreamAction->setCurrentItem( subtitleStream ); m_playerWidget->setShowTranslation( subtitleStream ? true : false ); } void Application::shiftToVideoPosition() { SubtitleLine* currentLine = m_linesWidget->currentLine(); if ( currentLine ) { m_subtitle->shiftLines( Range::full(), videoPosition( true ).toMillis() - currentLine->showTime().toMillis() ); } } void Application::adjustToVideoPositionAnchorLast() { SubtitleLine* currentLine = m_linesWidget->currentLine(); if ( currentLine ) { long lastLineTime = m_subtitle->lastLine()->showTime().toMillis(); long oldCurrentLineTime = currentLine->showTime().toMillis(); long oldDeltaTime = lastLineTime - oldCurrentLineTime; if ( ! oldDeltaTime ) return; long newCurrentLineTime = videoPosition( true ).toMillis(); long newDeltaTime = lastLineTime - newCurrentLineTime; double scaleFactor = (double)newDeltaTime/oldDeltaTime; long shiftTime = (long)(newCurrentLineTime-scaleFactor*oldCurrentLineTime); long newFirstLineTime = (long)(shiftTime + m_subtitle->firstLine()->showTime().toMillis()*scaleFactor); if ( newFirstLineTime < 0 ) { if ( KMessageBox::warningContinueCancel( m_mainWindow, i18n( "Continuing would result in loss of timing information for some lines.\nAre you sure you want to continue?" ) ) != KMessageBox::Continue ) return; } m_subtitle->adjustLines( Range::full(), newFirstLineTime, lastLineTime ); } } void Application::adjustToVideoPositionAnchorFirst() { SubtitleLine* currentLine = m_linesWidget->currentLine(); if ( currentLine ) { long firstLineTime = m_subtitle->firstLine()->showTime().toMillis(); long oldCurrentLineTime = currentLine->showTime().toMillis(); long oldDeltaTime = oldCurrentLineTime - firstLineTime; if ( ! oldDeltaTime ) return; long newCurrentLineTime = videoPosition( true ).toMillis(); long newDeltaTime = newCurrentLineTime - firstLineTime; double scaleFactor = (double)newDeltaTime/oldDeltaTime; long shiftTime = (long)(firstLineTime-scaleFactor*firstLineTime); long newLastLineTime = (long)(shiftTime + m_subtitle->lastLine()->showTime().toMillis()*scaleFactor); if ( newLastLineTime > Time::MaxMseconds ) { if ( KMessageBox::warningContinueCancel( m_mainWindow, i18n( "Continuing would result in loss of timing information for some lines.\nAre you sure you want to continue?" ) ) != KMessageBox::Continue ) return; } m_subtitle->adjustLines( Range::full(), firstLineTime, newLastLineTime ); } } void Application::openAudioLevels() { KFileDialog openDlg( m_lastAudioLevelsUrl, buildLevelsFilesFilter(), m_mainWindow ); openDlg.setModal( true ); openDlg.setCaption( i18n( "Open AudioLevels" ) ); if ( openDlg.exec() == QDialog::Accepted ) { m_lastAudioLevelsUrl = openDlg.selectedUrl(); openAudioLevels( openDlg.selectedUrl() ); } } void Application::openAudioLevels( const KUrl& /*url*/ ) { // FIXME audio levels /* closeAudioLevels(); m_audiolevels = new AudioLevels(); // if ( m_audiolevels->loadFromMedia( url.path(), true ) ) if ( m_audiolevels->load( url ) ) { m_recentAudioLevelsAction->addUrl( url ); emit audiolevelsOpened( m_audiolevels ); } else { delete m_audiolevels; m_audiolevels = 0; KMessageBox::sorry( m_mainWindow, i18n( "There was an error opening the audiolevels." ) ); } */ } void Application::saveAudioLevelsAs() { // FIXME audio levels /* KFileDialog saveDlg( m_lastAudioLevelsUrl, QString(), m_mainWindow ); saveDlg.setModal( true ); saveDlg.setCaption( i18n( "Save AudioLevels" ) ); saveDlg.setOperationMode( KFileDialog::Saving ); saveDlg.setMode( KFile::File ); if ( saveDlg.exec() == QDialog::Accepted ) { KUrl selectedUrl = saveDlg.selectedUrl(); if ( FileSaveHelper::exists( selectedUrl ) ) { if ( KMessageBox::warningContinueCancel( m_mainWindow, i18n( "A file named \"%1\" already exists. Are you sure you want to overwrite it?", QFileInfo( selectedUrl.path() ).fileName() ), i18n( "Overwrite File?" ), KGuiItem( i18n( "Overwrite" ) ) ) != KMessageBox::Continue ) return; } if ( ! m_audiolevels->save( selectedUrl, true ) ) KMessageBox::sorry( m_mainWindow, i18n( "There was an error saving the audiolevels." ) ); } */ } void Application::closeAudioLevels() { // FIXME audio levels /* delete m_audiolevels; m_audiolevels = 0; emit audiolevelsClosed(); */ } void Application::increaseAudioLevelsVZoom() { } void Application::decreaseAudioLevelsVZoom() { } void Application::increaseAudioLevelsHZoom() { } void Application::decreaseAudioLevelsHZoom() { } /// END ACTION HANDLERS void Application::updateTitle() { if ( m_subtitle ) { if ( m_translationMode ) { static const QString titleBuilder( "%1%2 | %3%4" ); static const QString modified = QString::fromUtf8( " [" ) + i18n( "modified" ) + QString::fromUtf8( "]" ); m_mainWindow->setCaption( titleBuilder .arg( m_subtitleUrl.isEmpty() ? i18n( "Untitled" ) : m_subtitleFileName ) .arg( m_subtitle->isPrimaryDirty() ? modified : QString() ) .arg( m_subtitleTrUrl.isEmpty() ? i18n( "Untitled Translation" ) : m_subtitleTrFileName ) .arg( m_subtitle->isSecondaryDirty() ? modified : QString() ), false ); } else { m_mainWindow->setCaption( m_subtitleUrl.isEmpty() ? i18n( "Untitled" ) : (m_subtitleUrl.isLocalFile() ? m_subtitleUrl.path() : m_subtitleUrl.prettyUrl()), m_subtitle->isPrimaryDirty() ); } } else m_mainWindow->setCaption( QString() ); } void Application::updateUndoRedoToolTips() { static QAction* undoAction = action( ACT_UNDO ); static QAction* redoAction = action( ACT_REDO ); static const QString undoToolTip = undoAction->toolTip(); static const QString redoToolTip = redoAction->toolTip(); if ( m_subtitle ) { if ( m_subtitle->actionManager().hasUndo() ) undoAction->setToolTip( undoToolTip + ": " + m_subtitle->actionManager().undoDescription() ); else undoAction->setToolTip( undoToolTip ); if ( m_subtitle->actionManager().hasRedo() ) redoAction->setToolTip( redoToolTip + ": " + m_subtitle->actionManager().redoDescription() ); else redoAction->setToolTip( redoToolTip ); } } void Application::onLineDoubleClicked( SubtitleLine* line ) { if ( m_player->state() == Player::Ready ) m_player->play(); int mseconds = line->showTime().toMillis() - generalConfig()->seekOffsetOnDoubleClick(); m_player->seek( mseconds > 0 ? mseconds / 1000.0 : 0.0, true ); if ( m_player->state() == Player::Paused ) m_player->play(); } void Application::onHighlightLine( SubtitleLine* line, bool primary, int firstIndex, int lastIndex ) { if ( m_playerWidget->fullScreenMode() ) { if ( m_lastFoundLine != line ) { m_lastFoundLine = line; m_player->seek( line->showTime().toMillis() / 1000.0, true ); } } else { m_linesWidget->setCurrentLine( line, true ); if ( firstIndex >= 0 && lastIndex >= 0 ) { if ( primary ) m_curLineWidget->highlightPrimary( firstIndex, lastIndex ); else m_curLineWidget->highlightSecondary( firstIndex, lastIndex ); } } } void Application::onPlayingLineChanged( SubtitleLine* line ) { m_linesWidget->setPlayingLine( line ); if ( m_linkCurrentLineToPosition ) m_linesWidget->setCurrentLine( line, true ); } void Application::onLinkCurrentLineToVideoToggled( bool value ) { if ( m_linkCurrentLineToPosition != value ) { m_linkCurrentLineToPosition = value; if ( m_linkCurrentLineToPosition ) m_linesWidget->setCurrentLine( m_playerWidget->playingLine(), true ); } } void Application::onPlayerFileOpened( const QString& filePath ) { m_recentVideosAction->addUrl( KUrl( filePath ) ); } void Application::onPlayerPlaying() { QAction* playPauseAction = action( ACT_PLAY_PAUSE ); playPauseAction->setIcon( KIcon( "media-playback-pause" ) ); playPauseAction->setText( i18n( "Pause" ) ); } void Application::onPlayerPaused() { QAction* playPauseAction = action( ACT_PLAY_PAUSE ); playPauseAction->setIcon( KIcon( "media-playback-start" ) ); playPauseAction->setText( i18n( "Play" ) ); } void Application::onPlayerStopped() { QAction* playPauseAction = action( ACT_PLAY_PAUSE ); playPauseAction->setIcon( KIcon( "media-playback-start" ) ); playPauseAction->setText( i18n( "Play" ) ); } void Application::onPlayerAudioStreamsChanged( const QStringList& audioStreams ) { KSelectAction* activeAudioStreamAction = (KSelectAction*)action( ACT_SET_ACTIVE_AUDIO_STREAM ); activeAudioStreamAction->setItems( audioStreams ); } void Application::onPlayerActiveAudioStreamChanged( int audioStream ) { KSelectAction* activeAudioStreamAction = (KSelectAction*)action( ACT_SET_ACTIVE_AUDIO_STREAM ); if ( audioStream >= 0 ) activeAudioStreamAction->setCurrentItem( audioStream ); } void Application::onPlayerMuteChanged( bool muted ) { KToggleAction* toggleMutedAction = (KToggleAction*)action( ACT_TOGGLE_MUTED ); toggleMutedAction->setChecked( muted ); } void Application::onPlayerOptionChanged( const QString& option, const QString& value ) { if ( option == PlayerConfig::keySeekJumpLength() ) { action( ACT_SEEK_BACKWARDS )->setStatusTip( i18np( "Seek backwards 1 second", "Seek backwards %1 seconds", value.toInt() ) ); action( ACT_SEEK_FORWARDS )->setStatusTip( i18np( "Seek forwards 1 second", "Seek forwards %1 seconds", value.toInt() ) ); } } void Application::onGeneralOptionChanged( const QString& option, const QString& value ) { if ( option == GeneralConfig::keyLinesQuickShiftAmount() ) { int shiftTimeMillis = value.toInt(); QAction* shiftSelectedLinesFwdAction = action( ACT_SHIFT_SELECTED_LINES_FORWARDS ); shiftSelectedLinesFwdAction->setText( i18np( "Shift %21 Millisecond", "Shift %2%1 Milliseconds", shiftTimeMillis, "+" ) ); shiftSelectedLinesFwdAction->setStatusTip( i18np( "Shift selected lines %21 millisecond", "Shift selected lines %2%1 milliseconds", shiftTimeMillis, "+" ) ); QAction* shiftSelectedLinesBwdAction = action( ACT_SHIFT_SELECTED_LINES_BACKWARDS ); shiftSelectedLinesBwdAction->setText( i18np( "Shift %21 Millisecond", "Shift %2%1 Milliseconds", shiftTimeMillis, "-" ) ); shiftSelectedLinesBwdAction->setStatusTip( i18np( "Shift selected lines %21 millisecond", "Shift selected lines -%2%1 milliseconds", shiftTimeMillis, "-" ) ); } } void Application::updateConfigFromDialog() { m_config = m_configDialog->config(); // We have to manually update the player backends configurations because the have their own copies QStringList backendNames( m_player->backendNames() ); for ( QStringList::ConstIterator it = backendNames.begin(), end = backendNames.end(); it != end; ++it ) m_player->backend( *it )->setConfig( m_config.group( *it ) ); } #include "application.moc" subtitlecomposer-0.5.3/src/main/mainwindow.cpp0000644000175000001440000000672411153657673020753 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "mainwindow.h" #include "application.h" #include "audiolevelswidget.h" #include "playerwidget.h" #include "lineswidget.h" #include "currentlinewidget.h" #include "../player/player.h" #include #include #include #include #include #include using namespace SubtitleComposer; MainWindow::MainWindow(): KXmlGuiWindow( 0 ) { QWidget* mainWidget = new QWidget( this ); QSplitter* splitter = new QSplitter( mainWidget ); // m_audiolevelsWidget = new AudioLevelsWidget( splitter ); // m_audiolevelsWidget->hide(); m_playerWidget = new PlayerWidget( splitter ); m_playerWidget->setContentsMargins( 0, 0, 0, 0 ); m_linesWidget = new LinesWidget( splitter ); m_linesWidget->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); splitter->setOrientation( Qt::Vertical ); splitter->setLineWidth( 0 ); splitter->setCollapsible( 1, false ); splitter->setSizes( QList() << 100 << 200 ); m_curLineWidget = new CurrentLineWidget( mainWidget ); m_curLineWidget->setMaximumHeight( m_curLineWidget->minimumSizeHint().height() ); QLayout* mainWidgetLayout = new QBoxLayout( QBoxLayout::TopToBottom, mainWidget ); mainWidgetLayout->setContentsMargins( 5, 1, 5, 2 ); mainWidgetLayout->setSpacing( 5 ); mainWidgetLayout->addWidget( splitter ); mainWidgetLayout->addWidget( m_curLineWidget ); setCentralWidget( mainWidget ); // tell the KMainWindow that this is indeed the main widget statusBar()->show(); // a status bar toolBar()->show(); // and a tool bar menuBar()->show(); } MainWindow::~MainWindow() { app()->saveConfig(); Player* player = Player::instance(); // We must disconnect the player when closing down, otherwise signal handlers // could be called with the some object destroyed, crashing the application disconnect( player, 0, 0, 0 ); player->setApplicationClosingDown(); } void MainWindow::loadConfig() { } void MainWindow::saveConfig() { } void MainWindow::setSubtitle( Subtitle* /*subtitle*/ ) { } bool MainWindow::queryClose() { return app()->closeSubtitle(); } #include "mainwindow.moc" subtitlecomposer-0.5.3/src/main/errorswidget.cpp0000644000175000001440000005612211153641513021276 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "profiler.h" #include "errorswidget.h" #include "application.h" #include "configs/errorsconfig.h" #include "../core/subtitle.h" #include "../core/subtitleline.h" #include #include #include #include #include #include #include #include #include #include #include using namespace SubtitleComposer; /// ERRORS MODEL NODE /// ================= ErrorsModelNode::ErrorsModelNode( ErrorsModel* model, const SubtitleLine* line ): m_model( model ), m_line( line ), m_errorCount( 0 ), m_marked( false ) { update(); } ErrorsModelNode::~ErrorsModelNode() { if ( m_marked ) m_model->m_markCount--; m_model->m_errorCount -= m_errorCount; if ( m_errorCount ) m_model->m_lineWithErrorsCount--; } void ErrorsModelNode::update() { bool newMarked = m_line->errorFlags() & SubtitleLine::UserMark; int newErrorsCount = m_line->errorCount(); if ( newMarked != m_marked ) { if ( m_marked ) m_model->m_markCount--; else m_model->m_markCount++; m_marked = newMarked; } if ( newErrorsCount > m_errorCount ) { m_model->incrementErrorsCount( newErrorsCount - m_errorCount ); int modelL1Row = m_model->mapLineIndexToModelL1Row( m_line->index() ) + 1; if ( ! m_errorCount ) // line was not visible before { m_model->beginInsertRows( QModelIndex(), modelL1Row, modelL1Row ); m_model->incrementVisibleLinesCount( 1 ); m_model->endInsertRows(); } m_model->beginInsertRows( m_model->index( modelL1Row, 0 ), m_errorCount, newErrorsCount - 1 ); m_errorCount = newErrorsCount; m_model->endInsertRows(); } else if ( newErrorsCount < m_errorCount ) { m_model->incrementErrorsCount( newErrorsCount - m_errorCount ); int modelL1Row = m_model->mapLineIndexToModelL1Row( m_line->index() ); if ( ! newErrorsCount ) // line is no longer visible { m_model->beginRemoveRows( QModelIndex(), modelL1Row, modelL1Row ); m_model->incrementVisibleLinesCount( -1 ); m_errorCount = 0; m_model->endRemoveRows(); } else { m_model->beginRemoveRows( m_model->index( modelL1Row, 0 ), newErrorsCount, m_errorCount - 1 ); m_errorCount = newErrorsCount; m_model->endRemoveRows(); } } } /// ERRORS MODEL /// ============ ErrorsModel::ErrorsModel( QObject* parent ): QAbstractItemModel( parent ), m_subtitle( 0 ), m_nodes(), m_statsChangedTimer( new QTimer( this ) ), m_lineWithErrorsCount( 0 ), m_errorCount( 0 ), m_markCount( 0 ), m_dataChangedTimer( new QTimer( this ) ), m_minChangedLineIndex( -1 ), m_maxChangedLineIndex( -1 ) { m_statsChangedTimer->setInterval( 0 ); m_statsChangedTimer->setSingleShot( true ); connect( m_statsChangedTimer, SIGNAL( timeout() ), this, SIGNAL( statsChanged() ) ); m_dataChangedTimer->setInterval( 0 ); m_dataChangedTimer->setSingleShot( true ); connect( m_dataChangedTimer, SIGNAL( timeout() ), this, SLOT( emitDataChanged() ) ); } ErrorsModel::~ErrorsModel() { qDeleteAll( m_nodes ); } int ErrorsModel::mapModelIndexToLineIndex( const QModelIndex& modelIndex ) const { if ( ! modelIndex.isValid() ) // modelIndex is the root item return -1; else if ( modelIndex.parent().isValid() ) // modelIndex is an error item return mapModelL1RowToLineIndex( modelIndex.parent().row() ); else // modelIndex is a line item return mapModelL1RowToLineIndex( modelIndex.row() ); } int ErrorsModel::mapLineIndexToModelL1Row( int targetLineIndex ) const { int modelL1Row = -1; if ( targetLineIndex >= m_nodes.count() ) targetLineIndex = m_nodes.count() - 1; for ( int lineIndex = 0; lineIndex <= targetLineIndex; ++lineIndex ) if ( m_nodes.at( lineIndex )->isVisible() ) modelL1Row++; return modelL1Row; } int ErrorsModel::mapModelL1RowToLineIndex( int targetModelL1Row ) const { int modelL1Row = -1; for ( int lineIndex = 0, linesCount = m_nodes.count(); lineIndex < linesCount; ++lineIndex ) { if ( m_nodes.at( lineIndex )->isVisible() ) { modelL1Row++; if ( modelL1Row == targetModelL1Row ) return lineIndex; } } return -1; } int ErrorsModel::mapModelL2RowToLineErrorID( int targetModelL2Row, int lineErrorFlags ) const { for ( int errorID = 0, modelL2Row = -1; errorID < SubtitleLine::ErrorSIZE; ++errorID ) { if ( ((0x1 << errorID) & lineErrorFlags) ) { modelL2Row++; if ( modelL2Row == targetModelL2Row ) return errorID; } } return SubtitleLine::ErrorUNKNOWN; } int ErrorsModel::mapModelL2RowToLineErrorFlag( int targetModelL2Row, int lineErrorFlags ) const { for ( int errorID = 0, modelL2Row = -1; errorID < SubtitleLine::ErrorSIZE; ++errorID ) { if ( ((0x1 << errorID) & lineErrorFlags) ) { modelL2Row++; if ( modelL2Row == targetModelL2Row ) return 0x1 << errorID; } } return 0; } void ErrorsModel::onLinesInserted( int firstLineIndex, int lastLineIndex ) { int firstVisibleLineIndex = INT_MAX, lastVisibleLineIndex = INT_MIN; ErrorsModelNode* node; for ( int lineIndex = firstLineIndex; lineIndex <= lastLineIndex; ++lineIndex ) { node = new ErrorsModelNode( this, m_subtitle->line( lineIndex ) ); m_nodes.insert( lineIndex, node ); if ( node->isVisible() ) { if ( lineIndex < firstVisibleLineIndex ) firstVisibleLineIndex = lineIndex; if ( lineIndex > lastVisibleLineIndex ) lastVisibleLineIndex = lineIndex; } } if ( firstVisibleLineIndex != INT_MAX && lastVisibleLineIndex != INT_MIN ) // at least one visible line was inserted { beginInsertRows( QModelIndex(), mapLineIndexToModelL1Row( firstVisibleLineIndex ), mapLineIndexToModelL1Row( lastVisibleLineIndex ) ); endInsertRows(); } emit dataChanged(); } void ErrorsModel::onLinesRemoved( int firstLineIndex, int lastLineIndex ) { int firstVisibleLineIndex = INT_MAX, lastVisibleLineIndex = INT_MIN; for ( int lineIndex = firstLineIndex; lineIndex <= lastLineIndex; ++lineIndex ) { if ( m_nodes.at( lineIndex )->isVisible() ) { if ( lineIndex < firstVisibleLineIndex ) firstVisibleLineIndex = lineIndex; if ( lineIndex > lastVisibleLineIndex ) lastVisibleLineIndex = lineIndex; } } int lastErrorRow = mapLineIndexToModelL1Row( lastVisibleLineIndex ); if ( firstVisibleLineIndex != INT_MAX && lastVisibleLineIndex != INT_MIN ) // at least one visible line was removed { int firstErrorRow = mapLineIndexToModelL1Row( firstVisibleLineIndex ); beginRemoveRows( QModelIndex(), firstErrorRow, lastErrorRow ); endRemoveRows(); } for ( int lineIndex = firstLineIndex; lineIndex <= lastLineIndex; ++lineIndex ) delete m_nodes.takeAt( firstLineIndex ); emit dataChanged(); } void ErrorsModel::onLineErrorsChanged( SubtitleLine* line ) { int lineIndex = line->index(); m_nodes.at( lineIndex )->update(); markLineChanged( lineIndex ); } void ErrorsModel::markLineChanged( int lineIndex ) { if ( m_minChangedLineIndex < 0 ) { m_minChangedLineIndex = lineIndex; m_maxChangedLineIndex = lineIndex; m_dataChangedTimer->start(); } else if ( lineIndex < m_minChangedLineIndex ) m_minChangedLineIndex = lineIndex; else if ( lineIndex > m_maxChangedLineIndex ) m_maxChangedLineIndex = lineIndex; } void ErrorsModel::emitDataChanged() { if ( m_minChangedLineIndex < 0 ) m_minChangedLineIndex = m_maxChangedLineIndex; else if ( m_maxChangedLineIndex < 0 ) m_maxChangedLineIndex = m_minChangedLineIndex; // at this point m_minChangedLineIndex and m_maxChangedLineIndex contain // indexes for lines that may not be visible int firstVisibleLineIndex = INT_MAX, lastVisibleLineIndex = INT_MIN; for ( int lineIndex = m_minChangedLineIndex; lineIndex <= m_maxChangedLineIndex; ++lineIndex ) { if ( m_nodes.at( lineIndex )->isVisible() ) { if ( lineIndex < firstVisibleLineIndex ) firstVisibleLineIndex = lineIndex; if ( lineIndex > lastVisibleLineIndex ) lastVisibleLineIndex = lineIndex; } } if ( firstVisibleLineIndex != INT_MAX && lastVisibleLineIndex != INT_MIN ) // at least one visible line was removed { // now we can map the lines indexes to error indexes emit dataChanged( index( mapLineIndexToModelL1Row( firstVisibleLineIndex ), 0 ), index( mapLineIndexToModelL1Row( lastVisibleLineIndex ), 0 ) ); } m_minChangedLineIndex = -1; m_maxChangedLineIndex = -1; } void ErrorsModel::incrementVisibleLinesCount( int delta ) { if ( ! m_statsChangedTimer->isActive() ) m_statsChangedTimer->start(); m_lineWithErrorsCount += delta; } void ErrorsModel::incrementErrorsCount( int delta ) { if ( ! m_statsChangedTimer->isActive() ) m_statsChangedTimer->start(); m_errorCount += delta; } void ErrorsModel::incrementMarksCount( int delta ) { if ( ! m_statsChangedTimer->isActive() ) m_statsChangedTimer->start(); m_markCount += delta; } void ErrorsModel::setSubtitle( Subtitle* subtitle ) { if ( m_subtitle != subtitle ) { if ( m_subtitle ) { disconnect( m_subtitle, SIGNAL( linesInserted( int, int ) ), this, SLOT( onLinesInserted( int, int ) ) ); disconnect( m_subtitle, SIGNAL( linesRemoved( int, int ) ), this, SLOT( onLinesRemoved( int, int ) ) ); disconnect( m_subtitle, SIGNAL( lineErrorFlagsChanged( SubtitleLine*, int ) ), this, SLOT( onLineErrorsChanged( SubtitleLine* ) ) ); if ( m_subtitle->linesCount() ) onLinesRemoved( 0, m_subtitle->linesCount() - 1 ); } m_subtitle = subtitle; if ( m_subtitle ) { if ( m_subtitle->linesCount() ) onLinesInserted( 0, m_subtitle->linesCount() - 1 ); connect( m_subtitle, SIGNAL( linesInserted( int, int ) ), this, SLOT( onLinesInserted( int, int ) ) ); connect( m_subtitle, SIGNAL( linesRemoved( int, int ) ), this, SLOT( onLinesRemoved( int, int ) ) ); connect( m_subtitle, SIGNAL( lineErrorFlagsChanged( SubtitleLine*, int ) ), this, SLOT( onLineErrorsChanged( SubtitleLine* ) ) ); } } } int ErrorsModel::rowCount( const QModelIndex& parent ) const { if ( ! m_subtitle ) return 0; if ( ! parent.isValid() ) // parent is the root item return m_lineWithErrorsCount; if ( parent.parent().isValid() ) // parent is an error item return 0; // parent is a line item int lineIndex = mapModelL1RowToLineIndex( parent.row() ); return lineIndex < 0 ? 0 : m_nodes.at( lineIndex )->errorCount(); } int ErrorsModel::columnCount( const QModelIndex& /*parent*/ ) const { return ColumnCount; } QModelIndex ErrorsModel::index( int row, int column, const QModelIndex& parent ) const { SubtitleLine* line = static_cast( parent.internalPointer() ); if ( ! line ) // index is a root level item { if ( row < 0 || row >= m_lineWithErrorsCount ) return QModelIndex(); // kDebug() << "retrieved level 1 CHILD index " << row; return createIndex( row, column, (void*)&LEVEL1_LINE ); } if ( line == &LEVEL1_LINE ) // index is a first level item (line item) { if ( row >= rowCount( parent ) || row < 0 /*|| column != Number*/ ) return QModelIndex(); // kDebug() << "retrieved level 2 CHILD index " << row; return createIndex( row, column, m_subtitle->line( mapModelL1RowToLineIndex( parent.row() ) ) ); } else // if ( line ) // index is a second level item (error item) { // kDebug() << "attempted to retrieve level 3 CHILD index " << row; return QModelIndex(); } } QModelIndex ErrorsModel::parent( const QModelIndex& index ) const { SubtitleLine* line = static_cast( index.internalPointer() ); if ( ! line ) // index is a root level item { // kDebug() << "attempted to retrieve level -1 PARENT index" << -2; return QModelIndex(); } if ( line == &LEVEL1_LINE ) // index is a first level item (line item) { // kDebug() << "retrieved level 0 PARENT index" << -1; return QModelIndex(); } else // if ( line ) // index is a second level item (error item) { // kDebug() << "retrieved level 1 PARENT index" << line->index(); return createIndex( mapLineIndexToModelL1Row( line->index() ), 0, (void*)&LEVEL1_LINE ); } } QVariant ErrorsModel::headerData( int section, Qt::Orientation orientation, int role ) const { if ( orientation == Qt::Vertical || role != Qt::DisplayRole ) return QVariant(); switch ( section ) { case Number: return i18n( "Line Errors" ); case ErrorCount: return i18n( "Count" ); case UserMark: return i18n( "Marked" ); default: return QVariant(); } } QVariant ErrorsModel::data( const QModelIndex& index, int role ) const { if ( ! m_subtitle || ! index.isValid() ) return QVariant(); SubtitleLine* line = static_cast( index.internalPointer() ); if ( line == &LEVEL1_LINE ) { if ( role == Qt::DisplayRole ) { static const QString yes = i18n( "yes" ); static const QString no = i18n( "no" ); int lineIndex = mapModelL1RowToLineIndex( index.row() ); if ( lineIndex < 0 ) return QVariant(); if ( index.column() == Number ) return i18n( "Line %1", lineIndex + 1 ); else if ( index.column() == ErrorCount ) return QString::number( m_nodes.at( lineIndex )->errorCount() ); else if ( index.column() == UserMark ) return m_nodes.at( lineIndex )->isMarked() ? yes : no; else return QVariant(); } else return QVariant(); } else { if ( index.column() != Number ) return QVariant(); if ( role == Qt::DisplayRole ) { int errorID = mapModelL2RowToLineErrorID( index.row(), line->errorFlags() ); return line->fullErrorText( (SubtitleLine::ErrorID)errorID ); } else if ( role == Qt::DecorationRole ) { int errorID = mapModelL2RowToLineErrorID( index.row(), line->errorFlags() ); if ( ((0x1 << errorID) & line->errorFlags()) == 0 ) return QVariant(); return errorID == SubtitleLine::UserMarkID ? markIcon() : errorIcon(); } else return QVariant(); } } const QIcon& ErrorsModel::markIcon() { static QIcon markIcon; if ( markIcon.isNull() ) markIcon = KIcon( "dialog-warning" ); return markIcon; } const QIcon& ErrorsModel::errorIcon() { static QIcon errorIcon; if ( errorIcon.isNull() ) errorIcon = KIcon( "dialog-error" ); return errorIcon; } /// ERRORS WIDGET /// ============= ErrorsWidget::ErrorsWidget( QWidget* parent ): TreeView( parent ), m_subtitle( 0 ) { setModel( new ErrorsModel( this ) ); QHeaderView* header = this->header(); header->setResizeMode( ErrorsModel::Number, QHeaderView::Interactive ); header->setResizeMode( ErrorsModel::ErrorCount, QHeaderView::Interactive ); header->setResizeMode( ErrorsModel::UserMark, QHeaderView::Interactive ); setSortingEnabled( false ); setRootIsDecorated( true ); setAllColumnsShowFocus( true ); setIconSize( QSize( 16, 16 ) ); setIndentation( 15 ); setUniformRowHeights( true ); setSelectionMode( QAbstractItemView::ExtendedSelection ); setSelectionBehavior( QAbstractItemView::SelectRows ); connect( selectionModel(), SIGNAL( currentRowChanged( const QModelIndex&, const QModelIndex& ) ), this, SLOT( onCurrentRowChanged( const QModelIndex& ) ) ); } ErrorsWidget::~ErrorsWidget() { } void ErrorsWidget::expandAll() { expandToDepth( 0 ); return; } void ErrorsWidget::loadConfig() { KConfigGroup group( KGlobal::config()->group( "ErrorsWidget Settings" ) ); QByteArray state; QStringList strState = group.readXdgListEntry( "Columns State", QString( "" ).split( ' ' ) ); for ( QStringList::ConstIterator it = strState.begin(), end = strState.end(); it != end; ++it ) state.append( (char)(*it).toInt() ); header()->restoreState( state ); } void ErrorsWidget::saveConfig() { KConfigGroup group( KGlobal::config()->group( "ErrorsWidget Settings" ) ); QStringList strState; QByteArray state = header()->saveState(); for ( int index = 0, size = state.size(); index < size; ++index ) strState.append( QString::number( state[index] ) ); group.writeXdgListEntry( "Columns State", strState ); } void ErrorsWidget::setSubtitle( Subtitle* subtitle ) { m_subtitle = subtitle; if ( isVisible() ) model()->setSubtitle( subtitle ); } void ErrorsWidget::showEvent( QShowEvent* event ) { if ( model()->subtitle() != m_subtitle ) model()->setSubtitle( m_subtitle ); QWidget::showEvent( event ); } void ErrorsWidget::hideEvent( QHideEvent* event ) { // we disconnect the subtitle from the errors model when // the widget is explicity hidden to improve performance if ( ! event->spontaneous() ) model()->setSubtitle( 0 ); QWidget::hideEvent( event ); } void ErrorsWidget::mouseDoubleClickEvent( QMouseEvent* event ) { QModelIndex index = indexAt( viewport()->mapFromGlobal( event->globalPos() ) ); if ( index.isValid() ) emit lineDoubleClicked( model()->subtitle()->line( model()->mapModelIndexToLineIndex( index ) ) ); } void ErrorsWidget::contextMenuEvent( QContextMenuEvent* event ) { int lineWithErrorsCount = 0, errorCount = 0, markCount = 0; QItemSelectionModel* selection = selectionModel(); for ( int lineIndex=0, modelL1Row=0, linesCount=model()->subtitle()->linesCount(); lineIndex < linesCount; ++lineIndex ) { const ErrorsModelNode* node = model()->node( lineIndex ); if ( node->isVisible() ) { QModelIndex modelL1Index = model()->index( modelL1Row, 0 ); if ( selection->isSelected( modelL1Index ) ) { lineWithErrorsCount++; errorCount += node->errorCount(); if ( node->isMarked() ) markCount++; } else { bool selected = false; const int lineErrorFlags = node->line()->errorFlags(); for ( int modelL2Row = 0, modelL2RowCount = node->errorCount(); modelL2Row < modelL2RowCount; ++modelL2Row ) { if ( selection->isSelected( model()->index( modelL2Row, 0, modelL1Index ) ) ) { selected = true; errorCount++; if ( model()->mapModelL2RowToLineErrorID( modelL2Row, lineErrorFlags ) == SubtitleLine::UserMarkID ) markCount++; } } if ( selected ) lineWithErrorsCount++; } modelL1Row++; if ( lineWithErrorsCount > 1 && errorCount > 1 && markCount > 1 ) break; } } errorCount -= markCount; if ( lineWithErrorsCount || errorCount || markCount ) { KMenu menu; Application* app = Application::instance(); menu.addAction( i18n( "Expand All" ), this, SLOT( expandAll() ) ); menu.addAction( i18n( "Collapse All" ), this, SLOT( collapseAll() ) ); menu.addSeparator(); menu.addAction( i18n( "Clear Selected Marks" ), app, SLOT( clearSelectedMarks() ) )->setEnabled( markCount ); menu.addAction( i18n( "Clear Selected Errors" ), app, SLOT( clearSelectedErrors() ) )->setEnabled( errorCount ); if ( ! app->errorsConfig()->autoClearFixed() ) { menu.addSeparator(); menu.addAction( i18n( "Clear Fixed Selection" ), app, SLOT( recheckSelectedErrors() ) )->setEnabled( errorCount ); } menu.exec( event->globalPos() ); event->ignore(); } TreeView::contextMenuEvent( event ); } SubtitleLine* ErrorsWidget::currentLine() { QModelIndex currentIndex = this->currentIndex(); if ( ! currentIndex.isValid() ) return 0; if ( currentIndex.parent().isValid() ) currentIndex = currentIndex.parent(); return model()->subtitle()->line( currentIndex.row() ); } int ErrorsWidget::lineSelectedErrorFlags( int lineIndex ) { QItemSelectionModel* selection = selectionModel(); int modelL1Row = model()->mapLineIndexToModelL1Row( lineIndex ); if ( modelL1Row < 0 ) return 0; int lineErrorFlags = model()->subtitle()->line( lineIndex )->errorFlags(); QModelIndex modelL1Index = model()->index( modelL1Row, 0 ); if ( selection->isSelected( modelL1Index ) ) return lineErrorFlags; int selectedErrorFlags = 0; for ( int modelL2row = 0, modelL2RowCount = model()->rowCount( modelL1Index ); modelL2row < modelL2RowCount; ++modelL2row ) { if ( selection->isSelected( model()->index( modelL2row, 0, modelL1Index ) ) ) selectedErrorFlags |= model()->mapModelL2RowToLineErrorFlag( modelL2row, lineErrorFlags ); } return selectedErrorFlags; } RangeList ErrorsWidget::selectionRanges() const { RangeList ranges; QItemSelectionModel* selection = selectionModel(); int rangeFirstIndex = -1, modelL1Row = 0; int lineIndex = 0; for ( int linesCount = model()->subtitle()->linesCount(); lineIndex < linesCount; ++lineIndex ) { const ErrorsModelNode* node = model()->node( lineIndex ); if ( node->isVisible() ) { QModelIndex modelL1Index = model()->index( modelL1Row, 0 ); bool selected = selection->isSelected( modelL1Index ); if ( ! selected ) { // is one of modelL1Index children selected? for ( int modelL2Row = 0, modelL2RowCount = node->errorCount(); modelL2Row < modelL2RowCount; ++modelL2Row ) { if ( selection->isSelected( model()->index( modelL2Row, 0, modelL1Index ) ) ) { selected = true; break; } } } if ( selected ) { if ( rangeFirstIndex == -1 ) // mark start of selected range rangeFirstIndex = lineIndex; } else { if ( rangeFirstIndex != -1 ) { ranges << Range( rangeFirstIndex, lineIndex - 1 ); rangeFirstIndex = -1; } } modelL1Row++; } } if ( rangeFirstIndex != -1 ) ranges << Range( rangeFirstIndex, lineIndex - 1 ); return ranges; } void ErrorsWidget::setCurrentLine( SubtitleLine* line, bool clearSelection ) { if ( model()->subtitle() && line ) { int modelL1Row = model()->mapLineIndexToModelL1Row( line->index() ); if ( modelL1Row >= 0 ) selectionModel()->setCurrentIndex( model()->index( modelL1Row, 0 ), clearSelection ? QItemSelectionModel::Select | QItemSelectionModel::Rows | QItemSelectionModel::Clear : QItemSelectionModel::Select | QItemSelectionModel::Rows ); } } void ErrorsWidget::onCurrentRowChanged( const QModelIndex& currentIndex ) { int currentLineIndex = model()->mapModelIndexToLineIndex( currentIndex ); emit currentLineChanged( currentLineIndex < 0 ? 0 : model()->subtitle()->line( currentLineIndex ) ); } void ErrorsWidget::keyPressEvent( QKeyEvent* event ) { if ( event->matches( QKeySequence::Delete )) { SubtitleCompositeActionExecutor executor( *model()->subtitle(), i18n( "Clear Lines Errors" ) ); app()->clearSelectedErrors(); app()->clearSelectedMarks(); event->accept(); } else TreeView::keyPressEvent( event ); } #include "errorswidget.moc" subtitlecomposer-0.5.3/src/main/main.cpp0000644000175000001440000000611511206423366017502 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif // #define BUILD_MAIN_TESTS #ifdef BUILD_MAIN_TESTS #include "main_tests.h" #else #include "application.h" #include #include #include #include #include int main( int argc, char** argv ) { KAboutData aboutData( "subtitlecomposer", // The program name used internally. "subtitlecomposer", // The message catalog name. ki18n( "Subtitle Composer" ), // A displayable program name string. "0.5.3", // The program version string. ki18n( "A KDE subtitle editor." ), // A short description of what the program does. KAboutData::License_GPL, // License identifier ki18n( "(C) 2007-2009 Sergio Pistone" ) // Copyright Statement ); aboutData.addAuthor( ki18n( "Sergio Pistone" ), // name ki18n( "Author & maintainer" ), // task "sergio_pistone@yahoo.com.ar" // email ); // Initialize command line args KCmdLineArgs::init( argc, argv, &aboutData ); // Define the command line options using KCmdLineOptions KCmdLineOptions options; options.add( "+[Primary URL]", ki18n( "Open location as primary subtitle") ); options.add( "+[Translation URL]", ki18n( "Open location as translation subtitle") ); // Register the supported options KCmdLineArgs::addCmdLineOptions( options ); // Create application object SubtitleComposer::Application app; app.mainWindow()->show(); // Handle our own options/arguments KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); if ( args->count() ) app.openSubtitle( KUrl( args->arg( 0 ) ) ); if ( args->count() > 1 ) app.openTrSubtitle( KUrl( args->arg( 1 ) ) ); args->clear(); return app.exec(); } #endif // BUILD_MAIN_TESTS subtitlecomposer-0.5.3/src/main/subtitlecomposer.desktop0000644000175000001440000000111011170276330023033 0ustar sergiousers[Desktop Entry] Type=Application Name=Subtitle Composer Name[es]=Subtitle Composer Name[fr]=Subtitle Composer GenericName=Subtitle Editor GenericName[es]=Editor de subtítulos GenericName[fr]=Éditeur de sous-titres Comment=KDE subtitle editor Comment[es]=Editor de subtítulos para KDE Comment[fr]=Éditeur de sous-titres pour KDE Icon=subtitlecomposer Exec=subtitlecomposer %f -caption "%c" MimeType=text/x-ssa;text/x-ass;text/x-microdvd;text/x-mpsub;application/x-subrip;text/x-subviewer;text/x-mplsub;text/x-tmplayer;text/x-tmplayer+; Terminal=false Categories=Qt;KDE;AudioVideo; subtitlecomposer-0.5.3/src/main/audiolevelswidget.cpp0000644000175000001440000001624111151345061022271 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "audiolevelswidget.h" #include "../core/subtitleline.h" #include "../player/player.h" #include #include #include #include #include #include using namespace SubtitleComposer; AudioLevelsWidget::AudioLevelsWidget( QWidget* parent ): QWidget( parent ), m_subtitle( 0 ), m_audiolevels( 0 ), m_lowerPosition( 0 ), m_playingPosition( 5000 ), m_upperPosition( 10000 ), m_regions( 0 ), m_points( 0 ), m_playingX( -1 ) { } AudioLevelsWidget::~AudioLevelsWidget() { delete [] m_regions; delete [] m_points; } void AudioLevelsWidget::loadConfig() { } void AudioLevelsWidget::saveConfig() { } Time AudioLevelsWidget::windowSize() const { return m_upperPosition - m_lowerPosition; } void AudioLevelsWidget::setWindowSize( const Time& size ) { if ( size != windowSize() ) { m_upperPosition = m_lowerPosition + size; rebuildRegions(); update(); } } void AudioLevelsWidget::setSubtitle( Subtitle* subtitle ) { m_subtitle = subtitle; } void AudioLevelsWidget::setAudioLevels( AudioLevels* audiolevels ) { delete [] m_regions; m_regions = 0; delete [] m_points; m_points = 0; m_playingX = -1; disconnect( Player::instance(), SIGNAL(positionChanged(double)), this, SLOT(onPlayerPositionChanged(double)) ); m_audiolevels = audiolevels; if ( m_audiolevels ) { connect( Player::instance(), SIGNAL(positionChanged(double)), this, SLOT(onPlayerPositionChanged(double)) ); m_regions = new QRegion[m_audiolevels->channelsCount()]; m_points = new QPolygon[m_audiolevels->channelsCount()]; rebuildRegions(); } update(); } void AudioLevelsWidget::paintEvent( QPaintEvent* e ) { QPainter painter( this ); QRect rect = this->rect(); painter.fillRect( e->rect(), Qt::white ); if ( ! m_audiolevels ) return; painter.drawText( rect, Qt::AlignLeft|Qt::AlignTop, m_lowerPosition.toString() ); painter.drawText( rect, Qt::AlignRight|Qt::AlignTop, m_upperPosition.toString() ); for ( unsigned channel = 0; channel < m_audiolevels->channelsCount(); ++channel ) { /* painter.setClipRegion( m_regions[channel] ); painter.fillRect( rect, Qt::red ); painter.setClipping( false );*/ painter.setPen( QPen( Qt::green, 2, Qt::SolidLine ) ); const unsigned size = m_points[channel].size(); for ( unsigned index = 1; index < size; ++index ) painter.drawLine( m_points[channel].point( index-1 ), m_points[channel].point( index-1 ) ); painter.setPen( QPen( Qt::red, 4, Qt::SolidLine ) ); painter.drawPolygon( m_points[channel] ); } if ( m_playingX >= 0 ) painter.drawLine( m_playingX, 0, m_playingX, height() ); } void AudioLevelsWidget::resizeEvent( QResizeEvent* e ) { QWidget::resizeEvent( e ); if ( m_audiolevels ) { rebuildRegions(); update(); } } void AudioLevelsWidget::onPlayerPositionChanged( double seconds ) { Time playingPosition; playingPosition.setSecondsTime( seconds ); // FIXME we have to deal with playingPosition being larger than audiolevels length if ( m_playingPosition != playingPosition ) { m_playingPosition = playingPosition; bool rebuild = false; Time windowSize = this->windowSize(); if ( m_playingPosition > m_upperPosition ) { m_lowerPosition = m_playingPosition - 2000; // 2000 can't be harcoded (must be relative to windowSize) m_upperPosition = m_lowerPosition + windowSize; rebuild = true; } else if ( m_playingPosition < m_lowerPosition ) { m_lowerPosition = m_playingPosition; m_upperPosition = m_lowerPosition + windowSize; rebuild = true; } m_playingX = width()*(m_playingPosition - m_lowerPosition).toMillis()/windowSize.toMillis(); if ( rebuild ) rebuildRegions(); update(); } } #define ABS( x ) ((x) >= 0 ? (-x) : (x)) void AudioLevelsWidget::rebuildRegions() { const unsigned lowerSample = m_audiolevels->sampleForPosition( m_lowerPosition ); const unsigned upperSample = m_audiolevels->sampleForPosition( m_upperPosition ); const int width = this->width(); const int channelHeight = this->height()/m_audiolevels->channelsCount(); const int heightScale = channelHeight*10; if ( lowerSample == upperSample ) { for ( unsigned channel = 0; channel < m_audiolevels->channelsCount(); ++channel ) { const unsigned midHeight = channel*channelHeight + channelHeight/2; int y = (int)(ABS(m_audiolevels->dataBySample( channel, lowerSample )*heightScale)) + midHeight; m_points[channel].resize( 2 ); m_points[channel].setPoint( 0, QPoint( 0, y ) ); m_points[channel].setPoint( 1, QPoint( width, y ) ); QPolygon regionPoints( 5 ); regionPoints.setPoint( 0, QPoint( 0, midHeight ) ); regionPoints.setPoint( 1, m_points[channel].point( 0 ) ); regionPoints.setPoint( 2, m_points[channel].point( 1 ) ); regionPoints.setPoint( 3, QPoint( width, midHeight ) ); regionPoints.setPoint( 4, QPoint( 0, midHeight ) ); m_regions[channel] = QRegion( regionPoints ); } } else // samples >= 2 { const unsigned samples = upperSample - lowerSample + 1; const double stepX = width/samples; for ( unsigned channel = 0; channel < m_audiolevels->channelsCount(); ++channel ) { const unsigned midHeight = channel*channelHeight + channelHeight/2; m_points[channel].resize( samples ); QPolygon regionPoints( samples + 3 ); regionPoints.setPoint( 0, QPoint( 0, midHeight ) ); for ( unsigned offset = 0; offset < samples; ++offset ) { QPoint point( (int)((offset+0.5)*stepX), (int)(ABS(m_audiolevels->dataBySample( channel, offset + lowerSample )*heightScale)) + midHeight ); m_points[channel].setPoint( offset, point ); regionPoints.setPoint( offset + 1, point ); } regionPoints.setPoint( samples + 1, QPoint( width, midHeight ) ); regionPoints.setPoint( samples + 2, QPoint( 0, midHeight ) ); m_regions[channel] = QRegion( regionPoints ); } } } #include "audiolevelswidget.moc" subtitlecomposer-0.5.3/src/main/configdialog.h0000644000175000001440000000535411151345061020646 0ustar sergiousers#ifndef CONFIGDIALOG_H #define CONFIGDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../config/appconfig.h" #include #include namespace SubtitleComposer { class AppConfigGroupWidget; class ConfigDialog : public KPageDialog { Q_OBJECT public: typedef enum { General=0, Errors, Spelling, Player, FirstBackend } Pages; explicit ConfigDialog( const AppConfig& config, QWidget* parent=0 ); virtual ~ConfigDialog(); void setConfig( const AppConfig& config ); const AppConfig& config() const; void setCurrentPage( unsigned pageIndex ); public slots: void show(); void hide(); signals: void accepted(); protected slots: void acceptConfig(); void acceptConfigAndClose(); void rejectConfig(); void rejectConfigAndClose(); void setControlsFromConfig(); void setControlsFromConfig( unsigned pageIndex ); void setConfigFromControls(); void setConfigFromControls( unsigned pageIndex ); void setActivePageControlsFromDefaults(); void setControlsFromDefaults( unsigned pageIndex ); void enableApply(); void onOptionChanged( const QString& groupName, const QString& optionName, const QString& value ); protected: AppConfig m_acceptedConfig; AppConfig m_config; QList m_configWidgets; QList m_pageWidgets; }; } #endif subtitlecomposer-0.5.3/src/main/actions/0000755000175000001440000000000011206423743017506 5ustar sergiouserssubtitlecomposer-0.5.3/src/main/actions/CMakeLists.txt0000644000175000001440000000023511172151705022244 0ustar sergiousersSET( main_actions_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/useraction.cpp ${CMAKE_CURRENT_SOURCE_DIR}/krecentfilesactionext.cpp CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/main/actions/krecentfilesactionext.h0000644000175000001440000000541211170267432024257 0ustar sergiousers#ifndef KRECENTFILESACTIONEXT_H #define KRECENTFILESACTIONEXT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include /// Taken from KDELibs and rewritten almost entirely because the /// KDE implementations is buggy and limited for our needs. class KRecentFilesActionExt : public KSelectAction { Q_OBJECT Q_PROPERTY( int maxItems READ maxItems WRITE setMaxItems ) public: KRecentFilesActionExt( QObject* parent=0 ); virtual ~KRecentFilesActionExt(); int maxItems() const; bool isEmpty() const; int count() const; KUrl::List urls() const; QString encodingForUrl( const KUrl& url ) const; virtual QAction* removeAction( QAction* action ); public slots: void setMaxItems( int maxItems ); void setUrls( const KUrl::List& urls ); void addUrl( const KUrl& url ); void removeUrl( const KUrl& url ); void clearUrls(); void loadEntries( const KConfigGroup& group ); void saveEntries( const KConfigGroup& group ); signals: void urlSelected( const KUrl& url ); protected: void setUrls( const KUrl::List& urls, bool ignoreCollisions ); virtual QAction* actionForUrl( const KUrl& url ) const; protected slots: void onActionTriggered( QAction* action ); protected: int m_maxItems; QMap m_urls; QMap m_actions; QAction* m_separatorAction; QAction* m_clearHistoryAction; }; #endif subtitlecomposer-0.5.3/src/main/actions/useraction.cpp0000644000175000001440000003104311151345060022361 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "useraction.h" #include "../../core/subtitle.h" // #include "../../core/audiolevels.h" #include "../../player/player.h" #include "../lineswidget.h" #include "../currentlinewidget.h" using namespace SubtitleComposer; UserAction::UserAction( QAction* action, int enableFlags ): m_action( action ), m_enableFlags( enableFlags ), m_actionEnabled( action->isEnabled() ), m_contextEnabled( false ), m_ignoreActionEnabledSignal( false ) { updateEnabledState(); connect( action, SIGNAL( changed() ), this, SLOT( onActionChanged() ) ); } void UserAction::onActionChanged() { if ( ! m_ignoreActionEnabledSignal ) { if ( m_action->isEnabled() != isEnabled() ) { // kDebug() << "enabled state externaly changed for" << m_action->objectName(); m_actionEnabled = m_action->isEnabled(); updateEnabledState(); } } } int UserAction::enableFlags() { return m_enableFlags; } QAction* UserAction::action() { return m_action; } bool UserAction::isEnabled() { return m_actionEnabled && m_contextEnabled; } void UserAction::setActionEnabled( bool enabled ) { if ( m_actionEnabled != enabled ) { m_actionEnabled = enabled; updateEnabledState(); } } void UserAction::setContextFlags( int contextFlags ) { bool contextEnabled = (contextFlags & m_enableFlags) == m_enableFlags; if ( m_contextEnabled != contextEnabled ) { m_contextEnabled = contextEnabled; updateEnabledState(); } } void UserAction::updateEnabledState() { bool enabled = m_actionEnabled && m_contextEnabled; if ( m_action->isEnabled() != enabled ) { m_ignoreActionEnabledSignal = true; m_action->setEnabled( enabled ); // QCoreApplication::processEvents( QEventLoop::ExcludeUserInputEvents ); // kDebug() << "setting action" << (m_action->isEnabled() ? "ENABLED":"DISABLED"); m_ignoreActionEnabledSignal = false; } } /// USER ACTION MANAGER UserActionManager::UserActionManager(): m_actionSpecs(), m_subtitle( 0 ), m_linesWidget( 0 ), m_player( 0 ), m_translationMode( false ), m_contextFlags( UserAction::SubClosed|UserAction::SubTrClosed| UserAction::VideoClosed| UserAction::AudioLevelsClosed| UserAction::FullScreenOff ) { } UserActionManager* UserActionManager::instance() { static UserActionManager actionManager; return &actionManager; } void UserActionManager::addAction( QAction* action, int enableFlags ) { addAction( new UserAction( action, enableFlags ) ); } void UserActionManager::addAction( UserAction* actionSpec ) { m_actionSpecs.append( actionSpec ); actionSpec->setContextFlags( m_contextFlags ); } void UserActionManager::setSubtitle( Subtitle* subtitle ) { if ( m_subtitle ) { disconnect( m_subtitle, SIGNAL( linesRemoved(int,int) ), this, SLOT( onSubtitleLinesChanged() ) ); disconnect( m_subtitle, SIGNAL( linesInserted(int,int) ), this, SLOT( onSubtitleLinesChanged() ) ); disconnect( m_subtitle, SIGNAL( primaryDirtyStateChanged(bool) ), this, SLOT( onPrimaryDirtyStateChanged(bool) ) ); disconnect( m_subtitle, SIGNAL( secondaryDirtyStateChanged(bool) ), this, SLOT( onSecondaryDirtyStateChanged(bool) ) ); disconnect( &(m_subtitle->actionManager()), SIGNAL( stateChanged() ), this, SLOT( onUndoRedoStateChanged() ) ); } m_subtitle = subtitle; int newContextFlags = m_contextFlags & ~UserAction::SubtitleMask; if ( m_subtitle ) { const ActionManager* actionManager = &(m_subtitle->actionManager()); connect( m_subtitle, SIGNAL( linesRemoved(int,int) ), this, SLOT( onSubtitleLinesChanged() ) ); connect( m_subtitle, SIGNAL( linesInserted(int,int) ), this, SLOT( onSubtitleLinesChanged() ) ); connect( m_subtitle, SIGNAL( primaryDirtyStateChanged(bool) ), this, SLOT( onPrimaryDirtyStateChanged(bool) ) ); connect( m_subtitle, SIGNAL( secondaryDirtyStateChanged(bool) ), this, SLOT( onSecondaryDirtyStateChanged(bool) ) ); connect( actionManager, SIGNAL( stateChanged() ), this, SLOT( onUndoRedoStateChanged() ) ); newContextFlags |= UserAction::SubOpened; if ( m_subtitle->isPrimaryDirty() ) newContextFlags |= UserAction::SubPDirty; else newContextFlags |= UserAction::SubPClean; if ( m_translationMode ) { newContextFlags |= UserAction::SubTrOpened; if ( m_subtitle->isSecondaryDirty() ) newContextFlags |= UserAction::SubSDirty; else newContextFlags |= UserAction::SubSClean; } else newContextFlags |= (UserAction::SubTrClosed|UserAction::SubSClean); if ( m_subtitle->linesCount() > 0 ) newContextFlags |= UserAction::SubHasLine; if ( m_subtitle->linesCount() > 1 ) newContextFlags |= UserAction::SubHasLines; if ( actionManager->hasUndo() ) newContextFlags |= UserAction::SubHasUndo; if ( actionManager->hasRedo() ) newContextFlags |= UserAction::SubHasRedo; } else newContextFlags |= (UserAction::SubClosed|UserAction::SubPClean|UserAction::SubTrClosed|UserAction::SubSClean); updateActionsContext( newContextFlags ); } void UserActionManager::onSubtitleLinesChanged() { int newContextFlags = m_contextFlags & ~(UserAction::SubHasLine|UserAction::SubHasLines); if ( m_subtitle->linesCount() > 0 ) newContextFlags |= UserAction::SubHasLine; if ( m_subtitle->linesCount() > 1 ) newContextFlags |= UserAction::SubHasLines; updateActionsContext( newContextFlags ); } void UserActionManager::onPrimaryDirtyStateChanged( bool dirty ) { int newContextFlags = m_contextFlags & ~(UserAction::SubPDirty|UserAction::SubPClean); if ( dirty ) newContextFlags |= UserAction::SubPDirty; else newContextFlags |= UserAction::SubPClean; updateActionsContext( newContextFlags ); } void UserActionManager::onSecondaryDirtyStateChanged( bool dirty ) { int newContextFlags = m_contextFlags & ~(UserAction::SubSDirty|UserAction::SubSClean); if ( m_translationMode ) { if ( dirty ) newContextFlags |= UserAction::SubSDirty; else newContextFlags |= UserAction::SubSClean; } else newContextFlags |= UserAction::SubSClean; updateActionsContext( newContextFlags ); } void UserActionManager::onUndoRedoStateChanged() { int newContextFlags = m_contextFlags & ~(UserAction::SubHasUndo|UserAction::SubHasRedo); if ( m_subtitle->actionManager().hasUndo() ) newContextFlags |= UserAction::SubHasUndo; if ( m_subtitle->actionManager().hasRedo() ) newContextFlags |= UserAction::SubHasRedo; updateActionsContext( newContextFlags ); } void UserActionManager::setLinesWidget( LinesWidget* linesWidget ) { if ( m_linesWidget ) disconnect( m_linesWidget->selectionModel(), SIGNAL( selectionChanged(const QItemSelection&, const QItemSelection&) ), this, SLOT( onLinesWidgetSelectionChanged() ) ); m_linesWidget = linesWidget; int newContextFlags = m_contextFlags & ~UserAction::SelectionMask; if ( m_linesWidget ) { connect( m_linesWidget->selectionModel(), SIGNAL( selectionChanged(const QItemSelection&, const QItemSelection&) ), this, SLOT( onLinesWidgetSelectionChanged() ) ); if ( m_linesWidget->firstSelectedIndex() >= 0 ) newContextFlags |= UserAction::HasSelection; } updateActionsContext( newContextFlags ); } void UserActionManager::onLinesWidgetSelectionChanged() { int newContextFlags = m_contextFlags & ~UserAction::SelectionMask; if ( m_linesWidget->firstSelectedIndex() >= 0 ) newContextFlags |= UserAction::HasSelection; updateActionsContext( newContextFlags ); } void UserActionManager::setAudioLevels( AudioLevels* audiolevels ) { int newContextFlags = m_contextFlags & ~UserAction::AudioLevelsMask; if ( audiolevels ) newContextFlags |= UserAction::AudioLevelsOpened; else newContextFlags |= UserAction::AudioLevelsClosed; updateActionsContext( newContextFlags ); } void UserActionManager::setPlayer( Player* player ) { if ( m_player ) { disconnect( m_player, SIGNAL( fileOpened(const QString&) ), this, SLOT( onPlayerStateChanged() ) ); disconnect( m_player, SIGNAL( fileClosed() ), this, SLOT( onPlayerStateChanged() ) ); disconnect( m_player, SIGNAL( playing() ), this, SLOT( onPlayerStateChanged() ) ); disconnect( m_player, SIGNAL( paused() ), this, SLOT( onPlayerStateChanged() ) ); disconnect( m_player, SIGNAL( stopped() ), this, SLOT( onPlayerStateChanged() ) ); } m_player = player; int newContextFlags = m_contextFlags & ~UserAction::VideoMask; if ( m_player ) { connect( m_player, SIGNAL( fileOpened(const QString&) ), this, SLOT( onPlayerStateChanged() ) ); connect( m_player, SIGNAL( fileClosed() ), this, SLOT( onPlayerStateChanged() ) ); connect( m_player, SIGNAL( playing() ), this, SLOT( onPlayerStateChanged() ) ); connect( m_player, SIGNAL( paused() ), this, SLOT( onPlayerStateChanged() ) ); connect( m_player, SIGNAL( stopped() ), this, SLOT( onPlayerStateChanged() ) ); Player::State state = m_player->state(); if ( state > Player::Opening ) { newContextFlags |= UserAction::VideoOpened; if ( state > Player::Paused ) newContextFlags |= UserAction::VideoStopped; else newContextFlags |= UserAction::VideoPlaying; } else newContextFlags |= UserAction::VideoClosed; } updateActionsContext( newContextFlags ); } void UserActionManager::onPlayerStateChanged() { int newContextFlags = m_contextFlags & ~UserAction::VideoMask; Player::State state = m_player->state(); if ( state > Player::Opening ) { newContextFlags |= UserAction::VideoOpened; if ( state > Player::Paused ) newContextFlags |= UserAction::VideoStopped; else newContextFlags |= UserAction::VideoPlaying; } else newContextFlags |= UserAction::VideoClosed; updateActionsContext( newContextFlags ); } void UserActionManager::setTranslationMode( bool translationMode ) { m_translationMode = translationMode; int newContextFlags = m_contextFlags & ~(UserAction::SubTrClosed|UserAction::SubTrOpened| UserAction::SubSDirty|UserAction::SubSClean); if ( m_subtitle && m_translationMode ) { newContextFlags |= UserAction::SubTrOpened; if ( m_subtitle->isSecondaryDirty() ) newContextFlags |= UserAction::SubSDirty; else newContextFlags |= UserAction::SubSClean; } else newContextFlags |= (UserAction::SubTrClosed|UserAction::SubSClean); updateActionsContext( newContextFlags ); } void UserActionManager::setFullScreenMode( bool fullScreenMode ) { int newContextFlags = m_contextFlags & ~UserAction::FullScreenMask; if ( fullScreenMode ) newContextFlags |= UserAction::FullScreenOn; else newContextFlags |= UserAction::FullScreenOff; updateActionsContext( newContextFlags ); } void UserActionManager::updateActionsContext( int contextFlags ) { // if ( (m_contextFlags & UserAction::SubHasLine) != (contextFlags & UserAction::SubHasLine) ) // kDebug() << "has line:" << ((contextFlags & UserAction::SubHasLine) != 0); // if ( (m_contextFlags & UserAction::SubHasLines) != (contextFlags & UserAction::SubHasLines) ) // kDebug() << "has lines:" << ((contextFlags & UserAction::SubHasLines) != 0); // if ( (m_contextFlags & UserAction::HasSelection) != (contextFlags & UserAction::HasSelection) ) // kDebug() << "has selection:" << ((contextFlags & UserAction::HasSelection) != 0); if ( m_contextFlags != contextFlags ) { m_contextFlags = contextFlags; for ( QList::ConstIterator it = m_actionSpecs.begin(), end = m_actionSpecs.end(); it != end; ++it ) (*it)->setContextFlags( m_contextFlags ); } } #include "useraction.moc" subtitlecomposer-0.5.3/src/main/actions/useractionnames.h0000644000175000001440000001462711151345060023063 0ustar sergiousers#ifndef USERACTIONNAMES_H #define USERACTIONNAMES_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #define ACT_NEW_SUBTITLE "new_subtitle" #define ACT_OPEN_SUBTITLE "open_subtitle" #define ACT_RECENT_SUBTITLES "recent_subtitles" #define ACT_CHANGE_SUBTITLE_ENCODING "change_subtitle_encoding" #define ACT_QUICK_CHANGE_SUBTITLE_ENCODING "quick_change_subtitle_encoding" #define ACT_SAVE_SUBTITLE "save_subtitle" #define ACT_SAVE_SUBTITLE_AS "save_subtitle_as" #define ACT_CLOSE_SUBTITLE "close_subtitle" #define ACT_NEW_TR_SUBTITLE "new_tr_subtitle" #define ACT_OPEN_TR_SUBTITLE "open_tr_subtitle" #define ACT_RECENT_TR_SUBTITLES "recent_tr_subtitles" #define ACT_SAVE_TR_SUBTITLE "save_tr_subtitle" #define ACT_SAVE_TR_SUBTITLE_AS "save_tr_subtitle_as" #define ACT_CLOSE_TR_SUBTITLE "close_tr_subtitle" #define ACT_UNDO "undo" #define ACT_REDO "redo" #define ACT_SPLIT_SUBTITLE "split_subtitle" #define ACT_JOIN_SUBTITLES "join_subtitles" #define ACT_INSERT_BEFORE_CURRENT_LINE "insert_before_current_line" #define ACT_INSERT_AFTER_CURRENT_LINE "insert_after_current_line" #define ACT_REMOVE_SELECTED_LINES "remove_selected_lines" #define ACT_SPLIT_SELECTED_LINES "split_selected_lines" #define ACT_JOIN_SELECTED_LINES "join_selected_lines" #define ACT_SELECT_ALL_LINES "select_all_lines" #define ACT_GOTO_LINE "goto_line" #define ACT_FIND "find" #define ACT_FIND_NEXT "find_next" #define ACT_FIND_PREVIOUS "find_previous" #define ACT_REPLACE "replace" #define ACT_RETROCEDE_CURRENT_LINE "retrocede_current_line" #define ACT_ADVANCE_CURRENT_LINE "advance_current_line" #define ACT_CHECK_ERRORS "check_errors" #define ACT_CLEAR_ERRORS "clear_errors" #define ACT_SHOW_ERRORS "show_errors" #define ACT_FIND_ERROR "find_error" #define ACT_FIND_NEXT_ERROR "find_next_error" #define ACT_FIND_PREVIOUS_ERROR "find_previous_error" #define ACT_SPELL_CHECK "spell_check" #define ACT_TOGGLE_SELECTED_LINES_MARK "toggle_selected_lines_mark" #define ACT_TOGGLE_SELECTED_LINES_BOLD "toggle_selected_lines_bold" #define ACT_TOGGLE_SELECTED_LINES_ITALIC "toggle_selected_lines_italic" #define ACT_TOGGLE_SELECTED_LINES_UNDERLINE "toggle_selected_lines_underline" #define ACT_TOGGLE_SELECTED_LINES_STRIKETHROUGH "toggle_selected_lines_strikethrough" #define ACT_SHIFT "shift" #define ACT_SHIFT_SELECTED_LINES_FORWARDS "shift_selected_lines_forwards" #define ACT_SHIFT_SELECTED_LINES_BACKWARDS "shift_selected_lines_backwards" #define ACT_ADJUST "adjust" #define ACT_SORT_LINES "sort_lines" #define ACT_CHANGE_FRAME_RATE "change_frame_rate" #define ACT_DURATION_LIMITS "duration_limits" #define ACT_AUTOMATIC_DURATIONS "automatic_durations" #define ACT_MAXIMIZE_DURATIONS "maximize_durations" #define ACT_FIX_OVERLAPPING_LINES "fix_overlapping_lines" #define ACT_SYNC_WITH_SUBTITLE "sync_with_subtitle" #define ACT_ADJUST_TEXTS "adjust_texts" #define ACT_UNBREAK_TEXTS "unbreak_texts" #define ACT_SIMPLIFY_SPACES "simplify_spaces" #define ACT_CHANGE_CASE "change_case" #define ACT_FIX_PUNCTUATION "fix_punctuation" #define ACT_TRANSLATE "translate" #define ACT_EDIT_CURRENT_LINE_IN_PLACE "edit_current_line_in_place" #define ACT_OPEN_VIDEO "open_video" #define ACT_RECENT_VIDEOS "recent_videos" #define ACT_CLOSE_VIDEO "close_video" #define ACT_TOGGLE_FULL_SCREEN "toggle_full_screen" #define ACT_STOP "stop" #define ACT_PLAY_PAUSE "play_pause" #define ACT_SEEK_BACKWARDS "seek_backwards" #define ACT_SEEK_FORWARDS "seek_forwards" #define ACT_SEEK_TO_NEXT_LINE "seek_to_next_line" #define ACT_SEEK_TO_PREVIOUS_LINE "seek_to_previous_line" #define ACT_SET_CURRENT_LINE_SHOW_TIME "set_current_line_show_time" #define ACT_SET_CURRENT_LINE_HIDE_TIME "set_current_line_hide_time" #define ACT_CURRENT_LINE_FOLLOWS_VIDEO "current_line_follows_video" #define ACT_TOGGLE_MUTED "toggle_muted" #define ACT_INCREASE_VOLUME "increase_volume" #define ACT_DECREASE_VOLUME "decrease_volume" #define ACT_SET_ACTIVE_AUDIO_STREAM "set_active_audio_stream" #define ACT_INCREASE_SUBTITLE_FONT "increase_font_size" #define ACT_DECREASE_SUBTITLE_FONT "decrease_font_size" #define ACT_SET_ACTIVE_SUBTITLE_STREAM "set_active_subtitle_stream" #define ACT_SHIFT_TO_VIDEO_POSITION "shift_to_video_position" #define ACT_ADJUST_TO_VIDEO_POSITION_A_F "adjust_to_video_position_anchor_first" #define ACT_ADJUST_TO_VIDEO_POSITION_A_L "adjust_to_video_position_anchor_last" #define ACT_OPEN_WAVEFORM "open_audiolevels" #define ACT_RECENT_WAVEFORMS "recent_audiolevels" #define ACT_SAVE_LEVELS_AS "save_audiolevels_as" #define ACT_CLOSE_WAVEFORM "close_audiolevels" #define ACT_INCREASE_LEVELS_V_ZOOM "increase_audiolevels_v_zoom" #define ACT_DECREASE_LEVELS_V_ZOOM "decrease_audiolevels_v_zoom" #define ACT_INCREASE_LEVELS_H_ZOOM "increase_audiolevels_h_zoom" #define ACT_DECREASE_LEVELS_H_ZOOM "decrease_audiolevels_h_zoom" #define ACT_SCRIPTS_MANAGER "scripts_manager" #endif subtitlecomposer-0.5.3/src/main/actions/useraction.h0000644000175000001440000001150511151345060022027 0ustar sergiousers#ifndef USERACTION_H #define USERACTION_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include namespace SubtitleComposer { class Subtitle; class AudioLevels; class LinesWidget; class CurrentLineWidget; class UserAction : public QObject { Q_OBJECT public: typedef enum { SubClosed = 0x1, // Subtitle is not opened SubOpened = 0x2, // Subtitle is opened SubTrClosed = 0x4, // Subtitle is not opened SubTrOpened = 0x8, // Subtitle is opened SubHasLine = 0x10, // Subtitle opened with, at least, one line SubHasLines = 0x20, // Subtitle opened with, at least, two lines SubPDirty = 0x40, // Subtitle opened and has unsaved changes SubPClean = 0x80, // Subtitle opened or closed without unsaved changes SubSDirty = 0x100, // Subtitle opened and has unsaved changes SubSClean = 0x200, // Subtitle opened or closed without unsaved changes SubHasUndo = 0x400, // An action can be undone SubHasRedo = 0x800, // An action can be redone HasSelection = 0x1000, // Subtitle opened with, at least, one line selected VideoClosed = 0x2000, VideoOpened = 0x4000, VideoStopped = 0x8000, VideoPlaying = 0x10000, AudioLevelsClosed = 0x20000, AudioLevelsOpened = 0x40000, FullScreenOn = 0x80000, FullScreenOff = 0x100000, SubtitleMask = SubClosed|SubOpened|SubTrClosed|SubTrOpened| SubPDirty|SubPClean|SubSDirty|SubSClean| SubHasLine|SubHasLines| SubHasUndo|SubHasRedo, SelectionMask = HasSelection, VideoMask = VideoClosed|VideoOpened|VideoStopped|VideoPlaying, AudioLevelsMask = AudioLevelsClosed|AudioLevelsOpened, FullScreenMask = FullScreenOn|FullScreenOff, AllMask = SubtitleMask|SelectionMask|VideoMask|AudioLevelsMask|FullScreenMask } EnableFlag; explicit UserAction( QAction* action, int enableFlags=SubOpened ); QAction* action(); int enableFlags(); bool isEnabled(); void setActionEnabled( bool enabled ); void setContextFlags( int contextFlags ); private: void updateEnabledState(); private slots: void onActionChanged(); private: QAction* m_action; int m_enableFlags; bool m_actionEnabled; bool m_contextEnabled; bool m_ignoreActionEnabledSignal; }; class Player; class UserActionManager : public QObject { Q_OBJECT public: static UserActionManager* instance(); void addAction( QAction* action, int enableFlags=UserAction::SubOpened ); void addAction( UserAction* actionSpec ); void removeAction( UserAction* actionSpec ); public slots: void setSubtitle( Subtitle* subtitle=0 ); void setLinesWidget( LinesWidget* linesWidget=0 ); void setAudioLevels( AudioLevels* audiolevels=0 ); void setPlayer( Player* player=0 ); void setTranslationMode( bool translationMode ); void setFullScreenMode( bool fullScreenMode ); private: UserActionManager(); void updateActionsContext( int contextFlags ); private slots: void onSubtitleLinesChanged(); void onPrimaryDirtyStateChanged( bool dirty ); void onSecondaryDirtyStateChanged( bool dirty ); void onUndoRedoStateChanged(); void onLinesWidgetSelectionChanged(); void onPlayerStateChanged(); private: QList m_actionSpecs; const Subtitle* m_subtitle; const LinesWidget* m_linesWidget; const Player* m_player; bool m_translationMode; int m_contextFlags; }; } #endif subtitlecomposer-0.5.3/src/main/actions/krecentfilesactionext.cpp0000644000175000001440000001403611170272060024605 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "krecentfilesactionext.h" #include #include #include #include KRecentFilesActionExt::KRecentFilesActionExt( QObject* parent ): KSelectAction( parent ), m_maxItems( 10 ) { setMenuAccelsEnabled( false ); m_separatorAction = new QAction( QString(), 0 ); m_separatorAction->setSeparator( true ); m_clearHistoryAction = new QAction( i18n( "Clear History" ), 0 ); connect( this, SIGNAL(triggered(QAction*)), this, SLOT(onActionTriggered(QAction*)) ); } KRecentFilesActionExt::~KRecentFilesActionExt() { selectableActionGroup()->removeAction( m_separatorAction ); delete m_separatorAction; selectableActionGroup()->removeAction( m_clearHistoryAction ); delete m_clearHistoryAction; } int KRecentFilesActionExt::maxItems() const { return m_maxItems; } void KRecentFilesActionExt::setMaxItems( int maxItems ) { if ( m_maxItems != maxItems && maxItems > 0 ) { m_maxItems = maxItems; while ( count() > maxItems ) removeAction( selectableActionGroup()->actions().last() )->deleteLater(); } } bool KRecentFilesActionExt::isEmpty() const { return m_urls.isEmpty(); } int KRecentFilesActionExt::count() const { return m_urls.count(); } QString KRecentFilesActionExt::encodingForUrl( const KUrl& url ) const { QAction* action = actionForUrl( url ); return action ? m_urls[action].fileEncoding() : QString(); } KUrl::List KRecentFilesActionExt::urls() const { return m_actions.keys(); } void KRecentFilesActionExt::setUrls( const KUrl::List& urls, bool ignoreCollisions ) { clearUrls(); QString entryText( "%1 [%2]" ); for ( KUrl::List::ConstIterator it = urls.begin(), end = urls.end(); it != end; ++it ) { if ( (*it).isLocalFile() && ! KGlobal::dirs()->relativeLocation( "tmp", (*it).path() ).startsWith( '/' ) ) continue; // don't store temporary paths if ( ! ignoreCollisions && actionForUrl( *it ) ) continue; QAction* action = new QAction( entryText. arg( (*it).fileName() ). arg( (*it).isLocalFile() ? (*it).path() : (*it).pathOrUrl() ), selectableActionGroup() ); m_urls[action] = *it; m_actions[*it] = action; addAction( action ); } addAction( m_separatorAction ); addAction( m_clearHistoryAction ); setEnabled( ! isEmpty() ); } void KRecentFilesActionExt::setUrls( const KUrl::List& urls ) { setUrls( urls, false ); } void KRecentFilesActionExt::addUrl( const KUrl& url ) { removeUrl( url ); // avoid duplicates KUrl::List newUrls = urls(); newUrls.prepend( url ); setUrls( newUrls, true ); } QAction* KRecentFilesActionExt::removeAction( QAction* action ) { action = KSelectAction::removeAction( action ); if ( m_urls.contains( action ) ) { m_actions.remove( m_urls[action] ); m_urls.remove( action ); } return action; } void KRecentFilesActionExt::removeUrl( const KUrl& url ) { if ( QAction* action = actionForUrl( url ) ) removeAction( action )->deleteLater(); setEnabled( ! isEmpty() ); } void KRecentFilesActionExt::clearUrls() { for ( QMap::ConstIterator it = m_actions.begin(), end = m_actions.end(); it != end; ++it ) removeAction( it.value() )->deleteLater(); removeAction( m_clearHistoryAction ); removeAction( m_separatorAction ); setEnabled( false ); } QAction* KRecentFilesActionExt::actionForUrl( const KUrl& url ) const { KUrl refUrl( url ); refUrl.setFileEncoding( QString() ); for ( QMap::ConstIterator it = m_actions.begin(), end = m_actions.end(); it != end; ++it ) { KUrl curUrl( it.key() ); curUrl.setFileEncoding( QString() ); if ( curUrl == refUrl ) return it.value(); } return 0; } void KRecentFilesActionExt::loadEntries( const KConfigGroup& group ) { KUrl::List urls; QString key( "File%1" ); for ( int index = 0, size = qMin( group.readEntry( "Files", m_maxItems ), m_maxItems ); index < size; ++index ) { QString value = group.readPathEntry( key.arg( index ), QString() ); if ( ! value.isEmpty() ) { KUrl url( value ); if ( url.isLocalFile() && ! QFile::exists( url.path() ) ) continue; // Don't restore if file doesn't exist anymore urls.append( url ); } } setUrls( urls, true ); } void KRecentFilesActionExt::saveEntries( const KConfigGroup& g ) { KConfigGroup group( g ); group.deleteGroup(); int index = 0; QString key( "File%1" ); for ( QMap::ConstIterator it = m_actions.begin(), end = m_actions.end(); it != end; ++it ) group.writePathEntry( key.arg( index++ ), it.key().pathOrUrl() ); group.writeEntry( "Files", m_urls.count() ); } void KRecentFilesActionExt::onActionTriggered( QAction* action ) { if ( action == m_clearHistoryAction ) clearUrls(); else emit urlSelected( m_urls[action] ); } #include "krecentfilesactionext.moc" subtitlecomposer-0.5.3/src/main/errorsdialog.cpp0000644000175000001440000001270411171201227021242 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "errorsdialog.h" #include "application.h" #include "configs/errorsconfig.h" #include "../core/subtitle.h" #include "../core/subtitleline.h" #include #include #include #include #include #include #include #include #include using namespace SubtitleComposer; ErrorsDialog::ErrorsDialog( QWidget* parent ): KDialog( parent ) { setCaption( i18n( "Subtitle Errors" ) ); setButtons( 0 ); QWidget* mainWidget = new QWidget( this ); setMainWidget( mainWidget ); QGridLayout* mainLayout = new QGridLayout( mainWidget ); mainLayout->setAlignment( Qt::AlignTop ); mainLayout->setSpacing( 5 ); m_autoClearFixed = app()->errorsConfig()->autoClearFixed(); m_clearFixedButton = new KPushButton( mainWidget ); m_clearFixedButton->setText( i18n( "Clear Fixed Errors" ) ); m_clearFixedButton->setEnabled( ! m_autoClearFixed ); KPushButton* checkErrorsButton = new KPushButton( mainWidget ); checkErrorsButton->setText( i18n( "Check Errors..." ) ); m_clearErrorsButton = new KPushButton( mainWidget ); m_clearErrorsButton->setText( i18n( "Clear Errors..." ) ); KPushButton* settingsButton = new KPushButton( mainWidget ); settingsButton->setText( i18n( "Settings..." ) ); m_errorsWidget = new ErrorsWidget( mainWidget ); m_statsLabel = new QLabel( mainWidget ); mainLayout->addWidget( m_errorsWidget, 1, 0, 1, 5 ); mainLayout->addWidget( m_statsLabel, 0, 0, 1, 5 ); mainLayout->addWidget( m_clearFixedButton, 2, 0 ); mainLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 2, 1 ); mainLayout->addWidget( checkErrorsButton, 2, 2 ); mainLayout->addWidget( m_clearErrorsButton, 2, 3 ); mainLayout->addWidget( settingsButton, 2, 4 ); resize( 500, height() + 50 ); onStatsChanged(); connect( m_clearFixedButton, SIGNAL( clicked() ), app(), SLOT( recheckAllErrors() ) ); connect( checkErrorsButton, SIGNAL( clicked() ), app(), SLOT( checkErrors() ) ); connect( m_clearErrorsButton, SIGNAL( clicked() ), app(), SLOT( clearErrors() ) ); connect( settingsButton, SIGNAL( clicked() ), app(), SLOT( showErrorsConfig() ) ); connect( m_errorsWidget->model(), SIGNAL( statsChanged() ), this, SLOT( onStatsChanged() ) ); connect( app()->errorsConfig(), SIGNAL( optionChanged( const QString&, const QString& ) ), this, SLOT( onOptionChanged( const QString&, const QString& ) ) ); } ErrorsWidget* ErrorsDialog::errorsWidget() { return m_errorsWidget; } void ErrorsDialog::loadConfig() { KConfigGroup group( KGlobal::config()->group( "ErrorsDialog Settings" ) ); resize( group.readEntry( "Width", width() ), group.readEntry( "Height", height() ) ); m_errorsWidget->loadConfig(); } void ErrorsDialog::saveConfig() { KConfigGroup group( KGlobal::config()->group( "ErrorsDialog Settings" ) ); group.writeEntry( "Width", width() ); group.writeEntry( "Height", height() ); m_errorsWidget->saveConfig(); } void ErrorsDialog::onStatsChanged() { ErrorsModel* model = m_errorsWidget->model(); QString lines = i18np( "Showing 1 line with errors", "Showing %1 lines with errors", model->lineWithErrorsCount() ); if ( model->lineWithErrorsCount() ) { QString errors = i18np( "1 total error", "%1 total errors", model->errorCount() ); QString marks = i18np( "1 user mark", "%1 user marks", model->markCount() ); if ( model->errorCount() == model->markCount() ) m_statsLabel->setText( QString( "%1 (%2)" ).arg( lines ).arg( marks ) ); else m_statsLabel->setText( QString( "%1 (%2, %3)" ).arg( lines ).arg( errors ).arg( marks ) ); m_clearErrorsButton->setEnabled( true ); m_clearFixedButton->setEnabled( ! m_autoClearFixed ); } else { m_statsLabel->setText( lines ); m_clearErrorsButton->setEnabled( false ); m_clearFixedButton->setEnabled( false ); } } void ErrorsDialog::onOptionChanged( const QString& option, const QString& value ) { if ( option == ErrorsConfig::keyAutoClearFixed() ) { m_autoClearFixed = value == "true"; m_clearFixedButton->setEnabled( m_clearErrorsButton->isEnabled() && ! m_autoClearFixed ); } } #include "errorsdialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/0000755000175000001440000000000011206423743017470 5ustar sergiouserssubtitlecomposer-0.5.3/src/main/dialogs/checkerrorsdialog.cpp0000644000175000001440000000550411152565572023701 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "checkerrorsdialog.h" #include #include #include #include using namespace SubtitleComposer; CheckErrorsDialog::CheckErrorsDialog( QWidget* parent ): ActionWithErrorTargetsDialog( i18n( "Check Errors" ), parent ) { createErrorsGroupBox( i18nc( "@title:group", "Errors to Check" ) ); createErrorsButtons( false, translationMode() ); QGroupBox* miscGroupBox = createGroupBox( i18nc( "@title:group Miscellaneous settings", "Miscellaneous" ) ); m_clearOtherErrorsCheckBox = new QCheckBox( miscGroupBox ); m_clearOtherErrorsCheckBox->setText( i18n( "Clear other errors" ) ); m_clearOtherErrorsCheckBox->setChecked( true ); m_clearMarksCheckBox = new QCheckBox( miscGroupBox ); m_clearMarksCheckBox->setText( i18n( "Clear user marks" ) ); m_clearMarksCheckBox->setChecked( false ); createLineTargetsButtonGroup(); createTextTargetsButtonGroup(); QGridLayout* miscLayout = createLayout( miscGroupBox ); miscLayout->addWidget( m_clearOtherErrorsCheckBox, 0, 0 ); miscLayout->addWidget( m_clearMarksCheckBox, 1, 0 ); } void CheckErrorsDialog::setTranslationMode( bool value ) { ActionWithErrorTargetsDialog::setTranslationMode( value ); createErrorsButtons( false, value ); } bool CheckErrorsDialog::clearOtherErrors() const { return m_clearOtherErrorsCheckBox->isChecked(); } bool CheckErrorsDialog::clearMarks() const { return m_clearMarksCheckBox->isChecked(); } #include "checkerrorsdialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/checkerrorsdialog.h0000644000175000001440000000363611151345055023341 0ustar sergiousers#ifndef CHECKERRORSDIALOG_H #define CHECKERRORSDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwitherrortargetsdialog.h" class QCheckBox; namespace SubtitleComposer { class CheckErrorsDialog : public ActionWithErrorTargetsDialog { Q_OBJECT public: CheckErrorsDialog( QWidget* parent=0 ); bool clearOtherErrors() const; bool clearMarks() const; protected: virtual void setTranslationMode( bool value ); private: QCheckBox* m_clearOtherErrorsCheckBox; QCheckBox* m_clearMarksCheckBox; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/CMakeLists.txt0000644000175000001440000000253711151345055022235 0ustar sergiousersSET( main_dialogs_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/opensubtitledialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/savesubtitledialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/actiondialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/actionwithtargetdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/selectablesubtitledialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/adjusttimesdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/shifttimesdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/autodurationsdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/durationlimitsdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/changetextscasedialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/fixoverlappingtimesdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/fixpunctuationdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/translatedialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/smarttextsadjustdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/changeframeratedialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/joinsubtitlesdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/splitsubtitledialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/syncsubtitlesdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/actionwitherrortargetsdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/checkerrorsdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/clearerrorsdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/insertlinedialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/removelinesdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/progressdialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/inputdialog.cpp CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/main/dialogs/splitsubtitledialog.h0000644000175000001440000000376711151345055023743 0ustar sergiousers#ifndef SPLITSUBTITLEDIALOG_H #define SPLITSUBTITLEDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actiondialog.h" #include "../../core/time.h" class QCheckBox; class TimeEdit; class KPushButton; namespace SubtitleComposer { class SplitSubtitleDialog : public ActionDialog { Q_OBJECT public: SplitSubtitleDialog( QWidget* parent=0 ); Time splitTime() const; bool shiftNewSubtitle() const; virtual void show(); private slots: void setSplitTimeFromVideo(); private: TimeEdit* m_splitTimeEdit; KPushButton* m_splitTimeFromVideoButton; QCheckBox* m_shiftNewSubtitleCheckBox; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/syncsubtitlesdialog.cpp0000644000175000001440000000522411151345055024270 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "syncsubtitlesdialog.h" #include #include #include #include using namespace SubtitleComposer; SyncSubtitlesDialog::SyncSubtitlesDialog( const QString& defaultEncoding, QWidget* parent ): SelectableSubtitleDialog( defaultEncoding, i18n( "Synchronize with Subtitle" ), parent ) { createSubtitleGroupBox( i18n( "Reference Subtitle" ) ); QGroupBox* syncModeGroupBox = createGroupBox( i18nc( "@title:group", "Synchronization Mode" )); m_adjustRadioButton = new QRadioButton( syncModeGroupBox ); m_adjustRadioButton->setText( i18n( "Adjust to reference's first and last lines" ) ); m_adjustRadioButton->setChecked( true ); m_synchronizeRadioButton = new QRadioButton( syncModeGroupBox ); m_synchronizeRadioButton->setText( i18n( "Copy timing information from reference line by line" ) ); QGridLayout* syncModeLayout = createLayout( syncModeGroupBox ); syncModeLayout->addWidget( m_adjustRadioButton, 0, 0 ); syncModeLayout->addWidget( m_synchronizeRadioButton, 1, 0 ); } bool SyncSubtitlesDialog::adjustToReferenceSubtitle() const { return m_adjustRadioButton->isChecked(); } bool SyncSubtitlesDialog::synchronizeToReferenceTimes() const { return m_synchronizeRadioButton->isChecked(); } #include "syncsubtitlesdialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/opensubtitledialog.h0000644000175000001440000000354111151345055023537 0ustar sergiousers#ifndef OPENSUBTITLEDIALOG_H #define OPENSUBTITLEDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include class KComboBox; namespace SubtitleComposer { class OpenSubtitleDialog : public KFileDialog { public: explicit OpenSubtitleDialog( bool primary, const QString& startDir=QString(), const QString& encoding=QString(), QWidget* parent=0 ); QString selectedEncoding() const; static QString inputFormatsFilter(); private: KComboBox* m_encodingComboBox; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/shifttimesdialog.cpp0000644000175000001440000000503311151347110023524 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "shifttimesdialog.h" #include "../../widgets/timeedit.h" #include #include #include #include using namespace SubtitleComposer; ShiftTimesDialog::ShiftTimesDialog( QWidget* parent ): ActionWithTargetDialog( i18n( "Shift" ), parent ) { QGroupBox* settingsGroupBox = createGroupBox( i18nc( "@title:group", "Shifting" ) ); m_directionComboBox = new KComboBox( false, settingsGroupBox ); m_directionComboBox->clear(); m_directionComboBox->addItem( i18n( "Forwards (+)" ) ); m_directionComboBox->addItem( i18n( "Backwards (–)" ) ); m_directionComboBox->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ); m_shiftTimeEdit = new TimeEdit( settingsGroupBox ); createLineTargetsButtonGroup(); QGridLayout* settingsLayout = createLayout( settingsGroupBox ); settingsLayout->addWidget( m_directionComboBox, 0, 0 ); settingsLayout->addWidget( m_shiftTimeEdit, 0, 1 ); } void ShiftTimesDialog::resetShiftTime() { m_shiftTimeEdit->setValue( 0 ); } int ShiftTimesDialog::shiftTimeMillis() const { return m_directionComboBox->currentIndex() == 0 ? m_shiftTimeEdit->value() : - m_shiftTimeEdit->value(); } subtitlecomposer-0.5.3/src/main/dialogs/smarttextsadjustdialog.h0000644000175000001440000000352311151345055024453 0ustar sergiousers#ifndef SMARTTEXTSADJUSTDIALOG_H #define SMARTTEXTSADJUSTDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwithtargetdialog.h" class KIntSpinBox; namespace SubtitleComposer { class SmartTextsAdjustDialog : public ActionWithTargetDialog { public: explicit SmartTextsAdjustDialog( unsigned minLengthForLineBreak, QWidget* parent=0 ); unsigned minLengthForLineBreak() const; private: KIntSpinBox* m_minLengthForLineBreakSpinBox; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/savesubtitledialog.cpp0000644000175000001440000001325511151347716024100 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "savesubtitledialog.h" #include "../application.h" #include "../../common/filesavehelper.h" #include "../../formats/formatmanager.h" #include #include #include #include #include #include #include using namespace SubtitleComposer; SaveSubtitleDialog::SaveSubtitleDialog( bool primary, const QString& startDir, const QString& encoding, int newLine, const QString& format, QWidget* parent ): KFileDialog( startDir, outputFormatsFilter(), parent ) { setCaption( primary ? i18n( "Save Subtitle" ) : i18n( "Save Translation Subtitle" ) ); setOperationMode( KFileDialog::Saving ); setModal( true ); setMode( KFile::File ); filterWidget()->setEditable( false ); if ( FormatManager::instance().output( format ) ) setCurrentFilter( format ); else setCurrentFilter( FormatManager::instance().outputNames().first() ); // setting the current filter will force the first valid extension for the format which // may not be the one of the file (even when the file's extension is perfectly valid) setSelection( startDir ); QWidget* customWidget = new QWidget( this ); m_encodingComboBox = new KComboBox( customWidget ); m_encodingComboBox->addItems( app()->availableEncodingNames() ); m_encodingComboBox->setCurrentItem( encoding ); m_encodingComboBox->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ); m_newLineComboBox = new KComboBox( customWidget ); m_newLineComboBox->addItems( QStringList() << "UNIX" << "Windows" << "Macintosh" ); m_newLineComboBox->setCurrentIndex( newLine ); m_newLineComboBox->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ); QLabel* newLineLabel = new QLabel( customWidget ); newLineLabel->setText( i18n( "EOL:" ) ); newLineLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); newLineLabel->setBuddy( m_newLineComboBox ); QGridLayout* layout = new QGridLayout( customWidget ); layout->setContentsMargins( 0, 0, 0, 0 ); layout->addWidget( m_encodingComboBox, 0, 0 ); layout->addWidget( newLineLabel, 0, 1 ); layout->addWidget( m_newLineComboBox, 0, 2 ); // FIXME set "encoding" label buddy to m_encodingComboBox (how do we get the "encoding" label widget?) fileWidget()->setCustomWidget( i18n( "Encoding:" ), customWidget ); } QString SaveSubtitleDialog::selectedEncoding() const { return m_encodingComboBox->currentText(); } void SaveSubtitleDialog::setCurrentFilter( const QString& formatName ) { const OutputFormat* format = FormatManager::instance().output( formatName ); if ( format ) { QStringList extensions( format->extensions() ); QString filter; for ( QStringList::ConstIterator it = extensions.begin(), end = extensions.end(); it != end; ++it ) filter += "*." + *it + " *." + (*it).toUpper(); filter += '|' + formatName; filterWidget()->setCurrentFilter( filter ); } } QString SaveSubtitleDialog::selectedFormat() const { return filterWidget()->currentText(); } Format::NewLine SaveSubtitleDialog::selectedNewLine() const { return m_newLineComboBox ? (Format::NewLine)m_newLineComboBox->currentIndex() : Format::CurrentOS; } QString SaveSubtitleDialog::outputFormatsFilter() { static QString filter; if ( filter.isEmpty() ) { QStringList formats = FormatManager::instance().outputNames(); for ( QStringList::ConstIterator it = formats.begin(), end = formats.end(); it != end; ++it ) { const OutputFormat* format = FormatManager::instance().output( *it ); const QStringList& formatExtensions = format->extensions(); QString extensions; for ( QStringList::ConstIterator extIt = formatExtensions.begin(), extEnd = formatExtensions.end(); extIt != extEnd; ++extIt ) extensions += "*." + *extIt + " *." + (*extIt).toUpper(); filter += '\n' + extensions + '|' + format->name(); } filter = filter.trimmed(); } return filter; } int SaveSubtitleDialog::exec() { int retCode = KFileDialog::exec(); if ( retCode == QDialog::Accepted ) { if ( FileSaveHelper::exists( selectedUrl() ) && KMessageBox::warningContinueCancel( parentWidget(), i18n( "A file named \"%1\" already exists. Are you sure you want to overwrite it?", QFileInfo( selectedUrl().path() ).fileName() ), i18n( "Overwrite File?" ), KGuiItem( i18n( "Overwrite" ) ) ) != KMessageBox::Continue ) return QDialog::Rejected; } return retCode; } subtitlecomposer-0.5.3/src/main/dialogs/actionwithtargetdialog.cpp0000644000175000001440000003226711153125703024742 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "actionwithtargetdialog.h" #include "../application.h" #include #include #include #include #include using namespace SubtitleComposer; ActionWithTargetDialog::ActionWithTargetDialog( const QString& title, QWidget* parent ): ActionDialog( title, parent ), m_targetGroupBox( 0 ), m_targetLayout( 0 ), m_lineTargetsButtonGroup( 0 ), m_textTargetsButtonGroup( 0 ), m_selectionTargetOnlyMode( false ), m_selectionTargetWasChecked( false ), m_translationMode( false ), m_nonTranslationModeTarget( Subtitle::Primary ) { // setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Default ); // setDefaultButton( KDialog::Ok ); // setButtonIcon( KDialog::Default, KIcon() ); // setButtonText( KDialog::Default, i18n( "Target <<" ) ); // setButtonToolTip( KDialog::Default, QString() ); // connect( this, SIGNAL( defaultClicked() ), this, SLOT( onDefaultButtonClicked() ) ); } int ActionWithTargetDialog::exec() { setTranslationMode( app()->translationMode() ); setSelectionTargetOnlyMode( app()->showingLinesContextMenu() ); return ActionDialog::exec(); } void ActionWithTargetDialog::show() { setTranslationMode( app()->translationMode() ); setSelectionTargetOnlyMode( app()->showingLinesContextMenu() ); ActionDialog::show(); } QGroupBox* ActionWithTargetDialog::createTargetsGroupBox( const QString& title, bool addToLayout ) { if ( ! m_targetGroupBox ) { m_targetGroupBox = createGroupBox( title, addToLayout ); m_targetLayout = createLayout( m_targetGroupBox ); } return m_targetGroupBox; } void ActionWithTargetDialog::updateTargetsGroupBoxHiddenState() { bool hidden = true; QList children = m_targetGroupBox->findChildren(); for ( int index = 0, size = children.size(); index < size; ++index ) { if ( ! children.at( index )->isHidden() ) { hidden = false; break; } } if ( hidden != m_targetGroupBox->isHidden() ) { if ( hidden ) m_targetGroupBox->hide(); else m_targetGroupBox->show(); } } void ActionWithTargetDialog::onDefaultButtonClicked() { if ( m_lineTargetsButtonGroup ) { LinesTarget prevTarget = selectedLinesTarget(); setSelectionTargetOnlyMode( ! m_lineTargetsButtonGroup->button( 0 )->isHidden() ); setSelectedLinesTarget( prevTarget ); // setSelectionTargetOnlyMode resets the target so we restore it } } void ActionWithTargetDialog::setTargetsButtonsHiddenState( QButtonGroup* targetButtonGroup, bool hidden ) { if ( ! targetButtonGroup || hidden == targetButtonGroup->button( 0 )->isHidden() ) return; QList buttons = targetButtonGroup->buttons(); if ( hidden ) { for ( int index = 0, size = buttons.size(); index < size; ++index ) buttons.at( index )->hide(); } else { for ( int index = 0, size = buttons.size(); index < size; ++index ) buttons.at( index )->show(); } updateTargetsGroupBoxHiddenState(); if ( targetButtonGroup == m_lineTargetsButtonGroup ) { setButtonText( KDialog::Default, hidden ? i18n( "Target >>" ) : i18n( "Target <<" ) ); m_mainWidget->updateGeometry(); setMinimumSize( minimumSizeHint() ); resize( size().width(), minimumSizeHint().height() ); } } /// LINE TARGETS /// ============ void ActionWithTargetDialog::createLineTargetsButtonGroup() { setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Default ); setDefaultButton( KDialog::Ok ); setButtonIcon( KDialog::Default, KIcon() ); setButtonText( KDialog::Default, i18n( "Target <<" ) ); setButtonToolTip( KDialog::Default, QString() ); connect( this, SIGNAL( defaultClicked() ), this, SLOT( onDefaultButtonClicked() ) ); createTargetsGroupBox(); m_lineTargetsButtonGroup = new QButtonGroup( this ); for ( int index = 0; index < None; ++index ) { QRadioButton* radioButton = new QRadioButton( m_targetGroupBox ); m_lineTargetsButtonGroup->addButton( radioButton, index ); m_targetLayout->addWidget( radioButton, index, 0 ); } m_lineTargetsButtonGroup->button( AllLines )->setText( i18n( "All lines" ) ); m_lineTargetsButtonGroup->button( Selection )->setText( i18n( "Selected lines" ) ); m_lineTargetsButtonGroup->button( FromSelected )->setText( i18n( "All lines from first selected" ) ); m_lineTargetsButtonGroup->button( UpToSelected )->setText( i18n( "All lines up to last selected" ) ); m_lineTargetsButtonGroup->button( AllLines )->setChecked( true ); _setSelectionTargetOnlyMode( m_selectionTargetOnlyMode, true ); } ActionWithTargetDialog::LinesTarget ActionWithTargetDialog::selectedLinesTarget() const { if ( ! m_lineTargetsButtonGroup ) // lines target was not created return AllLines; int checkedId = m_lineTargetsButtonGroup->checkedId(); return checkedId == -1 ? None : (LinesTarget)checkedId; } void ActionWithTargetDialog::setSelectedLinesTarget( ActionWithTargetDialog::LinesTarget target ) { if ( m_lineTargetsButtonGroup && m_lineTargetsButtonGroup->button( target ) ) m_lineTargetsButtonGroup->button( target )->setChecked( true ); } bool ActionWithTargetDialog::isLinesTargetEnabled( LinesTarget target ) const { return m_lineTargetsButtonGroup && m_lineTargetsButtonGroup->button( target ) && m_lineTargetsButtonGroup->button( target )->isEnabled(); } void ActionWithTargetDialog::setLinesTargetEnabled( LinesTarget target, bool enabled ) { if ( m_lineTargetsButtonGroup && m_lineTargetsButtonGroup->button( target ) ) m_lineTargetsButtonGroup->button( target )->setEnabled( enabled ); } bool ActionWithTargetDialog::selectionTargetOnlyMode() const { return m_selectionTargetOnlyMode; } void ActionWithTargetDialog::setSelectionTargetOnlyMode( bool value ) { _setSelectionTargetOnlyMode( value, false ); } void ActionWithTargetDialog::_setSelectionTargetOnlyMode( bool value, bool force ) { if ( force || m_selectionTargetOnlyMode != value ) { m_selectionTargetOnlyMode = value; if ( ! m_targetGroupBox || ! m_lineTargetsButtonGroup ) return; if ( m_selectionTargetOnlyMode ) { m_selectionTargetWasChecked = m_lineTargetsButtonGroup->button( Selection )->isChecked(); m_lineTargetsButtonGroup->button( Selection )->setEnabled( true ); m_lineTargetsButtonGroup->button( Selection )->setChecked( true ); } else { if ( ! m_selectionTargetWasChecked ) { m_lineTargetsButtonGroup->button( AllLines )->setEnabled( true ); m_lineTargetsButtonGroup->button( AllLines )->setChecked( true ); } } setTargetsButtonsHiddenState( m_lineTargetsButtonGroup, m_selectionTargetOnlyMode ); } } /// TEXT TARGETS /// ============ void ActionWithTargetDialog::createTextTargetsButtonGroup() { createTargetsGroupBox(); m_textTargetsButtonGroup = new QButtonGroup( this ); for ( int index = 0; index < Subtitle::TextTargetSIZE; ++index ) { QRadioButton* radioButton = new QRadioButton( m_targetGroupBox ); m_textTargetsButtonGroup->addButton( radioButton, index ); } m_textTargetsButtonGroup->button( SubtitleLine::Both )->setText( i18n( "Both subtitles" ) ); m_targetLayout->addWidget( m_textTargetsButtonGroup->button( SubtitleLine::Both ), 0, 1 ); m_textTargetsButtonGroup->button( SubtitleLine::Primary )->setText( i18n( "Primary subtitle" ) ); m_targetLayout->addWidget( m_textTargetsButtonGroup->button( SubtitleLine::Primary ), 1, 1 ); m_textTargetsButtonGroup->button( SubtitleLine::Secondary )->setText( i18n( "Translation subtitle" ) ); m_targetLayout->addWidget( m_textTargetsButtonGroup->button( SubtitleLine::Secondary ), 2, 1 ); _setTranslationMode( m_translationMode, true ); } Subtitle::TextTarget ActionWithTargetDialog::nonTranslationModeTarget() const { return m_nonTranslationModeTarget; } void ActionWithTargetDialog::setNonTranslationModeTarget( Subtitle::TextTarget target ) { if ( m_nonTranslationModeTarget != target ) { if ( ! m_translationMode && m_textTargetsButtonGroup ) { m_textTargetsButtonGroup->button( m_nonTranslationModeTarget )->setChecked( false ); m_textTargetsButtonGroup->button( target )->setChecked( true ); } m_nonTranslationModeTarget = target; } } Subtitle::TextTarget ActionWithTargetDialog::selectedTextsTarget() const { if ( ! m_textTargetsButtonGroup ) // texts target was not created return Subtitle::TextTargetSIZE; int checkedId = m_textTargetsButtonGroup->checkedId(); return checkedId == -1 ? Subtitle::TextTargetSIZE : (Subtitle::TextTarget)checkedId; } void ActionWithTargetDialog::setSelectedTextsTarget( Subtitle::TextTarget target ) { if ( m_textTargetsButtonGroup && m_textTargetsButtonGroup->button( target ) ) m_textTargetsButtonGroup->button( target )->setChecked( true ); } bool ActionWithTargetDialog::isTextsTargetEnabled( Subtitle::TextTarget target ) const { return m_textTargetsButtonGroup && m_textTargetsButtonGroup->button( target ) && m_textTargetsButtonGroup->button( target )->isEnabled(); } void ActionWithTargetDialog::setTextsTargetEnabled( Subtitle::TextTarget target, bool enabled ) { if ( m_textTargetsButtonGroup && m_textTargetsButtonGroup->button( target ) ) m_textTargetsButtonGroup->button( target )->setEnabled( enabled ); } bool ActionWithTargetDialog::translationMode() const { return m_translationMode; } void ActionWithTargetDialog::setTranslationMode( bool enabled ) { _setTranslationMode( enabled, false ); } void ActionWithTargetDialog::_setTranslationMode( bool enabled, bool force ) { if ( force || m_translationMode != enabled ) { m_translationMode = enabled; if ( ! m_targetGroupBox || ! m_textTargetsButtonGroup ) return; if ( ! m_translationMode ) m_textTargetsButtonGroup->button( m_nonTranslationModeTarget )->setChecked( true ); setTargetsButtonsHiddenState( m_textTargetsButtonGroup, ! m_translationMode ); } } /// ACTION WITH LINES TARGET DIALOG /// =============================== ActionWithLinesTargetDialog::ActionWithLinesTargetDialog( const QString& title, QWidget* parent ): ActionWithTargetDialog( title, parent ) { createLineTargetsButtonGroup(); } ActionWithLinesTargetDialog::ActionWithLinesTargetDialog( const QString& title, const QString& desc, QWidget* parent ): ActionWithTargetDialog( title, parent ) { createTargetsGroupBox( desc ); createLineTargetsButtonGroup(); } int ActionWithLinesTargetDialog::exec() { setTranslationMode( app()->translationMode() ); setSelectionTargetOnlyMode( app()->showingLinesContextMenu() ); return m_targetGroupBox->isHidden() ? QDialog::Accepted : ActionDialog::exec(); } /// ACTION WITH TEXTS TARGET DIALOG /// =============================== ActionWithTextsTargetDialog::ActionWithTextsTargetDialog( const QString& title, QWidget* parent ): ActionWithTargetDialog( title, parent ) { createTextTargetsButtonGroup(); } ActionWithTextsTargetDialog::ActionWithTextsTargetDialog( const QString& title, const QString& desc, QWidget* parent ): ActionWithTargetDialog( title, parent ) { createTargetsGroupBox( desc ); createTextTargetsButtonGroup(); } int ActionWithTextsTargetDialog::exec() { setTranslationMode( app()->translationMode() ); setSelectionTargetOnlyMode( app()->showingLinesContextMenu() ); return m_targetGroupBox->isHidden() ? QDialog::Accepted : ActionDialog::exec(); } /// ACTION WITH LINES AND TEXTS TARGET DIALOG /// ========================================= ActionWithLinesAndTextsTargetDialog::ActionWithLinesAndTextsTargetDialog( const QString& title, QWidget* parent ): ActionWithTargetDialog( title, parent ) { createLineTargetsButtonGroup(); createTextTargetsButtonGroup(); } ActionWithLinesAndTextsTargetDialog::ActionWithLinesAndTextsTargetDialog( const QString& title, const QString& desc, QWidget* parent ): ActionWithTargetDialog( title, parent ) { createTargetsGroupBox( desc ); createLineTargetsButtonGroup(); createTextTargetsButtonGroup(); } int ActionWithLinesAndTextsTargetDialog::exec() { setTranslationMode( app()->translationMode() ); setSelectionTargetOnlyMode( app()->showingLinesContextMenu() ); return m_targetGroupBox->isHidden() ? QDialog::Accepted : ActionDialog::exec(); } #include "actionwithtargetdialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/shifttimesdialog.h0000644000175000001440000000350111151345055023175 0ustar sergiousers#ifndef SHIFTTIMESDIALOG_H #define SHIFTTIMESDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwithtargetdialog.h" class TimeEdit; class KComboBox; namespace SubtitleComposer { class ShiftTimesDialog : public ActionWithTargetDialog { public: ShiftTimesDialog( QWidget* parent=0 ); void resetShiftTime(); int shiftTimeMillis() const; private: KComboBox* m_directionComboBox; TimeEdit* m_shiftTimeEdit; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/insertlinedialog.cpp0000644000175000001440000000334011153124526023526 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "insertlinedialog.h" #include using namespace SubtitleComposer; InsertLineDialog::InsertLineDialog( bool insertBefore, QWidget* parent ): ActionWithTextsTargetDialog( insertBefore ? i18n( "Insert Line Before Current" ) : i18n( "Insert Line After Current" ), i18n( "Insert Into" ), parent ) { setNonTranslationModeTarget( Subtitle::Both ); } subtitlecomposer-0.5.3/src/main/dialogs/joinsubtitlesdialog.cpp0000644000175000001440000000721211151350160024243 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "joinsubtitlesdialog.h" #include "../../common/commondefs.h" #include "../../player/player.h" #include "../../widgets/timeedit.h" #include #include #include #include #include using namespace SubtitleComposer; JoinSubtitlesDialog::JoinSubtitlesDialog( const QString& defaultEncoding, QWidget* parent ): SelectableSubtitleDialog( defaultEncoding, i18n( "Join Subtitles" ), parent ) { createSubtitleGroupBox(); m_shiftSubtitleCheckBox = new QCheckBox( m_subtitleGroupBox ); m_shiftSubtitleCheckBox->setText( i18n( "Shift subtitle forwards before append" ) ); m_shiftSubtitleCheckBox->setChecked( true ); m_shiftTimeFromVideoButton = new KPushButton( m_subtitleGroupBox ); m_shiftTimeFromVideoButton->setIcon( KIcon( "time-from-video" ) ); int buttonSize = m_shiftTimeFromVideoButton->sizeHint().height(); m_shiftTimeFromVideoButton->setFixedSize( buttonSize, buttonSize ); m_shiftTimeFromVideoButton->setToolTip( i18n( "Set from video length" ) ); m_shiftTimeEdit = new TimeEdit( m_subtitleGroupBox ); connect( m_shiftTimeFromVideoButton, SIGNAL( clicked() ), SLOT( setShiftTimeFromVideo() ) ); connect( m_shiftSubtitleCheckBox, SIGNAL( toggled(bool) ), m_shiftTimeFromVideoButton, SLOT( setEnabled(bool) ) ); connect( m_shiftSubtitleCheckBox, SIGNAL( toggled(bool) ), m_shiftTimeEdit, SLOT( setEnabled(bool) ) ); createTargetsGroupBox(); createTextTargetsButtonGroup(); QHBoxLayout* shiftTimeLayout = new QHBoxLayout(); shiftTimeLayout->addStretch(); shiftTimeLayout->addWidget( m_shiftTimeFromVideoButton ); shiftTimeLayout->addWidget( m_shiftTimeEdit ); m_subtitleLayout->addWidget( m_shiftSubtitleCheckBox, 2, 0, 1, 2 ); m_subtitleLayout->addLayout( shiftTimeLayout, 2, 2 ); } void JoinSubtitlesDialog::setShiftTimeFromVideo() { m_shiftTimeEdit->setValue( (int)(Player::instance()->length()*1000 + 0.5) ); } Time JoinSubtitlesDialog::shiftTime() const { return m_shiftSubtitleCheckBox->isChecked() ? m_shiftTimeEdit->value() : 0; } void JoinSubtitlesDialog::show() { m_shiftTimeFromVideoButton->setEnabled( Player::instance()->state() > Player::Opening ); if ( m_shiftTimeFromVideoButton->isEnabled() ) setShiftTimeFromVideo(); SelectableSubtitleDialog::show(); } #include "joinsubtitlesdialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/adjusttimesdialog.cpp0000644000175000001440000000566611151362123023716 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "adjusttimesdialog.h" #include "../../widgets/timeedit.h" #include #include #include #include using namespace SubtitleComposer; AdjustTimesDialog::AdjustTimesDialog( QWidget* parent ): ActionDialog( i18n( "Adjust" ), parent ) { QGroupBox* settingsGroupBox = createGroupBox( i18nc( "@title:group", "New Times" ) ); m_firstLineTimeEdit = new TimeEdit( settingsGroupBox ); QLabel* firstLineLabel = new QLabel( settingsGroupBox ); firstLineLabel->setText( i18n( "First spoken line:" ) ); firstLineLabel->setBuddy( m_firstLineTimeEdit ); m_lastLineTimeEdit = new TimeEdit( settingsGroupBox ); QLabel* lastLineLabel = new QLabel( settingsGroupBox ); lastLineLabel->setText( i18n( "Last spoken line:" ) ); lastLineLabel->setBuddy( m_lastLineTimeEdit ); QGridLayout* settingsLayout = createLayout( settingsGroupBox ); settingsLayout->addWidget( firstLineLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); settingsLayout->addWidget( m_firstLineTimeEdit, 0, 1 ); settingsLayout->addWidget( lastLineLabel, 1, 0, Qt::AlignRight|Qt::AlignVCenter ); settingsLayout->addWidget( m_lastLineTimeEdit, 1, 1 ); } Time AdjustTimesDialog::firstLineTime() const { return Time( m_firstLineTimeEdit->value() ); } void AdjustTimesDialog::setFirstLineTime( const Time& time ) { m_firstLineTimeEdit->setValue( time.toMillis() ); } Time AdjustTimesDialog::lastLineTime() const { return Time( m_lastLineTimeEdit->value() ); } void AdjustTimesDialog::setLastLineTime( const Time& time ) { m_lastLineTimeEdit->setValue( time.toMillis() ); } subtitlecomposer-0.5.3/src/main/dialogs/progressdialog.h0000644000175000001440000000444411152613646022676 0ustar sergiousers#ifndef PROGRESSDIALOG_H #define PROGRESSDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include class QLabel; class QProgressBar; class QCloseEvent; namespace SubtitleComposer { class ProgressDialog : public KDialog { Q_OBJECT public: ProgressDialog( const QString& caption, const QString& description, bool allowCancel, QWidget* parent=0 ); int value() const; int minimum() const; int maximum() const; QString description() const; bool isCancellable() const; protected: virtual void closeEvent( QCloseEvent* event ); public slots: void setMinimum( int minimum ); void incrementMinimum( int delta ); void setMaximum( int maximum ); void incrementMaximum( int delta ); void setValue( int value ); void setDescription( const QString& description ); void setCancellable( bool cancellable ); private: QLabel* m_label; QProgressBar* m_progressBar; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/changeframeratedialog.h0000644000175000001440000000405211151345055024134 0ustar sergiousers#ifndef CHANGEFRAMERATEDIALOG_H #define CHANGEFRAMERATEDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actiondialog.h" class KComboBox; namespace SubtitleComposer { class ChangeFrameRateDialog : public ActionDialog { Q_OBJECT public: explicit ChangeFrameRateDialog( double fromFramesPerSecond, QWidget* parent=0 ); double fromFramesPerSecond() const; void setFromFramesPerSecond( double framesPerSecond ); double toFramesPerSecond() const; void setNewFramesPerSecond( double framesPerSecond ); private slots: void onTextChanged(); private: KComboBox* m_fromFramesPerSecondComboBox; KComboBox* m_toFramesPerSecondComboBox; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/actiondialog.h0000644000175000001440000000377611151345055022311 0ustar sergiousers#ifndef ACTIONDIALOG_H #define ACTIONDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include class QGridLayout; class QVBoxLayout; class QGroupBox; namespace SubtitleComposer { class ActionDialog : public KDialog { Q_OBJECT public: explicit ActionDialog( const QString& title, QWidget* parent=0 ); public slots: virtual int exec(); virtual void show(); protected: QGroupBox* createGroupBox( const QString& title=QString(), bool addToLayout=true ); QGridLayout* createLayout( QGroupBox* groupBox ); protected: QWidget* m_mainWidget; QVBoxLayout* m_mainLayout; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/progressdialog.cpp0000644000175000001440000000713711152613732023227 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "progressdialog.h" #include #include #include #include #include using namespace SubtitleComposer; ProgressDialog::ProgressDialog( const QString& caption, const QString& description, bool allowCancel, QWidget* parent ): // KDialog( parent, Qt::FramelessWindowHint ) KDialog( parent, Qt::WindowTitleHint ) { setCaption( caption ); setModal( true ); setButtons( allowCancel ? KDialog::Cancel : (QFlags)0 ); QWidget* mainWidget = new QWidget( this ); setMainWidget( mainWidget ); m_label = new QLabel( mainWidget ); m_label->setText( description ); m_label->setAlignment( Qt::AlignHCenter ); m_progressBar = new QProgressBar( mainWidget ); m_progressBar->setMaximum( 1 ); m_progressBar->setValue( 0 ); QBoxLayout* mainLayout = new QBoxLayout( QBoxLayout::TopToBottom, mainWidget ); mainLayout->setMargin( 0 ); mainLayout->addWidget( m_label ); mainLayout->addWidget( m_progressBar ); setMinimumWidth( 300 ); resize( QSize( 300, 10 ) ); } void ProgressDialog::closeEvent( QCloseEvent* event ) { event->ignore(); } QString ProgressDialog::description() const { return m_label->text(); } void ProgressDialog::setDescription( const QString& description ) { m_label->setText( description ); } int ProgressDialog::value() const { return m_progressBar->value(); } void ProgressDialog::setValue( int value ) { m_progressBar->setValue( value ); } int ProgressDialog::minimum() const { return m_progressBar->minimum(); } void ProgressDialog::setMinimum( int minimum ) { m_progressBar->setMinimum( minimum ); } void ProgressDialog::incrementMinimum( int delta ) { m_progressBar->setMinimum( m_progressBar->minimum() + delta ); } int ProgressDialog::maximum() const { return m_progressBar->maximum(); } void ProgressDialog::setMaximum( int maximum ) { m_progressBar->setMaximum( maximum ); } void ProgressDialog::incrementMaximum( int delta ) { m_progressBar->setMaximum( m_progressBar->maximum() + delta ); } bool ProgressDialog::isCancellable() const { return isButtonEnabled( KDialog::Cancel ); } void ProgressDialog::setCancellable( bool cancellable ) { enableButton( KDialog::Cancel, cancellable ); } #include "progressdialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/translatedialog.h0000644000175000001440000000356411151345055023024 0ustar sergiousers#ifndef TRANSLATEDIALOG_H #define TRANSLATEDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwithtargetdialog.h" #include "../utils/language.h" class QComboBox; namespace SubtitleComposer { class TranslateDialog : public ActionWithTargetDialog { public: TranslateDialog( QWidget* parent=0 ); Language::Value inputLanguage() const; Language::Value outputLanguage() const; private: QComboBox* m_inputLanguageComboBox; QComboBox* m_outputLanguageComboBox; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/splitsubtitledialog.cpp0000644000175000001440000000731411151346632024270 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "splitsubtitledialog.h" #include "../../common/commondefs.h" #include "../../player/player.h" #include "../../widgets/timeedit.h" #include #include #include #include #include #include using namespace SubtitleComposer; SplitSubtitleDialog::SplitSubtitleDialog( QWidget* parent ): ActionDialog( i18n( "Split Subtitle" ), parent ) { QGroupBox* settingsGroupBox = createGroupBox( i18nc( "@title:group", "Settings" ) ); m_splitTimeFromVideoButton = new KPushButton( settingsGroupBox ); m_splitTimeFromVideoButton->setIcon( KIcon( "time-from-video" ) ); int buttonSize = m_splitTimeFromVideoButton->sizeHint().height(); m_splitTimeFromVideoButton->setFixedSize( buttonSize, buttonSize ); m_splitTimeFromVideoButton->setToolTip( i18n( "Set from video length" ) ); m_splitTimeEdit = new TimeEdit( settingsGroupBox ); QLabel* splitTimeLabel = new QLabel( settingsGroupBox ); splitTimeLabel->setText( i18n( "Split time:" ) ); splitTimeLabel->setBuddy( m_splitTimeEdit ); m_shiftNewSubtitleCheckBox = new QCheckBox( settingsGroupBox ); m_shiftNewSubtitleCheckBox->setText( i18n( "Shift new part backwards after split" ) ); m_shiftNewSubtitleCheckBox->setChecked( true ); QHBoxLayout* splitTimeLayout = new QHBoxLayout(); splitTimeLayout->addWidget( m_splitTimeFromVideoButton ); splitTimeLayout->addWidget( m_splitTimeEdit ); QGridLayout* settingsLayout = createLayout( settingsGroupBox ); settingsLayout->addWidget( splitTimeLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); settingsLayout->addLayout( splitTimeLayout, 0, 1 ); settingsLayout->addWidget( m_shiftNewSubtitleCheckBox, 1, 0, 1, 2 ); connect( m_splitTimeFromVideoButton, SIGNAL( clicked() ), SLOT( setSplitTimeFromVideo() ) ); } void SplitSubtitleDialog::setSplitTimeFromVideo() { m_splitTimeEdit->setValue( (int)(Player::instance()->length()*1000 + 0.5) ); } Time SplitSubtitleDialog::splitTime() const { return m_splitTimeEdit->value(); } bool SplitSubtitleDialog::shiftNewSubtitle() const { return m_shiftNewSubtitleCheckBox->isChecked(); } void SplitSubtitleDialog::show() { m_splitTimeFromVideoButton->setEnabled( Player::instance()->state() > Player::Opening ); if ( m_splitTimeFromVideoButton->isEnabled() ) setSplitTimeFromVideo(); ActionDialog::show(); } #include "splitsubtitledialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/removelinesdialog.cpp0000644000175000001440000000321711153124536023706 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "removelinesdialog.h" #include using namespace SubtitleComposer; RemoveLinesDialog::RemoveLinesDialog( QWidget* parent ): ActionWithTextsTargetDialog( i18n( "Remove Selected Lines" ), i18n( "Remove From" ), parent ) { setNonTranslationModeTarget( Subtitle::Both ); } subtitlecomposer-0.5.3/src/main/dialogs/joinsubtitlesdialog.h0000644000175000001440000000402311151345055023714 0ustar sergiousers#ifndef JOINSUBTITLESDIALOG_H #define JOINSUBTITLESDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "selectablesubtitledialog.h" #include "../../core/time.h" class QCheckBox; class TimeEdit; class KPushButton; namespace SubtitleComposer { class JoinSubtitlesDialog : public SelectableSubtitleDialog { Q_OBJECT public: explicit JoinSubtitlesDialog( const QString& defaultEncoding, QWidget* parent=0 ); Time shiftTime() const; virtual void show(); private slots: void setShiftTimeFromVideo(); private: TimeEdit* m_shiftTimeEdit; KPushButton* m_shiftTimeFromVideoButton; QCheckBox* m_shiftSubtitleCheckBox; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/fixpunctuationdialog.cpp0000644000175000001440000000612611151350257024437 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "fixpunctuationdialog.h" #include #include #include #include using namespace SubtitleComposer; FixPunctuationDialog::FixPunctuationDialog( QWidget* parent ): ActionWithTargetDialog( i18n( "Fix Punctuation" ), parent ) { QGroupBox* settingsGroupBox = createGroupBox( i18nc( "@title:group", "Settings" ) ); m_spacesCheckBox = new QCheckBox( settingsGroupBox ); m_spacesCheckBox->setText( i18n( "Fix and cleanup spaces" ) ); m_spacesCheckBox->setChecked( true ); m_quotesCheckBox = new QCheckBox( settingsGroupBox ); m_quotesCheckBox->setText( i18n( "Fix quotes and double quotes" ) ); m_quotesCheckBox->setChecked( true ); m_englishICheckBox = new QCheckBox( settingsGroupBox ); m_englishICheckBox->setText( i18n( "Fix English 'I' pronoun" ) ); m_englishICheckBox->setChecked( true ); m_ellipsisCheckBox = new QCheckBox( settingsGroupBox ); m_ellipsisCheckBox->setText( i18n( "Add ellipisis indicating non finished lines" ) ); m_ellipsisCheckBox->setChecked( true ); createLineTargetsButtonGroup(); createTextTargetsButtonGroup(); QGridLayout* settingsLayout = createLayout( settingsGroupBox ); settingsLayout->addWidget( m_spacesCheckBox, 0, 0 ); settingsLayout->addWidget( m_quotesCheckBox, 1, 0 ); settingsLayout->addWidget( m_englishICheckBox, 2, 0 ); settingsLayout->addWidget( m_ellipsisCheckBox, 3, 0 ); } bool FixPunctuationDialog::spaces() const { return m_spacesCheckBox->isChecked(); } bool FixPunctuationDialog::quotes() const { return m_quotesCheckBox->isChecked(); } bool FixPunctuationDialog::englishI() const { return m_englishICheckBox->isChecked(); } bool FixPunctuationDialog::ellipisis() const { return m_ellipsisCheckBox->isChecked(); } subtitlecomposer-0.5.3/src/main/dialogs/translatedialog.cpp0000644000175000001440000000761211153124515023353 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "translatedialog.h" #include #include #include #include #include using namespace SubtitleComposer; TranslateDialog::TranslateDialog( QWidget* parent ): ActionWithTargetDialog( i18n( "Translate" ), parent ) { QGroupBox* settingsGroupBox = createGroupBox( i18nc( "@title:group", "Settings" ) ); m_inputLanguageComboBox = new QComboBox( settingsGroupBox ); m_inputLanguageComboBox->setEditable( false ); m_inputLanguageComboBox->setIconSize( QSize( 21, 13 ) ); int index = 0; for ( QList::ConstIterator it = Language::input().begin(), end = Language::input().end(); it != end; ++it ) { m_inputLanguageComboBox->addItem( Language::name( *it ) ); QString flagPath = Language::flagPath( *it ); if ( ! flagPath.isEmpty() ) m_inputLanguageComboBox->setItemIcon( index, KIcon( flagPath ) ); index++; } QLabel* inputLanguageLabel = new QLabel( settingsGroupBox ); inputLanguageLabel->setText( i18n( "Input language:" ) ); inputLanguageLabel->setBuddy( m_inputLanguageComboBox ); m_outputLanguageComboBox = new QComboBox( settingsGroupBox ); m_outputLanguageComboBox->setEditable( false ); m_outputLanguageComboBox->setIconSize( QSize( 21, 13 ) ); index = 0; for ( QList::ConstIterator it = Language::output().begin(), end = Language::output().end(); it != end; ++it ) { m_outputLanguageComboBox->addItem( Language::name( *it ) ); QString flagPath = Language::flagPath( *it ); if ( ! flagPath.isEmpty() ) m_outputLanguageComboBox->setItemIcon( index, KIcon( flagPath ) ); index++; } QLabel* outputLanguageLabel = new QLabel( settingsGroupBox ); outputLanguageLabel->setText( i18n( "Output language:" ) ); outputLanguageLabel->setBuddy( m_outputLanguageComboBox ); createLineTargetsButtonGroup(); createTextTargetsButtonGroup(); setTextsTargetEnabled( Subtitle::Both, false ); QGridLayout* settingsLayout = createLayout( settingsGroupBox ); settingsLayout->addWidget( inputLanguageLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); settingsLayout->addWidget( m_inputLanguageComboBox, 0, 1 ); settingsLayout->addWidget( outputLanguageLabel, 1, 0, Qt::AlignRight|Qt::AlignVCenter ); settingsLayout->addWidget( m_outputLanguageComboBox, 1, 1 ); } Language::Value TranslateDialog::inputLanguage() const { return Language::input().at( m_inputLanguageComboBox->currentIndex() ); } Language::Value TranslateDialog::outputLanguage() const { return Language::output().at( m_outputLanguageComboBox->currentIndex() ); } subtitlecomposer-0.5.3/src/main/dialogs/actiondialog.cpp0000644000175000001440000000631311151361017022626 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "actiondialog.h" #include #include #include #include #include using namespace SubtitleComposer; ActionDialog::ActionDialog( const QString& title, QWidget* parent ): KDialog( parent ) { setCaption( title ); setButtons( KDialog::Ok | KDialog::Cancel ); setDefaultButton( KDialog::Ok ); m_mainWidget = new QWidget( this ); m_mainLayout = new QVBoxLayout( m_mainWidget ); m_mainLayout->setAlignment( Qt::AlignTop ); m_mainLayout->setContentsMargins( 0, 0, 0, 0 ); m_mainLayout->setSpacing( 5 ); setMainWidget( m_mainWidget ); } int ActionDialog::exec() { // attempt at showing the full action name on the title... // it would work better if we could get the fontMetrics used by kwin // int minWidth = fontMetrics().width( windowTitle() ) + 120; // if ( minWidth > minimumWidth() ) // setMinimumWidth( minWidth ); resize( minimumSizeHint() ); return KDialog::exec(); } void ActionDialog::show() { // attempt at showing the full action name on the title... // it would work better if we could get the fontMetrics used by kwin // int minWidth = fontMetrics().width( windowTitle() ) + 120; // if ( minWidth > minimumWidth() ) // setMinimumWidth( minWidth ); resize( minimumSizeHint() ); KDialog::show(); } QGroupBox* ActionDialog::createGroupBox( const QString& title, bool addToLayout ) { QGroupBox* groupBox = new QGroupBox( m_mainWidget ); groupBox->setTitle( title ); if ( addToLayout ) // m_mainLayout->addWidget( groupBox, m_mainLayout->rowCount(), 0 ); m_mainLayout->addWidget( groupBox ); return groupBox; } QGridLayout* ActionDialog::createLayout( QGroupBox* groupBox ) { QGridLayout* gridLayout = new QGridLayout( groupBox ); gridLayout->setAlignment( Qt::AlignTop ); gridLayout->setSpacing( 5 ); return gridLayout; } #include "actiondialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/fixoverlappingtimesdialog.cpp0000644000175000001440000000524211151363427025457 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "fixoverlappingtimesdialog.h" #include #include #include #include #include using namespace SubtitleComposer; FixOverlappingTimesDialog::FixOverlappingTimesDialog( QWidget* parent ): ActionWithTargetDialog( i18n( "Fix Overlapping Times" ), parent ) { QGroupBox* settingsGroupBox = createGroupBox( i18nc( "@title:group", "Settings" ) ); m_minIntervalSpinBox = new KIntNumInput( settingsGroupBox ); m_minIntervalSpinBox->setSuffix( i18n( " msecs" ) ); m_minIntervalSpinBox->setMinimum( 1 ); m_minIntervalSpinBox->setMaximum( 1000 ); m_minIntervalSpinBox->setValue( 50 ); QLabel* minIntervalLabel = new QLabel( settingsGroupBox ); minIntervalLabel->setText( i18n( "Minimum interval between lines:" ) ); minIntervalLabel->setBuddy( m_minIntervalSpinBox ); createLineTargetsButtonGroup(); QGridLayout* settingsLayout = createLayout( settingsGroupBox ); settingsLayout->addWidget( minIntervalLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); settingsLayout->addWidget( m_minIntervalSpinBox, 0, 1 ); } Time FixOverlappingTimesDialog::minimumInterval() const { return Time( m_minIntervalSpinBox->value() ); } void FixOverlappingTimesDialog::setMinimumInterval( const Time& time ) { m_minIntervalSpinBox->setValue( time.toMillis() ); } subtitlecomposer-0.5.3/src/main/dialogs/actionwithtargetdialog.h0000644000175000001440000001124511153124457024405 0ustar sergiousers#ifndef ACTIONWITHTARGETDIALOG_H #define ACTIONWITHTARGETDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actiondialog.h" #include "../../core/subtitle.h" #include #include class QGridLayout; class QGroupBox; class QButtonGroup; namespace SubtitleComposer { class ActionWithTargetDialog : public ActionDialog { Q_OBJECT public: typedef enum { AllLines=0, Selection, FromSelected, UpToSelected, None } LinesTarget; /// LINES TARGET LinesTarget selectedLinesTarget() const; void setSelectedLinesTarget( ActionWithTargetDialog::LinesTarget target ); bool isLinesTargetEnabled( LinesTarget target ) const; void setLinesTargetEnabled( LinesTarget target, bool enabled ); /// TEXTS TARGET // the active text target when translationMode is false Subtitle::TextTarget nonTranslationModeTarget() const; void setNonTranslationModeTarget( Subtitle::TextTarget target ); Subtitle::TextTarget selectedTextsTarget() const; void setSelectedTextsTarget( Subtitle::TextTarget target ); bool isTextsTargetEnabled( Subtitle::TextTarget target ) const; void setTextsTargetEnabled( Subtitle::TextTarget target, bool enabled ); public slots: virtual int exec(); virtual void show(); protected: explicit ActionWithTargetDialog( const QString& title, QWidget* parent=0 ); bool selectionTargetOnlyMode() const; bool translationMode() const; QGroupBox* createTargetsGroupBox( const QString& title=i18n( "Apply To" ), bool addToLayout=true ); void setTargetsButtonsHiddenState( QButtonGroup* targetButtonGroup, bool hidden ); void updateTargetsGroupBoxHiddenState(); void createLineTargetsButtonGroup(); void createTextTargetsButtonGroup(); virtual void setSelectionTargetOnlyMode( bool value ); virtual void setTranslationMode( bool value ); private: void _setSelectionTargetOnlyMode( bool value, bool force ); void _setTranslationMode( bool enabled, bool force ); private slots: void onDefaultButtonClicked(); protected: QGroupBox* m_targetGroupBox; QGridLayout* m_targetLayout; QButtonGroup* m_lineTargetsButtonGroup; QButtonGroup* m_textTargetsButtonGroup; private: bool m_selectionTargetOnlyMode; bool m_selectionTargetWasChecked; bool m_translationMode; Subtitle::TextTarget m_nonTranslationModeTarget; }; class ActionWithLinesTargetDialog : public ActionWithTargetDialog { Q_OBJECT public: explicit ActionWithLinesTargetDialog( const QString& title, QWidget* parent=0 ); ActionWithLinesTargetDialog( const QString& title, const QString& desc, QWidget* parent=0 ); public slots: virtual int exec(); }; class ActionWithTextsTargetDialog : public ActionWithTargetDialog { Q_OBJECT public: explicit ActionWithTextsTargetDialog( const QString& title, QWidget* parent=0 ); ActionWithTextsTargetDialog( const QString& title, const QString& desc, QWidget* parent=0 ); public slots: virtual int exec(); }; class ActionWithLinesAndTextsTargetDialog : public ActionWithTargetDialog { Q_OBJECT public: explicit ActionWithLinesAndTextsTargetDialog( const QString& title, QWidget* parent=0 ); ActionWithLinesAndTextsTargetDialog( const QString& title, const QString& desc, QWidget* parent=0 ); public slots: virtual int exec(); }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/selectablesubtitledialog.h0000644000175000001440000000454211151345055024703 0ustar sergiousers#ifndef SELECTABLESUBTITLEDIALOG_H #define SELECTABLESUBTITLEDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwithtargetdialog.h" #include class QGridLayout; class QGroupBox; class KLineEdit; class KComboBox; namespace SubtitleComposer { class SelectableSubtitleDialog : public ActionWithTargetDialog { Q_OBJECT public: SelectableSubtitleDialog( const QString& defaultEncoding, const QString& title, QWidget* parent=0 ); QString defaultEncoding() const; void setDefaultEncoding( const QString& defaultEncoding ); QString subtitlePath() const; QString subtitleEncoding() const; protected: QGroupBox* createSubtitleGroupBox( const QString& title=i18n( "Subtitle" ), bool addToLayout=true ); private slots: void selectSubtitle(); protected: QGroupBox* m_subtitleGroupBox; QGridLayout* m_subtitleLayout; KLineEdit* m_subtitleUrlLineEdit; KComboBox* m_subtitleEncodingComboBox; QString m_defaultEncoding; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/syncsubtitlesdialog.h0000644000175000001440000000364611151345055023743 0ustar sergiousers#ifndef SYNCSUBTITLESDIALOG_H #define SYNCSUBTITLESDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "selectablesubtitledialog.h" class QRadioButton; namespace SubtitleComposer { class SyncSubtitlesDialog : public SelectableSubtitleDialog { Q_OBJECT public: explicit SyncSubtitlesDialog( const QString& defaultEncoding, QWidget* parent=0 ); bool adjustToReferenceSubtitle() const; bool synchronizeToReferenceTimes() const; private: QRadioButton* m_adjustRadioButton; QRadioButton* m_synchronizeRadioButton; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/removelinesdialog.h0000644000175000001440000000323611151345055023353 0ustar sergiousers#ifndef REMOVELINESDIALOG_H #define REMOVELINESDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwithtargetdialog.h" namespace SubtitleComposer { class RemoveLinesDialog : public ActionWithTextsTargetDialog { public: RemoveLinesDialog( QWidget* parent=0 ); }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/smarttextsadjustdialog.cpp0000644000175000001440000000533511151347051025007 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "smarttextsadjustdialog.h" #include #include #include #include #include using namespace SubtitleComposer; SmartTextsAdjustDialog::SmartTextsAdjustDialog( unsigned minLengthForLineBreak, QWidget* parent ): ActionWithTargetDialog( i18n( "Break Lines" ), parent ) { QGroupBox* settingsGroupBox = createGroupBox( i18nc( "@title:group", "Settings" ) ); m_minLengthForLineBreakSpinBox = new KIntSpinBox( settingsGroupBox ); m_minLengthForLineBreakSpinBox->setMinimum( 0 ); m_minLengthForLineBreakSpinBox->setMaximum( 1000 ); m_minLengthForLineBreakSpinBox->setValue( minLengthForLineBreak ); m_minLengthForLineBreakSpinBox->setSuffix( i18n( " characters" ) ); QLabel* minLengthForLineBreakLabel = new QLabel( settingsGroupBox ); minLengthForLineBreakLabel->setText( i18n( "Minimum length for line break:" ) ); minLengthForLineBreakLabel->setBuddy( m_minLengthForLineBreakSpinBox ); createLineTargetsButtonGroup(); createTextTargetsButtonGroup(); QGridLayout* settingsLayout = createLayout( settingsGroupBox ); settingsLayout->addWidget( minLengthForLineBreakLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); settingsLayout->addWidget( m_minLengthForLineBreakSpinBox, 0, 1 ); } unsigned SmartTextsAdjustDialog::minLengthForLineBreak() const { return m_minLengthForLineBreakSpinBox->value(); } subtitlecomposer-0.5.3/src/main/dialogs/insertlinedialog.h0000644000175000001440000000326511151345055023201 0ustar sergiousers#ifndef INSERTLINEDIALOG_H #define INSERTLINEDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwithtargetdialog.h" namespace SubtitleComposer { class InsertLineDialog : public ActionWithTextsTargetDialog { public: explicit InsertLineDialog( bool insertAfter, QWidget* parent=0 ); }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/changetextscasedialog.cpp0000644000175000001440000001005311151350607024521 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "changetextscasedialog.h" #include #include #include #include #include #include using namespace SubtitleComposer; ChangeTextsCaseDialog::ChangeTextsCaseDialog( QWidget* parent ): ActionWithTargetDialog( i18n( "Change Case" ), parent ) { QGroupBox* caseGroupBox = createGroupBox( i18nc( "@title:group", "Change To" ) ); QButtonGroup* caseButtonGroup = new QButtonGroup( this ); m_lowerRadioButton = new QRadioButton( caseGroupBox ); m_lowerRadioButton->setText( i18n( "Lower case" ) ); m_lowerRadioButton->setChecked( true ); caseButtonGroup->addButton( m_lowerRadioButton, 0 ); m_upperRadioButton = new QRadioButton( caseGroupBox ); m_upperRadioButton->setText( i18n( "Upper case" ) ); caseButtonGroup->addButton( m_upperRadioButton, 1 ); m_titleRadioButton = new QRadioButton( caseGroupBox ); m_titleRadioButton->setText( i18n( "Title case" ) ); caseButtonGroup->addButton( m_titleRadioButton, 2 ); m_sentenceRadioButton = new QRadioButton( caseGroupBox ); m_sentenceRadioButton->setText( i18n( "Sentence case" ) ); caseButtonGroup->addButton( m_sentenceRadioButton, 3 ); m_lowerFirstCheckBox = new QCheckBox( caseGroupBox ); m_lowerFirstCheckBox->setText( i18n( "Convert to lower case first" ) ); m_lowerFirstCheckBox->setEnabled( false ); connect( caseButtonGroup, SIGNAL( buttonClicked(int) ), this, SLOT( onCaseButtonGroupClicked(int) ) ); createLineTargetsButtonGroup(); createTextTargetsButtonGroup(); QHBoxLayout* lowerFirstLayout = new QHBoxLayout(); lowerFirstLayout->addSpacing( 20 ); lowerFirstLayout->addWidget( m_lowerFirstCheckBox ); QGridLayout* caseLayout = createLayout( caseGroupBox ); caseLayout->addWidget( m_lowerRadioButton, 0, 0 ); caseLayout->addWidget( m_upperRadioButton, 1, 0 ); caseLayout->addWidget( m_titleRadioButton, 2, 0 ); caseLayout->addWidget( m_sentenceRadioButton, 3, 0 ); caseLayout->addLayout( lowerFirstLayout, 4, 0 ); } ChangeTextsCaseDialog::CaseOp ChangeTextsCaseDialog::caseOperation() const { if ( m_lowerRadioButton->isChecked() ) return ChangeTextsCaseDialog::Lower; else if ( m_upperRadioButton->isChecked() ) return ChangeTextsCaseDialog::Upper; else if ( m_titleRadioButton->isChecked() ) return ChangeTextsCaseDialog::Title; else // if ( m_sentenceRadioButton->isChecked() ) return ChangeTextsCaseDialog::Sentence; } bool ChangeTextsCaseDialog::lowerFirst() const { return m_lowerFirstCheckBox->isChecked(); } void ChangeTextsCaseDialog::onCaseButtonGroupClicked( int id ) { if ( id < 2 ) m_lowerFirstCheckBox->setChecked( false ); m_lowerFirstCheckBox->setEnabled( id >= 2 ); } #include "changetextscasedialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/changetextscasedialog.h0000644000175000001440000000413611151345055024174 0ustar sergiousers#ifndef CHANGETEXTSCASEDIALOG_H #define CHANGETEXTSCASEDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwithtargetdialog.h" class QCheckBox; class QRadioButton; namespace SubtitleComposer { class ChangeTextsCaseDialog : public ActionWithTargetDialog { Q_OBJECT public: typedef enum { Upper=0, Lower, Title, Sentence } CaseOp; ChangeTextsCaseDialog( QWidget* parent=0 ); CaseOp caseOperation() const; bool lowerFirst() const; private slots: void onCaseButtonGroupClicked( int id ); private: QCheckBox* m_lowerFirstCheckBox; QRadioButton* m_lowerRadioButton; QRadioButton* m_upperRadioButton; QRadioButton* m_titleRadioButton; QRadioButton* m_sentenceRadioButton; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/fixoverlappingtimesdialog.h0000644000175000001440000000356111151345055025123 0ustar sergiousers#ifndef FIXOVERLAPPINGTIMESDIALOG_H #define FIXOVERLAPPINGTIMESDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwithtargetdialog.h" #include "../../core/time.h" class KIntNumInput; namespace SubtitleComposer { class FixOverlappingTimesDialog : public ActionWithTargetDialog { public: FixOverlappingTimesDialog( QWidget* parent=0 ); Time minimumInterval() const; void setMinimumInterval( const Time& time ); private: KIntNumInput* m_minIntervalSpinBox; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/selectablesubtitledialog.cpp0000644000175000001440000001164511151347217025242 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "selectablesubtitledialog.h" #include "opensubtitledialog.h" #include "../application.h" #include #include #include #include #include #include #include #include #include using namespace SubtitleComposer; SelectableSubtitleDialog::SelectableSubtitleDialog( const QString& defaultEncoding, const QString& title, QWidget* parent ): ActionWithTargetDialog( title, parent ), m_defaultEncoding( defaultEncoding ) { } QGroupBox* SelectableSubtitleDialog::createSubtitleGroupBox( const QString& title, bool addToLayout ) { m_subtitleGroupBox = createGroupBox( title, addToLayout ); m_subtitleUrlLineEdit = new KLineEdit( m_subtitleGroupBox ); m_subtitleUrlLineEdit->setCompletionObject( new KUrlCompletion() ); QLabel* subtitlePathLabel = new QLabel( m_subtitleGroupBox ); subtitlePathLabel->setText( i18n( "Path:" ) ); subtitlePathLabel->setBuddy( m_subtitleUrlLineEdit ); KPushButton* subtitleButton = new KPushButton( m_subtitleGroupBox ); subtitleButton->setIcon( KIcon( "document-open" ) ); subtitleButton->setToolTip( i18n( "Select subtitle" ) ); int buttonSize = subtitleButton->sizeHint().height(); subtitleButton->setFixedSize( buttonSize, buttonSize ); connect( subtitleButton, SIGNAL( clicked() ), SLOT( selectSubtitle() ) ); m_subtitleEncodingComboBox = new KComboBox( m_subtitleGroupBox ); m_subtitleEncodingComboBox->addItems( app()->availableEncodingNames() ); m_subtitleEncodingComboBox->setCurrentItem( m_defaultEncoding ); QLabel* subtitleEncodingLabel = new QLabel( m_subtitleGroupBox ); subtitleEncodingLabel->setText( i18n( "Encoding:" ) ); subtitleEncodingLabel->setBuddy( m_subtitleEncodingComboBox ); QHBoxLayout* subtitlePathLayout = new QHBoxLayout(); subtitlePathLayout->addWidget( m_subtitleUrlLineEdit, 2 ); subtitlePathLayout->addWidget( subtitleButton ); QHBoxLayout* subtitleEncodingLayout = new QHBoxLayout(); subtitleEncodingLayout->addWidget( m_subtitleEncodingComboBox ); subtitleEncodingLayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); m_subtitleLayout = createLayout( m_subtitleGroupBox ); m_subtitleLayout->setColumnStretch( 1, 2 ); m_subtitleLayout->addWidget( subtitlePathLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); m_subtitleLayout->addLayout( subtitlePathLayout, 0, 1, 1, 2 ); m_subtitleLayout->addWidget( subtitleEncodingLabel, 1, 0, Qt::AlignRight|Qt::AlignVCenter ); m_subtitleLayout->addLayout( subtitleEncodingLayout, 1, 1 ); return m_subtitleGroupBox; } void SelectableSubtitleDialog::selectSubtitle() { OpenSubtitleDialog openDlg( true, subtitlePath().isEmpty() ? app()->lastSubtitleDirectory().prettyUrl() : subtitlePath(), subtitleEncoding() ); if ( openDlg.exec() == QDialog::Accepted ) { m_subtitleUrlLineEdit->setText( openDlg.selectedFile() ); m_subtitleEncodingComboBox->setCurrentItem( openDlg.selectedEncoding().toUpper() ); } } QString SelectableSubtitleDialog::defaultEncoding() const { return m_defaultEncoding; } void SelectableSubtitleDialog::setDefaultEncoding( const QString& defaultEncoding ) { if ( m_defaultEncoding != defaultEncoding ) { m_defaultEncoding = defaultEncoding; m_subtitleEncodingComboBox->setCurrentItem( m_defaultEncoding ); } } QString SelectableSubtitleDialog::subtitlePath() const { return m_subtitleUrlLineEdit->text(); } QString SelectableSubtitleDialog::subtitleEncoding() const { return m_subtitleEncodingComboBox->currentText(); } #include "selectablesubtitledialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/clearerrorsdialog.cpp0000644000175000001440000000404611151345055023701 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "clearerrorsdialog.h" #include #include #include #include #include using namespace SubtitleComposer; ClearErrorsDialog::ClearErrorsDialog( QWidget* parent ): ActionWithErrorTargetsDialog( i18n( "Clear Errors" ), parent ) { createErrorsGroupBox( i18nc( "@title:group", "Errors to Clear" ) ); createErrorsButtons( true, translationMode() ); createLineTargetsButtonGroup(); createTextTargetsButtonGroup(); } void ClearErrorsDialog::setTranslationMode( bool value ) { ActionWithErrorTargetsDialog::setTranslationMode( value ); createErrorsButtons( true, value ); } #include "clearerrorsdialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/inputdialog.cpp0000644000175000001440000001212611151350223022504 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "inputdialog.h" #include #include #include #include #include using namespace SubtitleComposer; /// TEXTINPUTDIALOG /// =============== TextInputDialog::TextInputDialog( const QString& caption, const QString& label, QWidget* parent ): KDialog( parent ) { init( caption, label, QString() ); } TextInputDialog::TextInputDialog( const QString& caption, const QString& label, const QString& value, QWidget* parent ): KDialog( parent ) { init( caption, label, value ); } void TextInputDialog::init( const QString& caption, const QString& labelText, const QString& value ) { setCaption( caption ); setModal( true ); setButtons( KDialog::Ok | KDialog::Cancel ); setMainWidget( new QWidget( this ) ); m_lineEdit = new QLineEdit( mainWidget() ); m_lineEdit->setText( value ); m_lineEdit->setFocus(); QLabel* label = new QLabel( mainWidget() ); label->setText( labelText ); label->setBuddy( m_lineEdit ); QGridLayout* mainLayout = new QGridLayout( mainWidget() ); mainLayout->setAlignment( Qt::AlignTop ); mainLayout->setContentsMargins( 0, 0, 0, 0 ); mainLayout->setSpacing( 5 ); mainLayout->addWidget( label, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); mainLayout->addWidget( m_lineEdit, 0, 1 ); button( KDialog::Ok )->setEnabled( false ); resize( 300, 10 ); connect( m_lineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( onLineEditTextChanged( const QString& ) ) ); } const QString TextInputDialog::value() const { return m_lineEdit->text(); } void TextInputDialog::setValue( const QString& value ) { m_lineEdit->setText( value ); } void TextInputDialog::onLineEditTextChanged( const QString& text ) { button( KDialog::Ok )->setEnabled( ! text.isEmpty() ); } /// INTINPUTDIALOG /// ============== IntInputDialog::IntInputDialog( const QString& caption, const QString& label, QWidget* parent ): KDialog( parent ) { init( caption, label, 0, 100, 0 ); } IntInputDialog::IntInputDialog( const QString& caption, const QString& label, int min, int max, QWidget* parent ): KDialog( parent ) { init( caption, label, min, max, min ); } IntInputDialog::IntInputDialog( const QString& caption, const QString& label, int min, int max, int value, QWidget* parent ): KDialog( parent ) { init( caption, label, min, max, value ); } void IntInputDialog::init( const QString& caption, const QString& labelText, int min, int max, int value ) { setCaption( caption ); setModal( true ); setButtons( KDialog::Ok | KDialog::Cancel ); setMainWidget( new QWidget( this ) ); m_intNumInput = new KIntNumInput( mainWidget() ); m_intNumInput->setRange( min, max ); m_intNumInput->setValue( value ); m_intNumInput->setEditFocus( true ); m_intNumInput->setSliderEnabled( true ); m_intNumInput->setFocus(); QLabel* label = new QLabel( mainWidget() ); label->setText( labelText ); label->setBuddy( m_intNumInput ); QGridLayout* mainLayout = new QGridLayout( mainWidget() ); mainLayout->setAlignment( Qt::AlignTop ); mainLayout->setContentsMargins( 0, 0, 0, 0 ); mainLayout->setSpacing( 5 ); mainLayout->addWidget( label, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); mainLayout->addWidget( m_intNumInput, 0, 1 ); mainLayout->setColumnStretch( 1, 2 ); resize( 300, 10 ); } int IntInputDialog::minimum() const { return m_intNumInput->minimum(); } void IntInputDialog::setMinimum( int minimum ) { m_intNumInput->setMinimum( minimum ); } int IntInputDialog::maximum() const { return m_intNumInput->maximum(); } void IntInputDialog::setMaximum( int maximum ) { m_intNumInput->setMaximum( maximum ); } int IntInputDialog::value() const { return m_intNumInput->value(); } void IntInputDialog::setValue( int value ) { m_intNumInput->setValue( value ); } #include "inputdialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/savesubtitledialog.h0000644000175000001440000000422411151345055023533 0ustar sergiousers#ifndef SAVESUBTITLEDIALOG_H #define SAVESUBTITLEDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../formats/format.h" #include class KComboBox; namespace SubtitleComposer { class SaveSubtitleDialog : public KFileDialog { public: explicit SaveSubtitleDialog( bool primary, const QString& startDir=QString(), const QString& encoding=QString(), int newLine=Format::CurrentOS, const QString& format=QString(), QWidget* parent=0 ); QString selectedEncoding() const; QString selectedFormat() const; Format::NewLine selectedNewLine() const; static QString outputFormatsFilter(); public slots: int exec(); private: void setCurrentFilter( const QString& formatName ); KComboBox* m_encodingComboBox; KComboBox* m_newLineComboBox; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/inputdialog.h0000644000175000001440000000545711151345055022171 0ustar sergiousers#ifndef INPUTDIALOG_H #define INPUTDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include class QLineEdit; class KIntNumInput; namespace SubtitleComposer { class TextInputDialog : public KDialog { Q_OBJECT public: TextInputDialog( const QString& caption, const QString& label, QWidget* parent=0 ); TextInputDialog( const QString& caption, const QString& label, const QString& value, QWidget* parent=0 ); const QString value() const; public slots: void setValue( const QString& value ); private: void init( const QString& caption, const QString& label, const QString& value ); private slots: void onLineEditTextChanged( const QString& text ); private: QLineEdit* m_lineEdit; }; class IntInputDialog : public KDialog { Q_OBJECT public: IntInputDialog( const QString& caption, const QString& label, QWidget* parent=0 ); IntInputDialog( const QString& caption, const QString& label, int min, int max, QWidget* parent=0 ); IntInputDialog( const QString& caption, const QString& label, int min, int max, int value, QWidget* parent=0 ); int minimum() const; int maximum() const; int value() const; public slots: void setMinimum( int minimum ); void setMaximum( int maximum ); void setValue( int value ); private: void init( const QString& caption, const QString& label, int min, int max, int value ); private: KIntNumInput* m_intNumInput; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/changeframeratedialog.cpp0000644000175000001440000001064711151350702024471 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "changeframeratedialog.h" #include #include #include #include #include #include #include using namespace SubtitleComposer; ChangeFrameRateDialog::ChangeFrameRateDialog( double fromFramesPerSecond, QWidget* parent ): ActionDialog( i18n( "Change Frame Rate" ), parent ) { QGroupBox* settingsGroupBox = createGroupBox( i18nc( "@title:group", "Settings" ) ); m_fromFramesPerSecondComboBox = new KComboBox( false, settingsGroupBox ); m_fromFramesPerSecondComboBox->setEditable( true ); m_fromFramesPerSecondComboBox->addItems( QString( "15 20 23.976 24 25 29.970 30" ).split( ' ' ) ); m_fromFramesPerSecondComboBox->setCurrentIndex( 2 ); setFromFramesPerSecond( fromFramesPerSecond ); QLabel* fromFramesPerSecondLabel = new QLabel( settingsGroupBox ); fromFramesPerSecondLabel->setText( i18n( "Current frame rate:" ) ); fromFramesPerSecondLabel->setBuddy( m_fromFramesPerSecondComboBox ); m_toFramesPerSecondComboBox = new KComboBox( false, settingsGroupBox ); m_toFramesPerSecondComboBox->setEditable( true ); m_toFramesPerSecondComboBox->addItems( QString( "15 20 23.976 24 25 29.970 30" ).split( ' ' ) ); m_toFramesPerSecondComboBox->setCurrentIndex( 2 ); QLabel* toFramesPerSecondLabel = new QLabel( settingsGroupBox ); toFramesPerSecondLabel->setText( i18n( "New frame rate:" ) ); toFramesPerSecondLabel->setBuddy( m_toFramesPerSecondComboBox ); connect( m_fromFramesPerSecondComboBox, SIGNAL( editTextChanged( const QString& ) ), this, SLOT( onTextChanged() ) ); connect( m_toFramesPerSecondComboBox, SIGNAL( editTextChanged( const QString& ) ), this, SLOT( onTextChanged() ) ); QGridLayout* settingsLayout = createLayout( settingsGroupBox ); settingsLayout->addWidget( fromFramesPerSecondLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); settingsLayout->addWidget( m_fromFramesPerSecondComboBox, 0, 1 ); settingsLayout->addWidget( toFramesPerSecondLabel, 1, 0, Qt::AlignRight|Qt::AlignVCenter ); settingsLayout->addWidget( m_toFramesPerSecondComboBox, 1, 1 ); setMinimumWidth( sizeHint().width() + 25 ); } double ChangeFrameRateDialog::fromFramesPerSecond() const { return m_fromFramesPerSecondComboBox->lineEdit()->text().toDouble(); } void ChangeFrameRateDialog::setFromFramesPerSecond( double framesPerSecond ) { m_fromFramesPerSecondComboBox->lineEdit()->setText( QString::number( framesPerSecond, 'f', 3 ) ); } double ChangeFrameRateDialog::toFramesPerSecond() const { return m_toFramesPerSecondComboBox->lineEdit()->text().toDouble(); } void ChangeFrameRateDialog::setNewFramesPerSecond( double framesPerSecond ) { m_toFramesPerSecondComboBox->lineEdit()->setText( QString::number( framesPerSecond, 'f', 3 ) ); } void ChangeFrameRateDialog::onTextChanged() { bool applyButtonEnabled; m_fromFramesPerSecondComboBox->lineEdit()->text().toDouble( &applyButtonEnabled ); if ( applyButtonEnabled ) m_toFramesPerSecondComboBox->lineEdit()->text().toDouble( &applyButtonEnabled ); enableButton( KDialog::Ok, applyButtonEnabled ); } #include "changeframeratedialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/actionwitherrortargetsdialog.cpp0000644000175000001440000001360611151416077026200 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "actionwitherrortargetsdialog.h" #include #include #include #include #include using namespace SubtitleComposer; ActionWithErrorTargetsDialog::ActionWithErrorTargetsDialog( const QString& title, QWidget* parent ): ActionWithTargetDialog( title, parent ), m_errorsGroupBox( 0 ), m_errorsCheckBox( 0 ), m_errorsLayout( 0 ) { } ActionWithErrorTargetsDialog::~ActionWithErrorTargetsDialog() { delete [] m_errorsCheckBox; } QGroupBox* ActionWithErrorTargetsDialog::createErrorsGroupBox( const QString& title ) { m_errorsGroupBox = createGroupBox( title ); m_errorsLayout = createLayout( m_errorsGroupBox ); return m_errorsGroupBox; } void ActionWithErrorTargetsDialog::createErrorsButtons( bool showUserMarks, bool showMissingTranslation ) { if ( m_errorsCheckBox ) { // no need to recreate everything if the configuration to show has not changed if ( (m_errorsCheckBox[SubtitleLine::UserMarkID] != 0) == showUserMarks && (m_errorsCheckBox[SubtitleLine::UntranslatedTextID] != 0) == showMissingTranslation ) return; } else m_errorsCheckBox = new QCheckBox*[SubtitleLine::ErrorSIZE]; if ( m_errorsGroupBox ) { for ( QLayoutItem* child = m_errorsLayout->takeAt( 0 ); child != 0; child = m_errorsLayout->takeAt( 0 ) ) delete child; QList children = m_errorsGroupBox->findChildren(); for ( QList::ConstIterator it = children.begin(), end = children.end(); it != end; ++it ) delete *it; } else createErrorsGroupBox( i18n( "Available errors" ) ); int excludedErrorFlags = SubtitleLine::SecondaryOnlyErrors; if ( showUserMarks ) excludedErrorFlags &= ~SubtitleLine::UserMark; else excludedErrorFlags |= SubtitleLine::UserMark; if ( showMissingTranslation ) excludedErrorFlags &= ~SubtitleLine::UntranslatedText; else excludedErrorFlags |= SubtitleLine::UntranslatedText; int errorCount = 0; for ( int errorId = 0; errorId < SubtitleLine::ErrorSIZE; ++errorId ) { if ( (0x1 << errorId) & excludedErrorFlags ) m_errorsCheckBox[errorId] = 0; else { m_errorsCheckBox[errorId] = new QCheckBox( m_errorsGroupBox ); m_errorsCheckBox[errorId]->setText( SubtitleLine::simpleErrorText( (SubtitleLine::ErrorID)errorId ) ); m_errorsCheckBox[errorId]->setChecked( true ); errorCount++; } } KPushButton* selectAllButton = new KPushButton( m_errorsGroupBox ); selectAllButton->setText( i18n( "Select All" ) ); KPushButton* selectNoneButton = new KPushButton( m_errorsGroupBox ); selectNoneButton->setText( i18n( "Select None" ) ); connect( selectAllButton, SIGNAL( clicked() ), this, SLOT( selectAllErrorFlags() ) ); connect( selectNoneButton, SIGNAL( clicked() ), this, SLOT( deselectAllErrorFlags() ) ); int row = 0, col = 0; for ( int errorId = 0; errorId < SubtitleLine::ErrorSIZE; ++errorId ) { if ( m_errorsCheckBox[errorId] ) { m_errorsLayout->addWidget( m_errorsCheckBox[errorId], row++, col ); if ( row > (errorCount-1)/2 ) { row = 0; col = 1; } } } QHBoxLayout* buttonsLayout = new QHBoxLayout(); buttonsLayout->addStretch(); buttonsLayout->addWidget( selectAllButton ); buttonsLayout->addWidget( selectNoneButton ); m_errorsLayout->addLayout( buttonsLayout, errorCount / 2 + 1, 0, 1, 2 ); } void ActionWithErrorTargetsDialog::selectAllErrorFlags() { for ( int errorId = 0; errorId < SubtitleLine::ErrorSIZE; ++errorId ) if ( m_errorsCheckBox[errorId] ) m_errorsCheckBox[errorId]->setChecked( true ); } void ActionWithErrorTargetsDialog::deselectAllErrorFlags() { for ( int errorId = 0; errorId < SubtitleLine::ErrorSIZE; ++errorId ) if ( m_errorsCheckBox[errorId] ) m_errorsCheckBox[errorId]->setChecked( false ); } int ActionWithErrorTargetsDialog::selectedErrorFlags() const { int errorFlags = 0; for ( int errorId = 0; errorId < SubtitleLine::ErrorSIZE; ++errorId ) if ( m_errorsCheckBox[errorId] && m_errorsCheckBox[errorId]->isChecked() ) errorFlags |= SubtitleLine::errorFlag( (SubtitleLine::ErrorID)errorId ); switch ( selectedTextsTarget() ) { case SubtitleLine::Primary: { return errorFlags; } case SubtitleLine::Secondary: { int secondaryErrorFlags = (errorFlags & SubtitleLine::PrimaryOnlyErrors) << 1; errorFlags = errorFlags & ~SubtitleLine::PrimaryOnlyErrors; return errorFlags | secondaryErrorFlags; } case SubtitleLine::Both: default: { int secondaryErrorFlags = (errorFlags & SubtitleLine::PrimaryOnlyErrors) << 1; return errorFlags | secondaryErrorFlags; } } } #include "actionwitherrortargetsdialog.moc" subtitlecomposer-0.5.3/src/main/dialogs/actionwitherrortargetsdialog.h0000644000175000001440000000436011151345055025637 0ustar sergiousers#ifndef ACTIONWITHERRORTARGETSDIALOG_H #define ACTIONWITHERRORTARGETSDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwithtargetdialog.h" #include "../../core/subtitleline.h" class QGroupBox; class QCheckBox; class QGridLayout; namespace SubtitleComposer { class ActionWithErrorTargetsDialog : public ActionWithTargetDialog { Q_OBJECT public: ~ActionWithErrorTargetsDialog(); int selectedErrorFlags() const; protected: explicit ActionWithErrorTargetsDialog( const QString& title, QWidget* parent=0 ); QGroupBox* createErrorsGroupBox( const QString& title ); void createErrorsButtons( bool showUserMarks, bool showMissingTranslation ); private slots: void selectAllErrorFlags(); void deselectAllErrorFlags(); private: QGroupBox* m_errorsGroupBox; QCheckBox** m_errorsCheckBox; QGridLayout* m_errorsLayout; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/fixpunctuationdialog.h0000644000175000001440000000365611151345055024111 0ustar sergiousers#ifndef FIXPUNCTUATIONDIALOG_H #define FIXPUNCTUATIONDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwithtargetdialog.h" class QCheckBox; namespace SubtitleComposer { class FixPunctuationDialog : public ActionWithTargetDialog { public: FixPunctuationDialog( QWidget* parent=0 ); bool spaces() const; bool quotes() const; bool englishI() const; bool ellipisis() const; private: QCheckBox* m_spacesCheckBox; QCheckBox* m_quotesCheckBox; QCheckBox* m_englishICheckBox; QCheckBox* m_ellipsisCheckBox; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/autodurationsdialog.cpp0000644000175000001440000001363311153125703024257 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "autodurationsdialog.h" #include #include #include #include #include #include #include #include using namespace SubtitleComposer; AutoDurationsDialog::AutoDurationsDialog( unsigned charMillis, unsigned wordMillis, unsigned lineMillis, QWidget* parent ): ActionWithTargetDialog( i18n( "Set Automatic Durations" ), parent ), m_translationMode( false ) { QGroupBox* settingsGroupBox = createGroupBox( i18nc( "@title:group", "Settings" ) ); m_lineMillisSpinBox = new KIntSpinBox( settingsGroupBox ); m_lineMillisSpinBox->setMinimum( 0 ); m_lineMillisSpinBox->setMaximum( 1000 ); m_lineMillisSpinBox->setValue( lineMillis ); QLabel* lineMillisLabel = new QLabel( settingsGroupBox ); lineMillisLabel->setText( i18n( "Milliseconds per line:" ) ); lineMillisLabel->setBuddy( m_lineMillisSpinBox ); m_wordMillisSpinBox = new KIntSpinBox( settingsGroupBox ); m_wordMillisSpinBox->setMinimum( 0 ); m_wordMillisSpinBox->setMaximum( 1000 ); m_wordMillisSpinBox->setValue( wordMillis ); QLabel* wordMillisLabel = new QLabel( settingsGroupBox ); wordMillisLabel->setText( i18n( "Milliseconds per word:" ) ); wordMillisLabel->setBuddy( m_wordMillisSpinBox ); m_charMillisSpinBox = new KIntSpinBox( settingsGroupBox ); m_charMillisSpinBox->setMinimum( 0 ); m_charMillisSpinBox->setMaximum( 1000 ); m_charMillisSpinBox->setValue( charMillis ); QLabel* charMillisLabel = new QLabel( settingsGroupBox ); charMillisLabel->setText( i18n( "Milliseconds per character:" ) ); charMillisLabel->setBuddy( m_charMillisSpinBox ); m_preventOverlapCheckBox = new QCheckBox( settingsGroupBox ); m_preventOverlapCheckBox->setText( i18n( "Prevent overlapping" ) ); m_preventOverlapCheckBox->setChecked( true ); QGroupBox* calculationGroupBox = createGroupBox( i18nc( "@title:group", "Duration Calculation" ) ); m_calculationButtonGroup = new QButtonGroup( this ); for ( int index = 0; index < SubtitleLine::TextTargetSIZE; ++index ) m_calculationButtonGroup->addButton( new QRadioButton( calculationGroupBox ), index ); m_calculationButtonGroup->button( SubtitleLine::Primary )->setText( i18n( "Use primary text" ) ); m_calculationButtonGroup->button( SubtitleLine::Secondary )->setText( i18n( "Use translation text" ) ); m_calculationButtonGroup->button( SubtitleLine::Both )->setText( i18n( "Calculate both and use maximum" ) ); createLineTargetsButtonGroup(); QGridLayout* settingsGroupBoxLayout = createLayout( settingsGroupBox ); settingsGroupBoxLayout->addWidget( lineMillisLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); settingsGroupBoxLayout->addWidget( m_lineMillisSpinBox, 0, 1 ); settingsGroupBoxLayout->addWidget( wordMillisLabel, 1, 0, Qt::AlignRight|Qt::AlignVCenter ); settingsGroupBoxLayout->addWidget( m_wordMillisSpinBox, 1, 1 ); settingsGroupBoxLayout->addWidget( charMillisLabel, 2, 0, Qt::AlignRight|Qt::AlignVCenter ); settingsGroupBoxLayout->addWidget( m_charMillisSpinBox, 2, 1 ); settingsGroupBoxLayout->addWidget( m_preventOverlapCheckBox, 3, 0, 1, 2 ); QGridLayout* calculationLayout = createLayout( calculationGroupBox ); for ( int index = 0; index < SubtitleLine::TextTargetSIZE; ++index ) calculationLayout->addWidget( m_calculationButtonGroup->button( index ), index, 0 ); } unsigned AutoDurationsDialog::charMillis() const { return m_charMillisSpinBox->value(); } unsigned AutoDurationsDialog::wordMillis() const { return m_wordMillisSpinBox->value(); } unsigned AutoDurationsDialog::lineMillis() const { return m_lineMillisSpinBox->value(); } bool AutoDurationsDialog::preventOverlap() const { return m_preventOverlapCheckBox->isChecked(); } bool AutoDurationsDialog::translationMode() const { return m_translationMode; } void AutoDurationsDialog::setTranslationMode( bool enabled ) { if ( m_translationMode != enabled ) { m_translationMode = enabled; if ( m_translationMode ) { QAbstractButton* radioButton = m_calculationButtonGroup->button( SubtitleLine::Both ); radioButton->setEnabled( true ); radioButton->setChecked( true ); radioButton->parentWidget()->show(); } else { QAbstractButton* radioButton = m_calculationButtonGroup->button( SubtitleLine::Primary ); radioButton->setEnabled( true ); radioButton->setChecked( true ); radioButton->parentWidget()->hide(); } } } Subtitle::TextTarget AutoDurationsDialog::calculationMode() const { int checkedId = m_calculationButtonGroup->checkedId(); return checkedId == -1 ? Subtitle::TextTargetSIZE : (Subtitle::TextTarget)checkedId; } subtitlecomposer-0.5.3/src/main/dialogs/durationlimitsdialog.h0000644000175000001440000000440211170303317024062 0ustar sergiousers#ifndef DURATIONLIMITSDIALOG_H #define DURATIONLIMITSDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwithtargetdialog.h" #include "../../core/time.h" class QGroupBox; class QCheckBox; class TimeEdit; namespace SubtitleComposer { class DurationLimitsDialog : public ActionWithTargetDialog { Q_OBJECT public: DurationLimitsDialog( const Time& minDuration, const Time& maxDuration, QWidget* parent=0 ); Time minDuration() const; Time maxDuration() const; bool enforceMaxDuration() const; bool enforceMinDuration() const; bool preventOverlap() const; private slots: void onMinDurationValueChanged( int value ); void onMaxDurationValueChanged( int value ); private: QGroupBox* m_maxGroupBox; TimeEdit* m_maxDurationTimeEdit; QGroupBox* m_minGroupBox; QCheckBox* m_preventOverlapCheckBox; TimeEdit* m_minDurationTimeEdit; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/adjusttimesdialog.h0000644000175000001440000000363511151345055023362 0ustar sergiousers#ifndef ADJUSTTIMESDIALOG_H #define ADJUSTTIMESDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actiondialog.h" #include "../../core/time.h" class TimeEdit; namespace SubtitleComposer { class AdjustTimesDialog : public ActionDialog { public: AdjustTimesDialog( QWidget* parent=0 ); Time firstLineTime() const; void setFirstLineTime( const Time& time ); Time lastLineTime() const; void setLastLineTime( const Time& time ); private: TimeEdit* m_firstLineTimeEdit; TimeEdit* m_lastLineTimeEdit; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/opensubtitledialog.cpp0000644000175000001440000000644511151350054024073 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "opensubtitledialog.h" #include "../application.h" #include "../../formats/formatmanager.h" #include #include #include #include using namespace SubtitleComposer; OpenSubtitleDialog::OpenSubtitleDialog( bool primary, const QString& startDir, const QString& encoding, QWidget* parent ): KFileDialog( startDir, inputFormatsFilter(), parent ) { setCaption( primary ? i18n( "Open Subtitle" ) : i18n( "Open Translation Subtitle" ) ); setOperationMode( KFileDialog::Opening ); setModal( true ); setMode( KFile::File|KFile::ExistingOnly ); m_encodingComboBox = new KComboBox( this ); m_encodingComboBox->addItems( app()->availableEncodingNames() ); m_encodingComboBox->setCurrentItem( encoding ); m_encodingComboBox->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ); // FIXME set "encoding" label buddy to m_encodingComboBox (how do we get the "encoding" label widget?) fileWidget()->setCustomWidget( i18n( "Encoding:" ), m_encodingComboBox ); } QString OpenSubtitleDialog::selectedEncoding() const { return m_encodingComboBox->currentText(); } QString OpenSubtitleDialog::inputFormatsFilter() { static QString filter; if ( filter.isEmpty() ) { QString allSupported; QStringList formats = FormatManager::instance().inputNames(); for ( QStringList::ConstIterator it = formats.begin(), end = formats.end(); it != end; ++it ) { const InputFormat* format = FormatManager::instance().input( *it ); const QStringList& formatExtensions = format->extensions(); QString extensions; for ( QStringList::ConstIterator extIt = formatExtensions.begin(), extEnd = formatExtensions.end(); extIt != extEnd; ++extIt ) extensions += "*." + *extIt + " *." + (*extIt).toUpper(); allSupported += ' ' + extensions; filter += '\n' + extensions + '|' + format->name(); } filter = allSupported + '|' + i18n( "All Supported" ) + filter; filter = filter.trimmed(); } return filter; } subtitlecomposer-0.5.3/src/main/dialogs/clearerrorsdialog.h0000644000175000001440000000347411151345055023352 0ustar sergiousers#ifndef CLEARERRORSDIALOG_H #define CLEARERRORSDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwitherrortargetsdialog.h" #include "../../core/subtitleline.h" class QCheckBox; class KPushButton; namespace SubtitleComposer { class ClearErrorsDialog : public ActionWithErrorTargetsDialog { Q_OBJECT public: ClearErrorsDialog( QWidget* parent=0 ); protected: virtual void setTranslationMode( bool value ); }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/autodurationsdialog.h0000644000175000001440000000440711153124625023725 0ustar sergiousers#ifndef AUTODURATIONSDIALOG_H #define AUTODURATIONSDIALOG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "actionwithtargetdialog.h" class QCheckBox; class KIntSpinBox; class QButtonGroup; namespace SubtitleComposer { class AutoDurationsDialog : public ActionWithTargetDialog { public: AutoDurationsDialog( unsigned charMillis, unsigned wordMillis, unsigned lineMillis, QWidget* parent=0 ); unsigned charMillis() const; unsigned wordMillis() const; unsigned lineMillis() const; bool preventOverlap() const; Subtitle::TextTarget calculationMode() const; bool translationMode() const; void setTranslationMode( bool enabled ); private: KIntSpinBox* m_charMillisSpinBox; KIntSpinBox* m_wordMillisSpinBox; KIntSpinBox* m_lineMillisSpinBox; QCheckBox* m_preventOverlapCheckBox; bool m_translationMode; QButtonGroup* m_calculationButtonGroup; }; } #endif subtitlecomposer-0.5.3/src/main/dialogs/durationlimitsdialog.cpp0000644000175000001440000001137611170303572024430 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "durationlimitsdialog.h" #include "../../widgets/timeedit.h" #include #include #include #include #include using namespace SubtitleComposer; DurationLimitsDialog::DurationLimitsDialog( const Time& minDuration, const Time& maxDuration, QWidget* parent ): ActionWithTargetDialog( i18n( "Enforce Duration Limits" ), parent ) { m_minGroupBox = createGroupBox( i18nc( "@title:group", "Minimum Duration" ) ); m_minGroupBox->setCheckable( true ); m_minDurationTimeEdit = new TimeEdit( m_minGroupBox ); QLabel* minDurationLabel = new QLabel( m_minGroupBox ); minDurationLabel->setText( i18n( "Expand duration to:" ) ); minDurationLabel->setBuddy( m_minDurationTimeEdit ); m_preventOverlapCheckBox = new QCheckBox( m_minGroupBox ); m_preventOverlapCheckBox->setText( i18n( "Prevent overlapping" ) ); m_preventOverlapCheckBox->setChecked( true ); m_maxGroupBox = createGroupBox( i18nc( "@title:group", "Maximum Duration" ) ); m_maxGroupBox->setCheckable( true ); m_maxDurationTimeEdit = new TimeEdit( m_maxGroupBox ); QLabel* maxDurationLabel = new QLabel( m_maxGroupBox ); maxDurationLabel->setText( i18n( "Shrink duration to:" ) ); maxDurationLabel->setBuddy( m_maxDurationTimeEdit ); createLineTargetsButtonGroup(); QGridLayout* minLayout = createLayout( m_minGroupBox ); minLayout->addWidget( minDurationLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); minLayout->addWidget( m_minDurationTimeEdit, 0, 1 ); minLayout->addWidget( m_preventOverlapCheckBox, 1, 0, 1, 2 ); QGridLayout* maxLayout = createLayout( m_maxGroupBox ); maxLayout->addWidget( maxDurationLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); maxLayout->addWidget( m_maxDurationTimeEdit, 0, 1 ); connect( m_maxGroupBox, SIGNAL( toggled(bool) ), maxDurationLabel, SLOT( setEnabled(bool) ) ); connect( m_maxGroupBox, SIGNAL( toggled(bool) ), m_maxDurationTimeEdit, SLOT( setEnabled(bool) ) ); connect( m_minGroupBox, SIGNAL( toggled(bool) ), m_preventOverlapCheckBox, SLOT( setEnabled(bool) ) ); connect( m_minGroupBox, SIGNAL( toggled(bool) ), minDurationLabel, SLOT( setEnabled(bool) ) ); connect( m_minGroupBox, SIGNAL( toggled(bool) ), m_minDurationTimeEdit, SLOT( setEnabled(bool) ) ); connect( m_maxDurationTimeEdit, SIGNAL( valueChanged(int) ), this, SLOT( onMaxDurationValueChanged(int) ) ); connect( m_minDurationTimeEdit, SIGNAL( valueChanged(int) ), this, SLOT( onMinDurationValueChanged(int) ) ); m_maxDurationTimeEdit->setValue( maxDuration.toMillis() ); m_minDurationTimeEdit->setValue( minDuration.toMillis() ); } void DurationLimitsDialog::onMaxDurationValueChanged( int value ) { if ( m_minDurationTimeEdit->value() > value ) m_minDurationTimeEdit->setValue( value ); } void DurationLimitsDialog::onMinDurationValueChanged( int value ) { if ( m_maxDurationTimeEdit->value() < value ) m_maxDurationTimeEdit->setValue( value ); } Time DurationLimitsDialog::minDuration() const { return Time( m_minDurationTimeEdit->value() ); } Time DurationLimitsDialog::maxDuration() const { return Time( m_maxDurationTimeEdit->value() ); } bool DurationLimitsDialog::enforceMaxDuration() const { return m_maxGroupBox->isChecked(); } bool DurationLimitsDialog::enforceMinDuration() const { return m_minGroupBox->isChecked(); } bool DurationLimitsDialog::preventOverlap() const { return m_preventOverlapCheckBox->isChecked(); } #include "durationlimitsdialog.moc" subtitlecomposer-0.5.3/src/main/subtitlecomposerrc0000644000175000001440000000016211151345061021713 0ustar sergiousers[MainWindow] Height 768=769 Width 1024=1025 LastDir=$HOME [MainWindow Toolbar mainToolBar] Index=0 NewLine=false subtitlecomposer-0.5.3/src/main/currentlinewidget.h0000644000175000001440000000710111151345061021747 0ustar sergiousers#ifndef CURRENTLINEWIDGET_H #define CURRENTLINEWIDGET_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../core/subtitle.h" #include "../core/subtitleline.h" #include class QTimer; class QGridLayout; class QLabel; class QToolButton; class TimeEdit; class SimpleRichTextEdit; namespace SubtitleComposer { class CurrentLineWidget : public QWidget { Q_OBJECT public: CurrentLineWidget( QWidget* parent ); virtual ~CurrentLineWidget(); QString focusedText() const; void loadConfig(); void saveConfig(); void setupActions(); public slots: void setSubtitle( Subtitle* subtitle=0 ); void setCurrentLine( SubtitleLine* line ); void setTranslationMode( bool enabled ); void highlightPrimary( int startIndex, int endIndex ); void highlightSecondary( int startIndex, int endIndex ); protected slots: void onPrimaryTextEditSelectionChanged(); void onSecondaryTextEditSelectionChanged(); void onPrimaryTextEditChanged(); void onSecondaryTextEditChanged(); void onShowTimeEditChanged( int showTime ); void onHideTimeEditChanged( int hideTime ); void onDurationTimeEditChanged( int durationTime ); void onLinePrimaryTextChanged( const SString& primaryText ); void onLineSecondaryTextChanged( const SString& secondaryText ); void onLineShowTimeChanged( const Time& showTime ); void onLineHideTimeChanged( const Time& hideTime ); void onSpellingOptionChanged( const QString& option, const QString& value ); void markUpdateShortcuts(); void updateShortcuts(); private: QToolButton* createToolButton( const QString& text, const char* icon, QObject* receiver, const char* slot ); QString buildTextDescription( const QString& text ); protected: SubtitleLine* m_currentLine; bool m_translationMode; bool m_updateCurrentLine; bool m_updateControls; TimeEdit* m_showTimeEdit; TimeEdit* m_hideTimeEdit; TimeEdit* m_durationTimeEdit; QLabel* m_textLabels[2]; SimpleRichTextEdit* m_textEdits[2]; QToolButton* m_italicButtons[2]; QToolButton* m_boldButtons[2]; QToolButton* m_underlineButtons[2]; QToolButton* m_strikeThroughButtons[2]; QGridLayout* m_mainLayout; QTimer* m_updateShorcutsTimer; }; } #endif subtitlecomposer-0.5.3/src/main/subtitlecomposerui.rc0000644000175000001440000001311711151345061022333 0ustar sergiousers &File Translation &Edit &Texts St&yles T&imes E&rrors &Video T&ools Main Toolbar Edit Toolbar subtitlecomposer-0.5.3/src/main/utils/0000755000175000001440000000000011206423743017206 5ustar sergiouserssubtitlecomposer-0.5.3/src/main/utils/CMakeLists.txt0000644000175000001440000000061611153644226021753 0ustar sergiousersSET( main_utils_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/errorfinder.cpp ${CMAKE_CURRENT_SOURCE_DIR}/errortracker.cpp ${CMAKE_CURRENT_SOURCE_DIR}/finder.cpp ${CMAKE_CURRENT_SOURCE_DIR}/replacer.cpp ${CMAKE_CURRENT_SOURCE_DIR}/speller.cpp ${CMAKE_CURRENT_SOURCE_DIR}/translator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/kreplace.cpp ${CMAKE_CURRENT_SOURCE_DIR}/language.cpp CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/main/utils/kfind_p.h0000644000175000001440000000601011151345060020760 0ustar sergiousers/* Copyright (C) 2001, S.R.Haque . Copyright (C) 2002, David Faure Copyright (C) 2004, Arend van Beelen jr. This file is part of the KDE project This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2, as published by the Free Software Foundation. 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 KFIND_P_H #define KFIND_P_H #include "kfind.h" #include #include #include #include #include struct KFind::Private { Private(KFind *q) : q(q) , findDialog(0) , currentId(0) , customIds(false) , patternChanged(false) , matchedPattern("") , emptyMatch(0) { } ~Private() { delete dialog; data.clear(); delete emptyMatch; emptyMatch = 0; } struct Match { Match() : dataId(-1), index(-1), matchedLength(-1) {} bool isNull() const { return index == -1; } Match(int _dataId, int _index, int _matchedLength) : dataId(_dataId), index(_index), matchedLength(_matchedLength) { Q_ASSERT( index != -1 ); } int dataId; int index; int matchedLength; }; struct Data { Data() : id(-1), dirty(false) { } Data(int id, const QString &text, bool dirty = false) : id(id), text(text), dirty(dirty) { } int id; QString text; bool dirty; }; void init( const QString& pattern ); void startNewIncrementalSearch(); static bool isInWord( QChar ch ); static bool isWholeWords( const QString &text, int starts, int matchedLength ); void _k_slotFindNext(); void _k_slotDialogClosed(); KFind *q; QPointer findDialog; int currentId; bool customIds : 1; bool patternChanged : 1; QString matchedPattern; QHash incrementalPath; Match * emptyMatch; QList data; // used like a vector, not like a linked-list QString pattern; QRegExp *regExp; KDialog* dialog; long options; unsigned matches; QString text; // the text set by setData int index; int matchedLength; bool dialogClosed : 1; bool lastResult : 1; }; #endif // KFIND_P_H subtitlecomposer-0.5.3/src/main/utils/finder.h0000644000175000001440000000554711153644176020647 0ustar sergiousers#ifndef FINDER_H #define FINDER_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../core/subtitle.h" #include "../../core/subtitleline.h" #include class QGroupBox; class QRadioButton; class KFind; class KFindDialog; namespace SubtitleComposer { class SubtitleIterator; class Finder : public QObject { Q_OBJECT public: explicit Finder( QWidget* parent=0 ); virtual ~Finder(); QWidget* parentWidget(); public slots: void setSubtitle( Subtitle* subtitle=0 ); void setTranslationMode( bool enabled ); void find( const RangeList& selectionRanges, int currentIndex, const QString& text=QString(), bool findBackwards=false ); bool findNext(); bool findPrevious(); signals: void found( SubtitleLine* line, bool primary, int startIndex, int endIndex ); private slots: void invalidate(); void onLinePrimaryTextChanged( const SString& text ); void onLineSecondaryTextChanged( const SString& text ); void onHighlight( const QString& text, int matchingIndex, int matchedLength ); void onIteratorSynchronized( int firstIndex, int lastIndex, bool inserted ); private: void advance(); private: Subtitle* m_subtitle; bool m_translationMode; bool m_feedingPrimary; KFind* m_find; KFindDialog* m_dialog; QGroupBox* m_targetGroupBox; QRadioButton* m_targetRadioButtons[SubtitleLine::TextTargetSIZE]; SubtitleIterator* m_iterator; SubtitleLine* m_dataLine; bool m_instancesFound; int m_allSearchedIndex; }; } #endif subtitlecomposer-0.5.3/src/main/utils/replacer.cpp0000644000175000001440000002310311151345060021500 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "replacer.h" #include "../../core/subtitleiterator.h" #include "kreplace.h" #include #include #include #include #include #include #include #include using namespace SubtitleComposer; Replacer::Replacer( QWidget* parent ): QObject( parent ), m_subtitle( 0 ), m_translationMode( false ), m_feedingPrimary( false ), m_replace( 0 ), m_iterator( 0 ) { m_dialog = new KReplaceDialog( parent ); m_dialog->setHasSelection( true ); m_dialog->setHasCursor( true ); m_dialog->setOptions( m_dialog->options() | KFind::FromCursor ); QWidget* mainWidget = m_dialog->mainWidget(); QLayout* mainLayout = mainWidget->layout(); m_targetGroupBox = new QGroupBox( mainWidget ); m_targetGroupBox->setTitle( i18n( "Find/Replace In" ) ); QGridLayout* targetLayout = new QGridLayout( m_targetGroupBox ); targetLayout->setAlignment( Qt::AlignTop ); targetLayout->setSpacing( 5 ); m_targetRadioButtons[SubtitleLine::Both] = new QRadioButton( m_targetGroupBox ); m_targetRadioButtons[SubtitleLine::Both]->setChecked( true ); m_targetRadioButtons[SubtitleLine::Both]->setText( i18n( "Both subtitles" ) ); m_targetRadioButtons[SubtitleLine::Primary] = new QRadioButton( m_targetGroupBox ); m_targetRadioButtons[SubtitleLine::Primary]->setText( i18n( "Primary subtitle" ) ); m_targetRadioButtons[SubtitleLine::Secondary] = new QRadioButton( m_targetGroupBox ); m_targetRadioButtons[SubtitleLine::Secondary]->setText( i18n( "Translation subtitle" ) ); targetLayout->addWidget( m_targetRadioButtons[SubtitleLine::Both], 0, 0 ); targetLayout->addWidget( m_targetRadioButtons[SubtitleLine::Primary], 1, 0 ); targetLayout->addWidget( m_targetRadioButtons[SubtitleLine::Secondary], 2, 0 ); mainLayout->addWidget( m_targetGroupBox ); m_targetGroupBox->hide(); } Replacer::~Replacer() { delete m_dialog; setSubtitle( 0 ); } void Replacer::invalidate() { delete m_replace; m_replace = 0; delete m_iterator; m_iterator = 0; m_feedingPrimary = false; } QWidget* Replacer::parentWidget() { return static_cast( parent() ); } void Replacer::setSubtitle( Subtitle* subtitle ) { m_subtitle = subtitle; invalidate(); } void Replacer::setTranslationMode( bool enabled ) { if ( m_translationMode != enabled ) { m_translationMode = enabled; if ( m_translationMode ) m_targetGroupBox->show(); else m_targetGroupBox->hide(); invalidate(); } } void Replacer::replace( const RangeList& selectionRanges, int currentIndex, const QString& text ) { invalidate(); if ( ! m_subtitle || ! m_subtitle->linesCount() ) return; if ( ! text.isEmpty() ) { QStringList history = m_dialog->findHistory(); history.removeAll( text ); history.prepend( text ); m_dialog->setFindHistory( history ); } if ( m_dialog->exec() != QDialog::Accepted ) return; m_replace = new KReplace( m_dialog->pattern(), m_dialog->replacement(), m_dialog->options(), 0 ); // Connect findNext signal - called when pressing the button in the dialog connect( m_replace, SIGNAL( findNext() ), this, SLOT(advance()) ); // Connect signals to code which handles highlighting of found text, and on-the-fly replacement. connect( m_replace, SIGNAL( highlight( const QString&, int, int ) ), this, SLOT( onHighlight( const QString&, int, int ) ) ); // Connect replace signal - called when doing a replacement connect( m_replace, SIGNAL( replace(const QString&, int, int, int) ), this, SLOT( onReplace(const QString&, int, int, int) ) ); if ( m_dialog->options() & KFind::SelectedText ) { m_iterator = new SubtitleIterator( *m_subtitle, selectionRanges ); if ( m_iterator->index() < 0 ) // Invalid index means no lines in selectionRanges return; } else m_iterator = new SubtitleIterator( *m_subtitle ); if ( m_dialog->options() & KFind::FromCursor ) m_iterator->toIndex( currentIndex < 0 ? 0 : currentIndex ); m_firstIndex = m_iterator->index(); m_instancesFound = false; advance(); } void Replacer::advance() { SubtitleCompositeActionExecutor executor( *m_subtitle, i18n( "Replace" ) ); KFind::Result res = KFind::NoMatch; bool selection = m_replace->options() & KFind::SelectedText; bool backwards = m_replace->options() & KFind::FindBackwards; KDialog* replaceNextDialog = this->replaceNextDialog(); // creates the dialog if it didn't existed before do { if ( m_replace->needData() ) { SubtitleLine* dataLine = m_iterator->current(); if ( dataLine ) { if ( ! m_translationMode || m_targetRadioButtons[SubtitleLine::Primary]->isChecked() ) { m_feedingPrimary = true; m_replace->setData( dataLine->primaryText().string() ); } else if ( m_targetRadioButtons[SubtitleLine::Secondary]->isChecked() ) { m_feedingPrimary = false; m_replace->setData( dataLine->secondaryText().string() ); } else // m_translationMode && m_targetRadioButtons[SubtitleLine::Both]->isChecked() { m_feedingPrimary = ! m_feedingPrimary; // we alternate the source of data m_replace->setData( (m_feedingPrimary ? dataLine->primaryText() : dataLine->secondaryText()).string() ); } } } res = m_replace->replace(); if ( res == KFind::NoMatch && (! m_translationMode || ! m_targetRadioButtons[SubtitleLine::Both]->isChecked() || ! m_feedingPrimary) ) { if ( backwards ) --(*m_iterator); else ++(*m_iterator); if ( m_firstIndex == m_iterator->index() || (backwards ? (m_firstIndex == m_iterator->lastIndex() && m_iterator->index() == SubtitleIterator::BehindFirst) : (m_firstIndex == m_iterator->firstIndex() && m_iterator->index() == SubtitleIterator::AfterLast)) ) { if ( replaceNextDialog ) replaceNextDialog->hide(); if ( m_instancesFound && m_replace->numReplacements() ) KMessageBox::information( parentWidget(), i18np( "1 replacement done.", "%1 replacements done.", m_replace->numReplacements() ), i18n( "Replace" ) ); else // special case KMessageBox::sorry( parentWidget(), i18n( "No instances of '%1' found!", m_replace->pattern() ), i18n( "Replace" ) ); m_replace->resetCounts(); break; } if ( m_iterator->index() < 0 ) { if ( backwards ) m_iterator->toLast(); else m_iterator->toFirst(); int numReplacements = m_replace->numReplacements(); m_replace->resetCounts(); if ( KMessageBox::warningContinueCancel( parentWidget(), i18np( "1 replacement done.", "%1 replacements done.", numReplacements ) + "\n\n" + (backwards ? (selection ? i18n( "Beginning of selection reached.\nContinue from the end?" ) : i18n( "Beginning of subtitle reached.\nContinue from the end?" )) : (selection ? i18n( "End of selection reached.\nContinue from the beginning?" ) : i18n( "End of subtitle reached.\nContinue from the beginning?" ))), i18n( "Replace" ) ) != KMessageBox::Continue ) { if ( replaceNextDialog ) replaceNextDialog->hide(); break; } } } } while ( res != KFind::Match ); } KDialog* Replacer::replaceNextDialog() { if ( ! m_replace ) return 0; KDialog* replaceNextDialog = m_replace->replaceNextDialog( false ); if ( ! replaceNextDialog && m_replace->options() & KReplaceDialog::PromptOnReplace ) { replaceNextDialog = m_replace->replaceNextDialog( true ); replaceNextDialog->setModal( true ); } return replaceNextDialog; } void Replacer::onHighlight( const QString&, int matchingIndex, int matchedLength ) { m_instancesFound = true; emit found( m_iterator->current(), m_feedingPrimary, matchingIndex, matchingIndex + matchedLength - 1 ); } void Replacer::onReplace( const QString& text, int replacementIndex, int replacedLength, int matchedLength ) { m_instancesFound = true; if ( m_feedingPrimary ) { SString stext = m_iterator->current()->primaryText(); stext.replace( replacementIndex, matchedLength, text.mid( replacementIndex, replacedLength ) ); m_iterator->current()->setPrimaryText( stext ); } else { SString stext = m_iterator->current()->secondaryText(); stext.replace( replacementIndex, matchedLength, text.mid( replacementIndex, replacedLength ) ); m_iterator->current()->setSecondaryText( stext ); } } #include "replacer.moc" subtitlecomposer-0.5.3/src/main/utils/translator.h0000644000175000001440000000677011172146710021560 0ustar sergiousers#ifndef TRANSLATOR_H #define TRANSLATOR_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "language.h" #include "../dialogs/progressdialog.h" #include #include #include class KJob; namespace KIO { class Job; class TransferJob; } namespace SubtitleComposer { class Translator : public QObject { Q_OBJECT public: static const int MaxChunkSize = 25000; // in characters Translator( QObject* parent=0 ); ~Translator(); QString inputText() const; QString outputText() const; Language::Value inputLanguage() const; Language::Value outputLanguage() const; int chunksCount() const; // upon how many chunks will the imput text be splitted? bool isFinished() const; bool isFinishedWithError() const; bool isAborted() const; QString errorMessage() const; public slots: bool syncTranslate( const QString& text, Language::Value inputLang, Language::Value outputLang, ProgressDialog*pd=0 ); void translate( const QString& text, Language::Value inputLang, Language::Value outputLang ); void abort(); signals: void progress( int percentage ); void finished( const QString& translatedText ); void finishedWithError( const QString& errorMessage ); void finished(); // finished with or without error private: static QByteArray prepareUrlEncodedData( const QMap& params ); static QByteArray prepareMultipartData( const QMap& params ); static QString& replaceHTMLEntities( QString& text ); static const QMap& namedEntities(); void startChunkDownload( int chunkNumber ); // first chunk is number 1 private slots: void onTransferJobProgress( KJob* job, unsigned long percent ); void onTransferJobData( KIO::Job* job, const QByteArray& data ); void onTransferJobResult( KJob* job ); private: KIO::TransferJob* m_currentTransferJob; QByteArray m_currentTransferData; QStringList m_inputTextChunks; QString m_outputText; Language::Value m_inputLanguage; Language::Value m_outputLanguage; int m_lastReceivedChunk; QString m_errorMessage; bool m_aborted; }; } #endif subtitlecomposer-0.5.3/src/main/utils/replacer.h0000644000175000001440000000541611153644176021170 0ustar sergiousers#ifndef REPLACER_H #define REPLACER_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../core/rangelist.h" #include "../../core/subtitle.h" #include "../../core/subtitleline.h" #include class QGroupBox; class QRadioButton; class KDialog; class KReplace; class KReplaceDialog; namespace SubtitleComposer { class SubtitleIterator; class Replacer : public QObject { Q_OBJECT public: explicit Replacer( QWidget* parent=0 ); virtual ~Replacer(); QWidget* parentWidget(); public slots: void setSubtitle( Subtitle* subtitle=0 ); void setTranslationMode( bool enabled ); void replace( const RangeList& selectionRanges, int currentIndex, const QString& text=QString() ); signals: void found( SubtitleLine* line, bool primary, int startIndex, int endIndex ); private: void invalidate(); KDialog* replaceNextDialog(); private slots: void advance(); void onHighlight( const QString& text, int matchingIndex, int matchedLength ); void onReplace( const QString& text, int replacementIndex, int replacedLength, int matchedLength ); private: Subtitle* m_subtitle; bool m_translationMode; bool m_feedingPrimary; KReplace* m_replace; KReplaceDialog* m_dialog; QGroupBox* m_targetGroupBox; QRadioButton* m_targetRadioButtons[SubtitleLine::TextTargetSIZE]; SubtitleIterator* m_iterator; bool m_instancesFound; int m_firstIndex; }; } #endif subtitlecomposer-0.5.3/src/main/utils/errorfinder.cpp0000644000175000001440000001671611176701137022250 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "errorfinder.h" #include "../../core/subtitleiterator.h" #include "../dialogs/actionwitherrortargetsdialog.h" #include #include #include #include #include #include namespace SubtitleComposer { class FindErrorsDialog : public ActionWithErrorTargetsDialog { public: FindErrorsDialog( QWidget* parent ): ActionWithErrorTargetsDialog( i18n( "Find Error" ), parent ) { createErrorsGroupBox( i18n( "Errors to Find" ) ); createErrorsButtons( true, translationMode() ); QGroupBox* optionsGroupBox = createGroupBox( i18n( "Options" ) ); m_selectionCheckBox = new QCheckBox( optionsGroupBox ); m_selectionCheckBox->setText( i18n( "Selected lines" ) ); m_fromCurrentCheckBox = new QCheckBox( optionsGroupBox ); m_fromCurrentCheckBox->setText( i18n( "From current line" ) ); m_fromCurrentCheckBox->setChecked( true ); m_findBackwards = new QCheckBox( optionsGroupBox ); m_findBackwards->setText( i18n( "Find backwards" ) ); createTargetsGroupBox( "Find In" ); createTextTargetsButtonGroup(); QGridLayout* optionsLayout = createLayout( optionsGroupBox ); optionsLayout->addWidget( m_selectionCheckBox, 0, 0 ); optionsLayout->addWidget( m_fromCurrentCheckBox, 1, 0 ); optionsLayout->addWidget( m_findBackwards, 0, 1 ); } bool findInSelection() const { return m_selectionCheckBox->isChecked(); } bool findFromCurrent() const { return m_fromCurrentCheckBox->isChecked(); } bool findBackwards() const { return m_findBackwards->isChecked(); } void setFindBackwards( bool value ) { m_findBackwards->setChecked( value ); } protected: virtual void setTranslationMode( bool value ) { ActionWithErrorTargetsDialog::setTranslationMode( value ); createErrorsButtons( true, value ); } private: QCheckBox* m_selectionCheckBox; QCheckBox* m_fromCurrentCheckBox; QCheckBox* m_findBackwards; }; } using namespace SubtitleComposer; ErrorFinder::ErrorFinder( QWidget* parent ): QObject( parent ), m_subtitle( 0 ), m_translationMode( false ), m_iterator( 0 ) { m_dialog = new FindErrorsDialog( parent ); } ErrorFinder::~ErrorFinder() { delete m_dialog; invalidate(); } void ErrorFinder::invalidate() { delete m_iterator; m_iterator = 0; } QWidget* ErrorFinder::parentWidget() { return static_cast( parent() ); } void ErrorFinder::setSubtitle( Subtitle* subtitle ) { m_subtitle = subtitle; invalidate(); } void ErrorFinder::setTranslationMode( bool enabled ) { if ( m_translationMode != enabled ) { m_translationMode = enabled; invalidate(); } } void ErrorFinder::find( const RangeList& selectionRanges, int currentIndex, bool findBackwards ) { if ( ! m_subtitle || ! m_subtitle->linesCount() ) return; invalidate(); m_dialog->setFindBackwards( findBackwards ); if ( m_dialog->exec() != QDialog::Accepted ) return; m_selection = m_dialog->findInSelection(); m_findBackwards = m_dialog->findBackwards(); m_targetErrorFlags = m_dialog->selectedErrorFlags(); m_iterator = new SubtitleIterator( *m_subtitle, m_selection ? selectionRanges : Range::full() ); if ( m_iterator->index() == SubtitleIterator::Invalid ) { invalidate(); return; } m_iterator->setAutoSync( true ); connect( m_iterator, SIGNAL( syncronized( int, int, bool ) ), this, SLOT( onIteratorSynchronized( int, int, bool ) ) ); if ( m_dialog->findFromCurrent() ) m_iterator->toIndex( currentIndex < 0 ? 0 : currentIndex ); m_allSearchedIndex = m_iterator->index(); m_instancesFound = false; advance( false ); } bool ErrorFinder::findNext() { if ( ! m_iterator ) return false; m_findBackwards = false; advance( true ); return true; } bool ErrorFinder::findPrevious() { if ( ! m_iterator ) return false; m_findBackwards = true; advance( true ); return true; } void ErrorFinder::advance( bool advanceIteratorOnFirstStep ) { bool foundError = false; do { if ( advanceIteratorOnFirstStep ) { if ( m_findBackwards ) --(*m_iterator); else ++(*m_iterator); if ( m_iterator->index() < 0 ) { if ( m_findBackwards ) m_iterator->toLast(); else m_iterator->toFirst(); if ( KMessageBox::warningContinueCancel( parentWidget(), m_findBackwards ? (m_selection ? i18n( "Beginning of selection reached.\nContinue from the end?" ) : i18n( "Beginning of subtitle reached.\nContinue from the end?" )) : (m_selection ? i18n( "End of selection reached.\nContinue from the beginning?" ) : i18n( "End of subtitle reached.\nContinue from the beginning?" )), i18n( "Find Error" ) ) != KMessageBox::Continue ) break; } } advanceIteratorOnFirstStep = true; foundError = m_iterator->current()->errorFlags() & m_targetErrorFlags; if ( ! foundError ) { // special case: we searched all lines and didn't found any matches if ( ! m_instancesFound && ( m_allSearchedIndex == m_iterator->index() || (m_findBackwards ? (m_allSearchedIndex == m_iterator->lastIndex() && m_iterator->index() == SubtitleIterator::BehindFirst) : (m_allSearchedIndex == m_iterator->firstIndex() && m_iterator->index() == SubtitleIterator::AfterLast)) ) ) { KMessageBox::sorry( parentWidget(), i18n( "No errors matching given criteria found!" ), i18n( "Find Error" ) ); invalidate(); break; } } } while ( ! foundError ); if ( foundError ) { m_instancesFound = true; emit found( m_iterator->current() ); } } void ErrorFinder::onIteratorSynchronized( int firstIndex, int lastIndex, bool inserted ) { if ( m_iterator->index() == SubtitleIterator::Invalid ) { invalidate(); return; } int linesCount = lastIndex - firstIndex + 1; if ( inserted ) { if ( m_allSearchedIndex >= firstIndex ) m_allSearchedIndex += linesCount; } else { if ( m_allSearchedIndex > lastIndex ) m_allSearchedIndex -= linesCount; else if ( m_allSearchedIndex >= firstIndex && m_allSearchedIndex <= lastIndex ) // was one of the removed lines m_allSearchedIndex = m_iterator->index(); } } #include "errorfinder.moc" subtitlecomposer-0.5.3/src/main/utils/speller.cpp0000644000175000001440000001225111151345060021353 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "speller.h" #include "../application.h" #include "../configs/spellingconfig.h" #include "../../core/subtitleiterator.h" #include #include #include #include #include using namespace SubtitleComposer; Speller::Speller( QWidget* parent ): QObject( parent ), m_subtitle( 0 ), m_translationMode( false ), m_feedPrimaryNext( true ), m_sonnetDialog( 0 ), m_iterator( 0 ) { connect( app()->spellingConfig(), SIGNAL(optionChanged(const QString&,const QString&)), this, SLOT(onSpellingOptionChanged(const QString&,const QString&)) ); } Speller::~Speller() { setSubtitle( 0 ); } void Speller::invalidate() { delete m_iterator; m_iterator = 0; m_feedPrimaryNext = true; } QWidget* Speller::parentWidget() { return static_cast( parent() ); } void Speller::setSubtitle( Subtitle* subtitle ) { m_subtitle = subtitle; invalidate(); } void Speller::setTranslationMode( bool enabled ) { m_translationMode = enabled; invalidate(); } void Speller::spellCheck( int currentIndex ) { invalidate(); if ( ! m_subtitle || ! m_subtitle->linesCount() ) return; m_iterator = new SubtitleIterator( *m_subtitle ); m_iterator->toIndex( currentIndex < 0 ? 0 : currentIndex ); m_firstIndex = m_iterator->index(); if ( ! m_sonnetDialog ) { m_sonnetDialog = new Sonnet::Dialog( new Sonnet::BackgroundChecker( this ), parentWidget() ); connect( m_sonnetDialog, SIGNAL( done(const QString&) ), this, SLOT( onBufferDone() ) ); connect( m_sonnetDialog, SIGNAL( replace(const QString&,int,const QString&) ), this, SLOT( onCorrected(const QString&,int,const QString&) ) ); connect( m_sonnetDialog, SIGNAL( misspelling(const QString&,int) ), this, SLOT( onMisspelling(const QString&,int) ) ); } m_sonnetDialog->setBuffer( m_iterator->current()->primaryText().string() ); m_sonnetDialog->show(); m_feedPrimaryNext = ! m_feedPrimaryNext; } void Speller::onBufferDone() { // NOTE: not setting the buffer in this slots closes the dialog if ( advance() ) { if ( m_translationMode ) { m_feedPrimaryNext = ! m_feedPrimaryNext; m_sonnetDialog->setBuffer( m_feedPrimaryNext ? m_iterator->current()->secondaryText().string() : m_iterator->current()->primaryText().string() ); } else m_sonnetDialog->setBuffer( m_iterator->current()->primaryText().string() ); } } bool Speller::advance() { if ( ! m_translationMode || m_feedPrimaryNext ) { ++(*m_iterator); if ( m_firstIndex == m_iterator->index() || m_firstIndex == m_iterator->firstIndex() && m_iterator->index() == SubtitleIterator::AfterLast ) return false; if ( m_iterator->index() < 0 ) { m_iterator->toFirst(); if ( KMessageBox::warningContinueCancel( parentWidget(), i18n( "End of subtitle reached.\nContinue from the beginning?" ), i18n( "Spell Checking" ) ) != KMessageBox::Continue ) return false; } } return true; } void Speller::onMisspelling( const QString& before, int pos ) { bool primary = ! m_translationMode || ! m_feedPrimaryNext; emit misspelled( m_iterator->current(), primary, pos, pos + before.length() - 1 ); } void Speller::onCorrected( const QString& before, int pos, const QString& after ) { if ( m_translationMode && m_feedPrimaryNext ) m_iterator->current()->setSecondaryText( SString( m_iterator->current()->secondaryText() ).replace( pos, before.length(), after ) ); else m_iterator->current()->setPrimaryText( SString( m_iterator->current()->primaryText() ).replace( pos, before.length(), after ) ); } void Speller::onSpellingOptionChanged( const QString& option, const QString& /*value*/ ) { if ( option == SpellingConfig::keyDefaultLanguage() ) { if ( m_sonnetDialog ) { invalidate(); m_sonnetDialog->deleteLater(); m_sonnetDialog = 0; } } } #include "speller.moc" subtitlecomposer-0.5.3/src/main/utils/language.h0000644000175000001440000000472711151345060021146 0ustar sergiousers#ifndef LANGUAGE_H #define LANGUAGE_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include namespace SubtitleComposer { class Language { public: typedef enum { INVALID = -1, Auto = 0, Arabic, Bulgarian, Catalan, ChineseS, ChineseT, Croatian, Czech, Danish, Dutch, English, Filipino, Finnish, French, German, Greek, Hebrew, Hindi, Indonesian, Italian, Japanese, Korean, Latvian, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swedish, Ukrainian, Vietnamese, SIZE } Value; static const QList& all(); static const QList& input(); static const QList& output(); static Value fromCode( const QString& code ); static const QString& code( Value language ); static QString name( Value language ); static QString flagPath( Value language ); static QStringList codes( const QList& languages ); static QStringList names( const QList& languages ); static QStringList flagPaths( const QList& languages ); }; } #endif subtitlecomposer-0.5.3/src/main/utils/errortracker.cpp0000644000175000001440000001230211153644664022425 0ustar sergiousers /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "errortracker.h" #include "../application.h" #include "../../core/subtitleline.h" using namespace SubtitleComposer; ErrorTracker::ErrorTracker( QObject* parent ): QObject( parent ), m_subtitle( 0 ), m_autoClearFixed( app()->errorsConfig()->autoClearFixed() ), m_minDuration( app()->errorsConfig()->minDuration() ), m_maxDuration( app()->errorsConfig()->maxDuration() ), m_minDurationPerChar( app()->errorsConfig()->minDurationPerChar() ), m_maxDurationPerChar( app()->errorsConfig()->maxDurationPerChar() ), m_maxCharacters( app()->errorsConfig()->maxCharacters() ), m_maxLines( app()->errorsConfig()->maxLines() ) { connect( app()->errorsConfig(), SIGNAL( optionChanged( const QString&,const QString& ) ), this, SLOT( onErrorsOptionChanged( const QString&,const QString& ) ) ); } ErrorTracker::~ErrorTracker() { } bool ErrorTracker::isTracking() const { return m_autoClearFixed && m_subtitle; } void ErrorTracker::setSubtitle( Subtitle* subtitle ) { if ( isTracking() ) disconnectSlots(); m_subtitle = subtitle; if ( isTracking() ) connectSlots(); } void ErrorTracker::connectSlots() { connect( m_subtitle, SIGNAL( linePrimaryTextChanged( SubtitleLine*, const SString& ) ), this, SLOT( onLinePrimaryTextChanged( SubtitleLine* ) ) ); connect( m_subtitle, SIGNAL( lineSecondaryTextChanged( SubtitleLine*, const SString& ) ), this, SLOT( onLineSecondaryTextChanged( SubtitleLine* ) ) ); connect( m_subtitle, SIGNAL( lineShowTimeChanged( SubtitleLine*, const Time& ) ), this, SLOT( onLineTimesChanged( SubtitleLine* ) ) ); connect( m_subtitle, SIGNAL( lineHideTimeChanged( SubtitleLine*, const Time& ) ), this, SLOT( onLineTimesChanged( SubtitleLine* ) ) ); } void ErrorTracker::disconnectSlots() { disconnect( m_subtitle, SIGNAL( linePrimaryTextChanged( SubtitleLine*, const SString& ) ), this, SLOT( onLinePrimaryTextChanged( SubtitleLine* ) ) ); disconnect( m_subtitle, SIGNAL( lineSecondaryTextChanged( SubtitleLine*, const SString& ) ), this, SLOT( onLineSecondaryTextChanged( SubtitleLine* ) ) ); disconnect( m_subtitle, SIGNAL( lineShowTimeChanged( SubtitleLine*, const Time& ) ), this, SLOT( onLineTimesChanged( SubtitleLine* ) ) ); disconnect( m_subtitle, SIGNAL( lineHideTimeChanged( SubtitleLine*, const Time& ) ), this, SLOT( onLineTimesChanged( SubtitleLine* ) ) ); } void ErrorTracker::updateLineErrors( SubtitleLine* line, int errorFlags ) const { line->check( errorFlags, m_minDuration, m_maxDuration, m_minDurationPerChar, m_maxDurationPerChar, m_maxCharacters, m_maxLines ); } void ErrorTracker::onLinePrimaryTextChanged( SubtitleLine* line ) { updateLineErrors( line, line->errorFlags() & SubtitleLine::PrimaryOnlyErrors ); } void ErrorTracker::onLineSecondaryTextChanged( SubtitleLine* line ) { updateLineErrors( line, line->errorFlags() & SubtitleLine::SecondaryOnlyErrors ); } void ErrorTracker::onLineTimesChanged( SubtitleLine* line ) { updateLineErrors( line, line->errorFlags() & SubtitleLine::TimesErrors ); SubtitleLine* prevLine = line->prevLine(); if ( prevLine ) updateLineErrors( prevLine, prevLine->errorFlags() & SubtitleLine::OverlapsWithNext ); } void ErrorTracker::onErrorsOptionChanged( const QString& /*optionName*/, const QString& /*value*/ ) { ErrorsConfig* errorsConfig = app()->errorsConfig(); if ( m_autoClearFixed != errorsConfig->autoClearFixed() ) // is this option that has been toggled { if ( isTracking() ) disconnectSlots(); m_autoClearFixed = ! m_autoClearFixed; if ( isTracking() ) connectSlots(); } else { m_minDuration = errorsConfig->minDuration(); m_maxDuration = errorsConfig->maxDuration(); m_minDurationPerChar = errorsConfig->minDurationPerChar(); m_maxDurationPerChar = errorsConfig->maxDurationPerChar(); m_maxCharacters = errorsConfig->maxCharacters(); m_maxLines = errorsConfig->maxLines(); } } #include "errortracker.moc" subtitlecomposer-0.5.3/src/main/utils/language.cpp0000644000175000001440000001542211151345060021473 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "language.h" #include #include #include #include using namespace SubtitleComposer; const QList& Language::all() { static QList languages; if ( languages.empty() ) { for ( int index = Auto; index < SIZE; ++index ) languages << (Value)index; } return languages; } const QList& Language::input() { static QList inputLanguages; if ( inputLanguages.empty() ) { inputLanguages = all(); inputLanguages.removeAll( ChineseT ); } return inputLanguages; } const QList& Language::output() { static QList outputLanguages; if ( outputLanguages.empty() ) { outputLanguages = all(); outputLanguages.removeAll( Auto ); } return outputLanguages; } Language::Value Language::fromCode( const QString& code ) { for ( QList::ConstIterator it = all().begin(), end = all().end(); it != end; ++it ) { if ( Language::code( *it ) == code ) return *it; } return INVALID; } const QString& Language::code( Language::Value language ) { static QMap codes; static QString notFound; if ( codes.empty() ) { codes[Auto] = "auto"; codes[Arabic] = "ar"; codes[Bulgarian] = "bg"; codes[Catalan] = "ca"; codes[ChineseS] = "zh-CN"; codes[ChineseT] = "zh-TW"; codes[Czech] = "cs"; codes[Danish] = "da"; codes[German] = "de"; codes[Greek] = "el"; codes[English] = "en"; codes[Spanish] = "es"; codes[Finnish] = "fi"; codes[French] = "fr"; codes[Hindi] = "hi"; codes[Croatian] = "hr"; codes[Indonesian] = "id"; codes[Italian] = "it"; codes[Hebrew] = "iw"; codes[Japanese] = "ja"; codes[Korean] = "ko"; codes[Lithuanian] = "lt"; codes[Latvian] = "lv"; codes[Dutch] = "nl"; codes[Norwegian] = "no"; codes[Polish] = "pl"; codes[Portuguese] = "pt"; codes[Romanian] = "ro"; codes[Russian] = "ru"; codes[Slovak] = "sk"; codes[Slovenian] = "sl"; codes[Serbian] = "sr"; codes[Swedish] = "sv"; codes[Filipino] = "tl"; codes[Ukrainian] = "uk"; codes[Vietnamese] = "vi"; } return codes.contains( language ) ? codes[language] : notFound; } QString Language::name( Language::Value language ) { switch ( language ) { case Auto: return i18n( "Automatic" ); case ChineseS: return KGlobal::locale()->languageCodeToName( "zh_CN" ); case ChineseT: return KGlobal::locale()->languageCodeToName( "zh_TW" ); //case Filipino: return KGlobal::locale()->languageCodeToName( "tl" ); case Filipino: return i18nc( "Official language of the Philippines, aka Filipino", "Tagalog" ); case Hebrew: return KGlobal::locale()->languageCodeToName( "he" ); case Norwegian: return KGlobal::locale()->languageCodeToName( "nb" ); default: return KGlobal::locale()->languageCodeToName( code( language ) ); } } QString Language::flagPath( Value language ) { static QStringList localesDirs = KGlobal::dirs()->findDirs( "locale", "l10n" ); static QString localeDir = localesDirs.isEmpty() ? QString() : localesDirs.first(); QString localeCode; if ( localeDir.isEmpty() ) return localeCode; switch ( language ) { case Arabic: localeCode = "km"; break; case Bulgarian: localeCode = "bg"; break; case Catalan: localeCode = "es"; break; case ChineseS: localeCode = "cn"; break; case ChineseT: localeCode = "cn"; break; case Czech: localeCode = "cz"; break; case Danish: localeCode = "dk"; break; case German: localeCode = "de"; break; case Greek: localeCode = "gr"; break; case English: localeCode = "gb"; break; case Spanish: localeCode = "es"; break; case Finnish: localeCode = "fi"; break; case French: localeCode = "fr"; break; case Hindi: localeCode = "in"; break; case Croatian: localeCode = "hr"; break; case Indonesian: localeCode = "id"; break; case Italian: localeCode = "it"; break; case Hebrew: localeCode = "il"; break; case Japanese: localeCode = "jp"; break; case Korean: localeCode = "kr"; break; case Lithuanian: localeCode = "lt"; break; case Latvian: localeCode = "lv"; break; case Dutch: localeCode = "nl"; break; case Norwegian: localeCode = "no"; break; case Polish: localeCode = "pl"; break; case Portuguese: localeCode = "pt"; break; case Romanian: localeCode = "ro"; break; case Russian: localeCode = "ru"; break; case Slovak: localeCode = "sk"; break; case Slovenian: localeCode = "si"; break; case Serbian: localeCode = "rs"; break; case Swedish: localeCode = "se"; break; case Filipino: localeCode = "ph"; break; case Ukrainian: localeCode = "ua"; break; case Vietnamese: localeCode = "vn"; break; default: return QString(); } QString flagPath = localeDir + localeCode + "/flag.png"; return QFile::exists( flagPath ) ? flagPath : QString(); } QStringList Language::codes( const QList& languages ) { QStringList codes; for ( QList::ConstIterator it = languages.begin(), end = languages.end(); it != end; ++it ) codes << code( *it ); return codes; } QStringList Language::names( const QList& languages ) { QStringList names; for ( QList::ConstIterator it = languages.begin(), end = languages.end(); it != end; ++it ) names << name( *it ); return names; } QStringList Language::flagPaths( const QList& languages ) { QStringList flagPaths; for ( QList::ConstIterator it = languages.begin(), end = languages.end(); it != end; ++it ) flagPaths << flagPath( *it ); return flagPaths; } subtitlecomposer-0.5.3/src/main/utils/translator.cpp0000644000175000001440000004240211172151015022075 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "translator.h" #include "../../common/qxtsignalwaiter.h" #include #include #include #include #include #include #include #include #include #include using namespace SubtitleComposer; #define MULTIPART_DATA_BOUNDARY "----------nOtA5FcjrNZuZ3TMioysxHGGCO69vA5iYysdBTL2osuNwOjcCfU7uiN" Translator::Translator( QObject* parent ): QObject( parent ), m_currentTransferJob( 0 ), m_inputLanguage( Language::INVALID ), m_outputLanguage( Language::INVALID ), m_lastReceivedChunk( 0 ) { connect( this, SIGNAL( finished( const QString& ) ), this, SIGNAL( finished() ) ); connect( this, SIGNAL( finishedWithError( const QString& ) ), this, SIGNAL( finished() ) ); } Translator::~Translator() { } QString Translator::inputText() const { return m_inputTextChunks.join( QString() ); } QString Translator::outputText() const { return m_outputText; } Language::Value Translator::inputLanguage() const { return m_inputLanguage; } Language::Value Translator::outputLanguage() const { return m_outputLanguage; } int Translator::chunksCount() const { return m_inputTextChunks.count(); } bool Translator::isFinished() const { return isFinishedWithError() || m_lastReceivedChunk == chunksCount(); } bool Translator::isFinishedWithError() const { return ! m_errorMessage.isEmpty(); } bool Translator::isAborted() const { return m_aborted; } QString Translator::errorMessage() const { return m_errorMessage; } bool Translator::syncTranslate( const QString& text, Language::Value inputLang, Language::Value outputLang, ProgressDialog* progressDialog ) { if ( progressDialog ) { connect( this, SIGNAL( progress( int ) ), progressDialog, SLOT( setValue( int ) ) ); connect( progressDialog, SIGNAL( cancelClicked() ), this, SLOT( abort() ) ); progressDialog->setMinimum( 0 ); progressDialog->setMaximum( 100 ); progressDialog->show(); } QxtSignalWaiter finishedSignalWaiter( this, SIGNAL( finished() ) ); finishedSignalWaiter.setProcessEventFlags( QEventLoop::AllEvents ); translate( text, inputLang, outputLang ); finishedSignalWaiter.wait(); if ( progressDialog ) progressDialog->hide(); return ! isFinishedWithError(); } static int findOptimalSplitIndex( const QString& text, int fromIndex=0 ) { int lastTargetIndex = qMin( fromIndex + Translator::MaxChunkSize, text.count() - 1 ); int index = text.lastIndexOf( '\n', lastTargetIndex ); if ( index >= (fromIndex + Translator::MaxChunkSize*(3/4)) ) return index; index = text.lastIndexOf( ' ', lastTargetIndex ); if ( index >= (fromIndex + Translator::MaxChunkSize*(3/4)) ) return index; // text it's really weird (probably garbage)... we just splitted anywhere return fromIndex + Translator::MaxChunkSize; } void Translator::translate( const QString& text, Language::Value inputLanguage, Language::Value outputLanguage ) { m_inputTextChunks.clear(); for ( int index = 0, splitIndex; index < text.length(); index = splitIndex + 1 ) { splitIndex = findOptimalSplitIndex( text, index ); m_inputTextChunks << text.mid( index, splitIndex - index + 1 ); } m_lastReceivedChunk = 0; Q_ASSERT( text == inputText() ); m_outputText.clear(); m_inputLanguage = inputLanguage; m_outputLanguage = outputLanguage; m_errorMessage.clear(); m_aborted = false; startChunkDownload( 1 ); } void Translator::abort() { if ( m_currentTransferJob ) { m_currentTransferJob->kill(); // deletes the job m_aborted = true; m_errorMessage = i18n( "Operation cancelled by user" ); emit finishedWithError( m_errorMessage ); } } // "Content-type" => "application/x-www-form-urlencoded" QByteArray Translator::prepareUrlEncodedData( const QMap& params ) { QByteArray data; QUrl url; for ( QMap::ConstIterator it = params.begin(), end = params.end(); it != end; ++it ) url.addQueryItem( it.key(), it.value() ); return url.toEncoded( QUrl::RemoveScheme|QUrl::RemoveAuthority|QUrl::RemovePath ).remove( 0, 1 ); } // "Content-type" => "multipart/form-data; boundary=" MULTIPART_DATA_BOUNDARY QByteArray Translator::prepareMultipartData( const QMap& params ) { QByteArray data; for ( QMap::ConstIterator it = params.begin(), end = params.end(); it != end; ++it ) { data.append( "--" ); data.append( MULTIPART_DATA_BOUNDARY ); data.append( "\r\n" ); data.append( "Content-Disposition: form-data; name=\"" ); data.append( it.key().toUtf8() ); data.append( "\"\r\n\r\n" ); data.append( it.value().toUtf8() ); data.append( "\r\n" ); } data.append( "--" ); data.append( MULTIPART_DATA_BOUNDARY ); data.append( "--" ); return data; } void Translator::startChunkDownload( int chunkNumber ) { QMap params; params["prev"] = "_t"; params["sl"] = Language::code( m_inputLanguage ); params["tl"] = Language::code( m_outputLanguage ); params["text"] = m_inputTextChunks.at( chunkNumber - 1 ); //QByteArray postData = prepareMultipartData( params ); QByteArray postData = prepareUrlEncodedData( params ); m_currentTransferJob = KIO::http_post( KUrl( "http://translate.google.com/translate_t" ), postData, KIO::HideProgressInfo ); // m_currentTransferJob->addMetaData( "content-type", "Content-Type: multipart/form-data; boundary=" MULTIPART_DATA_BOUNDARY ); m_currentTransferJob->addMetaData( "content-type", "Content-Type: application/x-www-form-urlencoded" ); m_currentTransferJob->setTotalSize( postData.length() ); connect( m_currentTransferJob, SIGNAL( percent( KJob*, unsigned long ) ), this, SLOT( onTransferJobProgress( KJob*, unsigned long ) ) ); connect( m_currentTransferJob, SIGNAL( result( KJob* ) ), this, SLOT( onTransferJobResult( KJob* ) ) ); connect( m_currentTransferJob, SIGNAL( data( KIO::Job*, const QByteArray& ) ), this, SLOT( onTransferJobData( KIO::Job*, const QByteArray& ) ) ); m_currentTransferData.clear(); m_currentTransferJob->start(); } void Translator::onTransferJobProgress( KJob* /*job*/, unsigned long percent ) { const double r = 1.0/chunksCount(); int percentage = (int)(m_lastReceivedChunk * 100.0 * r + percent * r); emit progress( percentage ); } void Translator::onTransferJobData( KIO::Job* /*job*/, const QByteArray& data ) { m_currentTransferData.append( data ); } void Translator::onTransferJobResult( KJob* job ) { m_currentTransferJob = 0; if ( job->error() ) { m_aborted = false; m_errorMessage = job->errorString(); kDebug() << m_errorMessage; emit finishedWithError( m_errorMessage ); return; } QTextCodec* codec = QTextCodec::codecForHtml( m_currentTransferData, QTextCodec::codecForName( "UTF-8" ) ); QString content = codec->toUnicode( m_currentTransferData ); QRegExp resultStartRegExp( "^.*
]+|)>", Qt::CaseInsensitive ); if ( content.contains( resultStartRegExp ) ) content.remove( resultStartRegExp ); else { m_errorMessage = i18n( "Unexpected contents received from translation service" ); emit finishedWithError( m_errorMessage ); return; } QRegExp resultEndRegExp( "
.*$", Qt::CaseInsensitive ); if ( content.contains( resultEndRegExp ) ) content.remove( resultEndRegExp ); else { m_errorMessage = i18n( "Unexpected contents received from translation service" ); emit finishedWithError( m_errorMessage ); return; } content.replace( QRegExp( " ?
?", Qt::CaseInsensitive ), "\n" ); content.replace( QRegExp( "\n{2,}", Qt::CaseInsensitive ), "\n" ); replaceHTMLEntities( content ); if ( ! m_outputText.isEmpty() ) m_outputText += "\n"; m_outputText += content; m_lastReceivedChunk += 1; if ( m_lastReceivedChunk >= chunksCount() ) emit finished( m_outputText ); else startChunkDownload( m_lastReceivedChunk + 1 ); } QString& Translator::replaceHTMLEntities( QString& text ) { const QMap& namedEntities = Translator::namedEntities(); static QRegExp namedEntitiesRegExp( "&([a-zA-Z]+);" ); for ( int offsetIndex = 0, matchedIndex; (matchedIndex = namedEntitiesRegExp.indexIn( text, offsetIndex )) != -1; ) { QString entityName = namedEntitiesRegExp.cap( 1 ).toLower(); if ( namedEntities.contains( entityName ) ) { text.replace( matchedIndex, namedEntitiesRegExp.matchedLength(), namedEntities[entityName] ); offsetIndex = matchedIndex + 1; } else offsetIndex = matchedIndex + namedEntitiesRegExp.matchedLength(); } static QRegExp unnamedB10EntitiesRegExp( "&#(\\d{2,4});" ); for ( int offsetIndex = 0, matchedIndex; (matchedIndex = unnamedB10EntitiesRegExp.indexIn( text, offsetIndex )) != -1; offsetIndex = matchedIndex + 1 ) { QChar entityValue( unnamedB10EntitiesRegExp.cap( 1 ).toUInt( 0, 10 ) ); text.replace( matchedIndex, unnamedB10EntitiesRegExp.matchedLength(), entityValue ); } static QRegExp unnamedB16EntitiesRegExp( "&#x([\\da-fA-F]{2,4});" ); for ( int offsetIndex = 0, matchedIndex; (matchedIndex = unnamedB16EntitiesRegExp.indexIn( text, offsetIndex )) != -1; offsetIndex = matchedIndex + 1 ) { QChar entityValue( unnamedB16EntitiesRegExp.cap( 1 ).toUInt( 0, 16 ) ); text.replace( matchedIndex, unnamedB16EntitiesRegExp.matchedLength(), entityValue ); } return text; } const QMap& Translator::namedEntities() { static QMap entities; if ( entities.empty() ) { entities["quot"] = 34; entities["amp"] = 38; entities["lt"] = 60; entities["gt"] = 62; entities["oelig"] = 338; entities["oelig"] = 339; entities["scaron"] = 352; entities["scaron"] = 353; entities["yuml"] = 376; entities["circ"] = 710; entities["tilde"] = 732; entities["ensp"] = 8194; entities["emsp"] = 8195; entities["thinsp"] = 8201; entities["zwnj"] = 8204; entities["zwj"] = 8205; entities["lrm"] = 8206; entities["rlm"] = 8207; entities["ndash"] = 8211; entities["mdash"] = 8212; entities["lsquo"] = 8216; entities["rsquo"] = 8217; entities["sbquo"] = 8218; entities["ldquo"] = 8220; entities["rdquo"] = 8221; entities["bdquo"] = 8222; entities["dagger"] = 8224; entities["dagger"] = 8225; entities["permil"] = 8240; entities["lsaquo"] = 8249; entities["rsaquo"] = 8250; entities["euro"] = 8364; entities["fnof"] = 402; entities["alpha"] = 913; entities["beta"] = 914; entities["gamma"] = 915; entities["delta"] = 916; entities["epsilon"] = 917; entities["zeta"] = 918; entities["eta"] = 919; entities["theta"] = 920; entities["iota"] = 921; entities["kappa"] = 922; entities["lambda"] = 923; entities["mu"] = 924; entities["nu"] = 925; entities["xi"] = 926; entities["omicron"] = 927; entities["pi"] = 928; entities["rho"] = 929; entities["sigma"] = 931; entities["tau"] = 932; entities["upsilon"] = 933; entities["phi"] = 934; entities["chi"] = 935; entities["psi"] = 936; entities["omega"] = 937; entities["alpha"] = 945; entities["beta"] = 946; entities["gamma"] = 947; entities["delta"] = 948; entities["epsilon"] = 949; entities["zeta"] = 950; entities["eta"] = 951; entities["theta"] = 952; entities["iota"] = 953; entities["kappa"] = 954; entities["lambda"] = 955; entities["mu"] = 956; entities["nu"] = 957; entities["xi"] = 958; entities["omicron"] = 959; entities["pi"] = 960; entities["rho"] = 961; entities["sigmaf"] = 962; entities["sigma"] = 963; entities["tau"] = 964; entities["upsilon"] = 965; entities["phi"] = 966; entities["chi"] = 967; entities["psi"] = 968; entities["omega"] = 969; entities["thetasym"] = 977; entities["upsih"] = 978; entities["piv"] = 982; entities["bull"] = 8226; entities["hellip"] = 8230; entities["prime"] = 8242; entities["prime"] = 8243; entities["oline"] = 8254; entities["frasl"] = 8260; entities["weierp"] = 8472; entities["image"] = 8465; entities["real"] = 8476; entities["trade"] = 8482; entities["alefsym"] = 8501; entities["larr"] = 8592; entities["uarr"] = 8593; entities["rarr"] = 8594; entities["darr"] = 8595; entities["harr"] = 8596; entities["crarr"] = 8629; entities["larr"] = 8656; entities["uarr"] = 8657; entities["rarr"] = 8658; entities["darr"] = 8659; entities["harr"] = 8660; entities["forall"] = 8704; entities["part"] = 8706; entities["exist"] = 8707; entities["empty"] = 8709; entities["nabla"] = 8711; entities["isin"] = 8712; entities["notin"] = 8713; entities["ni"] = 8715; entities["prod"] = 8719; entities["sum"] = 8721; entities["minus"] = 8722; entities["lowast"] = 8727; entities["radic"] = 8730; entities["prop"] = 8733; entities["infin"] = 8734; entities["ang"] = 8736; entities["and"] = 8743; entities["or"] = 8744; entities["cap"] = 8745; entities["cup"] = 8746; entities["int"] = 8747; entities["there4"] = 8756; entities["sim"] = 8764; entities["cong"] = 8773; entities["asymp"] = 8776; entities["ne"] = 8800; entities["equiv"] = 8801; entities["le"] = 8804; entities["ge"] = 8805; entities["sub"] = 8834; entities["sup"] = 8835; entities["nsub"] = 8836; entities["sube"] = 8838; entities["supe"] = 8839; entities["oplus"] = 8853; entities["otimes"] = 8855; entities["perp"] = 8869; entities["sdot"] = 8901; entities["lceil"] = 8968; entities["rceil"] = 8969; entities["lfloor"] = 8970; entities["rfloor"] = 8971; entities["lang"] = 9001; entities["rang"] = 9002; entities["loz"] = 9674; entities["spades"] = 9824; entities["clubs"] = 9827; entities["hearts"] = 9829; entities["diams"] = 9830; entities["nbsp"] = 160; entities["iexcl"] = 161; entities["cent"] = 162; entities["pound"] = 163; entities["curren"] = 164; entities["yen"] = 165; entities["brvbar"] = 166; entities["sect"] = 167; entities["uml"] = 168; entities["copy"] = 169; entities["ordf"] = 170; entities["laquo"] = 171; entities["not"] = 172; entities["shy"] = 173; entities["reg"] = 174; entities["macr"] = 175; entities["deg"] = 176; entities["plusmn"] = 177; entities["sup2"] = 178; entities["sup3"] = 179; entities["acute"] = 180; entities["micro"] = 181; entities["para"] = 182; entities["middot"] = 183; entities["cedil"] = 184; entities["sup1"] = 185; entities["ordm"] = 186; entities["raquo"] = 187; entities["frac14"] = 188; entities["frac12"] = 189; entities["frac34"] = 190; entities["iquest"] = 191; entities["agrave"] = 192; entities["aacute"] = 193; entities["acirc"] = 194; entities["atilde"] = 195; entities["auml"] = 196; entities["aring"] = 197; entities["aelig"] = 198; entities["ccedil"] = 199; entities["egrave"] = 200; entities["eacute"] = 201; entities["ecirc"] = 202; entities["euml"] = 203; entities["igrave"] = 204; entities["iacute"] = 205; entities["icirc"] = 206; entities["iuml"] = 207; entities["eth"] = 208; entities["ntilde"] = 209; entities["ograve"] = 210; entities["oacute"] = 211; entities["ocirc"] = 212; entities["otilde"] = 213; entities["ouml"] = 214; entities["times"] = 215; entities["oslash"] = 216; entities["ugrave"] = 217; entities["uacute"] = 218; entities["ucirc"] = 219; entities["uuml"] = 220; entities["yacute"] = 221; entities["thorn"] = 222; entities["szlig"] = 223; entities["agrave"] = 224; entities["aacute"] = 225; entities["acirc"] = 226; entities["atilde"] = 227; entities["auml"] = 228; entities["aring"] = 229; entities["aelig"] = 230; entities["ccedil"] = 231; entities["egrave"] = 232; entities["eacute"] = 233; entities["ecirc"] = 234; entities["euml"] = 235; entities["igrave"] = 236; entities["iacute"] = 237; entities["icirc"] = 238; entities["iuml"] = 239; entities["eth"] = 240; entities["ntilde"] = 241; entities["ograve"] = 242; entities["oacute"] = 243; entities["ocirc"] = 244; entities["otilde"] = 245; entities["ouml"] = 246; entities["divide"] = 247; entities["oslash"] = 248; entities["ugrave"] = 249; entities["uacute"] = 250; entities["ucirc"] = 251; entities["uuml"] = 252; entities["yacute"] = 253; entities["thorn"] = 254; entities["yuml"] = 255; } return entities; } #include "translator.moc" subtitlecomposer-0.5.3/src/main/utils/errorfinder.h0000644000175000001440000000473411176701127021711 0ustar sergiousers#ifndef ERRORFINDER_H #define ERRORFINDER_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../core/subtitle.h" #include namespace SubtitleComposer { class FindErrorsDialog; class SubtitleIterator; class ErrorFinder : public QObject { Q_OBJECT public: explicit ErrorFinder( QWidget* parent=0 ); virtual ~ErrorFinder(); QWidget* parentWidget(); public slots: void setSubtitle( Subtitle* subtitle=0 ); void setTranslationMode( bool enabled ); void find( const RangeList& selectionRanges, int currentIndex, bool findBackwards=false ); bool findNext(); bool findPrevious(); signals: void found( SubtitleLine* line ); private: void advance( bool advanceIteratorOnFirstStep ); private slots: void invalidate(); void onIteratorSynchronized( int firstIndex, int lastIndex, bool inserted ); private: Subtitle* m_subtitle; FindErrorsDialog* m_dialog; bool m_translationMode; int m_targetErrorFlags; bool m_findBackwards; bool m_selection; SubtitleIterator* m_iterator; bool m_instancesFound; int m_allSearchedIndex; }; } #endif subtitlecomposer-0.5.3/src/main/utils/speller.h0000644000175000001440000000477311153644176021046 0ustar sergiousers#ifndef SPELLER_H #define SPELLER_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../core/subtitle.h" #include "../../core/subtitleline.h" #include namespace Sonnet { class Dialog; } namespace SubtitleComposer { class SubtitleIterator; class Speller : public QObject { Q_OBJECT public: explicit Speller( QWidget* parent=0 ); virtual ~Speller(); QWidget* parentWidget(); public slots: void setSubtitle( Subtitle* subtitle=0 ); void setTranslationMode( bool enabled ); void spellCheck( int currentIndex ); signals: void misspelled( SubtitleLine* line, bool primary, int startIndex, int endIndex ); private: void invalidate(); bool advance(); private slots: void onBufferDone(); void onMisspelling( const QString& before, int pos ); void onCorrected( const QString& before, int pos, const QString& after ); void onSpellingOptionChanged( const QString& option, const QString& value ); private: Subtitle* m_subtitle; bool m_translationMode; bool m_feedPrimaryNext; Sonnet::Dialog* m_sonnetDialog; SubtitleIterator* m_iterator; int m_firstIndex; }; } #endif subtitlecomposer-0.5.3/src/main/utils/errortracker.h0000644000175000001440000000455011153644664022100 0ustar sergiousers#ifndef ERRORTRACKER_H #define ERRORTRACKER_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../core/subtitle.h" namespace SubtitleComposer { class SubtitleLine; class ErrorTracker : public QObject { Q_OBJECT public: explicit ErrorTracker( QObject* parent=0 ); virtual ~ErrorTracker(); bool isTracking() const; public slots: void setSubtitle( Subtitle* subtitle=0 ); private: void connectSlots(); void disconnectSlots(); void updateLineErrors( SubtitleLine* line, int errorFlags ) const; private slots: void onLinePrimaryTextChanged( SubtitleLine* line ); void onLineSecondaryTextChanged( SubtitleLine* line ); void onLineTimesChanged( SubtitleLine* line ); void onErrorsOptionChanged( const QString& optionName, const QString& value ); private: Subtitle* m_subtitle; bool m_autoClearFixed; int m_minDuration; int m_maxDuration; int m_minDurationPerChar; int m_maxDurationPerChar; int m_maxCharacters; int m_maxLines; }; } #endif subtitlecomposer-0.5.3/src/main/utils/finder.cpp0000644000175000001440000002476311155110026021163 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "finder.h" #include "../../core/subtitleiterator.h" #include #include #include #include #include #include #include #include using namespace SubtitleComposer; Finder::Finder( QWidget* parent ): QObject( parent ), m_subtitle( 0 ), m_translationMode( false ), m_feedingPrimary( false ), m_find( 0 ), m_iterator( 0 ), m_dataLine( 0 ) { m_dialog = new KFindDialog( parent ); m_dialog->setHasSelection( true ); m_dialog->setHasCursor( true ); m_dialog->setOptions( m_dialog->options() | KFind::FromCursor ); QWidget* mainWidget = m_dialog->mainWidget(); QLayout* mainLayout = mainWidget->layout(); m_targetGroupBox = new QGroupBox( mainWidget ); m_targetGroupBox->setTitle( i18n( "Find In" ) ); QGridLayout* targetLayout = new QGridLayout( m_targetGroupBox ); targetLayout->setAlignment( Qt::AlignTop ); targetLayout->setSpacing( 5 ); m_targetRadioButtons[SubtitleLine::Both] = new QRadioButton( m_targetGroupBox ); m_targetRadioButtons[SubtitleLine::Both]->setChecked( true ); m_targetRadioButtons[SubtitleLine::Both]->setText( i18n( "Both subtitles" ) ); m_targetRadioButtons[SubtitleLine::Primary] = new QRadioButton( m_targetGroupBox ); m_targetRadioButtons[SubtitleLine::Primary]->setText( i18n( "Primary subtitle" ) ); m_targetRadioButtons[SubtitleLine::Secondary] = new QRadioButton( m_targetGroupBox ); m_targetRadioButtons[SubtitleLine::Secondary]->setText( i18n( "Translation subtitle" ) ); targetLayout->addWidget( m_targetRadioButtons[SubtitleLine::Both], 0, 0 ); targetLayout->addWidget( m_targetRadioButtons[SubtitleLine::Primary], 1, 0 ); targetLayout->addWidget( m_targetRadioButtons[SubtitleLine::Secondary], 2, 0 ); mainLayout->addWidget( m_targetGroupBox ); m_targetGroupBox->hide(); } Finder::~Finder() { delete m_dialog; invalidate(); } void Finder::invalidate() { delete m_find; m_find = 0; delete m_iterator; m_iterator = 0; m_feedingPrimary = false; // NOTE a line shoudn't be deleted before being removed from the subtitle // so there's no risk of being left with an invalid referece as this // method is called when a line is removed from the subtitle and before // anyone has a chance to delete the line. if ( m_dataLine ) { disconnect( m_dataLine, SIGNAL( primaryTextChanged(const SString&) ), this, SLOT( onLinePrimaryTextChanged(const SString&) ) ); disconnect( m_dataLine, SIGNAL( secondaryTextChanged(const SString&) ), this, SLOT( onLineSecondaryTextChanged(const SString&) ) ); m_dataLine = 0; } } QWidget* Finder::parentWidget() { return static_cast( parent() ); } void Finder::setSubtitle( Subtitle* subtitle ) { m_subtitle = subtitle; invalidate(); } void Finder::setTranslationMode( bool enabled ) { if ( m_translationMode != enabled ) { m_translationMode = enabled; if ( m_translationMode ) m_targetGroupBox->show(); else m_targetGroupBox->hide(); invalidate(); } } void Finder::find( const RangeList& selectionRanges, int currentIndex, const QString& text, bool findBackwards ) { if ( ! m_subtitle || ! m_subtitle->linesCount() ) return; invalidate(); m_dialog->setOptions( findBackwards ? m_dialog->options() | KFind::FindBackwards : m_dialog->options() & ~KFind::FindBackwards ); if ( ! text.isEmpty() ) { QStringList history = m_dialog->findHistory(); history.removeAll( text ); history.prepend( text ); m_dialog->setFindHistory( history ); } if ( m_dialog->exec() != QDialog::Accepted ) return; m_find = new KFind( m_dialog->pattern(), m_dialog->options(), 0 ); m_find->closeFindNextDialog(); connect( m_find, SIGNAL( highlight(const QString&,int,int) ), this, SLOT( onHighlight(const QString&,int,int) ) ); m_iterator = new SubtitleIterator( *m_subtitle, m_dialog->options() & KFind::SelectedText ? selectionRanges : Range::full() ); if ( m_iterator->index() == SubtitleIterator::Invalid ) { invalidate(); return; } m_iterator->setAutoSync( true ); connect( m_iterator, SIGNAL( syncronized( int, int, bool ) ), this, SLOT( onIteratorSynchronized( int, int, bool ) ) ); if ( m_dialog->options() & KFind::FromCursor ) m_iterator->toIndex( currentIndex < 0 ? 0 : currentIndex ); m_allSearchedIndex = m_iterator->index(); m_find->setPattern( m_dialog->pattern() ); m_find->setOptions( m_dialog->options() ); m_instancesFound = false; advance(); } bool Finder::findNext() { if ( ! m_iterator ) return false; m_find->setOptions( m_find->options() & ~KFind::FindBackwards ); advance(); return true; } bool Finder::findPrevious() { if ( ! m_iterator ) return false; m_find->setOptions( m_find->options() | KFind::FindBackwards ); advance(); return true; } void Finder::advance() { KFind::Result res = KFind::NoMatch; bool selection = m_find->options() & KFind::SelectedText; bool backwards = m_find->options() & KFind::FindBackwards; do { if ( m_find->needData() ) { if ( m_dataLine ) { disconnect( m_dataLine, SIGNAL( primaryTextChanged(const SString&) ), this, SLOT( onLinePrimaryTextChanged(const SString&) ) ); disconnect( m_dataLine, SIGNAL( secondaryTextChanged(const SString&) ), this, SLOT( onLineSecondaryTextChanged(const SString&) ) ); } m_dataLine = m_iterator->current(); if ( m_dataLine ) { if ( ! m_translationMode || m_targetRadioButtons[SubtitleLine::Primary]->isChecked() ) { m_feedingPrimary = true; m_find->setData( m_dataLine->primaryText().string() ); } else if ( m_targetRadioButtons[SubtitleLine::Secondary]->isChecked() ) { m_feedingPrimary = false; m_find->setData( m_dataLine->secondaryText().string() ); } else // m_translationMode && m_targetRadioButtons[SubtitleLine::Both]->isChecked() { m_feedingPrimary = ! m_feedingPrimary; // we alternate the source of data m_find->setData( (m_feedingPrimary ? m_dataLine->primaryText() : m_dataLine->secondaryText()).string() ); } connect( m_dataLine, SIGNAL( primaryTextChanged(const SString&) ), this, SLOT( onLinePrimaryTextChanged(const SString&) ) ); connect( m_dataLine, SIGNAL( secondaryTextChanged(const SString&) ), this, SLOT( onLineSecondaryTextChanged(const SString&) ) ); } } res = m_find->find(); if ( res == KFind::NoMatch && (! m_translationMode || ! m_targetRadioButtons[SubtitleLine::Both]->isChecked() || ! m_feedingPrimary) ) { if ( backwards ) --(*m_iterator); else ++(*m_iterator); // special case: we searched all lines and didn't found any matches if ( ! m_instancesFound && ( m_allSearchedIndex == m_iterator->index() || (backwards ? (m_allSearchedIndex == m_iterator->lastIndex() && m_iterator->index() == SubtitleIterator::BehindFirst) : (m_allSearchedIndex == m_iterator->firstIndex() && m_iterator->index() == SubtitleIterator::AfterLast)) ) ) { KMessageBox::sorry( parentWidget(), i18n( "No instances of '%1' found!", m_find->pattern() ), i18n( "Find" ) ); invalidate(); break; } if ( m_iterator->index() < 0 ) { if ( backwards ) m_iterator->toLast(); else m_iterator->toFirst(); if ( KMessageBox::warningContinueCancel( parentWidget(), backwards ? (selection ? i18n( "Beginning of selection reached.\nContinue from the end?" ) : i18n( "Beginning of subtitle reached.\nContinue from the end?" )) : (selection ? i18n( "End of selection reached.\nContinue from the beginning?" ) : i18n( "End of subtitle reached.\nContinue from the beginning?" )), i18n( "Find" ) ) != KMessageBox::Continue ) break; } } } while ( res == KFind::NoMatch ); } void Finder::onHighlight( const QString&, int matchingIndex, int matchedLength ) { m_instancesFound = true; emit found( m_iterator->current(), m_feedingPrimary, matchingIndex, matchingIndex + matchedLength - 1 ); } void Finder::onLinePrimaryTextChanged( const SString& text ) { if ( m_feedingPrimary ) m_find->setData( text.string() ); } void Finder::onLineSecondaryTextChanged( const SString& text ) { if ( ! m_feedingPrimary ) m_find->setData( text.string() ); } void Finder::onIteratorSynchronized( int firstIndex, int lastIndex, bool inserted ) { if ( m_iterator->index() == SubtitleIterator::Invalid ) { invalidate(); return; } int linesCount = lastIndex - firstIndex + 1; if ( inserted ) { if ( m_allSearchedIndex >= firstIndex ) m_allSearchedIndex += linesCount; } else { if ( m_dataLine->index() < 0 ) // m_dataLine was removed { // work around missing "invalidateData" method in KFind long options = m_find->options(); QString pattern = m_find->pattern(); delete m_find; m_find = new KFind( pattern, options, 0 ); m_find->closeFindNextDialog(); connect( m_find, SIGNAL( highlight(const QString&,int,int) ), this, SLOT( onHighlight(const QString&,int,int) ) ); } if ( m_allSearchedIndex > lastIndex ) m_allSearchedIndex -= linesCount; else if ( m_allSearchedIndex >= firstIndex && m_allSearchedIndex <= lastIndex ) // was one of the removed lines m_allSearchedIndex = m_iterator->index(); } } #include "finder.moc" subtitlecomposer-0.5.3/src/main/utils/kreplace.cpp0000644000175000001440000003471111151345060021500 0ustar sergiousers/* Copyright (C) 2001, S.R.Haque . Copyright (C) 2002, David Faure This file is part of the KDE project This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2, as published by the Free Software Foundation. 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. */ #include "kreplace.h" #include "kfind_p.h" #include #include #include #include #include #include "kreplacedialog.h" #include //#define DEBUG_REPLACE #define INDEX_NOMATCH -1 class KReplaceNextDialog : public KDialog { public: explicit KReplaceNextDialog( QWidget *parent ); void setLabel( const QString& pattern, const QString& replacement ); private: QLabel* m_mainLabel; }; KReplaceNextDialog::KReplaceNextDialog(QWidget *parent) : KDialog(parent) { setModal( false ); setCaption( i18n("Replace") ); setButtons( User3 | User2 | User1 | Close ); setButtonGuiItem( User1, KGuiItem(i18n("&All")) ); setButtonGuiItem( User2, KGuiItem(i18n("&Skip")) ); setButtonGuiItem( User3, KGuiItem(i18n("Replace")) ); setDefaultButton( User3 ); showButtonSeparator( false ); m_mainLabel = new QLabel( this ); setMainWidget( m_mainLabel ); } void KReplaceNextDialog::setLabel( const QString& pattern, const QString& replacement ) { m_mainLabel->setText( i18n("Replace '%1' with '%2'?", pattern, replacement) ); } //// class KReplacePrivate { public: KReplacePrivate(KReplace *q, const QString& replacement) : q(q) , m_replacement( replacement ) , m_replacements( 0 ) {} KReplaceNextDialog* dialog(); void doReplace(); //static int replace( QString &text, const QString &replacement, int index, long options, int length ); static int replace(QString& text, const QString& replacement, QRegExp* regExp, int index, long options, int length); void _k_slotSkip(); void _k_slotReplace(); void _k_slotReplaceAll(); KReplace *q; QString m_replacement; unsigned m_replacements; }; //// KReplace::KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent) : KFind( pattern, options, parent ), d( new KReplacePrivate(this, replacement) ) { } KReplace::KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent, QWidget *dlg) : KFind( pattern, options, parent, dlg ), d( new KReplacePrivate(this, replacement) ) { } KReplace::~KReplace() { delete d; } int KReplace::numReplacements() const { return d->m_replacements; } KDialog* KReplace::replaceNextDialog( bool create ) { if ( KFind::d->dialog || create ) return d->dialog(); return 0L; } KReplaceNextDialog* KReplacePrivate::dialog() { if ( !q->KFind::d->dialog ) { q->KFind::d->dialog = new KReplaceNextDialog( q->parentWidget() ); q->connect( q->KFind::d->dialog, SIGNAL( user1Clicked() ), q, SLOT( _k_slotReplaceAll() ) ); q->connect( q->KFind::d->dialog, SIGNAL( user2Clicked() ), q, SLOT( _k_slotSkip() ) ); q->connect( q->KFind::d->dialog, SIGNAL( user3Clicked() ), q, SLOT( _k_slotReplace() ) ); q->connect( q->KFind::d->dialog, SIGNAL( finished() ), q, SLOT( _k_slotDialogClosed() ) ); } return static_cast(q->KFind::d->dialog); } void KReplace::displayFinalDialog() const { if ( !d->m_replacements ) KMessageBox::information(parentWidget(), i18n("No text was replaced.")); else KMessageBox::information(parentWidget(), i18np("1 replacement done.", "%1 replacements done.", d->m_replacements ) ); } KFind::Result KReplace::replace() { #ifdef DEBUG_REPLACE kDebug() << "d->index=" << KFind::d->index; #endif if ( KFind::d->index == INDEX_NOMATCH && KFind::d->lastResult == Match ) { KFind::d->lastResult = NoMatch; return NoMatch; } do // this loop is only because validateMatch can fail { #ifdef DEBUG_REPLACE kDebug() << "beginning of loop: KFind::d->index=" << KFind::d->index; #endif // Find the next match. if ( KFind::d->options & KFind::RegularExpression ) KFind::d->index = KFind::find(KFind::d->text, *KFind::d->regExp, KFind::d->index, KFind::d->options, &KFind::d->matchedLength); else KFind::d->index = KFind::find(KFind::d->text, KFind::d->pattern, KFind::d->index, KFind::d->options, &KFind::d->matchedLength); #ifdef DEBUG_REPLACE kDebug() << "KFind::find returned KFind::d->index=" << KFind::d->index; #endif if ( KFind::d->index != -1 ) { // Flexibility: the app can add more rules to validate a possible match if ( validateMatch( KFind::d->text, KFind::d->index, KFind::d->matchedLength ) ) { if ( KFind::d->options & KReplaceDialog::PromptOnReplace ) { #ifdef DEBUG_REPLACE kDebug() << "PromptOnReplace"; #endif // Display accurate initial string and replacement string, they can vary QString matchedText (KFind::d->text.mid( KFind::d->index, KFind::d->matchedLength )); QString rep (matchedText); d->KReplacePrivate::replace(rep, d->m_replacement, KFind::d->regExp, 0, KFind::d->options, KFind::d->matchedLength); d->dialog()->setLabel( matchedText, rep ); d->dialog()->show(); // Tell the world about the match we found, in case someone wants to // highlight it. emit highlight(KFind::d->text, KFind::d->index, KFind::d->matchedLength); KFind::d->lastResult = Match; return Match; } else { d->doReplace(); // this moves on too } } else { // not validated -> move on if (KFind::d->options & KFind::FindBackwards) KFind::d->index--; else KFind::d->index++; } } else KFind::d->index = INDEX_NOMATCH; // will exit the loop } while (KFind::d->index != INDEX_NOMATCH); KFind::d->lastResult = NoMatch; return NoMatch; } int KReplace::replace(QString &text, const QString &pattern, const QString &replacement, int index, long options, int *replacedLength) { if ( (options & KFind::RegularExpression) && (options & KReplaceDialog::BackReference) ) { QRegExp regExp( pattern, options & KFind::CaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive ); return KReplace::replace(text, regExp, replacement, index, options, replacedLength); } else { int matchedLength; index = KFind::find(text, pattern, index, options, &matchedLength); if (index != -1) { *replacedLength = KReplacePrivate::replace(text, replacement, 0, index, options, matchedLength); if (options & KFind::FindBackwards) index--; else index += *replacedLength; } return index; } } int KReplace::replace(QString &text, const QRegExp &pattern, const QString &replacement, int index, long options, int *replacedLength) { int matchedLength; index = KFind::find(text, pattern, index, options, &matchedLength); if (index != -1) { QRegExp regExp( pattern ); *replacedLength = KReplacePrivate::replace(text, replacement, ®Exp, index, options, matchedLength); if (options & KFind::FindBackwards) index--; else index += *replacedLength; } return index; } // int KReplacePrivate::replace(QString &text, const QString &replacement, int index, long options, int length) // { // QString rep (replacement); // // Backreferences: replace \0 with the right portion of 'text' // if ( options & KReplaceDialog::BackReference ) // rep.replace( "\\0", text.mid( index, length ) ); // // Then replace rep into the text // text.replace(index, length, rep); // return rep.length(); // } int KReplacePrivate::replace(QString& text, const QString& replacement, QRegExp* regExp, int index, long options, int length) { // Backreferences: replace \N with the right portion of 'text' if ( regExp && (options & KReplaceDialog::BackReference) ) { QString mutableReplacement( replacement ); // NOTE we have to build the replacement string from the regExp, the // matched text and the replacement template. // We can't do QString::replace( *regExp, replacement ) on the matched // text because that ignores the \0 and we can't replace it ourselves // before nor after that call as both the matched text and the matched // subexpressions can contain text that may look as backreferences but // which should be not be considered as such. // For the same reason we can't just do a QString::replace( "\\N", // regExp.cap( N ) ) on all subexpressions found. // There's no choice but to iterate the replacement template, replacing // the back references with the corresponding captures as we find them. if ( regExp->indexIn( text.mid( index, length ) /* the matched text */ ) != -1 ) // set up the captures { int capNumber, maxCapNumber = qMin( 9, regExp->numCaptures() ); int idx = 0; while ( idx < mutableReplacement.length() ) { if ( mutableReplacement.at( idx ) == '\\' ) { idx++; if ( idx >= mutableReplacement.length() ) break; QChar chr = mutableReplacement.at( idx ); capNumber = chr.digitValue(); if ( capNumber >= 0 && capNumber <= maxCapNumber ) { QString cap( regExp->cap( capNumber ) ); mutableReplacement.replace( idx-1, 2, cap ); idx += cap.length() - 1; } else if ( chr == '\\' ) { mutableReplacement.replace( idx-1, 2, '\\' ); } else idx++; } else idx++; } } text.replace( index, length, mutableReplacement ); return mutableReplacement.length(); } else { text.replace( index, length, replacement ); return replacement.length(); } } void KReplacePrivate::_k_slotReplaceAll() { doReplace(); q->KFind::d->options &= ~KReplaceDialog::PromptOnReplace; emit q->optionsChanged(); emit q->findNext(); } void KReplacePrivate::_k_slotSkip() { if (q->KFind::d->options & KFind::FindBackwards) q->KFind::d->index--; else q->KFind::d->index++; if ( q->KFind::d->dialogClosed ) { delete q->KFind::d->dialog; // hide it again q->KFind::d->dialog = 0L; } else emit q->findNext(); } void KReplacePrivate::_k_slotReplace() { doReplace(); if ( q->KFind::d->dialogClosed ) { delete q->KFind::d->dialog; // hide it again q->KFind::d->dialog = 0L; } else emit q->findNext(); } void KReplacePrivate::doReplace() { int replacedLength = replace(q->KFind::d->text, m_replacement, q->KFind::d->regExp, q->KFind::d->index, q->KFind::d->options, q->KFind::d->matchedLength); // Tell the world about the replacement we made, in case someone wants to // highlight it. emit q->replace(q->KFind::d->text, q->KFind::d->index, replacedLength, q->KFind::d->matchedLength); #ifdef DEBUG_REPLACE kDebug() << "after replace() signal: KFind::d->index=" << q->KFind::d->index << " replacedLength=" << replacedLength; #endif m_replacements++; if (q->KFind::d->options & KFind::FindBackwards) q->KFind::d->index--; else { q->KFind::d->index += replacedLength; // when replacing the empty pattern, move on. See also kjs/regexp.cpp for how this should be done for regexps. if ( q->KFind::d->pattern.isEmpty() ) ++(q->KFind::d->index); } #ifdef DEBUG_REPLACE kDebug() << "after adjustement: KFind::d->index=" << q->KFind::d->index; #endif } void KReplace::resetCounts() { KFind::resetCounts(); d->m_replacements = 0; } bool KReplace::shouldRestart( bool forceAsking, bool showNumMatches ) const { // Only ask if we did a "find from cursor", otherwise it's pointless. // ... Or if the prompt-on-replace option was set. // Well, unless the user can modify the document during a search operation, // hence the force boolean. if ( !forceAsking && (KFind::d->options & KFind::FromCursor) == 0 && (KFind::d->options & KReplaceDialog::PromptOnReplace) == 0 ) { displayFinalDialog(); return false; } QString message; if ( showNumMatches ) { if ( !d->m_replacements ) message = i18n("No text was replaced."); else message = i18np("1 replacement done.", "%1 replacements done.", d->m_replacements ); } else { if ( KFind::d->options & KFind::FindBackwards ) message = i18n( "Beginning of document reached." ); else message = i18n( "End of document reached." ); } message += '\n'; // Hope this word puzzle is ok, it's a different sentence message += ( KFind::d->options & KFind::FindBackwards ) ? i18n("Do you want to restart search from the end?") : i18n("Do you want to restart search at the beginning?"); int ret = KMessageBox::questionYesNo( parentWidget(), message, QString(), KGuiItem(i18n("Restart")), KGuiItem(i18n("Stop")) ); return( ret == KMessageBox::Yes ); } void KReplace::closeReplaceNextDialog() { closeFindNextDialog(); } #include "kreplace.moc" subtitlecomposer-0.5.3/src/main/utils/kreplace.h0000644000175000001440000002175111151345060021145 0ustar sergiousers/* Copyright (C) 2001, S.R.Haque . Copyright (C) 2002, David Faure This file is part of the KDE project This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2, as published by the Free Software Foundation. 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 KREPLACE_H #define KREPLACE_H #include "kfind.h" class KReplaceNextDialog; class KReplacePrivate; /** * @brief A generic implementation of the "replace" function. * * @author S.R.Haque , David Faure * * \b Detail: * * This class includes prompt handling etc. Also provides some * static functions which can be used to create custom behavior * instead of using the class directly. * * \b Example: * * To use the class to implement a complete replace feature: * * In the slot connect to the replace action, after using KReplaceDialog: * \code * * // This creates a replace-on-prompt dialog if needed. * m_replace = new KReplace(pattern, replacement, options, this); * * // Connect signals to code which handles highlighting * // of found text, and on-the-fly replacement. * connect( m_replace, SIGNAL( highlight( const QString &, int, int ) ), * this, SLOT( slotHighlight( const QString &, int, int ) ) ); * // Connect findNext signal - called when pressing the button in the dialog * connect( m_replace, SIGNAL( findNext() ), * this, SLOT( slotReplaceNext() ) ); * // Connect replace signal - called when doing a replacement * connect( m_replace, SIGNAL( replace(const QString &, int, int, int) ), * this, SLOT( slotReplace(const QString &, int, int, int) ) ); * \endcode * Then initialize the variables determining the "current position" * (to the cursor, if the option FromCursor is set, * to the beginning of the selection if the option SelectedText is set, * and to the beginning of the document otherwise). * Initialize the "end of search" variables as well (end of doc or end of selection). * Swap begin and end if FindBackwards. * Finally, call slotReplaceNext(); * * \code * void slotReplaceNext() * { * KFind::Result res = KFind::NoMatch; * while ( res == KFind::NoMatch && ) { * if ( m_replace->needData() ) * m_replace->setData( ); * * // Let KReplace inspect the text fragment, and display a dialog if a match is found * res = m_replace->replace(); * * if ( res == KFind::NoMatch ) { * * } * } * * if ( res == KFind::NoMatch ) // i.e. at end * displayFinalDialog(); delete m_replace; m_replace = 0L; * or if ( m_replace->shouldRestart() ) { reinit (w/o FromCursor) and call slotReplaceNext(); } * else { m_replace->closeReplaceNextDialog(); }> * } * \endcode * * Don't forget delete m_find in the destructor of your class, * unless you gave it a parent widget on construction. * */ class KDEUI_EXPORT KReplace : public KFind { Q_OBJECT public: /** * Only use this constructor if you don't use KFindDialog, or if * you use it as a modal dialog. */ KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent = 0); /** * This is the recommended constructor if you also use KReplaceDialog (non-modal). * You should pass the pointer to it here, so that when a message box * appears it has the right parent. Don't worry about deletion, KReplace * will notice if the find dialog is closed. */ KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent, QWidget* replaceDialog); virtual ~KReplace(); /** * Return the number of replacements made (i.e. the number of times * the replace signal was emitted). * Can be used in a dialog box to tell the user how many replacements were made. * The final dialog does so already, unless you used setDisplayFinalDialog(false). */ int numReplacements() const; /** * Call this to reset the numMatches & numReplacements counts. * Can be useful if reusing the same KReplace for different operations, * or when restarting from the beginning of the document. */ virtual void resetCounts(); /** * Walk the text fragment (e.g. kwrite line, kspread cell) looking for matches. * For each match, if prompt-on-replace is specified, emits the highlight() signal * and displays the prompt-for-replace dialog before doing the replace. */ Result replace(); /** * Return (or create) the dialog that shows the "find next?" prompt. * Usually you don't need to call this. * One case where it can be useful, is when the user selects the "Find" * menu item while a find operation is under way. In that case, the * program may want to call setActiveWindow() on that dialog. */ KDialog* replaceNextDialog( bool create = false ); /** * Close the "replace next?" dialog. The application should do this when * the last match was hit. If the application deletes the KReplace, then * "find previous" won't be possible anymore. */ void closeReplaceNextDialog(); /** * Search the given string, replaces with the given replacement string, * and returns whether a match was found. If one is, * the replacement string length is also returned. * * A performance optimised version of the function is provided for use * with regular expressions. * * @param text The string to search. * @param pattern The pattern to look for. * @param replacement The replacement string to insert into the text. * @param index The starting index into the string. * @param options The options to use. * @param replacedLength Output parameter, contains the length of the replaced string. * Not always the same as replacement.length(), when backreferences are used. * @return The index at which a match was found, or -1 if no match was found. */ static int replace( QString &text, const QString &pattern, const QString &replacement, int index, long options, int *replacedLength ); static int replace( QString &text, const QRegExp &pattern, const QString &replacement, int index, long options, int *replacedLength ); /** * Returns true if we should restart the search from scratch. * Can ask the user, or return false (if we already searched/replaced the * whole document without the PromptOnReplace option). * * @param forceAsking set to true if the user modified the document during the * search. In that case it makes sense to restart the search again. * * @param showNumMatches set to true if the dialog should show the number of * matches. Set to false if the application provides a "find previous" action, * in which case the match count will be erroneous when hitting the end, * and we could even be hitting the beginning of the document (so not all * matches have even been seen). */ virtual bool shouldRestart( bool forceAsking = false, bool showNumMatches = true ) const; /** * Displays the final dialog telling the user how many replacements were made. * Call either this or shouldRestart(). */ virtual void displayFinalDialog() const; Q_SIGNALS: /** * Connect to this slot to implement updating of replaced text during the replace * operation. * * Extra care must be taken to properly implement the "no prompt-on-replace" case. * For instance highlight isn't emitted in that case (some code might rely on it), * and for performance reasons one should repaint after replace() ONLY if * prompt-on-replace was selected. * * @param text The text, in which the replacement has already been done. * @param replacementIndex Starting index of the matched substring * @param replacedLength Length of the replacement string * @param matchedLength Length of the matched string */ void replace(const QString &text, int replacementIndex, int replacedLength, int matchedLength); private: friend class KReplacePrivate; KReplacePrivate * const d; Q_PRIVATE_SLOT( d, void _k_slotSkip() ); Q_PRIVATE_SLOT( d, void _k_slotReplace() ); Q_PRIVATE_SLOT( d, void _k_slotReplaceAll() ); }; #endif subtitlecomposer-0.5.3/src/main/playerwidget.h0000644000175000001440000001176611151345061020725 0ustar sergiousers#ifndef PLAYERWIDGET_H #define PLAYERWIDGET_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../core/time.h" #include "../core/subtitle.h" #include "../core/subtitleline.h" #include #include class LayeredWidget; class TextOverlayWidget; class AttachableWidget; class TimeEdit; class QGridLayout; class QGroupBox; class QLabel; class QToolButton; class QSlider; namespace SubtitleComposer { class Player; class PlayerWidget : public QWidget { Q_OBJECT public: PlayerWidget( QWidget* parent ); virtual ~PlayerWidget(); void loadConfig(); void saveConfig(); bool fullScreenMode() const; void setFullScreenMode( bool fullScreenMode ); SubtitleLine* playingLine(); SubtitleLine* overlayLine(); void plugActions(); virtual bool eventFilter( QObject* object, QEvent* event ); public slots: void setSubtitle( Subtitle* subtitle=0 ); void setTranslationMode( bool enabled ); void setShowTranslation( bool showTranslation ); void increaseFontSize( int points=1 ); void decreaseFontSize( int points=1 ); signals: void playingLineChanged( SubtitleLine* line ); protected: virtual void timerEvent( QTimerEvent* event ); private: static QToolButton* toolButton( QWidget* parent, const char* name ); static QToolButton* createToolButton( QWidget* parent, const char* name, int size ); void updateOverlayLine( const Time& videoPosition ); void setOverlayLine( SubtitleLine* line ); void setPlayingLine( SubtitleLine* line ); void updatePositionEditVisibility(); private slots: void invalidateOverlayLine(); void onVolumeSliderValueChanged( int value ); void onSeekSliderValueChanged( int value ); void onSeekSliderMoved( int value ); void onSeekSliderPressed(); void onSeekSliderReleased(); void onPositionEditValueChanged( int position ); void onPlayerOptionChanged( const QString& option, const QString& value ); void onPlayerFileOpened( const QString& filePath ); void onPlayerFileOpenError( const QString& filePath ); void onPlayerFileClosed(); void onPlayerPlaybackError(); void onPlayerPlaying(); void onPlayerStopped(); void onPlayerPositionChanged( double seconds ); void onPlayerLengthChanged( double seconds ); void onPlayerFramesPerSecondChanged( double fps ); void onPlayerVolumeChanged( double volume ); void onPlayerLeftClicked( const QPoint& point ); void onPlayerRightClicked( const QPoint& point ); void onPlayerDoubleClicked( const QPoint& point ); void onPlayerBackendInitialized(); private: Subtitle* m_subtitle; bool m_translationMode; bool m_showTranslation; SubtitleLine* m_overlayLine; // the line being shown or to be shown next SubtitleLine* m_playingLine; // the line being shown or the last one shown bool m_fullScreenMode; Player* m_player; Time m_lastSearchedLineToShowTime; Time m_lastCheckedTime; QGridLayout* m_mainLayout; LayeredWidget* m_layeredWidget; TextOverlayWidget* m_textOverlay; AttachableWidget* m_fullScreenControls; QSlider* m_seekSlider; QSlider* m_fsSeekSlider; QLabel* m_fsPositionLabel; QString m_lengthString; int m_updatePositionControls; // "true" when >0 bool m_updateVideoPosition; QSlider* m_volumeSlider; QSlider* m_fsVolumeSlider; bool m_updateVolumeControls; bool m_updatePlayerVolume; QGroupBox* m_infoControlsGroupBox; QLabel* m_positionLabel; TimeEdit* m_positionEdit; bool m_showPositionTimeEdit; QLabel* m_lengthLabel; QLabel* m_fpsLabel; QPoint m_lastCursorPos; // for hidding the mouse on full screen mode QPoint m_cursorPos; }; } #endif subtitlecomposer-0.5.3/src/main/audiolevelswidget.h0000644000175000001440000000466011151345061021740 0ustar sergiousers#ifndef AUDIOLEVELSWIDGET_H #define AUDIOLEVELSWIDGET_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../core/time.h" #include "../core/subtitle.h" #include "../core/audiolevels.h" #include class QRegion; class QPolygon; namespace SubtitleComposer { class AudioLevelsWidget : public QWidget { Q_OBJECT public: AudioLevelsWidget( QWidget* parent ); virtual ~AudioLevelsWidget(); void loadConfig(); void saveConfig(); Time windowSize() const; void setWindowSize( const Time& size ); public slots: void setSubtitle( Subtitle* subtitle=0 ); void setAudioLevels( AudioLevels* audiolevels=0 ); protected: virtual void paintEvent( QPaintEvent* ); virtual void resizeEvent( QResizeEvent* e ); void rebuildRegions(); private slots: void onPlayerPositionChanged( double seconds ); private: Subtitle* m_subtitle; AudioLevels* m_audiolevels; Time m_lowerPosition; Time m_playingPosition; Time m_upperPosition; QRegion* m_regions; QPolygon* m_points; int m_playingX; }; } #endif subtitlecomposer-0.5.3/src/main/configs/0000755000175000001440000000000011206423743017476 5ustar sergiouserssubtitlecomposer-0.5.3/src/main/configs/CMakeLists.txt0000644000175000001440000000041511172151742022235 0ustar sergiousersSET( main_configs_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/errorsconfigwidget.cpp ${CMAKE_CURRENT_SOURCE_DIR}/generalconfigwidget.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerconfigwidget.cpp ${CMAKE_CURRENT_SOURCE_DIR}/spellingconfigwidget.cpp CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/main/configs/generalconfigwidget.cpp0000644000175000001440000001343411151345056024215 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "generalconfigwidget.h" #include "../application.h" #include #include #include #include #include #include #include #include using namespace SubtitleComposer; GeneralConfigWidget::GeneralConfigWidget( QWidget* parent ): AppConfigGroupWidget( new GeneralConfig(), parent ) { QGroupBox* generalGroupBox = createGroupBox( i18nc( "@title:group General settings", "General" ) ); QLabel* defaultEncodingLabel = new QLabel( generalGroupBox ); defaultEncodingLabel->setText( i18n( "Default encoding for opening subtitles:" ) ); m_defaultEncodingComboBox = new KComboBox( generalGroupBox ); m_defaultEncodingComboBox->addItems( app()->availableEncodingNames() ); QLabel* relativeSeekPositionLabel = new QLabel( generalGroupBox ); relativeSeekPositionLabel->setText( i18n( "On line double click, jump to show time minus:" ) ); m_relativeSeekPositionSpinBox = new KIntNumInput( generalGroupBox ); m_relativeSeekPositionSpinBox->setMinimum( 0 ); m_relativeSeekPositionSpinBox->setMaximum( 10000 ); m_relativeSeekPositionSpinBox->setSuffix( i18n( " msecs" ) ); m_autoLoadVideoCheckBox = new QCheckBox( generalGroupBox ); m_autoLoadVideoCheckBox->setText( i18n( "Automatically load video file when opening subtitle" ) ); QGroupBox* quickActionsGroupBox = createGroupBox( i18nc( "@title:group", "Quick Actions" ) ); QLabel* shiftMillisecondsLabel = new QLabel( quickActionsGroupBox ); shiftMillisecondsLabel->setText( i18n( "Time shift for selected lines:" ) ); m_shiftMsecsSpinBox = new KIntNumInput( quickActionsGroupBox ); m_shiftMsecsSpinBox->setMinimum( 1 ); m_shiftMsecsSpinBox->setMaximum( 1000 ); m_shiftMsecsSpinBox->setSuffix( i18n( " msecs" ) ); QLabel* setTimeCompMsecsLabel = new QLabel( quickActionsGroupBox ); setTimeCompMsecsLabel->setText( i18n( "Compensation for captured video times:" ) ); m_videoPosCompMsecsSpinBox = new KIntNumInput( quickActionsGroupBox ); m_videoPosCompMsecsSpinBox->setMinimum( 1 ); m_videoPosCompMsecsSpinBox->setMaximum( 1000 ); m_videoPosCompMsecsSpinBox->setSuffix( i18n( " msecs" ) ); QGridLayout* generalLayout = createGridLayout( generalGroupBox ); generalLayout->addWidget( defaultEncodingLabel, 1, 0, Qt::AlignRight|Qt::AlignVCenter ); generalLayout->addWidget( m_defaultEncodingComboBox, 1, 1 ); generalLayout->addWidget( relativeSeekPositionLabel, 2, 0, Qt::AlignRight|Qt::AlignVCenter ); generalLayout->addWidget( m_relativeSeekPositionSpinBox, 2, 1 ); generalLayout->addWidget( m_autoLoadVideoCheckBox, 3, 0, 1, 2 ); QGridLayout* quickActionsLayout = createGridLayout( quickActionsGroupBox ); quickActionsLayout->addWidget( shiftMillisecondsLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); quickActionsLayout->addWidget( m_shiftMsecsSpinBox, 0, 1 ); quickActionsLayout->addWidget( setTimeCompMsecsLabel, 1, 0, Qt::AlignRight|Qt::AlignVCenter ); quickActionsLayout->addWidget( m_videoPosCompMsecsSpinBox, 1, 1 ); connect( m_defaultEncodingComboBox, SIGNAL(activated(int)), this, SIGNAL(settingsChanged()) ); connect( m_relativeSeekPositionSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(settingsChanged()) ); connect( m_autoLoadVideoCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(settingsChanged()) ); connect( m_shiftMsecsSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(settingsChanged()) ); connect( m_videoPosCompMsecsSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(settingsChanged()) ); setControlsFromConfig(); } GeneralConfigWidget::~GeneralConfigWidget() { } void GeneralConfigWidget::setConfigFromControls() { config()->setDefaultSubtitlesEncoding( m_defaultEncodingComboBox->currentText() ); config()->setSeekOffsetOnDoubleClick( m_relativeSeekPositionSpinBox->value() ); config()->setAutomaticVideoLoad( m_autoLoadVideoCheckBox->isChecked() ); config()->setLinesQuickShiftAmount( m_shiftMsecsSpinBox->value() ); config()->setGrabbedPositionCompensation( m_videoPosCompMsecsSpinBox->value() ); } void GeneralConfigWidget::setControlsFromConfig() { m_defaultEncodingComboBox->setCurrentItem( config()->defaultSubtitlesEncoding() ); m_relativeSeekPositionSpinBox->setValue( config()->seekOffsetOnDoubleClick() ); m_autoLoadVideoCheckBox->setChecked( config()->automaticVideoLoad() ); m_shiftMsecsSpinBox->setValue( config()->linesQuickShiftAmount() ); m_videoPosCompMsecsSpinBox->setValue( config()->grabbedPositionCompensation() ); } #include "generalconfigwidget.moc" subtitlecomposer-0.5.3/src/main/configs/playerconfig.h0000644000175000001440000001137211151345056022334 0ustar sergiousers#ifndef PLAYERCONFIG_H #define PLAYERCONFIG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../config/appconfiggroup.h" #include namespace SubtitleComposer { class PlayerConfig : public AppConfigGroup { friend class Application; friend class PlayerConfigWidget; public: virtual AppConfigGroup* clone() const { return new PlayerConfig( *this ); } QString backend() const { return option( keyBackend() ); } void setBackend( const QString& backend ) { setOption( keyBackend(), backend ); } int seekJumpLength() const { return optionAsInt( keySeekJumpLength() ); } /// in seconds void setSeekJumpLength( int seconds ) { setOption( keySeekJumpLength(), seconds ); } bool showPositionTimeEdit() const { return optionAsBool( keyShowPositionTimeEdit() ); } void setShowPositionTimeEdit( bool show ) { setOption( keyShowPositionTimeEdit(), show ); } void toggleShowPositionTimeEdit() { setShowPositionTimeEdit( ! showPositionTimeEdit() ); } QString fontFamily() const { return option( keyFontFamily() ); } void setFontFamily( const QString& family ) { setOption( keyFontFamily(), family ); } int fontPointSize() const { return optionAsInt( keyFontPointSize() ); } void setFontPointSize( int pointSize ) { setOption( keyFontPointSize(), pointSize ); } void incFontPointSize( int delta ) { setFontPointSize( fontPointSize() + delta ); } QColor fontColor() const { return optionAsColor( keyFontColor() ); } void setFontColor( const QColor& color ) { setOption( keyFontColor(), color ); } QColor outlineColor() const { return optionAsColor( keyOutlineColor() ); } void setOutlineColor( const QColor& color ) { setOption( keyOutlineColor(), color ); } int outlineWidth() const { return optionAsInt( keyOutlineWidth() ); } void setOutlineWidth( int width ) { setOption( keyOutlineWidth(), width ); } static const QString& keyBackend() { static const QString key( "Backend" ); return key; } static const QString& keySeekJumpLength() { static const QString key( "SeekJumpLength" ); return key; } static const QString& keyShowPositionTimeEdit() { static const QString key( "ShowPositionTimeEdit" ); return key; } static const QString& keyFontFamily() { static const QString key( "FontFamily" ); return key; } static const QString& keyFontPointSize() { static const QString key( "FontPointSize" ); return key; } static const QString& keyFontColor() { static const QString key( "FontColor" ); return key; } static const QString& keyOutlineColor() { static const QString key( "OutlineColor" ); return key; } static const QString& keyOutlineWidth() { static const QString key( "OutlineWidth" ); return key; } private: PlayerConfig():AppConfigGroup( "Player", defaults() ) {} PlayerConfig( const PlayerConfig& config ):AppConfigGroup( config ) {} static QMap defaults() { QMap defaults; #ifdef HAVE_GSTREAMER defaults[keyBackend()] = "GStreamer"; #else defaults[keyBackend()] = "MPlayer"; #endif defaults[keySeekJumpLength()] = "15"; // in seconds defaults[keyShowPositionTimeEdit()] = "false"; defaults[keyFontFamily()] = "Sans Serif"; defaults[keyFontPointSize()] = "15"; defaults[keyFontColor()] = QColor( Qt::yellow ).name(); defaults[keyOutlineColor()] = QColor( Qt::black ).name(); defaults[keyOutlineWidth()] = "1"; return defaults; } }; } #endif subtitlecomposer-0.5.3/src/main/configs/generalconfigwidget.h0000644000175000001440000000432711151345056023663 0ustar sergiousers#ifndef GENERALCONFIGWIDGET_H #define GENERALCONFIGWIDGET_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "generalconfig.h" #include "../../config/appconfiggroupwidget.h" class KComboBox; class KIntNumInput; class QCheckBox; namespace SubtitleComposer { class GeneralConfigWidget : public AppConfigGroupWidget { Q_OBJECT friend class ConfigDialog; public: virtual ~GeneralConfigWidget(); virtual void setControlsFromConfig(); virtual void setConfigFromControls(); private: explicit GeneralConfigWidget( QWidget* parent=0 ); GeneralConfig* config() { return static_cast( m_config ); }; KComboBox* m_defaultEncodingComboBox; KIntNumInput* m_relativeSeekPositionSpinBox; QCheckBox* m_autoLoadVideoCheckBox; KIntNumInput* m_shiftMsecsSpinBox; KIntNumInput* m_videoPosCompMsecsSpinBox; }; } #endif subtitlecomposer-0.5.3/src/main/configs/playerconfigwidget.h0000644000175000001440000000524611151345056023543 0ustar sergiousers#ifndef PLAYERCONFIGWIDGET_H #define PLAYERCONFIGWIDGET_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "playerconfig.h" #include "../../config/appconfiggroupwidget.h" class QCheckBox; class QFontComboBox; class KComboBox; class KColorCombo; class KIntNumInput; class TextOverlayWidget; namespace SubtitleComposer { class PlayerConfigWidget : public AppConfigGroupWidget { Q_OBJECT friend class ConfigDialog; public: virtual ~PlayerConfigWidget(); virtual void setControlsFromConfig(); virtual void setConfigFromControls(); private slots: void onFamilyChanged( const QString& family ); void onSizeChanged( int size ); void onPrimaryColorChanged( const QColor& color ); void onOutlineColorChanged( const QColor& color ); void onOutlineWidthChanged( int width ); private: explicit PlayerConfigWidget( QWidget* parent=0 ); PlayerConfig* config() { return static_cast( m_config ); }; private: KComboBox* m_backendComboBox; KIntNumInput* m_seekJumpSecsSpinBox; QCheckBox* m_showPositionTimeEditCheckBox; QFontComboBox* m_fontComboBox; KIntNumInput* m_sizeSpinBox; KColorCombo* m_primaryColorComboBox; KColorCombo* m_outlineColorComboBox; KIntNumInput* m_outlineWidthSpinBox; TextOverlayWidget* m_textOverlayWidget; }; } #endif subtitlecomposer-0.5.3/src/main/configs/errorsconfig.h0000644000175000001440000001027611151345056022356 0ustar sergiousers#ifndef ERRORSCONFIG_H #define ERRORSCONFIG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../config/appconfiggroup.h" namespace SubtitleComposer { class ErrorsConfig : public AppConfigGroup { friend class Application; friend class ErrorsConfigWidget; public: virtual AppConfigGroup* clone() const { return new ErrorsConfig( *this ); } int minDuration() { return optionAsInt( keyMinDuration() ); } /// in milliseconds void setMinDuration( int mseconds ) { setOption( keyMinDuration(), mseconds ); } int maxDuration() { return optionAsInt( keyMaxDuration() ); } /// in milliseconds void setMaxDuration( int mseconds ) { setOption( keyMaxDuration(), mseconds ); } int minDurationPerChar() { return optionAsInt( keyMinDurationPerChar() ); } /// in milliseconds void setMinDurationPerChar( int mseconds ) { setOption( keyMinDurationPerChar(), mseconds ); } int maxDurationPerChar() { return optionAsInt( keyMaxDurationPerChar() ); } /// in milliseconds void setMaxDurationPerChar( int mseconds ) { setOption( keyMaxDurationPerChar(), mseconds ); } int maxCharacters() { return optionAsInt( keyMaxCharacters() ); } void setMaxCharacters( int characters ) { setOption( keyMaxCharacters(), characters ); } int maxLines() { return optionAsInt( keyMaxLines() ); } void setMaxLines( int lines ) { setOption( keyMaxLines(), lines ); } bool autoClearFixed() { return optionAsBool( keyAutoClearFixed() ); } void setAutoClearFixed( bool autoClearFixed ) { setOption( keyAutoClearFixed(), autoClearFixed ); } static const QString& keyMinDuration() { static const QString key( "MinDuration" ); return key; } static const QString& keyMaxDuration() { static const QString key( "MaxDuration" ); return key; } static const QString& keyMinDurationPerChar() { static const QString key( "MinDurationPerCharacter" ); return key; } static const QString& keyMaxDurationPerChar() { static const QString key( "MaxDurationPerCharacter" ); return key; } static const QString& keyMaxCharacters() { static const QString key( "MaxCharacters" ); return key; } static const QString& keyMaxLines() { static const QString key( "MaxLines" ); return key; } static const QString& keyAutoClearFixed() { static const QString key( "AutoClearFixed" ); return key; } private: ErrorsConfig():AppConfigGroup( "Errors", defaults() ) {} static QMap defaults() { QMap defaults; defaults[keyMinDuration()] = "700"; // in milliseconds defaults[keyMaxDuration()] = "5000"; // in milliseconds defaults[keyMinDurationPerChar()] = "30"; // in milliseconds defaults[keyMaxDurationPerChar()] = "185"; // in milliseconds defaults[keyMaxCharacters()] = "80"; defaults[keyMaxLines()] = "2"; defaults[keyAutoClearFixed()] = "false"; return defaults; } }; } #endif subtitlecomposer-0.5.3/src/main/configs/errorsconfigwidget.cpp0000644000175000001440000001653211170303270024107 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "errorsconfigwidget.h" #include "../../widgets/timeedit.h" #include #include #include #include #include #include using namespace SubtitleComposer; ErrorsConfigWidget::ErrorsConfigWidget( QWidget* parent ): AppConfigGroupWidget( new ErrorsConfig(), parent ) { QGroupBox* textsGroupBox = createGroupBox( i18nc( "@title:group", "Texts" ) ); QLabel* maxCharactersLabel = new QLabel( textsGroupBox ); maxCharactersLabel->setText( i18n( "Maximum number of characters:" ) ); m_maxCharactersSpinBox = new KIntNumInput( textsGroupBox ); m_maxCharactersSpinBox->setMinimum( 0 ); m_maxCharactersSpinBox->setMaximum( 200 ); m_maxCharactersSpinBox->setSuffix( i18n( " characters" ) ); QLabel* maxLinesLabel = new QLabel( textsGroupBox ); maxLinesLabel->setText( i18n( "Maximum number of lines:" ) ); m_maxLinesSpinBox = new KIntNumInput( textsGroupBox ); m_maxLinesSpinBox->setMinimum( 1 ); m_maxLinesSpinBox->setMaximum( 20 ); m_maxLinesSpinBox->setSuffix( i18n( " lines" ) ); QGroupBox* absoluteDurationsGroupBox = createGroupBox( i18nc( "@title:group", "Absolute Durations" ) ); QLabel* minDurationLabel = new QLabel( absoluteDurationsGroupBox ); minDurationLabel->setText( i18n( "Minimum duration:" ) ); m_minDurationSpinBox = new KIntNumInput( absoluteDurationsGroupBox ); m_minDurationSpinBox->setMinimum( 0 ); m_minDurationSpinBox->setMaximum( 2000 ); m_minDurationSpinBox->setSuffix( i18n( " msecs" ) ); QLabel* maxDurationLabel = new QLabel( absoluteDurationsGroupBox ); maxDurationLabel->setText( i18n( "Maximum duration:" ) ); m_maxDurationSpinBox = new KIntNumInput( absoluteDurationsGroupBox ); m_maxDurationSpinBox->setMinimum( 2000 ); m_maxDurationSpinBox->setMaximum( 8000 ); m_maxDurationSpinBox->setSuffix( i18n( " msecs" ) ); QGroupBox* relativeDurationsGroupBox = createGroupBox( i18nc( "@title:group", "Relative Durations" ) ); QLabel* minDurationPerCharLabel = new QLabel( relativeDurationsGroupBox ); minDurationPerCharLabel->setText( i18n( "Minimum duration:" ) ); m_minDurationPerCharSpinBox = new KIntNumInput( relativeDurationsGroupBox ); m_minDurationPerCharSpinBox->setMinimum( 0 ); m_minDurationPerCharSpinBox->setMaximum( 100 ); m_minDurationPerCharSpinBox->setSuffix( i18n( " msecs/character" ) ); QLabel* maxDurationPerCharLabel = new QLabel( relativeDurationsGroupBox ); maxDurationPerCharLabel->setText( i18n( "Maximum duration:" ) ); m_maxDurationPerCharSpinBox = new KIntNumInput( relativeDurationsGroupBox ); m_maxDurationPerCharSpinBox->setMinimum( 0 ); m_maxDurationPerCharSpinBox->setMaximum( 500 ); m_maxDurationPerCharSpinBox->setSuffix( i18n( " msecs/character" ) ); QGroupBox* behaviorGroupBox = createGroupBox( i18nc( "@title:group", "Behavior" ) ); m_autoClearFixedCheckBox = new QCheckBox( behaviorGroupBox ); m_autoClearFixedCheckBox->setText( i18n( "Automatically clear fixed errors" ) ); QGridLayout* textsLayout = createGridLayout( textsGroupBox ); textsLayout->addWidget( maxCharactersLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); textsLayout->addWidget( m_maxCharactersSpinBox, 0, 1 ); textsLayout->addWidget( maxLinesLabel, 1, 0, Qt::AlignRight|Qt::AlignVCenter ); textsLayout->addWidget( m_maxLinesSpinBox, 1, 1 ); QGridLayout* absoluteDurationsLayout = createGridLayout( absoluteDurationsGroupBox ); absoluteDurationsLayout->addWidget( minDurationLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); absoluteDurationsLayout->addWidget( m_minDurationSpinBox, 0, 1 ); absoluteDurationsLayout->addWidget( maxDurationLabel, 1, 0, Qt::AlignRight|Qt::AlignVCenter ); absoluteDurationsLayout->addWidget( m_maxDurationSpinBox, 1, 1 ); QGridLayout* relativeDurationsLayout = createGridLayout( relativeDurationsGroupBox ); relativeDurationsLayout->addWidget( minDurationPerCharLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); relativeDurationsLayout->addWidget( m_minDurationPerCharSpinBox, 0, 1 ); relativeDurationsLayout->addWidget( maxDurationPerCharLabel, 1, 0, Qt::AlignRight|Qt::AlignVCenter ); relativeDurationsLayout->addWidget( m_maxDurationPerCharSpinBox, 1, 1 ); QGridLayout* behaviorLayout = createGridLayout( behaviorGroupBox ); behaviorLayout->addWidget( m_autoClearFixedCheckBox, 0, 0 ); connect( m_maxCharactersSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(settingsChanged()) ); connect( m_maxLinesSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(settingsChanged()) ); connect( m_minDurationSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(settingsChanged()) ); connect( m_maxDurationSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(settingsChanged()) ); connect( m_minDurationPerCharSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(settingsChanged()) ); connect( m_maxDurationPerCharSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(settingsChanged()) ); connect( m_autoClearFixedCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(settingsChanged()) ); setControlsFromConfig(); } ErrorsConfigWidget::~ErrorsConfigWidget() { } void ErrorsConfigWidget::setConfigFromControls() { config()->setMaxCharacters( m_maxCharactersSpinBox->value() ); config()->setMaxLines( m_maxLinesSpinBox->value() ); config()->setMinDuration( m_minDurationSpinBox->value() ); config()->setMaxDuration( m_maxDurationSpinBox->value() ); config()->setMinDurationPerChar( m_minDurationPerCharSpinBox->value() ); config()->setMaxDurationPerChar( m_maxDurationPerCharSpinBox->value() ); config()->setAutoClearFixed( m_autoClearFixedCheckBox->isChecked() ); } void ErrorsConfigWidget::setControlsFromConfig() { m_maxCharactersSpinBox->setValue( config()->maxCharacters() ); m_maxLinesSpinBox->setValue( config()->maxLines() ); m_minDurationSpinBox->setValue( config()->minDuration() ); m_maxDurationSpinBox->setValue( config()->maxDuration() ); m_minDurationPerCharSpinBox->setValue( config()->minDurationPerChar() ); m_maxDurationPerCharSpinBox->setValue( config()->maxDurationPerChar() ); m_autoClearFixedCheckBox->setChecked( config()->autoClearFixed() ); } #include "errorsconfigwidget.moc" subtitlecomposer-0.5.3/src/main/configs/playerconfigwidget.cpp0000644000175000001440000002241711151345056024075 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "playerconfigwidget.h" #include "../../player/player.h" #include "../../widgets/layeredwidget.h" #include "../../widgets/textoverlaywidget.h" #include #include #include #include #include #include #include #include #include #include #include using namespace SubtitleComposer; PlayerConfigWidget::PlayerConfigWidget( QWidget* parent ): AppConfigGroupWidget( new PlayerConfig(), parent ) { QGroupBox* generalGroupBox = createGroupBox( i18nc( "@title:group General settings", "General" ) ); QLabel* backendLabel = new QLabel( generalGroupBox ); backendLabel->setText( i18n( "Player backend:" ) ); m_backendComboBox = new KComboBox( generalGroupBox ); m_backendComboBox->addItems( Player::instance()->backendNames() ); QLabel* seekJumpLabel = new QLabel( generalGroupBox ); seekJumpLabel->setText( i18n( "Jump length on seek:" ) ); m_seekJumpSecsSpinBox = new KIntNumInput( generalGroupBox ); m_seekJumpSecsSpinBox->setMinimum( 1 ); m_seekJumpSecsSpinBox->setMaximum( 600 ); m_seekJumpSecsSpinBox->setSuffix( i18n( " secs" ) ); m_showPositionTimeEditCheckBox = new QCheckBox( generalGroupBox ); m_showPositionTimeEditCheckBox->setText( i18n( "Show editable position control" ) ); QGroupBox* fontGroupBox = createGroupBox( i18nc( "@title:group", "Subtitles" ) ); QLabel* fontLabel = new QLabel( fontGroupBox ); fontLabel->setText( i18nc( "@label:chooser The font family name", "Font family:" ) ); m_fontComboBox = new QFontComboBox( fontGroupBox ); QLabel* sizeLabel = new QLabel( fontGroupBox ); sizeLabel->setText( i18n( "Font size:" ) ); m_sizeSpinBox = new KIntNumInput( fontGroupBox ); m_sizeSpinBox->setMinimum( 4 ); m_sizeSpinBox->setMaximum( 100 ); m_sizeSpinBox->setSuffix( i18n( " points" ) ); QLabel* primaryColorLabel = new QLabel( fontGroupBox ); primaryColorLabel->setText( i18n( "Primary color:" ) ); m_primaryColorComboBox = new KColorCombo( fontGroupBox ); QLabel* outlineColorLabel = new QLabel( fontGroupBox ); outlineColorLabel->setText( i18n( "Outline color:" ) ); m_outlineColorComboBox = new KColorCombo( fontGroupBox ); QLabel* outlineWidthLabel = new QLabel( fontGroupBox ); outlineWidthLabel->setText( i18n( "Outline width:" ) ); m_outlineWidthSpinBox = new KIntNumInput( fontGroupBox ); m_outlineWidthSpinBox->setMinimum( 0 ); m_outlineWidthSpinBox->setMaximum( 5 ); m_outlineWidthSpinBox->setSuffix( i18n( " pixels" ) ); QGroupBox* previewGroupBox = createGroupBox( i18nc( "@title:group", "Subtitles Preview" ) ); QWidget* previewWidget = new LayeredWidget( previewGroupBox ); // previewWidget->setBackgroundColor( Qt::black ); previewWidget->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); previewWidget->setMinimumHeight( 60 ); m_textOverlayWidget = new TextOverlayWidget( previewWidget ); m_textOverlayWidget->setText( i18nc( "Text for previewing the subtitles font settings", "

The Quick Brown Fox
Jumps Over The Lazy Dog

" ) ); m_textOverlayWidget->setRichTextMode( true ); m_textOverlayWidget->setOutlineWidth( 1 ); m_textOverlayWidget->setAlignment( Qt::AlignHCenter|Qt::AlignVCenter ); QGridLayout* generalLayout = createGridLayout( generalGroupBox ); generalLayout->addWidget( backendLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); generalLayout->addWidget( m_backendComboBox, 0, 1 ); generalLayout->addWidget( seekJumpLabel, 1, 0, Qt::AlignRight|Qt::AlignVCenter ); generalLayout->addWidget( m_seekJumpSecsSpinBox, 1, 1 ); generalLayout->addWidget( m_showPositionTimeEditCheckBox, 2, 0, 1, 2 ); QGridLayout* fontLayout = createGridLayout( fontGroupBox ); fontLayout->addWidget( fontLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); fontLayout->addWidget( m_fontComboBox, 0, 1 ); fontLayout->addWidget( sizeLabel, 1, 0, Qt::AlignRight|Qt::AlignVCenter ); fontLayout->addWidget( m_sizeSpinBox, 1, 1 ); fontLayout->addWidget( primaryColorLabel, 2, 0, Qt::AlignRight|Qt::AlignVCenter ); fontLayout->addWidget( m_primaryColorComboBox, 2, 1 ); fontLayout->addWidget( outlineColorLabel, 3, 0, Qt::AlignRight|Qt::AlignVCenter ); fontLayout->addWidget( m_outlineColorComboBox, 3, 1 ); fontLayout->addWidget( outlineWidthLabel, 4, 0, Qt::AlignRight|Qt::AlignVCenter ); fontLayout->addWidget( m_outlineWidthSpinBox, 4, 1 ); QGridLayout* previewLayout = createGridLayout( previewGroupBox ); previewLayout->addWidget( previewWidget, 0, 0 ); connect( m_backendComboBox, SIGNAL(activated(int)), this, SIGNAL(settingsChanged()) ); connect( m_seekJumpSecsSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(settingsChanged()) ); connect( m_showPositionTimeEditCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(settingsChanged()) ); connect( m_fontComboBox, SIGNAL(activated(const QString&)), this, SLOT(onFamilyChanged(const QString&)) ); connect( m_fontComboBox, SIGNAL(textChanged(const QString&)), this, SLOT(onFamilyChanged(const QString&)) ); connect( m_sizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(onSizeChanged(int)) ); connect( m_primaryColorComboBox, SIGNAL(activated(const QColor&)), this, SLOT(onPrimaryColorChanged(const QColor&)) ); connect( m_outlineColorComboBox, SIGNAL(activated(const QColor&)), this, SLOT(onOutlineColorChanged(const QColor&)) ); connect( m_outlineWidthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(onOutlineWidthChanged(int)) ); connect( m_fontComboBox, SIGNAL(activated(int)), this, SIGNAL(settingsChanged()) ); connect( m_sizeSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(settingsChanged()) ); connect( m_primaryColorComboBox, SIGNAL(activated(const QColor&)), this, SIGNAL(settingsChanged()) ); connect( m_outlineColorComboBox, SIGNAL(activated(const QColor&)), this, SIGNAL(settingsChanged()) ); connect( m_outlineWidthSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(settingsChanged()) ); setControlsFromConfig(); } PlayerConfigWidget::~PlayerConfigWidget() { } void PlayerConfigWidget::setControlsFromConfig() { m_backendComboBox->setCurrentItem( config()->backend() ); m_seekJumpSecsSpinBox->setValue( config()->seekJumpLength() ); m_showPositionTimeEditCheckBox->setChecked( config()->showPositionTimeEdit() ); m_fontComboBox->setCurrentFont( config()->fontFamily() ); onFamilyChanged( config()->fontFamily() ); m_sizeSpinBox->setValue( config()->fontPointSize() ); onSizeChanged( config()->fontPointSize() ); m_primaryColorComboBox->setColor( config()->fontColor() ); onPrimaryColorChanged( config()->fontColor() ); m_outlineColorComboBox->setColor( config()->outlineColor() ); onOutlineColorChanged( config()->outlineColor() ); m_outlineWidthSpinBox->setValue( config()->outlineWidth() ); onOutlineWidthChanged( config()->outlineWidth() ); } void PlayerConfigWidget::setConfigFromControls() { config()->setBackend( m_backendComboBox->currentText() ); config()->setSeekJumpLength( m_seekJumpSecsSpinBox->value() ); config()->setShowPositionTimeEdit( m_showPositionTimeEditCheckBox->isChecked() ); config()->setFontFamily( m_textOverlayWidget->family() ); config()->setFontPointSize( m_textOverlayWidget->pointSize() ); config()->setFontColor( m_textOverlayWidget->primaryColor() ); config()->setOutlineColor( m_textOverlayWidget->outlineColor() ); config()->setOutlineWidth( (int)m_textOverlayWidget->outlineWidth() ); } void PlayerConfigWidget::onFamilyChanged( const QString& family ) { if ( m_fontComboBox->findText( family ) != -1 ) m_textOverlayWidget->setFamily( family ); } void PlayerConfigWidget::onSizeChanged( int size ) { m_textOverlayWidget->setPointSize( size ); } void PlayerConfigWidget::onPrimaryColorChanged( const QColor& color ) { m_textOverlayWidget->setPrimaryColor( color ); } void PlayerConfigWidget::onOutlineColorChanged( const QColor& color ) { m_textOverlayWidget->setOutlineColor( color ); } void PlayerConfigWidget::onOutlineWidthChanged( int width ) { m_textOverlayWidget->setOutlineWidth( width ); } #include "playerconfigwidget.moc" subtitlecomposer-0.5.3/src/main/configs/errorsconfigwidget.h0000644000175000001440000000441211170303270023546 0ustar sergiousers#ifndef ERRORSCONFIGWIDGET_H #define ERRORSCONFIGWIDGET_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "errorsconfig.h" #include "../../config/appconfiggroupwidget.h" class KIntNumInput; class QCheckBox; namespace SubtitleComposer { class ErrorsConfigWidget : public AppConfigGroupWidget { Q_OBJECT friend class ConfigDialog; public: virtual ~ErrorsConfigWidget(); virtual void setControlsFromConfig(); virtual void setConfigFromControls(); private: explicit ErrorsConfigWidget( QWidget* parent=0 ); ErrorsConfig* config() { return static_cast( m_config ); }; KIntNumInput* m_minDurationSpinBox; KIntNumInput* m_maxDurationSpinBox; KIntNumInput* m_maxCharactersSpinBox; KIntNumInput* m_maxLinesSpinBox; KIntNumInput* m_minDurationPerCharSpinBox; KIntNumInput* m_maxDurationPerCharSpinBox; QCheckBox* m_autoClearFixedCheckBox; }; } #endif subtitlecomposer-0.5.3/src/main/configs/generalconfig.h0000644000175000001440000001013011151345056022444 0ustar sergiousers#ifndef GENERALCONFIG_H #define GENERALCONFIG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../config/appconfiggroup.h" #include #include #include namespace SubtitleComposer { class GeneralConfig : public AppConfigGroup { friend class Application; friend class GeneralConfigWidget; public: virtual AppConfigGroup* clone() const { return new GeneralConfig( *this ); } QString defaultSubtitlesEncoding() const { return option( keyDefaultSubtitlesEncoding() ); } void setDefaultSubtitlesEncoding( const QString& encoding ) { setOption( keyDefaultSubtitlesEncoding(), encoding ); } int seekOffsetOnDoubleClick() const { return optionAsInt( keySeekOffsetOnDoubleClick() ); } /// in milliseconds void setSeekOffsetOnDoubleClick( int mseconds ) { setOption( keySeekOffsetOnDoubleClick(), mseconds ); } bool automaticVideoLoad() const { return optionAsBool( keyAutomaticVideoLoad() ); } void setAutomaticVideoLoad( bool automaticLoad ) { setOption( keyAutomaticVideoLoad(), automaticLoad ); } int linesQuickShiftAmount() const { return optionAsInt( keyLinesQuickShiftAmount() ); } /// in milliseconds void setLinesQuickShiftAmount( int mseconds ) { setOption( keyLinesQuickShiftAmount(), mseconds ); } int grabbedPositionCompensation() const { return optionAsInt( keyGrabbedPositionCompensation() ); } /// in milliseconds void setGrabbedPositionCompensation( int mseconds ) { setOption( keyGrabbedPositionCompensation(), mseconds ); } static const QString& keyDefaultSubtitlesEncoding() { static const QString key( "DefaultSubtitlesEncoding" ); return key; } static const QString& keySeekOffsetOnDoubleClick() { static const QString key( "SeekOffsetOnDoubleClick" ); return key; } static const QString& keyAutomaticVideoLoad() { static const QString key( "AutomaticVideoLoad" ); return key; } static const QString& keyLinesQuickShiftAmount() { static const QString key( "LinesQuickShiftAmount" ); return key; } static const QString& keyGrabbedPositionCompensation() { static const QString key( "GrabbedPositionCompensation" ); return key; } private: GeneralConfig():AppConfigGroup( "General", defaults() ) {} GeneralConfig( const GeneralConfig& config ):AppConfigGroup( config ) {} static QMap defaults() { QMap defaults; defaults[keyDefaultSubtitlesEncoding()] = KGlobal::locale()->codecForEncoding()->name(); defaults[keySeekOffsetOnDoubleClick()] = "1500"; // in milliseconds defaults[keyAutomaticVideoLoad()] = "true"; defaults[keyLinesQuickShiftAmount()] = "100"; // in milliseconds defaults[keyGrabbedPositionCompensation()] = "250"; // in milliseconds return defaults; } }; } #endif subtitlecomposer-0.5.3/src/main/configs/spellingconfigwidget.cpp0000644000175000001440000001143411153272550024413 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "spellingconfigwidget.h" #include "../../player/player.h" #include "../../widgets/layeredwidget.h" #include "../../widgets/textoverlaywidget.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace SubtitleComposer; #define SONNET_CONFIG_GROUP "Spelling" SpellingConfigWidget::SpellingConfigWidget( QWidget* parent ): AppConfigGroupWidget( new SpellingConfig(), parent ), m_sonnetConfigWidget( 0 ), m_globalConfig( KGlobal::config().data() ) { setControlsFromConfig(); } SpellingConfigWidget::~SpellingConfigWidget() { } void SpellingConfigWidget::setControlsFromConfig() { // NOTE: Sonnet::ConfigWidget doesn't provide a way to change the controls state to reflect // a new settings state, as it is only evaluated at initialization. We work around that by // setting the state of the KConfig object used to read the controls state and (re)creating // a new Sonnet::ConfigWidget instance. However, we are not supposed to change (any) application // config state in this method so, after the Sonnet::ConfigWidget is (re)created, we restore // the KConfig state to how it was before. KConfigGroup group( m_globalConfig->group( SONNET_CONFIG_GROUP ) ); QMap previousSettings = group.entryMap(); group.writeEntry( SpellingConfig::keyDefaultLanguage(), config()->defaultLanguage() ); group.writeEntry( SpellingConfig::keyDefaultClient(), config()->defaultClient() ); group.writeEntry( SpellingConfig::keyCheckUppercase(), config()->checkUppercase() ); group.writeEntry( SpellingConfig::keySkipRunTogether(), config()->skipRunTogether() ); setUpdatesEnabled( false ); delete m_sonnetConfigWidget; m_sonnetConfigWidget = new Sonnet::ConfigWidget( m_globalConfig, this ); layout()->addWidget( m_sonnetConfigWidget ); setUpdatesEnabled( true ); group.writeEntry( SpellingConfig::keyDefaultLanguage(), previousSettings[SpellingConfig::keyDefaultLanguage()] ); group.writeEntry( SpellingConfig::keyDefaultClient(), previousSettings[SpellingConfig::keyDefaultClient()] ); group.writeEntry( SpellingConfig::keyCheckUppercase(), previousSettings[SpellingConfig::keyCheckUppercase()] ); group.writeEntry( SpellingConfig::keySkipRunTogether(), previousSettings[SpellingConfig::keySkipRunTogether()] ); connect( m_sonnetConfigWidget, SIGNAL( configChanged() ), this, SIGNAL( settingsChanged() ) ); } void SpellingConfigWidget::setConfigFromControls() { // NOTE: we make sure the Sonnet::ConfigWidget dumps it's settings to the KConfig object. // Only then we can load our config object from it. m_sonnetConfigWidget->save(); KConfigGroup group( m_globalConfig->group( SONNET_CONFIG_GROUP ) ); config()->setOption( SpellingConfig::keyDefaultLanguage(), group.readEntry( SpellingConfig::keyDefaultLanguage() ) ); config()->setOption( SpellingConfig::keyDefaultClient(), group.readEntry( SpellingConfig::keyDefaultClient() ) ); config()->setOption( SpellingConfig::keyCheckUppercase(), group.readEntry( SpellingConfig::keyCheckUppercase() ) ); config()->setOption( SpellingConfig::keySkipRunTogether(), group.readEntry( SpellingConfig::keySkipRunTogether() ) ); } #include "spellingconfigwidget.moc" subtitlecomposer-0.5.3/src/main/configs/spellingconfigwidget.h0000644000175000001440000000414511151345056024061 0ustar sergiousers#ifndef SPELLINGCONFIGWIDGET_H #define SPELLINGCONFIGWIDGET_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "spellingconfig.h" #include "../../config/appconfiggroupwidget.h" class KConfig; namespace Sonnet { class ConfigWidget; } namespace SubtitleComposer { class SpellingConfigWidget : public AppConfigGroupWidget { Q_OBJECT friend class ConfigDialog; public: virtual ~SpellingConfigWidget(); virtual void setControlsFromConfig(); virtual void setConfigFromControls(); private: explicit SpellingConfigWidget( QWidget* parent=0 ); SpellingConfig* config() { return static_cast( m_config ); }; private: Sonnet::ConfigWidget* m_sonnetConfigWidget; KConfig* m_globalConfig; }; } #endif subtitlecomposer-0.5.3/src/main/configs/spellingconfig.h0000644000175000001440000000661311151345056022657 0ustar sergiousers#ifndef SPELLINGCONFIG_H #define SPELLINGCONFIG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../config/appconfiggroup.h" #include #include namespace SubtitleComposer { class SpellingConfig : public AppConfigGroup { friend class Application; friend class SpellingConfigWidget; public: virtual AppConfigGroup* clone() const { return new SpellingConfig( *this ); } QString defaultLanguage() const { return option( keyDefaultLanguage() ); } void setDefaultLanguage( const QString& defaultLanguage ) { setOption( keyDefaultLanguage(), defaultLanguage ); } QString defaultClient() const { return option( keyDefaultClient() ); } void setDefaultClient( const QString& defaultClient ) { setOption( keyDefaultClient(), defaultClient ); } bool checkUppercase() const { return optionAsBool( keyCheckUppercase() ); } void setCheckUppercase( bool checkUppercase ) { setOption( keyCheckUppercase(), checkUppercase ); } bool skipRunTogether() const { return optionAsBool( keySkipRunTogether() ); } void setSkipRunTogether( bool skipRunTogether ) { setOption( keySkipRunTogether(), skipRunTogether ); } static const QString& keyDefaultLanguage() { static const QString key( "defaultLanguage" ); return key; } static const QString& keyDefaultClient() { static const QString key( "defaultClient" ); return key; } static const QString& keyCheckUppercase() { static const QString key( "checkUppercase" ); return key; } static const QString& keySkipRunTogether() { static const QString key( "skipRunTogether" ); return key; } private: SpellingConfig():AppConfigGroup( "Spelling", defaults() ) {} SpellingConfig( const SpellingConfig& config ):AppConfigGroup( config ) {} static QMap defaults() { QMap defaults; defaults[keyDefaultLanguage()] = KGlobal::locale()->language(); defaults[keyDefaultClient()] = ""; defaults[keyCheckUppercase()] = "true"; defaults[keySkipRunTogether()] = "true"; return defaults; } }; } #endif subtitlecomposer-0.5.3/src/formats/0000755000175000001440000000000011206423743016575 5ustar sergiouserssubtitlecomposer-0.5.3/src/formats/CMakeLists.txt0000644000175000001440000000244311151345064021336 0ustar sergiousers# each format appends its files to formats_SRCS ADD_SUBDIRECTORY( microdvd ) ADD_SUBDIRECTORY( mplayer ) ADD_SUBDIRECTORY( mplayer2 ) ADD_SUBDIRECTORY( subrip ) ADD_SUBDIRECTORY( substationalpha ) ADD_SUBDIRECTORY( subviewer1 ) ADD_SUBDIRECTORY( subviewer2 ) ADD_SUBDIRECTORY( tmplayer ) SET( formats_DEFS ${formats_microdvd_DEFS} ${formats_mplayer_DEFS} ${formats_mplayer2_DEFS} ${formats_subrip_DEFS} ${formats_substationalpha_DEFS} ${formats_subviewer1_DEFS} ${formats_subviewer2_DEFS} ${formats_tmplayer_DEFS} CACHE INTERNAL EXPORTEDVARIABLE ) SET( formats_LIBS ${formats_microdvd_LIBS} ${formats_mplayer_LIBS} ${formats_mplayer2_LIBS} ${formats_subrip_LIBS} ${formats_substationalpha_LIBS} ${formats_subviewer1_LIBS} ${formats_subviewer2_LIBS} ${formats_tmplayer_LIBS} CACHE INTERNAL EXPORTEDVARIABLE ) SET( formats_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/format.h ${CMAKE_CURRENT_SOURCE_DIR}/formatmanager.h ${CMAKE_CURRENT_SOURCE_DIR}/inputformat.h ${CMAKE_CURRENT_SOURCE_DIR}/outputformat.h ${CMAKE_CURRENT_SOURCE_DIR}/formatmanager.cpp ${formats_microdvd_SRCS} ${formats_mplayer_SRCS} ${formats_mplayer2_SRCS} ${formats_subrip_SRCS} ${formats_substationalpha_SRCS} ${formats_subviewer1_SRCS} ${formats_subviewer2_SRCS} ${formats_tmplayer_SRCS} CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/formats/mplayer/0000755000175000001440000000000011206423743020246 5ustar sergiouserssubtitlecomposer-0.5.3/src/formats/mplayer/CMakeLists.txt0000644000175000001440000000024211151345063023001 0ustar sergiousersSET( formats_mplayer_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/mplayerinputformat.h ${CMAKE_CURRENT_SOURCE_DIR}/mplayeroutputformat.h CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/formats/mplayer/mplayerinputformat.h0000644000175000001440000000502411151345063024357 0ustar sergiousers#ifndef MPLAYERINPUTFORMAT_H #define MPLAYERINPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../inputformat.h" #include namespace SubtitleComposer { class MPlayerInputFormat : public InputFormat { friend class FormatManager; public: virtual ~MPlayerInputFormat() {} virtual bool parseSubtitles( Subtitle& subtitle, const QString& data ) const { double framesPerSecond = subtitle.framesPerSecond(); unsigned readLines = 0; for ( int offset = 0; m_lineRegExp.indexIn( data, offset ) != -1; offset += m_lineRegExp.matchedLength() ) { Time showTime( (long)((m_lineRegExp.cap( 1 ).toLong() / framesPerSecond)*1000) ); Time hideTime( (long)((m_lineRegExp.cap( 2 ).toLong() / framesPerSecond)*1000) ); QString text( m_lineRegExp.cap( 3 ).replace( "|", "\n" ) ); subtitle.insertLine( new SubtitleLine( text, showTime, hideTime ) ); readLines++; } return readLines > 0; } protected: MPlayerInputFormat(): InputFormat( "MPlayer", QStringList( "mpl" ) ), m_lineRegExp( "(^|\n)(\\d+),(\\d+),0,([^\n]+)[^\n]" ) { } mutable QRegExp m_lineRegExp; }; } #endif subtitlecomposer-0.5.3/src/formats/mplayer/mplayeroutputformat.h0000644000175000001440000000476311151345063024571 0ustar sergiousers#ifndef MPLAYEROUTPUTFORMAT_H #define MPLAYEROUTPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../outputformat.h" #include "../../core/subtitleiterator.h" namespace SubtitleComposer { class MPlayerOutputFormat : public OutputFormat { friend class FormatManager; public: virtual ~MPlayerOutputFormat() {} virtual QString dumpSubtitles( const Subtitle& subtitle, bool primary ) const { QString ret; double framesPerSecond = subtitle.framesPerSecond(); for ( SubtitleIterator it( subtitle ); it.current(); ++it ) { const SubtitleLine* line = it.current(); const SString& text = primary ? line->primaryText() : line->secondaryText(); ret += m_lineBuilder .arg( (long)((line->showTime().toMillis()/1000.0)*framesPerSecond + 0.5) ) .arg( (long)((line->hideTime().toMillis()/1000.0)*framesPerSecond + 0.5) ) .arg( text.string().replace( '\n', '|' ) ); } return ret; } protected: MPlayerOutputFormat(): OutputFormat( "MPlayer", QStringList( "mpl" ) ), m_lineBuilder( "%1,%2,0,%3\n" ) { } const QString m_lineBuilder; }; } #endif subtitlecomposer-0.5.3/src/formats/subviewer2/0000755000175000001440000000000011206423743020672 5ustar sergiouserssubtitlecomposer-0.5.3/src/formats/subviewer2/CMakeLists.txt0000644000175000001440000000025311151345063023427 0ustar sergiousersSET( formats_subviewer2_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/subviewer2inputformat.h ${CMAKE_CURRENT_SOURCE_DIR}/subviewer2outputformat.h CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/formats/subviewer2/subviewer2outputformat.h0000644000175000001440000000646011151345063025635 0ustar sergiousers#ifndef SUBVIEWER2OUTPUTFORMAT_H #define SUBVIEWER2OUTPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../outputformat.h" #include "../../core/subtitleiterator.h" namespace SubtitleComposer { class SubViewer2OutputFormat : public OutputFormat { friend class FormatManager; public: virtual ~SubViewer2OutputFormat() {} virtual QString dumpSubtitles( const Subtitle& subtitle, bool primary ) const { QString ret( "[INFORMATION]\n[TITLE]\n[AUTHOR]\n[SOURCE]\n[PRG]\n[FILEPATH]\n[DELAY]0\n[CD TRACK]0\n" "[COMMENT]\n[END INFORMATION]\n[SUBTITLE]\n[COLF]&HFFFFFF,[STYLE]bd,[SIZE]24,[FONT]Tahoma\n" ); for ( SubtitleIterator it( subtitle ); it.current(); ++it ) { const SubtitleLine* line = it.current(); Time showTime = line->showTime(); Time hideTime = line->hideTime(); ret += m_builder.sprintf( "%02d:%02d:%02d.%02d,%02d:%02d:%02d.%02d\n", showTime.hours(), showTime.minutes(), showTime.seconds(), (int)((showTime.mseconds()+5)/10), hideTime.hours(), hideTime.minutes(), hideTime.seconds(), (int)((hideTime.mseconds()+5)/10) ); const SString& text = primary ? line->primaryText() : line->secondaryText(); ret += m_stylesMap[text.cummulativeStyleFlags()]; ret += text.string().replace( "\n", "[br]" ); ret += "\n\n"; } return ret; } protected: SubViewer2OutputFormat(): OutputFormat( "SubViewer 2.0", QStringList( "sub" ) ), m_stylesMap() { m_stylesMap[SString::Bold] = "{Y:b}"; m_stylesMap[SString::Italic] = "{Y:i}"; m_stylesMap[SString::Underline] = "{Y:u}"; m_stylesMap[SString::Bold|SString::Italic] = "{Y:bi}"; m_stylesMap[SString::Bold|SString::Underline] = "{Y:ub}"; m_stylesMap[SString::Italic|SString::Underline] = "{Y:ui}"; m_stylesMap[SString::Bold|SString::Italic|SString::Underline] = "{Y:ubi}"; } mutable QString m_builder; mutable QMap m_stylesMap; }; } #endif subtitlecomposer-0.5.3/src/formats/subviewer2/subviewer2inputformat.h0000644000175000001440000000664011151345063025434 0ustar sergiousers#ifndef SUBVIEWER2INPUTFORMAT_H #define SUBVIEWER2INPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../inputformat.h" #include namespace SubtitleComposer { class SubViewer2InputFormat : public InputFormat { friend class FormatManager; public: virtual ~SubViewer2InputFormat() {} virtual bool parseSubtitles( Subtitle& subtitle, const QString& data ) const { unsigned readLines = 0; for ( int offset = 0; m_lineRegExp.indexIn( data, offset ) != -1; offset = m_lineRegExp.pos() + m_lineRegExp.matchedLength() ) { Time showTime( m_lineRegExp.cap( 1 ).toInt(), m_lineRegExp.cap( 2 ).toInt(), m_lineRegExp.cap( 3 ).toInt(), m_lineRegExp.cap( 4 ).toInt() * 10 ); Time hideTime( m_lineRegExp.cap( 5 ).toInt(), m_lineRegExp.cap( 6 ).toInt(), m_lineRegExp.cap( 7 ).toInt(), m_lineRegExp.cap( 8 ).toInt() * 10 ); int styleFlags = 0; QString text = m_lineRegExp.cap( 9 ).replace( "[br]", "\n" ).trimmed(); if ( m_styleRegExp.indexIn( text ) != -1 ) { QString styleText( m_styleRegExp.cap( 1 ) ); if ( styleText.contains( 'b', Qt::CaseInsensitive ) ) styleFlags |= SString::Bold; if ( styleText.contains( 'i', Qt::CaseInsensitive ) ) styleFlags |= SString::Italic; if ( styleText.contains( 'u', Qt::CaseInsensitive ) ) styleFlags |= SString::Underline; text.remove( m_styleRegExp ); } subtitle.insertLine( new SubtitleLine( SString( text, styleFlags ), showTime, hideTime ) ); readLines++; } return readLines > 0; } protected: SubViewer2InputFormat(): InputFormat( "SubViewer 2.0", QStringList( "sub" ) ), m_lineRegExp( "([0-2][0-9]):([0-5][0-9]):([0-5][0-9])\\.([0-9][0-9])," "([0-2][0-9]):([0-5][0-9]):([0-5][0-9])\\.([0-9][0-9])\n" "([^\n]*)\n\n", Qt::CaseInsensitive ), m_styleRegExp( "(\\{y:[ubi]+\\})", Qt::CaseInsensitive ) { } mutable QRegExp m_lineRegExp; mutable QRegExp m_styleRegExp; }; } #endif subtitlecomposer-0.5.3/src/formats/subrip/0000755000175000001440000000000011206423743020101 5ustar sergiouserssubtitlecomposer-0.5.3/src/formats/subrip/CMakeLists.txt0000644000175000001440000000023711151345063022640 0ustar sergiousersSET( formats_subrip_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/subripinputformat.h ${CMAKE_CURRENT_SOURCE_DIR}/subripoutputformat.h CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/formats/subrip/subripoutputformat.h0000644000175000001440000000523511151345063024252 0ustar sergiousers#ifndef SUBRIPOUTPUTFORMAT_H #define SUBRIPOUTPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../outputformat.h" #include "../../core/subtitleiterator.h" namespace SubtitleComposer { class SubRipOutputFormat : public OutputFormat { friend class FormatManager; public: virtual ~SubRipOutputFormat() {} virtual QString dumpSubtitles( const Subtitle& subtitle, bool primary ) const { QString ret; for ( SubtitleIterator it( subtitle ); it.current(); ++it ) { const SubtitleLine* line = it.current(); Time showTime = line->showTime(); Time hideTime = line->hideTime(); ret += m_timeBuilder.sprintf( "%d\n%02d:%02d:%02d,%03d --> %02d:%02d:%02d,%03d\n", it.index() + 1, showTime.hours(), showTime.minutes(), showTime.seconds(), showTime.mseconds(), hideTime.hours(), hideTime.minutes(), hideTime.seconds(), hideTime.mseconds() ); const SString& text = primary ? line->primaryText() : line->secondaryText(); ret += text.richString(); ret += "\n\n"; } return ret; } protected: SubRipOutputFormat(): OutputFormat( "SubRip", QStringList( "srt" ) ), m_dialogueBuilder( "%1%2%3%4%5%6%7\n\n" ) { } const QString m_dialogueBuilder; mutable QString m_timeBuilder; }; } #endif subtitlecomposer-0.5.3/src/formats/subrip/subripinputformat.h0000644000175000001440000000564311151345063024054 0ustar sergiousers#ifndef SUBRIPINPUTFORMAT_H #define SUBRIPINPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../inputformat.h" #include namespace SubtitleComposer { class SubRipInputFormat : public InputFormat { friend class FormatManager; public: virtual ~SubRipInputFormat() {} virtual bool parseSubtitles( Subtitle& subtitle, const QString& data ) const { if ( m_regExp.indexIn( data, 0 ) == -1 ) return false; // couldn't find first line unsigned readLines = 0; int offset = 0; do { Time showTime( m_regExp.cap( 1 ).toInt(), m_regExp.cap( 2 ).toInt(), m_regExp.cap( 3 ).toInt(), m_regExp.cap( 4 ).toInt() ); Time hideTime( m_regExp.cap( 5 ).toInt(), m_regExp.cap( 6 ).toInt(), m_regExp.cap( 7 ).toInt(), m_regExp.cap( 8 ).toInt() ); offset += m_regExp.matchedLength(); QString text( data.mid( offset, (unsigned)m_regExp.indexIn( data, offset ) - offset ) ); offset += text.length(); SString stext; stext.setRichString( text.trimmed() ); subtitle.insertLine( new SubtitleLine( stext, showTime, hideTime ) ); readLines++; } while ( m_regExp.matchedLength() != -1 ); return readLines > 0; } protected: SubRipInputFormat(): InputFormat( "SubRip", QStringList( "srt" ) ), m_regExp( "[\\d]+\n([0-2][0-9]):([0-5][0-9]):([0-5][0-9])[,\\.]([0-9][0-9][0-9]) --> ([0-2][0-9]):([0-5][0-9]):([0-5][0-9])[,\\.]([0-9][0-9][0-9])\n" ) { } mutable QRegExp m_regExp; }; } #endif subtitlecomposer-0.5.3/src/formats/microdvd/0000755000175000001440000000000011206423743020404 5ustar sergiouserssubtitlecomposer-0.5.3/src/formats/microdvd/CMakeLists.txt0000644000175000001440000000024511151345063023142 0ustar sergiousersSET( formats_microdvd_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/microdvdinputformat.h ${CMAKE_CURRENT_SOURCE_DIR}/microdvdoutputformat.h CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/formats/microdvd/microdvdoutputformat.h0000644000175000001440000000616211151345063025060 0ustar sergiousers#ifndef MICRODVDOUTPUTFORMAT_H #define MICRODVDOUTPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../outputformat.h" #include "../../core/subtitleiterator.h" namespace SubtitleComposer { class MicroDVDOutputFormat : public OutputFormat { friend class FormatManager; public: virtual ~MicroDVDOutputFormat() {} virtual QString dumpSubtitles( const Subtitle& subtitle, bool primary ) const { QString ret; double framesPerSecond = subtitle.framesPerSecond(); ret += m_lineBuilder.arg( 1 ).arg( 1 ).arg( "" ).arg( QString::number( framesPerSecond, 'f', 3 ) ); for ( SubtitleIterator it( subtitle ); it.current(); ++it ) { const SubtitleLine* line = it.current(); const SString& text = primary ? line->primaryText() : line->secondaryText(); ret += m_lineBuilder .arg( (long)((line->showTime().toMillis()/1000.0)*framesPerSecond + 0.5) ) .arg( (long)((line->hideTime().toMillis()/1000.0)*framesPerSecond + 0.5) ) .arg( m_stylesMap[text.cummulativeStyleFlags()] ) .arg( text.string().replace( '\n', '|' ) ); } return ret; } protected: MicroDVDOutputFormat(): OutputFormat( "MicroDVD", QString( "sub:txt" ).split( ":" ) ), m_lineBuilder( "{%1}{%2}%3%4\n" ), m_stylesMap() { m_stylesMap[SString::Bold] = "{Y:b}"; m_stylesMap[SString::Italic] = "{Y:i}"; m_stylesMap[SString::Underline] = "{Y:u}"; m_stylesMap[SString::Bold|SString::Italic] = "{Y:bi}"; m_stylesMap[SString::Bold|SString::Underline] = "{Y:ub}"; m_stylesMap[SString::Italic|SString::Underline] = "{Y:ui}"; m_stylesMap[SString::Bold|SString::Italic|SString::Underline] = "{Y:ubi}"; } const QString m_lineBuilder; mutable QMap m_stylesMap; }; } #endif subtitlecomposer-0.5.3/src/formats/microdvd/microdvdinputformat.h0000644000175000001440000001005411151345063024652 0ustar sergiousers#ifndef MICRODVDINPUTFORMAT_H #define MICRODVDINPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../inputformat.h" #include namespace SubtitleComposer { class MicroDVDInputFormat : public InputFormat { friend class FormatManager; public: virtual ~MicroDVDInputFormat() {} virtual bool parseSubtitles( Subtitle& subtitle, const QString& data ) const { if ( m_lineRegExp.indexIn( data, 0 ) == -1 ) return false; // couldn't find first line (content or FPS) int offset = 0; // if present, the FPS must by indicated by the first entry with both initial and final frames at 1 bool ok; double framesPerSecond = m_lineRegExp.cap( 3 ).toDouble( &ok ); if ( ok && m_lineRegExp.cap( 1 ) == "1" && m_lineRegExp.cap( 2 ) == "1" ) { // first line contained the frames per second subtitle.setFramesPerSecond( framesPerSecond ); offset += m_lineRegExp.matchedLength(); if ( m_lineRegExp.indexIn( data, offset ) == -1 ) return false; // couldn't find first line with content } else // first line doesn't contain the FPS, use the value loaded by default framesPerSecond = subtitle.framesPerSecond(); unsigned readLines = 0; do { offset += m_lineRegExp.matchedLength(); Time showTime( (long)((m_lineRegExp.cap( 1 ).toLong() / framesPerSecond)*1000) ); Time hideTime( (long)((m_lineRegExp.cap( 2 ).toLong() / framesPerSecond)*1000) ); int styleFlags = 0; QString text = m_lineRegExp.cap( 3 ).replace( "|", "\n" ); if ( m_styleRegExp.indexIn( text ) != -1 ) { QString styleText( m_styleRegExp.cap( 1 ) ); if ( styleText.contains( 'b', Qt::CaseInsensitive ) ) styleFlags |= SString::Bold; if ( styleText.contains( 'i', Qt::CaseInsensitive ) ) styleFlags |= SString::Italic; if ( styleText.contains( 'u', Qt::CaseInsensitive ) ) styleFlags |= SString::Underline; text.remove( m_styleRegExp ); } text.replace( m_unsupportedFormatRegExp, "" ); subtitle.insertLine( new SubtitleLine( SString( text, styleFlags ), showTime, hideTime ) ); readLines++; } while ( m_lineRegExp.indexIn( data, offset ) != -1 ); return readLines > 0; } protected: MicroDVDInputFormat(): InputFormat( "MicroDVD", QString( "sub:txt" ).split( ":" ) ), m_lineRegExp( "\\{(\\d+)\\}\\{(\\d+)\\}([^\n]+)\n", Qt::CaseInsensitive ), m_styleRegExp( "(\\{y:[ubi]+\\})", Qt::CaseInsensitive ), m_unsupportedFormatRegExp( "\\{C:\\$[0-9a-f]{6,6}\\}", Qt::CaseInsensitive ) { } mutable QRegExp m_lineRegExp; mutable QRegExp m_styleRegExp; mutable QRegExp m_unsupportedFormatRegExp; }; } #endif subtitlecomposer-0.5.3/src/formats/mplayer2/0000755000175000001440000000000011206423743020330 5ustar sergiouserssubtitlecomposer-0.5.3/src/formats/mplayer2/CMakeLists.txt0000644000175000001440000000024511151345063023066 0ustar sergiousersSET( formats_mplayer2_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/mplayer2inputformat.h ${CMAKE_CURRENT_SOURCE_DIR}/mplayer2outputformat.h CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/formats/mplayer2/mplayer2inputformat.h0000644000175000001440000000464711151345063024535 0ustar sergiousers#ifndef MPLAYER2INPUTFORMAT_H #define MPLAYER2INPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../inputformat.h" #include namespace SubtitleComposer { class MPlayer2InputFormat : public InputFormat { friend class FormatManager; public: virtual ~MPlayer2InputFormat() {} virtual bool parseSubtitles( Subtitle& subtitle, const QString& data ) const { unsigned readLines = 0; for ( int offset = 0; m_lineRegExp.indexIn( data, offset ) != -1; offset += m_lineRegExp.matchedLength() ) { Time showTime( m_lineRegExp.cap( 1 ).toInt() * 100 ); Time hideTime( m_lineRegExp.cap( 2 ).toInt() * 100 ); QString text( m_lineRegExp.cap( 3 ).replace( "|", "\n" ) ); subtitle.insertLine( new SubtitleLine( text, showTime, hideTime ) ); readLines++; } return readLines > 0; } protected: MPlayer2InputFormat(): InputFormat( "MPlayer2", QStringList( "mpl" ) ), m_lineRegExp( "\\[(\\d+)\\]\\[(\\d+)\\]([^\n]+)\n" ) { } mutable QRegExp m_lineRegExp; }; } #endif subtitlecomposer-0.5.3/src/formats/mplayer2/mplayer2outputformat.h0000644000175000001440000000463511151345063024733 0ustar sergiousers#ifndef MPLAYER2OUTPUTFORMAT_H #define MPLAYER2OUTPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../outputformat.h" #include "../../core/subtitleiterator.h" namespace SubtitleComposer { class MPlayer2OutputFormat : public OutputFormat { friend class FormatManager; public: virtual ~MPlayer2OutputFormat() {} virtual QString dumpSubtitles( const Subtitle& subtitle, bool primary ) const { QString ret; for ( SubtitleIterator it( subtitle ); it.current(); ++it ) { const SubtitleLine* line = it.current(); const SString& text = primary ? line->primaryText() : line->secondaryText(); ret += m_lineBuilder .arg( (long)((line->showTime().toMillis()/100.0) + 0.5) ) .arg( (long)((line->hideTime().toMillis()/100.0) + 0.5) ) .arg( text.string().replace( '\n', '|' ) ); } return ret; } protected: MPlayer2OutputFormat(): OutputFormat( "MPlayer2", QStringList( "mpl" ) ), m_lineBuilder( "[%1][%2]%3\n" ) { } const QString m_lineBuilder; }; } #endif subtitlecomposer-0.5.3/src/formats/subviewer1/0000755000175000001440000000000011206423743020671 5ustar sergiouserssubtitlecomposer-0.5.3/src/formats/subviewer1/CMakeLists.txt0000644000175000001440000000025311151345063023426 0ustar sergiousersSET( formats_subviewer1_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/subviewer1inputformat.h ${CMAKE_CURRENT_SOURCE_DIR}/subviewer1outputformat.h CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/formats/subviewer1/subviewer1inputformat.h0000644000175000001440000000550211151345063025426 0ustar sergiousers#ifndef SUBVIEWER1INPUTFORMAT_H #define SUBVIEWER1INPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../inputformat.h" #include namespace SubtitleComposer { class SubViewer1InputFormat : public InputFormat { friend class FormatManager; public: virtual ~SubViewer1InputFormat() {} virtual bool parseSubtitles( Subtitle& subtitle, const QString& data ) const { if ( m_regExp.indexIn( data, 0 ) == -1 ) return false; // couldn't find first line unsigned readLines = 0; int offset = m_regExp.pos(); do { offset += m_regExp.matchedLength(); Time showTime( m_regExp.cap( 1 ).toInt(), m_regExp.cap( 2 ).toInt(), m_regExp.cap( 3 ).toInt(), 0 ); QString text( m_regExp.cap( 4 ).replace( "|", "\n" ).trimmed() ); // search hideTime if ( m_regExp.indexIn( data, offset ) == -1 ) break; Time hideTime( m_regExp.cap( 1 ).toInt(), m_regExp.cap( 2 ).toInt(), m_regExp.cap( 3 ).toInt(), 0 ); subtitle.insertLine( new SubtitleLine( text, showTime, hideTime ) ); offset += m_regExp.matchedLength(); readLines++; } while ( m_regExp.indexIn( data, offset ) != -1 ); // search next line's showTime return readLines > 0; } protected: SubViewer1InputFormat(): InputFormat( "SubViewer 1.0", QStringList( "sub" ) ), m_regExp( "\\[([0-2][0-9]):([0-5][0-9]):([0-5][0-9])\\]\n([^\n]*)\n" ) { } mutable QRegExp m_regExp; }; } #endif subtitlecomposer-0.5.3/src/formats/subviewer1/subviewer1outputformat.h0000644000175000001440000000536311151345063025634 0ustar sergiousers#ifndef SUBVIEWER1OUTPUTFORMAT_H #define SUBVIEWER1OUTPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../outputformat.h" #include "../../core/subtitleiterator.h" namespace SubtitleComposer { class SubViewer1OutputFormat : public OutputFormat { friend class FormatManager; public: virtual ~SubViewer1OutputFormat() {} virtual QString dumpSubtitles( const Subtitle& subtitle, bool primary ) const { QString ret; ret += "[TITLE]\n\n[AUTHOR]\n\n[SOURCE]\n\n[PRG]\n\n[FILEPATH]\n\n[DELAY]\n0\n[CD TRACK]\n0\n[BEGIN]\n" "******** START SCRIPT ********\n"; for ( SubtitleIterator it( subtitle ); it.current(); ++it ) { const SubtitleLine* line = it.current(); Time showTime = line->showTime(); ret += m_builder.sprintf( "[%02d:%02d:%02d]\n", showTime.hours(), showTime.minutes(), showTime.seconds() ); const SString& text = primary ? line->primaryText() : line->secondaryText(); ret += text.string().replace( '\n', '|' ); Time hideTime = line->hideTime(); ret += m_builder.sprintf( "\n[%02d:%02d:%02d]\n\n", hideTime.hours(), hideTime.minutes(), hideTime.seconds() ); } ret += "[END]\n" "******** END SCRIPT ********\n"; return ret; } protected: SubViewer1OutputFormat(): OutputFormat( "SubViewer 1.0", QStringList( "sub" ) ) { } mutable QString m_builder; }; } #endif subtitlecomposer-0.5.3/src/formats/outputformat.h0000644000175000001440000000476211151345064021526 0ustar sergiousers#ifndef OUTPUTFORMAT_H #define OUTPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "format.h" #include "../common/filesavehelper.h" #include #include #include namespace SubtitleComposer { class OutputFormat : public Format { public: virtual ~OutputFormat() {} bool writeSubtitle( const Subtitle& subtitle, NewLine newLine, bool primary, const KUrl& url, QTextCodec* codec, bool overwrite ) const { FileSaveHelper fileSaveHelper( url, overwrite ); if ( ! fileSaveHelper.open() ) return false; QString data = dumpSubtitles( subtitle, primary ); if ( newLine == Windows ) data.replace( "\n", "\r\n" ); else if ( newLine == Macintosh ) data.replace( "\n", "\r" ); QTextStream stream( fileSaveHelper.file() ); stream.setCodec( codec ); stream << data; return fileSaveHelper.close(); } virtual QString dumpSubtitles( const Subtitle& subtitle, bool secondary ) const = 0; protected: OutputFormat( const QString& name, const QStringList& extensions ): Format( name, extensions ) {} }; } #endif subtitlecomposer-0.5.3/src/formats/formatmanager.h0000644000175000001440000000463411151345064021576 0ustar sergiousers#ifndef FORMATMANAGER_H #define FORMATMANAGER_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "inputformat.h" #include "outputformat.h" #include #include #include #include namespace SubtitleComposer { class FormatManager { public: static FormatManager& instance(); bool hasInput( const QString& name ); const InputFormat* input( const QString& name ); QStringList inputNames(); bool readSubtitle( Subtitle& subtitle, bool primary, const KUrl& url, QTextCodec* codec, Format::NewLine* newLine=0, QString* format=0 ); bool hasOutput( const QString& name ); const OutputFormat* output( const QString& name ); QStringList outputNames(); bool writeSubtitle( const Subtitle& subtitle, bool primary, const KUrl& url, QTextCodec* codec, Format::NewLine newLine, const QString& format, bool overwrite ); protected: FormatManager(); ~FormatManager(); QMap m_inputFormats; QMap m_outputFormats; }; } #endif subtitlecomposer-0.5.3/src/formats/formatmanager.cpp0000644000175000001440000001562311151345064022131 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "formatmanager.h" #include "microdvd/microdvdinputformat.h" #include "microdvd/microdvdoutputformat.h" #include "mplayer/mplayerinputformat.h" #include "mplayer/mplayeroutputformat.h" #include "mplayer2/mplayer2inputformat.h" #include "mplayer2/mplayer2outputformat.h" #include "subrip/subripinputformat.h" #include "subrip/subripoutputformat.h" #include "substationalpha/substationalphainputformat.h" #include "substationalpha/substationalphaoutputformat.h" #include "subviewer1/subviewer1inputformat.h" #include "subviewer1/subviewer1outputformat.h" #include "subviewer2/subviewer2inputformat.h" #include "subviewer2/subviewer2outputformat.h" #include "tmplayer/tmplayerinputformat.h" #include "tmplayer/tmplayeroutputformat.h" using namespace SubtitleComposer; FormatManager& FormatManager::instance() { static FormatManager instance; return instance; } FormatManager::FormatManager() { InputFormat* inputFormat = new SubRipInputFormat(); m_inputFormats[inputFormat->name()] = inputFormat; inputFormat = new MicroDVDInputFormat(); m_inputFormats[inputFormat->name()] = inputFormat; inputFormat = new MPlayerInputFormat(); m_inputFormats[inputFormat->name()] = inputFormat; inputFormat = new MPlayer2InputFormat(); m_inputFormats[inputFormat->name()] = inputFormat; inputFormat = new SubStationAlphaInputFormat(); m_inputFormats[inputFormat->name()] = inputFormat; inputFormat = new AdvancedSubStationAlphaInputFormat(); m_inputFormats[inputFormat->name()] = inputFormat; inputFormat = new SubViewer1InputFormat(); m_inputFormats[inputFormat->name()] = inputFormat; inputFormat = new SubViewer2InputFormat(); m_inputFormats[inputFormat->name()] = inputFormat; inputFormat = new TMPlayerInputFormat(); m_inputFormats[inputFormat->name()] = inputFormat; inputFormat = new TMPlayerPlusInputFormat(); m_inputFormats[inputFormat->name()] = inputFormat; OutputFormat* outputFormat = new SubRipOutputFormat(); m_outputFormats[outputFormat->name()] = outputFormat; outputFormat = new MicroDVDOutputFormat(); m_outputFormats[outputFormat->name()] = outputFormat; outputFormat = new MPlayerOutputFormat(); m_outputFormats[outputFormat->name()] = outputFormat; outputFormat = new MPlayer2OutputFormat(); m_outputFormats[outputFormat->name()] = outputFormat; outputFormat = new SubStationAlphaOutputFormat(); m_outputFormats[outputFormat->name()] = outputFormat; outputFormat = new AdvancedSubStationAlphaOutputFormat(); m_outputFormats[outputFormat->name()] = outputFormat; outputFormat = new SubViewer1OutputFormat(); m_outputFormats[outputFormat->name()] = outputFormat; outputFormat = new SubViewer2OutputFormat(); m_outputFormats[outputFormat->name()] = outputFormat; outputFormat = new TMPlayerOutputFormat(); m_outputFormats[outputFormat->name()] = outputFormat; outputFormat = new TMPlayerPlusOutputFormat(); m_outputFormats[outputFormat->name()] = outputFormat; } FormatManager::~FormatManager() { for ( QMap::ConstIterator it = m_inputFormats.begin(), end = m_inputFormats.end(); it != end; ++it ) delete it.value(); for ( QMap::ConstIterator it = m_outputFormats.begin(), end = m_outputFormats.end(); it != end; ++it ) delete it.value(); } bool FormatManager::hasInput( const QString& name ) { return m_inputFormats.contains( name ); } const InputFormat* FormatManager::input( const QString& name ) { return m_inputFormats.contains( name ) ? m_inputFormats[name] : 0; } QStringList FormatManager::inputNames() { return m_inputFormats.keys(); } bool FormatManager::readSubtitle( Subtitle& subtitle, bool primary, const KUrl& url, QTextCodec* codec, Format::NewLine* newLine, QString* formatName ) { QString extension = QFileInfo( url.path() ).suffix(); // attempt to parse subtitles based on extension information for ( QMap::ConstIterator it = m_inputFormats.begin(), end = m_inputFormats.end(); it != end; ++it ) { if ( it.value()->knowsExtension( extension ) ) { if ( it.value()->readSubtitle( subtitle, newLine, primary, url, codec, true ) ) { if ( formatName ) *formatName = it.value()->name(); return true; } } } // that didn't worked, attempt to parse subtitles based on content for ( QMap::ConstIterator it = m_inputFormats.begin(), end = m_inputFormats.end(); it != end; ++it ) { if ( ! it.value()->knowsExtension( extension ) ) { if ( it.value()->readSubtitle( subtitle, newLine, primary, url, codec, true ) ) { if ( formatName ) *formatName = it.value()->name(); return true; } } } return false; } bool FormatManager::hasOutput( const QString& name ) { return m_outputFormats.contains( name ); } const OutputFormat* FormatManager::output( const QString& name ) { return m_outputFormats.contains( name ) ? m_outputFormats[name] : 0; } QStringList FormatManager::outputNames() { return m_outputFormats.keys(); } bool FormatManager::writeSubtitle( const Subtitle& subtitle, bool primary, const KUrl& url, QTextCodec* codec, Format::NewLine newLine, const QString& formatName, bool overwrite ) { const OutputFormat* format = output( formatName ); if ( format == 0 ) { QString extension = QFileInfo( url.path() ).suffix(); // attempt find format based on extension information for ( QMap::ConstIterator it = m_outputFormats.begin(), end = m_outputFormats.end(); it != end; ++it ) if ( it.value()->knowsExtension( extension ) ) { format = *it; break; } } if ( format == 0 ) return false; return format->writeSubtitle( subtitle, newLine, primary, url, codec, overwrite ); } subtitlecomposer-0.5.3/src/formats/tmplayer/0000755000175000001440000000000011206423743020432 5ustar sergiouserssubtitlecomposer-0.5.3/src/formats/tmplayer/CMakeLists.txt0000644000175000001440000000024511151345063023170 0ustar sergiousersSET( formats_tmplayer_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/tmplayerinputformat.h ${CMAKE_CURRENT_SOURCE_DIR}/tmplayeroutputformat.h CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/formats/tmplayer/tmplayerinputformat.h0000644000175000001440000000716711151345063024741 0ustar sergiousers#ifndef TMPLAYERINPUTFORMAT_H #define TMPLAYERINPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../inputformat.h" #include namespace SubtitleComposer { // FIXME TMPlayer Multiline variant class TMPlayerInputFormat : public InputFormat { friend class FormatManager; public: virtual ~TMPlayerInputFormat() {} virtual bool parseSubtitles( Subtitle& subtitle, const QString& data ) const { unsigned readLines = 0; if ( m_regExp.indexIn( data, 0 ) == -1 ) return false; Time previousShowTime( m_regExp.cap( 1 ).toInt(), m_regExp.cap( 2 ).toInt(), m_regExp.cap( 3 ).toInt(), 0 ); QString previousText( m_regExp.cap( 4 ).replace( "|", "\n" ).trimmed() ); int offset = m_regExp.matchedLength(); for ( ; m_regExp.indexIn( data, offset ) != -1; offset += m_regExp.matchedLength() ) { Time showTime( m_regExp.cap( 1 ).toInt(), m_regExp.cap( 2 ).toInt(), m_regExp.cap( 3 ).toInt(), 0 ); QString text( m_regExp.cap( 4 ).replace( "|", "\n" ).trimmed() ); // To compensate for the format deficiencies, Subtitle Composer writes empty lines // indicating that way the line hide time. We do the same. if ( ! previousText.isEmpty() ) { subtitle.insertLine( new SubtitleLine( previousText, previousShowTime, showTime ) ); readLines++; } previousText = text; previousShowTime = showTime; } if ( ! previousText.isEmpty() ) { subtitle.insertLine( new SubtitleLine( previousText, previousShowTime, previousShowTime + 2000 ) ); readLines++; } return true; } protected: TMPlayerInputFormat(): InputFormat( "TMPlayer", QString( "sub:txt" ).split( ":" ) ), m_regExp( "([0-2]?[0-9]):([0-5][0-9]):([0-5][0-9]):([^\n]*)\n?" ) { } TMPlayerInputFormat( const QString& name, const QStringList& extensions, const QString& regExp ): InputFormat( name, extensions ), m_regExp( regExp ) { } mutable QRegExp m_regExp; }; class TMPlayerPlusInputFormat : public TMPlayerInputFormat { friend class FormatManager; protected: TMPlayerPlusInputFormat(): TMPlayerInputFormat( "TMPlayer+", QString( "sub:txt" ).split( ":" ), "([0-2]?[0-9]):([0-5][0-9]):([0-5][0-9])=([^\n]*)\n?" ) { } }; } #endif subtitlecomposer-0.5.3/src/formats/tmplayer/tmplayeroutputformat.h0000644000175000001440000000637311151345063025140 0ustar sergiousers#ifndef TMPLAYEROUTPUTFORMAT_H #define TMPLAYEROUTPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../outputformat.h" #include "../../core/subtitleiterator.h" namespace SubtitleComposer { class TMPlayerOutputFormat : public OutputFormat { friend class FormatManager; public: virtual ~TMPlayerOutputFormat() {} virtual QString dumpSubtitles( const Subtitle& subtitle, bool primary ) const { QString builder; QString ret; for ( SubtitleIterator it( subtitle ); it.current(); ++it ) { const SubtitleLine* line = it.current(); Time showTime = line->showTime(); ret += builder.sprintf( m_timeFormat, showTime.hours(), showTime.minutes(), showTime.seconds() ); const SString& text = primary ? line->primaryText() : line->secondaryText(); ret += text.string().replace( '\n', '|' ); ret += '\n'; // We behave like Subtitle Workshop here: to compensate for the lack of hide time // indication provisions in the format we add an empty line with the hide time. Time hideTime = line->hideTime(); ret += builder.sprintf( m_timeFormat, hideTime.hours(), hideTime.minutes(), hideTime.seconds() ); ret += "\n"; } return ret; } protected: TMPlayerOutputFormat(): OutputFormat( "TMPlayer", QString( "sub:txt" ).split( ":" ) ), m_timeFormat( "%02d:%02d:%02d:" ) { } TMPlayerOutputFormat( const QString& name, const QStringList& extensions, const char* timeFormat ): OutputFormat( name, extensions ), m_timeFormat( timeFormat ) { } const char* m_timeFormat; }; class TMPlayerPlusOutputFormat : public TMPlayerOutputFormat { friend class FormatManager; protected: TMPlayerPlusOutputFormat(): TMPlayerOutputFormat( "TMPlayer+", QString( "sub:txt" ).split( ":" ), "%02d:%02d:%02d=" ) { } }; } #endif subtitlecomposer-0.5.3/src/formats/format.h0000644000175000001440000000704311151345064020240 0ustar sergiousers#ifndef FORMAT_H #define FORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../core/formatdata.h" #include "../core/subtitle.h" #include "../core/subtitleline.h" #include #include namespace SubtitleComposer { class Format { public: friend class FormatManager; typedef enum { UNIX = 0, Windows, Macintosh, #ifdef Q_OS_UNIX // krazy:exclude=c++/cpp CurrentOS = UNIX #else #ifdef Q_OS_WIN // krazy:exclude=c++/cpp CurrentOS = Windows #else CurrentOS = Macintosh #endif #endif } NewLine; Format( const QString& name, const QStringList& extensions ): m_name( name ), m_extensions( extensions ) {} virtual ~Format() {} const QString& name() const { return m_name; } const QStringList& extensions() const { return m_extensions; } bool knowsExtension( const QString& extension ) const { QString ext = extension.toLower(); for ( QStringList::ConstIterator it = m_extensions.begin(), end = m_extensions.end(); it != end; ++it ) { if ( *it == ext && *it != "*" ) return true; } return false; } protected: FormatData createFormatData() const { return FormatData( m_name ); } FormatData* formatData( const Subtitle& subtitle ) const { FormatData* formatData = subtitle.formatData(); return formatData && formatData->formatName() == m_name ? formatData : 0; } void setFormatData( Subtitle& subtitle, FormatData* formatData ) const { subtitle.setFormatData( formatData ); } void setFormatData( Subtitle& subtitle, FormatData& formatData ) const { subtitle.setFormatData( &formatData ); } FormatData* formatData( const SubtitleLine* line ) const { FormatData* formatData = line->formatData(); return formatData && formatData->formatName() == m_name ? formatData : 0; } void setFormatData( SubtitleLine* line, FormatData* formatData ) const { line->setFormatData( formatData ); } void setFormatData( SubtitleLine* line, FormatData& formatData ) const { line->setFormatData( &formatData ); } QString m_name; QStringList m_extensions; }; } #endif subtitlecomposer-0.5.3/src/formats/substationalpha/0000755000175000001440000000000011206423743021776 5ustar sergiouserssubtitlecomposer-0.5.3/src/formats/substationalpha/CMakeLists.txt0000644000175000001440000000027211151345063024534 0ustar sergiousersSET( formats_substationalpha_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/substationalphainputformat.h ${CMAKE_CURRENT_SOURCE_DIR}/substationalphaoutputformat.h CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/formats/substationalpha/substationalphainputformat.h0000644000175000001440000001736611151345063027653 0ustar sergiousers#ifndef SUBSTATIONALPHAINPUTFORMAT_H #define SUBSTATIONALPHAINPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../inputformat.h" #include namespace SubtitleComposer { class SubStationAlphaInputFormat : public InputFormat { friend class FormatManager; friend class AdvancedSubStationAlphaInputFormat; public: virtual ~SubStationAlphaInputFormat() {} SString toSString( QString string ) const { static QRegExp cmdRegExp( "\\{([^\\}]+)\\}" ); static QRegExp tagCmdRegExp( "\\[ibu][01]" ); SString ret; string.replace( "\\N", "\n" ); string.replace( "\\n", "\n" ); int currentStyle = 0; int offsetPos = 0, matchedPos; while ( (matchedPos = cmdRegExp.indexIn( string, offsetPos ) ) != -1 ) { int newStyleFlags = currentStyle; QString commands( cmdRegExp.cap( 1 ) ); QStringList commandsList( commands.split( '\\' ) ); for ( QStringList::ConstIterator it = commandsList.begin(), end = commandsList.end(); it != end; ++it ) { if ( *it == "\\il" ) newStyleFlags |= SString::Italic; else if ( *it == "\\bl" ) newStyleFlags |= SString::Bold; else if ( *it == "\\ul" ) newStyleFlags |= SString::Underline; else if ( *it == "\\i0" ) newStyleFlags &= ~SString::Italic; else if ( *it == "\\b0" ) newStyleFlags &= ~SString::Bold; else if ( *it == "\\u0" ) newStyleFlags &= ~SString::Underline; } commands.replace( tagCmdRegExp, "" ); QString token( string.mid( offsetPos, matchedPos - offsetPos ) ); if ( commands.length() ) token += "{" + commands + "}"; ret.append( SString( token, currentStyle ) ); currentStyle = newStyleFlags; offsetPos = matchedPos + cmdRegExp.matchedLength(); } ret.append( SString( string.mid( offsetPos, matchedPos - offsetPos ), currentStyle ) ); return ret; } virtual bool parseSubtitles( Subtitle& subtitle, const QString& data ) const { if ( m_scriptInfoRegExp.indexIn( data ) == -1 ) return false; int stylesStart = m_stylesRegExp.indexIn( data ); if ( stylesStart == -1 ) return false; FormatData formatData = createFormatData(); formatData.setValue( "ScriptInfo", data.mid( 0, stylesStart - 1 ) ); int eventsStart = m_eventsRegExp.indexIn( data, stylesStart ); if ( eventsStart == -1 ) return false; formatData.setValue( "Styles", data.mid( stylesStart, eventsStart - stylesStart ) ); if ( m_formatRegExp.indexIn( data, eventsStart ) == -1 ) return false; setFormatData( subtitle, formatData ); formatData.clear(); unsigned readLines = 0; int offset = m_formatRegExp.pos() + m_formatRegExp.matchedLength(); for ( ; m_dialogueRegExp.indexIn( data, offset ) != -1; offset += m_dialogueRegExp.matchedLength() ) { if ( m_timeRegExp.indexIn( m_dialogueRegExp.cap( 1 ) ) == -1 ) continue; Time showTime( m_timeRegExp.cap( 1 ).toInt(), m_timeRegExp.cap( 2 ).toInt(), m_timeRegExp.cap( 3 ).toInt(), m_timeRegExp.cap( 4 ).toInt() * 10 ); if ( m_timeRegExp.indexIn( m_dialogueRegExp.cap( 2 ) ) == -1 ) continue; Time hideTime( m_timeRegExp.cap( 1 ).toInt(), m_timeRegExp.cap( 2 ).toInt(), m_timeRegExp.cap( 3 ).toInt(), m_timeRegExp.cap( 4 ).toInt() * 10 ); SubtitleLine* line = new SubtitleLine( toSString( m_dialogueRegExp.cap( 3 ) ), showTime, hideTime ); formatData.setValue( "Dialogue", m_dialogueRegExp.cap( 0 ).replace( m_dialogue2RegExp, "\\1%1\\2%2\\3%3\n" ) ); setFormatData( line, formatData ); subtitle.insertLine( line ); readLines++; } return readLines > 0; } protected: SubStationAlphaInputFormat(): InputFormat( "SubStation Alpha", QStringList( "ssa" ) ), m_scriptInfoRegExp( "^ *\\[Script Info\\] *\n" ), m_stylesRegExp( s_stylesRegExp ), m_eventsRegExp( "\n\\ *\\[Events\\] *\n" ), m_formatRegExp( s_formatRegExp ), m_dialogueRegExp( s_dialogueRegExp ), m_dialogue2RegExp( s_dialogue2RegExp ), m_timeRegExp( "([0-9]):([0-5][0-9]):([0-5][0-9]).([0-9][0-9])" ) { } SubStationAlphaInputFormat( const QString& name, const QStringList& extensions, const QString& stylesRegExp, const QString& formatRegExp ): InputFormat( name, extensions ), m_scriptInfoRegExp( "^ *\\[Script Info\\] *\n" ), m_stylesRegExp( stylesRegExp ), m_eventsRegExp( "\n\\ *\\[Events\\] *\n" ), m_formatRegExp( formatRegExp ), m_dialogueRegExp( s_dialogueRegExp ), m_dialogue2RegExp( s_dialogue2RegExp ), m_timeRegExp( "([0-9]):([0-5][0-9]):([0-5][0-9]).([0-9][0-9])" ) { } mutable QRegExp m_scriptInfoRegExp; mutable QRegExp m_stylesRegExp; mutable QRegExp m_eventsRegExp; mutable QRegExp m_formatRegExp; mutable QRegExp m_dialogueRegExp; mutable QRegExp m_dialogue2RegExp; mutable QRegExp m_timeRegExp; static const char* s_stylesRegExp; static const char* s_formatRegExp; static const char* s_dialogueRegExp; static const char* s_dialogue2RegExp; }; const char* SubStationAlphaInputFormat::s_stylesRegExp = "\n\\ *\\[V4 Styles\\] *\n"; const char* SubStationAlphaInputFormat::s_formatRegExp = " *Format: *Marked, *Start, *End, *Style, *Name, *MarginL, *MarginR, *MarginV, *Effect, *Text *\n"; const char* SubStationAlphaInputFormat::s_dialogueRegExp = " *Dialogue: *[^,]+, *([^,]+), *([^,]+), *[^,]+, *[^,]*, *[0-9]{4,4}, *[0-9]{4,4}, *[0-9]{4,4}, *[^,]*, *([^\n]*)\n?"; const char* SubStationAlphaInputFormat::s_dialogue2RegExp = " *(Dialogue: *[^,]+, *)[^,]+(, *)[^,]+(, *[^,]+, *[^,]*, *[0-9]{4,4}, *[0-9]{4,4}, *[0-9]{4,4}, *[^,]*, *).*"; class AdvancedSubStationAlphaInputFormat : public SubStationAlphaInputFormat { friend class FormatManager; protected: AdvancedSubStationAlphaInputFormat(): SubStationAlphaInputFormat( "Advanced SubStation Alpha", QStringList( "ass" ), s_stylesRegExp, s_formatRegExp ) { } static const char* s_stylesRegExp; static const char* s_formatRegExp; }; const char* AdvancedSubStationAlphaInputFormat::s_stylesRegExp = "\n\\ *\\[V4\\+ Styles\\] *\n"; const char* AdvancedSubStationAlphaInputFormat::s_formatRegExp = " *Format: *Layer, *Start, *End, *Style, *(Actor|Name), *MarginL, *MarginR, *MarginV, *Effect, *Text *\n"; // Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text } #endif subtitlecomposer-0.5.3/src/formats/substationalpha/substationalphaoutputformat.h0000644000175000001440000001524611151345063030047 0ustar sergiousers#ifndef SUBSTATIONALPHAOUTPUTFORMAT_H #define SUBSTATIONALPHAOUTPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../outputformat.h" #include "../../core/formatdata.h" #include "../../core/subtitleiterator.h" namespace SubtitleComposer { class SubStationAlphaOutputFormat : public OutputFormat { friend class FormatManager; public: virtual ~SubStationAlphaOutputFormat() {} QString fromSString( const SString& string ) const { QString ret( string.richString() ); ret.replace( "", "{\\b1}" ); ret.replace( "", "{\\b0}" ); ret.replace( "", "{\\i1}" ); ret.replace( "", "{\\i0}" ); ret.replace( "", "{\\u1}" ); ret.replace( "", "{\\u0}" ); ret.replace( "<", "<" ); ret.replace( ">", ">" ); ret.replace( "\n", "\\N" ); return ret; } virtual QString dumpSubtitles( const Subtitle& subtitle, bool primary ) const { FormatData* formatData = this->formatData( subtitle ); QString builder( "%1\n%2\n%3" ); QString ret = builder .arg( formatData ? formatData->value( "ScriptInfo" ) : m_defaultScriptInfo ) .arg( formatData ? formatData->value( "Styles" ) : m_defaultStyles ) .arg( m_events ); for ( SubtitleIterator it( subtitle ); it.current(); ++it ) { const SubtitleLine* line = it.current(); Time showTime = line->showTime(); QString showTimeArg = builder.sprintf( "%01d:%02d:%02d.%02d", showTime.hours(), showTime.minutes(), showTime.seconds(), (showTime.mseconds() + 5)/10 ); Time hideTime = line->hideTime(); QString hideTimeArg = builder.sprintf( "%01d:%02d:%02d.%02d", hideTime.hours(), hideTime.minutes(), hideTime.seconds(), (hideTime.mseconds() + 5)/10 ); formatData = this->formatData( line ); ret += QString( formatData ? formatData->value( "Dialogue" ) : m_dialogueBuilder ) .arg( showTimeArg ) .arg( hideTimeArg ) .arg( fromSString( primary ? line->primaryText() : line->secondaryText() ) ); } return ret; } protected: SubStationAlphaOutputFormat(): OutputFormat( "SubStation Alpha", QStringList( "ssa" ) ), m_defaultScriptInfo( s_defaultScriptInfo ), m_defaultStyles( s_defaultStyles ), m_events( s_events ), m_dialogueBuilder( s_dialogueBuilder ) { } SubStationAlphaOutputFormat( const QString& name, const QStringList& extensions, const QString& scriptInfo, const QString& styles, const QString& events, const QString& dialogueBuilder ): OutputFormat( name, extensions ), m_defaultScriptInfo( scriptInfo ), m_defaultStyles( styles ), m_events( events ), m_dialogueBuilder( dialogueBuilder ) { } const QString m_defaultScriptInfo; const QString m_defaultStyles; const QString m_events; const QString m_dialogueBuilder; const QString m_textBuilder; static const char* s_defaultScriptInfo; static const char* s_defaultStyles; static const char* s_events; static const char* s_dialogueBuilder; }; const char* SubStationAlphaOutputFormat::s_defaultScriptInfo = "[Script Info]\n" "Title: Untitled\n" "ScriptType: V4.00\n" "Collisions: Normal\n" "Timer: 100\n" "WrapStyle: 0\n"; const char* SubStationAlphaOutputFormat::s_defaultStyles = "[V4 Styles]\n" "Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, " "Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding\n" "Style: Default, Sans, 24, 16777215, 16777215, 16777215, 12632256, -1, 0, 1, 1, 1, 6, 30, 30, 415, 0, 0\n"; const char* SubStationAlphaOutputFormat::s_events = "[Events]\n" "Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\n"; const char* SubStationAlphaOutputFormat::s_dialogueBuilder = "Dialogue: Marked=0,%1,%2,Default,,0000,0000,0000,,%3\n"; class AdvancedSubStationAlphaOutputFormat : public SubStationAlphaOutputFormat { friend class FormatManager; protected: AdvancedSubStationAlphaOutputFormat(): SubStationAlphaOutputFormat( "Advanced SubStation Alpha", QStringList( "ass" ), s_defaultScriptInfo, s_defaultStyles, s_events, s_dialogueBuilder ) { } static const char* s_defaultScriptInfo; static const char* s_defaultStyles; static const char* s_events; static const char* s_dialogueBuilder; }; const char* AdvancedSubStationAlphaOutputFormat::s_defaultScriptInfo = "[Script Info]\n" "Title: Untitled\n" "ScriptType: V4.00+\n" "Collisions: Normal\n" "Timer: 100\n" "WrapStyle: 0\n"; const char* AdvancedSubStationAlphaOutputFormat::s_defaultStyles = "[V4+ Styles]\n" "Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeThrough, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding\n" "Style: Default, Sans, 16, &H00FFFFFF, &H00FFFFFF, &H00674436, &HFFFFFFF8, -1, 0, 0, 0, 100, 90, 0, 0, 1, 2.1, 0.5, 2, 15, 15, 15, 0\n"; const char* AdvancedSubStationAlphaOutputFormat::s_events = "[Events]\n" "Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text\n"; const char* AdvancedSubStationAlphaOutputFormat::s_dialogueBuilder = "Dialogue: 0,%1,%2,Default,,0000,0000,0000,,%3\n"; } #endif subtitlecomposer-0.5.3/src/formats/inputformat.h0000644000175000001440000000612511151345064021320 0ustar sergiousers#ifndef INPUTFORMAT_H #define INPUTFORMAT_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "format.h" #include "../common/fileloadhelper.h" #include #include #include #include #include namespace SubtitleComposer { class InputFormat : public Format { public: virtual ~InputFormat() {} bool readSubtitle( Subtitle& subtitle, NewLine* newLine, bool primary, const KUrl& url, QTextCodec* codec, bool ignoreExtension ) const { if ( ! ignoreExtension ) { QString extension( QFileInfo( url.path() ).suffix() ); if ( ! knowsExtension( extension ) ) return false; } FileLoadHelper fileLoadHelper( url ); if ( ! fileLoadHelper.open() ) return false; QTextStream textStream( fileLoadHelper.file() ); textStream.setCodec( codec ); QString data = textStream.readAll(); fileLoadHelper.close(); if ( newLine ) { if ( data.indexOf( "\r\n" ) != -1 ) *newLine = Windows; else if ( data.indexOf( "\r" ) != -1 ) *newLine = Macintosh; else if ( data.indexOf( "\n" ) != -1 ) *newLine = UNIX; else *newLine = CurrentOS; } data.replace( "\r\n", "\n" ); data.replace( "\r", "\n" ); Subtitle newSubtitle; if ( ! parseSubtitles( newSubtitle, data ) ) return false; if ( primary ) subtitle.setPrimaryData( newSubtitle, true ); else subtitle.setSecondaryData( newSubtitle, true ); return true; } virtual bool parseSubtitles( Subtitle& subtitle, const QString& data ) const = 0; protected: InputFormat( const QString& name, const QStringList& extensions ): Format( name, extensions ) {} }; } #endif subtitlecomposer-0.5.3/src/config/0000755000175000001440000000000011206423743016367 5ustar sergiouserssubtitlecomposer-0.5.3/src/config/CMakeLists.txt0000644000175000001440000000030511151345061021120 0ustar sergiousersSET( config_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/appconfig.cpp ${CMAKE_CURRENT_SOURCE_DIR}/appconfiggroup.cpp ${CMAKE_CURRENT_SOURCE_DIR}/appconfiggroupwidget.cpp CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/config/appconfiggroupwidget.cpp0000644000175000001440000000533211151345061023320 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "appconfiggroupwidget.h" #include #include using namespace SubtitleComposer; AppConfigGroupWidget::AppConfigGroupWidget( AppConfigGroup* configGroup, QWidget* parent ): QWidget( parent, 0 ), m_config( configGroup ) { m_mainLayout = new QGridLayout( this ); m_mainLayout->setAlignment( Qt::AlignTop ); m_mainLayout->setMargin( 0 ); m_mainLayout->setSpacing( 5 ); } AppConfigGroupWidget::~AppConfigGroupWidget() { delete m_config; } const AppConfigGroup* const AppConfigGroupWidget::config() { return m_config; } void AppConfigGroupWidget::setConfig( const AppConfigGroup* const config ) { if ( config && m_config->isCompatibleWith( *config ) ) { *m_config = *config; setControlsFromConfig(); } } void AppConfigGroupWidget::setControlsFromDefaults() { m_config->loadDefaults(); setControlsFromConfig(); } QGroupBox* AppConfigGroupWidget::createGroupBox( const QString& title, bool addToLayout ) { QGroupBox* groupBox = new QGroupBox( this ); groupBox->setTitle( title ); if ( addToLayout ) m_mainLayout->addWidget( groupBox, m_mainLayout->rowCount(), 0 ); return groupBox; } QGridLayout* AppConfigGroupWidget::createGridLayout( QGroupBox* groupBox ) { QGridLayout* gridLayout = new QGridLayout( groupBox ); gridLayout->setAlignment( Qt::AlignTop ); return gridLayout; } #include "appconfiggroupwidget.moc" subtitlecomposer-0.5.3/src/config/appconfig.cpp0000644000175000001440000001165411151345061021043 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "appconfig.h" #include #include #include #include using namespace SubtitleComposer; AppConfig::AppConfig(): QObject(), m_groups() { } AppConfig::AppConfig( const AppConfig& config ): QObject(), m_groups() { for ( QMap::ConstIterator it = config.m_groups.begin(), end = config.m_groups.end(); it != end; ++it ) setGroup( it.value()->clone() ); } AppConfig& AppConfig::operator=( const AppConfig& config ) { if ( this == &config ) return *this; if ( ! isCompatibleWith( config ) ) { kDebug() << "can't assign imcompatible AppConfig instances"; return *this; } for ( QMap::ConstIterator it = config.m_groups.begin(); it != config.m_groups.end(); ++it ) setGroup( it.value()->clone() ); return *this; } AppConfig::~AppConfig() { for ( QMap::ConstIterator it = m_groups.begin(), end = m_groups.end(); it != end; ++it ) delete it.value(); } bool AppConfig::isCompatibleWith( const AppConfig& config ) { for ( QMap::ConstIterator it = m_groups.begin(), end = m_groups.end(); it != end; ++it ) { if ( ! config.m_groups.contains( it.key() ) ) return false; if ( ! it.value()->isCompatibleWith( *config.m_groups[it.key()] ) ) return false; } for ( QMap::ConstIterator it = config.m_groups.begin(), end = config.m_groups.end(); it != end; ++it ) { if ( ! m_groups.contains( it.key() ) ) return false; } return true; } void AppConfig::loadDefaults() { for ( QMap::ConstIterator it = m_groups.begin(), end = m_groups.end(); it != end; ++it ) it.value()->loadDefaults(); } void AppConfig::readFrom( const KConfig* config ) { for ( QMap::ConstIterator it = m_groups.begin(), end = m_groups.end(); it != end; ++it ) it.value()->readFrom( config ); } void AppConfig::readFrom( const KSharedConfig* config ) { for ( QMap::ConstIterator it = m_groups.begin(), end = m_groups.end(); it != end; ++it ) it.value()->readFrom( config ); } void AppConfig::writeTo( KConfig* config ) const { for ( QMap::ConstIterator it = m_groups.begin(), end = m_groups.end(); it != end; ++it ) it.value()->writeTo( config ); } void AppConfig::writeTo( KSharedConfig* config ) const { for ( QMap::ConstIterator it = m_groups.begin(), end = m_groups.end(); it != end; ++it ) it.value()->writeTo( config ); } AppConfigGroup* AppConfig::group( const QString& name ) { return m_groups.contains( name ) ? m_groups[name] : 0; } const AppConfigGroup* const AppConfig::group( const QString& name ) const { return m_groups.contains( name ) ? m_groups[name] : 0; } void AppConfig::setGroup( AppConfigGroup* group ) { if ( m_groups.contains( group->name() ) ) { *m_groups[group->name()] = *group; delete group; } else { group->m_config = this; m_groups[group->name()] = group; connect( group, SIGNAL(optionChanged(const QString&,const QString&,const QString&)), this, SIGNAL(optionChanged(const QString&,const QString&,const QString&)) ); } } AppConfigGroup* AppConfig::removeGroup( const QString& name ) { if ( m_groups.contains( name ) ) { AppConfigGroup* group = m_groups[name]; group->m_config = 0; disconnect( group, SIGNAL(optionChanged(const QString&,const QString&,const QString&)), this, SIGNAL(optionChanged(const QString&,const QString&,const QString&)) ); m_groups.remove( name ); return group; } else return 0; } #include "appconfig.moc" subtitlecomposer-0.5.3/src/config/appconfiggroup.cpp0000644000175000001440000001631411151345061022116 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "appconfiggroup.h" #include "appconfig.h" #include #include #include #include using namespace SubtitleComposer; AppConfigGroup::AppConfigGroup( const QString& name, const QMap& defaults ): QObject(), m_config( 0 ), m_name( name ), m_values(), m_defaultValues( defaults ) { loadDefaults(); } AppConfigGroup::AppConfigGroup( const AppConfigGroup& configGroup ): QObject(), m_config( 0 ), m_name( configGroup.m_name ), m_values( configGroup.m_values ), m_defaultValues( configGroup.m_defaultValues ) { } bool AppConfigGroup::equals( const QString& str1, const QString& str2 ) { return (str1.isEmpty() && str2.isEmpty()) || str1 == str2; } bool AppConfigGroup::nonEquals( const QString& str1, const QString& str2 ) { return (!str1.isEmpty() || !str2.isEmpty()) && str1 != str2; } AppConfigGroup& AppConfigGroup::operator=( const AppConfigGroup& configGroup ) { if ( this == &configGroup ) return *this; if ( ! isCompatibleWith( configGroup ) ) { kDebug() << "can't assign imcompatible AppConfigGroup instances"; return *this; } m_name = configGroup.m_name; m_defaultValues.clear(); m_defaultValues = configGroup.m_defaultValues; // this makes sure we emit the corresponding optionChanged signals for ( QMap::ConstIterator it = configGroup.m_values.begin(), end = configGroup.m_values.end(); it != end; ++it ) setOption( it.key(), it.value() ); return *this; } AppConfigGroup* AppConfigGroup::clone() const { return new AppConfigGroup( *this ); } AppConfigGroup::~AppConfigGroup() { } const QString& AppConfigGroup::name() const { return m_name; } void AppConfigGroup::loadDefaults() { for ( QMap::ConstIterator it = m_defaultValues.begin(), end = m_defaultValues.end(); it != end; ++it ) setOption( it.key(), it.value() ); } bool AppConfigGroup::isCompatibleWith( const AppConfigGroup& config ) const { for ( QMap::ConstIterator it = m_defaultValues.begin(), end = m_defaultValues.end(); it != end; ++it ) if ( ! config.m_defaultValues.contains( it.key() ) ) return false; for ( QMap::ConstIterator it = config.m_defaultValues.begin(), end = config.m_defaultValues.end(); it != end; ++it ) if ( ! m_defaultValues.contains( it.key() ) ) return false; return true; } void AppConfigGroup::readFrom( const KConfig* config ) { if ( config->hasGroup( m_name ) ) { KConfigGroup group( config->group( m_name ) ); for ( QMap::ConstIterator it = m_defaultValues.begin(), end = m_defaultValues.end(); it != end; ++it ) setOption( it.key(), group.readEntry( it.key(), it.value() ) ); } } void AppConfigGroup::readFrom( const KSharedConfig* config ) { if ( config->hasGroup( m_name ) ) { KConfigGroup group( config->group( m_name ) ); for ( QMap::ConstIterator it = m_defaultValues.begin(), end = m_defaultValues.end(); it != end; ++it ) setOption( it.key(), group.readEntry( it.key(), it.value() ) ); } } void AppConfigGroup::writeTo( KConfig* config ) const { KConfigGroup group( config->group( m_name ) ); for ( QMap::ConstIterator it = m_values.begin(), end = m_values.end(); it != end; ++it ) group.writeEntry( it.key(), it.value() ); } void AppConfigGroup::writeTo( KSharedConfig* config ) const { KConfigGroup group( config->group( m_name ) ); for ( QMap::ConstIterator it = m_values.begin(), end = m_values.end(); it != end; ++it ) group.writeEntry( it.key(), it.value() ); } QString AppConfigGroup::option( const QString& optionName ) const { return m_values.contains( optionName ) ? m_values[optionName] : QString(); } bool AppConfigGroup::optionAsBool( const QString& optionName ) const { return option( optionName ).trimmed().toLower() == "true"; } long AppConfigGroup::optionAsLong( const QString& optionName ) const { return option( optionName ).toLong(); } int AppConfigGroup::optionAsInt( const QString& optionName ) const { return option( optionName ).toInt(); } QColor AppConfigGroup::optionAsColor( const QString& optionName ) const { QColor color; color.setNamedColor( option( optionName ) ); return color; } void AppConfigGroup::setOption( const QString& optionName, const QString& value ) { if ( ! m_defaultValues.contains( optionName ) ) return; if ( ! m_values.contains( optionName ) ) { // NOTE: this condition can only triggered by operator=() m_values[optionName] = value; emit optionChanged( optionName, value ); emit optionChanged( m_name, optionName, value ); } else if ( nonEquals( m_values[optionName], value ) ) { m_values[optionName] = value; emit optionChanged( optionName, value ); emit optionChanged( m_name, optionName, value ); } } void AppConfigGroup::setOption( const QString& optionName, const char* value ) { setOption( optionName, QString( value ) ); } void AppConfigGroup::setOption( const QString& optionName, bool value ) { setOption( optionName, QString( value ? "true" : "false" ) ); } void AppConfigGroup::setOption( const QString& optionName, long value ) { setOption( optionName, QString::number( value ) ); } void AppConfigGroup::setOption( const QString& optionName, int value ) { setOption( optionName, QString::number( value ) ); } void AppConfigGroup::setOption( const QString& optionName, const QColor& value ) { setOption( optionName, value.name() ); } bool AppConfigGroup::operator==( const AppConfigGroup& configGroup ) const { for ( QMap::ConstIterator it = m_values.begin(), end = m_values.end(); it != end; ++it ) { if ( ! configGroup.m_values.contains( it.key() ) ) return false; if ( nonEquals( it.value(), configGroup.m_values[it.key()] ) ) return false; } return true; } bool AppConfigGroup::operator!=( const AppConfigGroup& configGroup ) const { return ! operator==( configGroup ); } #include "appconfiggroup.moc" subtitlecomposer-0.5.3/src/config/appconfig.h0000644000175000001440000000524211151345061020504 0ustar sergiousers#ifndef APPCONFIG_H #define APPCONFIG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "appconfiggroup.h" #include #include #include class KConfig; class KSharedConfig; namespace SubtitleComposer { class AppConfig : public QObject { Q_OBJECT public: AppConfig(); AppConfig( const AppConfig& config ); AppConfig& operator=( const AppConfig& config ); ~AppConfig(); /// returns true if config object has the same groups as this object /// and all corresponding groups are compatible between them bool isCompatibleWith( const AppConfig& config ); void loadDefaults(); void readFrom( const KConfig* config ); void readFrom( const KSharedConfig* config ); void writeTo( KConfig* config ) const; void writeTo( KSharedConfig* config ) const; AppConfigGroup* group( const QString& name ); const AppConfigGroup* const group( const QString& name ) const; void setGroup( AppConfigGroup* group ); /// ownership is transferred to this object AppConfigGroup* removeGroup( const QString& name ); /// ownership is transferred to the caller signals: void optionChanged( const QString& groupName, const QString& optionName, const QString& value ); protected: QMap m_groups; }; } #endif subtitlecomposer-0.5.3/src/config/appconfiggroup.h0000644000175000001440000000725211151345061021564 0ustar sergiousers#ifndef APPCONFIGGROUP_H #define APPCONFIGGROUP_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include class KConfig; class KSharedConfig; namespace SubtitleComposer { class AppConfig; class AppConfigGroup : public QObject { Q_OBJECT friend class AppConfig; public: /// NOTE: keys not in the defaults map are not valid AppConfigGroup( const QString& name, const QMap& defaults ); AppConfigGroup( const AppConfigGroup& config ); AppConfigGroup& operator=( const AppConfigGroup& config ); ~AppConfigGroup(); virtual AppConfigGroup* clone() const; const QString& name() const; /// returns true if config object has all the keys in this object and viceversa bool isCompatibleWith( const AppConfigGroup& config ) const; void loadDefaults(); void readFrom( const KConfig* config ); void readFrom( const KSharedConfig* config ); void writeTo( KConfig* config ) const; void writeTo( KSharedConfig* config ) const; QString option( const QString& optionName ) const; bool optionAsBool( const QString& optionName ) const; long optionAsLong( const QString& optionName ) const; int optionAsInt( const QString& optionName ) const; QColor optionAsColor( const QString& optionName ) const; void setOption( const QString& optionName, const QString& value ); void setOption( const QString& optionName, const char* value ); void setOption( const QString& optionName, bool value ); void setOption( const QString& optionName, int value ); void setOption( const QString& optionName, long value ); void setOption( const QString& optionName, const QColor& value ); bool operator==( const AppConfigGroup& configGroup ) const; bool operator!=( const AppConfigGroup& configGroup ) const; signals: void optionChanged( const QString& optionName, const QString& value ); void optionChanged( const QString& groupName, const QString& optionName, const QString& value ); protected: static bool equals( const QString& str1, const QString& str2 ); static bool nonEquals( const QString& str1, const QString& str2 ); protected: AppConfig* m_config; QString m_name; QMap m_values; QMap m_defaultValues; }; } #endif subtitlecomposer-0.5.3/src/config/appconfiggroupwidget.h0000644000175000001440000000501011151345061022756 0ustar sergiousers#ifndef APPCONFIGGROUPWIDGET_H #define APPCONFIGGROUPWIDGET_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "appconfiggroup.h" #include class QGroupBox; class QGridLayout; namespace SubtitleComposer { class AppConfigGroupWidget : public QWidget { Q_OBJECT public: /// ownership of the config object is transferred to this object explicit AppConfigGroupWidget( AppConfigGroup* configGroup, QWidget* parent=0 ); virtual ~AppConfigGroupWidget(); const AppConfigGroup* const config(); signals: void settingsChanged(); public slots: /// If possible (i.e., configs are compatible), copies the config object into /// the widget config. Ownership of config object it's not transferred. void setConfig( const AppConfigGroup* const config ); void setControlsFromDefaults(); virtual void setControlsFromConfig() = 0; virtual void setConfigFromControls() = 0; protected: QGroupBox* createGroupBox( const QString& title=QString(), bool addToLayout=true ); QGridLayout* createGridLayout( QGroupBox* groupBox ); protected: AppConfigGroup* m_config; QGridLayout* m_mainLayout; }; } #endif subtitlecomposer-0.5.3/src/player/0000755000175000001440000000000011206423743016416 5ustar sergiouserssubtitlecomposer-0.5.3/src/player/CMakeLists.txt0000644000175000001440000000251411151345071021154 0ustar sergiousersMACRO_OPTIONAL_FIND_PACKAGE( GStreamer ) IF( GSTREAMER_FOUND ) SET( HAVE_GSTREAMER 1 CACHE INTERNAL EXPORTEDVARIABLE ) ADD_SUBDIRECTORY( gstreamer ) ELSE( GSTREAMER_FOUND ) MESSAGE( STATUS "GStreamer was not found. GStreamer backend will not be built" ) ENDIF( GSTREAMER_FOUND ) ADD_SUBDIRECTORY( mplayer ) ADD_SUBDIRECTORY( phonon ) MACRO_OPTIONAL_FIND_PACKAGE( Xine ) IF( XINE_FOUND ) SET( HAVE_XINE 1 CACHE INTERNAL EXPORTEDVARIABLE ) ADD_SUBDIRECTORY( xine ) ELSE( XINE_FOUND ) MESSAGE( STATUS "Xine was not found. Xine backend will not be built" ) ENDIF( XINE_FOUND ) SET( players_INCLUDE_DIR ${players_gstreamer_INCLUDE_DIR} ${players_mplayer_INCLUDE_DIR} ${players_phonon_INCLUDE_DIR} ${players_xine_INCLUDE_DIR} CACHE INTERNAL EXPORTEDVARIABLE ) SET( players_DEFS ${players_gstreamer_DEFS} ${players_mplayer_DEFS} ${players_phonon_DEFS} ${players_xine_DEFS} CACHE INTERNAL EXPORTEDVARIABLE ) SET( players_LIBS ${players_gstreamer_LIBS} ${players_mplayer_LIBS} ${players_phonon_LIBS} ${players_xine_LIBS} CACHE INTERNAL EXPORTEDVARIABLE ) SET( players_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/player.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbackend.cpp ${CMAKE_CURRENT_SOURCE_DIR}/videowidget.cpp ${players_gstreamer_SRCS} ${players_mplayer_SRCS} ${players_phonon_SRCS} ${players_xine_SRCS} CACHE INTERNAL EXPORTEDVARIABLE ) subtitlecomposer-0.5.3/src/player/videowidget.h0000755000175000001440000000556011170243330021102 0ustar sergiousers#ifndef PLAYERVIDEOWIDGET_H #define PLAYERVIDEOWIDGET_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include class QResizeEvent; class QPaintEvent; class QMouseEvent; class QWheelEvent; namespace SubtitleComposer { class VideoWidget : public QWidget { Q_OBJECT public: explicit VideoWidget( QWidget* parent ); VideoWidget( QWidget* videoLayer, QWidget* parent ); virtual ~VideoWidget(); QWidget* videoLayer(); int videoWidth() const; int videoHeight() const; double videoDAR() const; /// if dar is <= 0, it's ignored (the dar becomes width/height) void setVideoResolution( int width, int height, double dar=0.0 ); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; double desktopAspectRatio(); QSize desktopSize(); void updateVideoLayerGeometry(); public slots: virtual void setMouseTracking( bool enable ); signals: void doubleClicked( const QPoint& point ); void rightClicked( const QPoint& point ); void leftClicked( const QPoint& point ); void wheelUp(); void wheelDown(); protected: void init( bool setVideoLayerAttributes ); virtual void resizeEvent( QResizeEvent* e); virtual void mouseReleaseEvent( QMouseEvent* e ); virtual void mouseDoubleClickEvent( QMouseEvent* e ); virtual void wheelEvent( QWheelEvent* e ); protected: QWidget* m_videoLayer; int m_videoWidth; int m_videoHeight; double m_videoDAR; }; } #endif subtitlecomposer-0.5.3/src/player/playerbackend.cpp0000755000175000001440000000446211151345071021733 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "playerbackend.h" #include "videowidget.h" #include using namespace SubtitleComposer; PlayerBackend::PlayerBackend( Player* player, AppConfigGroup* config ): QObject( 0 ), m_player( player ), m_config( config ) { } PlayerBackend::~PlayerBackend() { delete m_config; } bool PlayerBackend::isInitialized() const { return m_player->m_activeBackend == this; } bool PlayerBackend::isActiveBackend() const { return m_player->m_activeBackend == this; } bool PlayerBackend::doesVolumeCorrection() const { return false; } bool PlayerBackend::supportsChangingAudioStream( bool* onTheFly ) const { if ( onTheFly ) *onTheFly = true; return true; } void PlayerBackend::setConfig( const AppConfigGroup* const config ) { if ( config && m_config->isCompatibleWith( *config ) ) { if ( *m_config != *config ) { *m_config = *config; if ( isActiveBackend() ) m_player->reinitializeBackend(); } } } #include "playerbackend.moc" subtitlecomposer-0.5.3/src/player/mplayer/0000755000175000001440000000000011206423743020067 5ustar sergiouserssubtitlecomposer-0.5.3/src/player/mplayer/CMakeLists.txt0000644000175000001440000000051111151345071022620 0ustar sergiousersSET( players_mplayer_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/mediadata.h ${CMAKE_CURRENT_SOURCE_DIR}/mplayerbackend.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mplayerconfigwidget.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mplayerprocess.cpp CACHE INTERNAL EXPORTEDVARIABLE ) INSTALL( FILES input.conf DESTINATION ${DATA_INSTALL_DIR}/subtitlecomposer ) subtitlecomposer-0.5.3/src/player/mplayer/mediadata.h0000755000175000001440000000445711151345071022162 0ustar sergiousers#ifndef MEDIADATA_H #define MEDIADATA_H /*************************************************************************** * smplayer, GUI front-end for mplayer. * * Copyright (C) 2007 Ricardo Villalba (rvm@escomposlinux.org) * * * * modified for inclusion in Subtitle Composer * * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include namespace SubtitleComposer { class TrackData { public: QString name; QString language; }; class MediaData { public: MediaData() { reset(); }; void reset() { duration = 0; hasVideo = false; videoWidth = 0; videoHeight = 0; videoDAR = 4.0/3.0; videoFPS = 0.0; audioTracks.clear(); } double duration; int videoWidth; int videoHeight; double videoDAR; double videoFPS; bool hasVideo; QMap audioTracks; }; } #endif subtitlecomposer-0.5.3/src/player/mplayer/mplayerconfigwidget.h0000644000175000001440000000463011151345071024302 0ustar sergiousers#ifndef MPLAYERCONFIGWIDGET_H #define MPLAYERCONFIGWIDGET_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "mplayerconfig.h" #include "../../config/appconfiggroupwidget.h" class QCheckBox; class KComboBox; class KIntSpinBox; class KUrlRequester; namespace SubtitleComposer { class MPlayerConfigWidget : public AppConfigGroupWidget { Q_OBJECT friend class MPlayerBackend; public: virtual ~MPlayerConfigWidget(); virtual void setControlsFromConfig(); virtual void setConfigFromControls(); private: explicit MPlayerConfigWidget( QWidget* parent=0 ); MPlayerConfig* config() { return static_cast( m_config ); }; private: QCheckBox* m_frameDropCheckBox; QCheckBox* m_hardFrameDropCheckBox; KComboBox* m_videoOutputComboBox; QCheckBox* m_videoOutputCheckBox; KComboBox* m_audioOutputComboBox; KIntSpinBox* m_avsyncSpinBox; QCheckBox* m_volumeNormalizationCheckBox; QCheckBox* m_avsyncCheckBox; QCheckBox* m_audioOutputCheckBox; KUrlRequester* m_pathUrlRequester; }; } #endif subtitlecomposer-0.5.3/src/player/mplayer/mplayerbackend.cpp0000755000175000001440000001724611151345071023565 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * based on smplayer by Ricardo Villalba * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "mplayerbackend.h" #include "mplayerconfigwidget.h" #include "mplayerprocess.h" #include "mediadata.h" #include "../../common/qxtsignalwaiter.h" #include #include #include using namespace SubtitleComposer; MPlayerBackend::MPlayerBackend( Player* player ): PlayerBackend( player, new MPlayerConfig() ), m_process( new MPlayerProcess( config(), this ) ), m_position( 0.0 ), m_reportUpdates( true ) { connect( m_process, SIGNAL(mediaDataLoaded()), this, SLOT(onMediaDataLoaded()) ); connect( m_process, SIGNAL(playingReceived()), this, SLOT(onPlayingReceived()) ); connect( m_process, SIGNAL(pausedReceived()), this, SLOT(onPausedReceived()) ); connect( m_process, SIGNAL(positionReceived(double)), this, SLOT(onPositionReceived(double)) ); connect( m_process, SIGNAL(processExited()), this, SLOT(onProcessExited()) ); } MPlayerBackend::~MPlayerBackend() { if ( isInitialized() ) _finalize(); } VideoWidget* MPlayerBackend::initialize( QWidget* videoWidgetParent ) { return new VideoWidget( videoWidgetParent ); } void MPlayerBackend::finalize() { _finalize(); } void MPlayerBackend::_finalize() { } SubtitleComposer::AppConfigGroupWidget* MPlayerBackend::newAppConfigGroupWidget( QWidget* parent ) { return new MPlayerConfigWidget( parent ); } bool MPlayerBackend::openFile( const QString& filePath, bool& playingAfterCall ) { m_position = 0.0; playingAfterCall = true; if ( ! m_process->start( filePath, (int)m_player->videoWidget()->videoLayer()->winId(), m_player->activeAudioStream(), m_player->audioStreams().count() ) ) return false; return true; } void MPlayerBackend::closeFile() { } bool MPlayerBackend::stop() { if ( m_process->state() == QProcess::NotRunning ) return true; if ( ! m_player->isApplicationClosingDown() ) { // NOTE the quit message is not processed when the application // is closing down so we don't even send it because it would // just be a waste of 3 seconds. m_process->sendQuit(); m_process->waitForFinished( 3000 ); } if ( m_process->state() == QProcess::Running ) { m_process->terminate(); m_process->waitForFinished( 3000 ); } if ( m_process->state() == QProcess::Running ) { m_process->kill(); m_process->waitForFinished( 3000 ); } //return m_process->state() == QProcess::NotRunning; return true; } bool MPlayerBackend::play() { if ( m_process->state() == QProcess::NotRunning ) // player state was Ready { m_position = 0.0; if ( ! m_process->start( m_player->filePath(), (int)m_player->videoWidget()->videoLayer()->winId(), m_player->activeAudioStream(), m_player->audioStreams().count() ) ) return false; if ( m_process->state() == QProcess::NotRunning ) return false; // process ended prematurely } else // player state was Playing or Paused m_process->sendTogglePause(); return true; } bool MPlayerBackend::pause() { if ( m_process->state() == QProcess::NotRunning ) // player state was Ready { m_position = 0.0; if ( ! m_process->start( m_player->filePath(), (int)m_player->videoWidget()->videoLayer()->winId(), m_player->activeAudioStream(), m_player->audioStreams().count() ) ) return false; if ( m_process->state() == QProcess::NotRunning ) return false; // process ended prematurely m_process->sendTogglePause(); } else // player state was Playing or Paused m_process->sendTogglePause(); return true; } bool MPlayerBackend::seek( double seconds, bool accurate ) { if ( accurate ) { bool wasPaused = m_player->isPaused(); bool wasMuted = m_player->isMuted(); m_reportUpdates = false; if ( ! wasPaused ) m_process->sendTogglePause(); if ( ! wasMuted ) m_process->sendToggleMute(); double seekPosition = seconds; do { m_process->sendSeek( seekPosition ); if ( seekPosition > 0.0 ) { seekPosition -= 1.0; if ( seekPosition < 0.0 ) seekPosition = 0.0; } else break; } while ( m_position > seconds ); if ( ! wasMuted ) m_process->sendToggleMute(); if ( ! wasPaused ) m_process->sendTogglePause(); m_reportUpdates = true; m_player->updatePosition( m_position ); } else m_process->sendFastSeek( seconds ); return true; } bool MPlayerBackend::setActiveAudioStream( int audioStream ) { if ( m_process->state() != QProcess::NotRunning ) { bool wasMuted = m_player->isMuted(); m_process->sendAudioStream( audioStream ); m_process->sendVolume( m_player->volume() ); if ( wasMuted ) m_process->sendToggleMute(); } return true; } bool MPlayerBackend::setVolume( double volume ) { m_process->sendVolume( volume ); return true; } void MPlayerBackend::onMediaDataLoaded() { const MediaData& mediaData = m_process->mediaData(); QStringList audioStreams; for ( QMap::ConstIterator it = mediaData.audioTracks.begin(), end = mediaData.audioTracks.end(); it != end; ++it) { QString audioStreamName; if ( ! it.value().language.isEmpty() ) audioStreamName = it.value().language; if ( ! it.value().name.isEmpty() ) { if ( ! audioStreamName.isEmpty() ) audioStreamName += " / "; audioStreamName += it.value().name; } if ( audioStreamName.isEmpty() ) audioStreamName = i18n( "Audio Stream #%1", it.key() ); audioStreams << audioStreamName; } if ( mediaData.videoWidth && mediaData.videoHeight ) { m_player->videoWidget()->setVideoResolution( mediaData.videoWidth, mediaData.videoHeight, mediaData.videoDAR ); } m_player->updateAudioStreams( audioStreams, audioStreams.isEmpty() ? -1 : 0 ); if ( mediaData.duration ) m_player->updateLength( mediaData.duration ); if ( mediaData.videoFPS ) m_player->updateFramesPerSecond( mediaData.videoFPS ); } void MPlayerBackend::onPlayingReceived() { if ( ! m_reportUpdates ) return; m_player->updateState( Player::Playing ); } void MPlayerBackend::onPausedReceived() { if ( ! m_reportUpdates ) return; m_player->updateState( Player::Paused ); } void MPlayerBackend::onPositionReceived( double seconds ) { m_position = seconds; if ( ! m_reportUpdates ) return; if ( ! m_player->isPlaying() ) m_player->updateState( Player::Playing ); m_player->updatePosition( seconds ); } void MPlayerBackend::onProcessExited() { m_player->updateState( Player::Ready ); } #include "mplayerbackend.moc" subtitlecomposer-0.5.3/src/player/mplayer/mplayerconfig.h0000755000175000001440000001277111151345071023106 0ustar sergiousers#ifndef MPLAYERCONFIG_H #define MPLAYERCONFIG_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "../../config/appconfiggroup.h" #include namespace SubtitleComposer { class MPlayerConfig : public AppConfigGroup { friend class MPlayerBackend; friend class MPlayerConfigWidget; public: virtual AppConfigGroup* clone() const { return new MPlayerConfig( *this ); } QString executablePath() const { return option( keyExecutablePath() ); } void setExecutablePath( const QString& execPath ) { setOption( keyExecutablePath(), execPath ); } bool hasAudioOutput() const { return ! option( keyAudioOutput() ).isEmpty(); } QString audioOutput() const { return option( keyAudioOutput() ); } void setAudioOutput( const QString& audioOutput ) { setOption( keyAudioOutput(), audioOutput ); } bool hasVideoOutput() const { return ! option( keyVideoOutput() ).isEmpty(); } QString videoOutput() const { return option( keyVideoOutput() ); } void setVideoOutput( const QString& videoOutput ) { setOption( keyVideoOutput(), videoOutput ); } bool hasCacheSize() const { return ! option( keyCacheSize() ).isEmpty(); } int cacheSize() const { return optionAsInt( keyCacheSize() ); } /// in kbytes void setCacheSize( int kbytes ) { setOption( keyCacheSize(), kbytes < 0 ? "" : QString::number( kbytes ) ); } bool volumeNormalizationEnabled() const { return optionAsBool( keyVolumeNormalizationEnabled() ); } void setVolumeNormalizationEnabled( bool enabled ) { setOption( keyVolumeNormalizationEnabled(), enabled ); } bool hasInputConfigPath() const { return ! option( keyInputConfigPath() ).isEmpty(); } QString inputConfigPath() const { return option( keyInputConfigPath() ); } void setInputConfigPath( const QString& inputConfigPath ) { setOption( keyInputConfigPath(), inputConfigPath ); } bool frameDropping() const { return optionAsBool( keyFrameDropping() ); } void setFrameDropping( bool frameDropping ) { setOption( keyFrameDropping(), frameDropping ); } bool hardFrameDropping() const { return optionAsBool( keyHardFrameDropping() ); } void setHardFrameDropping( bool hardFrameDropping ) { setOption( keyHardFrameDropping(), hardFrameDropping ); } bool hasAutoSyncFactor() const { return ! option( keyAutoSyncFactor() ).isEmpty(); } int autoSyncFactor() const { return optionAsInt( keyAutoSyncFactor() ); } void setAutoSyncFactor( int factor ) { setOption( keyAutoSyncFactor(), factor < 0 ? "" : QString::number( factor ) );} static const QString& keyExecutablePath() { static const QString key( "ExecutablePath" ); return key; } static const QString& keyAudioOutput() { static const QString key( "AudioOutput" ); return key; } static const QString& keyVideoOutput() { static const QString key( "VideoOutput" ); return key; } static const QString& keyCacheSize() { static const QString key( "CacheSize" ); return key; } static const QString& keyVolumeNormalizationEnabled() { static const QString key( "VolumeNormalizationEnabled" ); return key; } static const QString& keyInputConfigPath() { static const QString key( "InputConfigPath" ); return key; } static const QString& keyFrameDropping() { static const QString key( "FrameDropping" ); return key; } static const QString& keyHardFrameDropping() { static const QString key( "HardFrameDropping" ); return key; } static const QString& keyAutoSyncFactor() { static const QString key( "AutoSyncFactor" ); return key; } private: MPlayerConfig():AppConfigGroup( "MPlayer", defaults() ) {} MPlayerConfig( const MPlayerConfig& config ):AppConfigGroup( config ) {} static QMap defaults() { QMap defaults; defaults[keyExecutablePath()] = "mplayer"; defaults[keyAudioOutput()] = ""; defaults[keyVideoOutput()] = ""; defaults[keyCacheSize()] = "5120"; // in kbytes defaults[keyVolumeNormalizationEnabled()] = "false"; defaults[keyInputConfigPath()] = KGlobal::dirs()->locate( "appdata", "input.conf" ); defaults[keyFrameDropping()] = "false"; defaults[keyHardFrameDropping()] = "false"; defaults[keyAutoSyncFactor()] = ""; return defaults; } }; } #endif subtitlecomposer-0.5.3/src/player/mplayer/mplayerprocess.cpp0000755000175000001440000002755511151345071023660 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * based on smplayer by Ricardo Villalba * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "mplayerprocess.h" #include "../../common/qxtsignalwaiter.h" #include #include #include #include using namespace SubtitleComposer; MPlayerProcess::MPlayerProcess( const MPlayerConfig* const config, QObject* parent ): QProcess( parent ), m_config( config ), m_mediaData(), m_incompleteLine(), m_isMediaDataLoaded( false ), m_isPaused( false ), m_emitPlaying( false ), m_positionRegExp( "^[AV]: *([0-9,:.-]+)" ), m_videoFrameRegExp( "^[AV]:.* (\\d+)\\/.\\d+" ), m_generalTagRegExp( "^(ID_.*)=(.*)" ), m_audioTagRegExp( "^ID_AID_(\\d+)_(LANG|NAME)=(.*)" ), m_pausedTagRegExp( "^ID_PAUSED" ) { connect( this, SIGNAL(readyReadStandardOutput()), this, SLOT(onReadyReadStandardOutput()) ); connect( this, SIGNAL(bytesWritten(qint64)), this, SLOT(onWroteToStdin()) ); connect( &m_commandsQueueTimer, SIGNAL(timeout()), this, SLOT(onTimeout()) ); connect( this, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(onStateChanged(QProcess::ProcessState)) ); } MPlayerProcess::~MPlayerProcess() { } const MediaData& MPlayerProcess::mediaData() { return m_mediaData; } bool MPlayerProcess::start( const QString& filePath, int winId, int audioStream, int audioStreamCount ) { if ( KStandardDirs::findExe( m_config->executablePath() ).isEmpty() ) return false; m_mediaData.reset(); m_isMediaDataLoaded = false; m_isPaused = false; m_emitPlaying = false; m_incompleteLine.clear(); QStringList args; if ( audioStream >= 0 && audioStreamCount > 1 ) args << "-aid" << QString::number( audioStream ); args << "-noquiet"; args << "-nofs"; // No mplayer fullscreen mode args << "-identify"; // makes mplayer emit all kinds of additional information args << "-slave"; // enable slave mode so we can sent commands to mplayer process if ( m_config->hasVideoOutput() ) args << "-vo" << m_config->videoOutput(); if ( m_config->hasAudioOutput() ) args << "-ao" << m_config->audioOutput(); args << "-zoom"; // allow software scaling where hardware scaling is unavaliable args << "-nokeepaspect"; // do not keep window aspect ratio when resizing windows if ( m_config->frameDropping() ) args << "-framedrop"; if ( m_config->hardFrameDropping() ) args << "-hardframedrop"; if ( m_config->hasAutoSyncFactor() ) args << "-autosync" << QString::number( m_config->autoSyncFactor() ); if ( m_config->hasInputConfigPath() ) args << "-input" << "conf=" + m_config->inputConfigPath(); args << "-wid" << QString::number( winId ); // set window id so that it gets embedded in our window args << "-noautosub"; // turn off automatic subtitle file loading if ( m_config->hasCacheSize() ) { args << "-cache" << QString::number( m_config->cacheSize() ); args << "-cache-min" << QString::number( 99 ); args << "-cache-seek-min" << QString::number( 99 ); } args << "-osdlevel" << QString::number( 0 ); // no OSD if ( m_config->volumeNormalizationEnabled() ) args << "-af" << "volnorm=2"; // set volume normalization args << "-softvol" << "-softvol-max" << QString::number( 100 ); // maximum software volume level args << filePath; QProcess::start( KStandardDirs::findExe( m_config->executablePath() ), args ); return waitForStarted( -1 ); } void MPlayerProcess::sendTogglePause() { if ( m_isPaused ) // set playing sendCommand( "pause", Playing, false ); else // set paused sendCommand( "pause", Pausing, true ); } void MPlayerProcess::sendSeek( double seconds ) { sendCommand( QByteArray( "seek % 2" ).replace( '%', QByteArray::number( seconds ) ), PausingKeep, true ); } void MPlayerProcess::sendFastSeek( double seconds ) { const QByteArray seek( "seek" ); for ( QList::Iterator it = m_commandsQueue.begin(), end = m_commandsQueue.end(); it != end; ) { if ( (*it).contains( seek ) ) it = m_commandsQueue.erase( it ); else ++it; } queueCommand( QByteArray( "seek % 2" ).replace( '%', QByteArray::number( seconds ) ), PausingKeep ); } void MPlayerProcess::sendToggleMute() { sendCommand( "mute", PausingKeep, true ); } void MPlayerProcess::sendVolume( double volume ) { sendCommand( QByteArray( "volume % 1" ).replace( '%', QByteArray::number( volume ) ), PausingKeep, false ); } void MPlayerProcess::sendAudioStream( int audioStream ) { sendCommand( QByteArray( "switch_audio %" ).replace( '%', QByteArray::number( audioStream ) ), PausingKeep, false ); } void MPlayerProcess::sendQuit() { sendCommand( "quit", PausingKeep, false ); } void MPlayerProcess::sendCommand( const char* cmd, MPlayerProcess::CommandMode mode, bool block ) { sendCommand( QByteArray( cmd ), mode, block ); } void MPlayerProcess::sendCommand( const QByteArray& cmd, MPlayerProcess::CommandMode mode, bool block ) { static int count = 0; if ( count ) { kDebug() << "call to sendCommand already in progress"; return; } if ( state() != QProcess::Running ) return; count++; if ( mode == Pausing || (mode == PausingKeep && m_isPaused) ) { // kDebug() << "sending pausing" << cmd; if ( block ) { QxtSignalWaiter pauseWaiter( this, SIGNAL(pausedReceived()) ); write( "pausing " + cmd + '\n' ); // kDebug() << "WAITING"; if ( ! pauseWaiter.wait( 5000 ) ) kDebug() << ">>>>>>>TIMEDOUT<<<<<<<"; // kDebug() << "WAITED"; } else { write( "pausing " + cmd + '\n' ); } } else // if ( mode == Playing || (mode == PausingKeep && ! m_isPaused) ) { // kDebug() << "sending" << cmd; if ( block ) { QxtSignalWaiter playingWaiter( this, SIGNAL(playingReceived()) ); m_emitPlaying = true; // to make the playingReceived() signal be emmited again write( cmd + '\n' ); // kDebug() << "WAITING"; if ( ! playingWaiter.wait( 5000 ) ) kDebug() << ">>>>>>TIMEDOUT<<<<<<<"; // kDebug() << "WAITED"; } else { write( cmd + '\n' ); } } count--; } void MPlayerProcess::queueCommand( const char* cmd, CommandMode mode ) { queueCommand( QByteArray( cmd ), mode ); } void MPlayerProcess::queueCommand( const QByteArray& cmd, MPlayerProcess::CommandMode mode ) { switch ( mode ) { case Pausing: m_commandsQueue.append( "pausing " + cmd + '\n' ); break; case PausingKeep: m_commandsQueue.append( "pausing_keep " + cmd + '\n' ); break; case Playing: m_commandsQueue.append( cmd + '\n' ); break; } if ( ! m_commandsQueueTimer.isActive() ) m_commandsQueueTimer.start( 100 ); } void MPlayerProcess::onReadyReadStandardOutput() { QByteArray newData = readAllStandardOutput(); if ( ! newData.size() ) return; m_incompleteLine.append( newData ); m_incompleteLine.replace( 0x0D, '\n' ); for ( int idx = m_incompleteLine.indexOf( '\n' ); idx > -1; idx = m_incompleteLine.indexOf( '\n' ) ) { parseLine( QString::fromLocal8Bit( m_incompleteLine.left( idx ).constData() ) ); m_incompleteLine = m_incompleteLine.mid( idx + 1 ); } } void MPlayerProcess::onWroteToStdin() { if ( m_commandsQueue.empty() ) return; m_commandsQueue.removeFirst(); } void MPlayerProcess::onTimeout() { if ( ! m_commandsQueue.empty() ) write( m_commandsQueue.first() ); else m_commandsQueueTimer.stop(); } void MPlayerProcess::onStateChanged( QProcess::ProcessState newState ) { if ( newState == QProcess::NotRunning ) emit processExited(); } void MPlayerProcess::parseLine( const QString& line ) { if ( line.isEmpty() ) return; // kDebug() << line; if ( m_mediaData.videoFPS != 0.0 && m_videoFrameRegExp.indexIn( line ) > -1 ) { // try to parse the position from the reported frame number if ( ! m_isMediaDataLoaded ) { emit mediaDataLoaded(); m_isMediaDataLoaded = true; } if ( m_isPaused || m_emitPlaying ) { m_isPaused = false; m_emitPlaying = false; emit playingReceived(); } double position = m_videoFrameRegExp.cap( 1 ).toInt() / m_mediaData.videoFPS; if ( m_positionRegExp.indexIn( line ) > -1 ) { double aux = m_positionRegExp.cap( 1 ).toDouble(); if ( position - aux > 0.5 || position - aux < -0.5 ) // mplayer is reporting badly, use inaccurate (but safe) value instead position = aux; } emit positionReceived( position ); } else if ( m_positionRegExp.indexIn( line ) > -1 ) { // parse the reported position in seconds if ( ! m_isMediaDataLoaded ) { // in newer versions of mplayer, we must explicitly // hide the subtitles for formats with embedded ones sendCommand( "sub_select -1", PausingKeep, false ); emit mediaDataLoaded(); m_isMediaDataLoaded = true; } if ( m_isPaused || m_emitPlaying ) { m_isPaused = false; m_emitPlaying = false; emit playingReceived(); } emit positionReceived( m_positionRegExp.cap( 1 ).toDouble() ); } else { // pause toggled if ( m_pausedTagRegExp.indexIn( line ) > -1 ) { m_isPaused = ! m_isPaused; if ( m_isPaused ) emit pausedReceived(); else emit playingReceived(); } // The following things are not sent when the file has started to play // (or if sent, smplayer will ignore anyway...) // So not process anymore, if video is playing to save some time if ( m_isMediaDataLoaded ) return; // Matroska audio if ( m_audioTagRegExp.indexIn( line ) > -1 ) { int ID = m_audioTagRegExp.cap( 1 ).toInt(); if ( m_audioTagRegExp.cap( 2 ) == "NAME" ) m_mediaData.audioTracks[ID].name = m_audioTagRegExp.cap( 3 ); else m_mediaData.audioTracks[ID].language = m_audioTagRegExp.cap( 3 ); } else // Generic things if ( m_generalTagRegExp.indexIn( line ) > -1 ) { QString tag = m_generalTagRegExp.cap( 1 ); QString value = m_generalTagRegExp.cap( 2 ); if ( tag == "ID_AUDIO_ID" ) // Generic audio { int ID = value.toInt(); if ( ! m_mediaData.audioTracks.contains( ID ) ) m_mediaData.audioTracks.insert( ID, TrackData() ); } else if ( tag == "ID_LENGTH" ) m_mediaData.duration = value.toDouble(); else if ( tag == "ID_VIDEO_WIDTH" ) { m_mediaData.hasVideo = true; m_mediaData.videoWidth = value.toInt(); } else if ( tag == "ID_VIDEO_HEIGHT" ) { m_mediaData.hasVideo = true; m_mediaData.videoHeight = value.toInt(); } else if ( tag == "ID_VIDEO_ASPECT" ) { m_mediaData.hasVideo = true; m_mediaData.videoDAR = value.toDouble(); if ( m_mediaData.videoDAR == 0.0 && m_mediaData.videoWidth != 0.0 && m_mediaData.videoHeight != 0 ) m_mediaData.videoDAR = (double) m_mediaData.videoWidth / m_mediaData.videoHeight; } else if ( tag == "ID_VIDEO_FPS" ) { bool ok; m_mediaData.videoFPS = value.toDouble( &ok ); if ( ! ok ) m_mediaData.videoFPS = 0.0; } } } } #include "mplayerprocess.moc" subtitlecomposer-0.5.3/src/player/mplayer/mplayerbackend.h0000755000175000001440000000553511151345071023230 0ustar sergiousers#ifndef MPLAYERBACKEND_H #define MPLAYERBACKEND_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * based on smplayer by Ricardo Villalba * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "mplayerconfig.h" #include "../playerbackend.h" #include #include namespace SubtitleComposer { class MPlayerProcess; class MVideoWidget; class MPlayerBackend : public PlayerBackend { Q_OBJECT public: MPlayerBackend( Player* player ); virtual ~MPlayerBackend(); const MPlayerConfig* const config() { return static_cast( PlayerBackend::config() ); } virtual AppConfigGroupWidget* newAppConfigGroupWidget( QWidget* parent ); protected: virtual VideoWidget* initialize( QWidget* videoWidgetParent ); virtual void finalize(); void _finalize(); virtual bool openFile( const QString& filePath, bool& playingAfterCall ); virtual void closeFile(); virtual bool play(); virtual bool pause(); virtual bool seek( double seconds, bool accurate ); virtual bool stop(); virtual bool setActiveAudioStream( int audioStream ); virtual bool setVolume( double volume ); protected slots: void onMediaDataLoaded(); void onPlayingReceived(); void onPausedReceived(); void onProcessExited(); void onPositionReceived( double seconds ); protected: void setupProcessArgs( const QString& filePath ); protected: MPlayerProcess* m_process; double m_position; bool m_reportUpdates; }; } #endif subtitlecomposer-0.5.3/src/player/mplayer/mplayerprocess.h0000755000175000001440000000727511151345071023322 0ustar sergiousers#ifndef MPLAYERPROCESS_H #define MPLAYERPROCESS_H /*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * based on smplayer by Ricardo Villalba * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "mediadata.h" #include "mplayerconfig.h" #include #include #include #include #include #include #include namespace SubtitleComposer { class MPlayerProcess : public QProcess { Q_OBJECT friend class MPlayer; public: explicit MPlayerProcess( const MPlayerConfig* const, QObject* parent=0 ); virtual ~MPlayerProcess(); const MediaData& mediaData(); /** returns false only if the executable couldn't be found (in which case the process could not be started) */ bool start( const QString& filePath, int winId, int audioStream=-1, int audioStreamCount=1 ); void sendTogglePause(); void sendSeek( double seconds ); void sendFastSeek( double seconds ); void sendToggleMute(); void sendVolume( double volume ); void sendAudioStream( int audioStream ); void sendQuit(); signals: void mediaDataLoaded(); void playingReceived(); void pausedReceived(); void positionReceived( double seconds ); void processExited(); private slots: void onReadyReadStandardOutput(); void onWroteToStdin(); void onTimeout(); void onStateChanged( QProcess::ProcessState newState ); private: /// indicates in which state the player is left after the execution /// of a command: playing, paused or the same as before. typedef enum { Playing, Pausing, PausingKeep } CommandMode; void sendCommand( const char* cmd, CommandMode mode, bool block ); void sendCommand( const QByteArray& cmd, CommandMode mode, bool block ); void queueCommand( const char* cmd, CommandMode mode ); void queueCommand( const QByteArray& cmd, CommandMode mode ); void parseLine( const QString& line ); private: const MPlayerConfig* const m_config; MediaData m_mediaData; QList m_commandsQueue; QTimer m_commandsQueueTimer; QByteArray m_incompleteLine; bool m_isMediaDataLoaded; bool m_isPaused; bool m_emitPlaying; QRegExp m_positionRegExp; QRegExp m_videoFrameRegExp; QRegExp m_generalTagRegExp; QRegExp m_audioTagRegExp; QRegExp m_pausedTagRegExp; }; } #endif subtitlecomposer-0.5.3/src/player/mplayer/input.conf0000644000175000001440000000164311151345071022075 0ustar sergiousers## prevent mplayer from messing up our shortcuts RIGHT gui_about LEFT gui_about DOWN gui_about UP gui_about PGUP gui_about PGDWN gui_about - gui_about + gui_about ESC gui_about ENTER gui_about SPACE pausing_keep gui_about HOME gui_about END gui_about > gui_about < gui_about INS gui_about DEL gui_about [ gui_about ] gui_about { gui_about } gui_about BS gui_about TAB gui_about . gui_about # gui_about @ gui_about ! gui_about 9 gui_about / gui_about 0 gui_about * gui_about 1 gui_about 2 gui_about 3 gui_about 4 gui_about 5 gui_about 6 gui_about 7 gui_about 8 gui_about a gui_about b gui_about c gui_about d gui_about e gui_about F invalid_command f invalid_command g gui_about h gui_about i gui_about j gui_about k gui_about l gui_about m gui_about n gui_about o gui_about p gui_about q gui_about r gui_about s gui_about t gui_about T gui_about u gui_about v gui_about w gui_about x gui_about y gui_about z gui_about S gui_about subtitlecomposer-0.5.3/src/player/mplayer/mplayerconfigwidget.cpp0000644000175000001440000001724011151345071024636 0ustar sergiousers/*************************************************************************** * Copyright (C) 2007-2009 Sergio Pistone (sergio_pistone@yahoo.com.ar) * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "mplayerconfigwidget.h" #include #include #include #include #include #include #include #include using namespace SubtitleComposer; MPlayerConfigWidget::MPlayerConfigWidget( QWidget* parent ): AppConfigGroupWidget( new MPlayerConfig(), parent ) { QGroupBox* generalGroupBox = createGroupBox( i18nc( "@title:group General settings", "General" ) ); QLabel* pathLabel = new QLabel( generalGroupBox ); pathLabel->setText( i18n( "Executable path:" ) ); m_pathUrlRequester = new KUrlRequester( generalGroupBox ); m_pathUrlRequester->setWindowTitle( i18n( "Select the MPlayer executable" ) ); m_pathUrlRequester->setMode( KFile::File|KFile::ExistingOnly|KFile::LocalOnly ); m_pathUrlRequester->setUrl( KUrl( "mplayer" ) ); QGroupBox* videoGroupBox = createGroupBox( i18nc( "@title:group Video settings", "Video" ) ); m_videoOutputCheckBox = new QCheckBox( videoGroupBox ); m_videoOutputCheckBox->setText( i18n( "Video output driver:" ) ); m_videoOutputComboBox = new KComboBox( false, videoGroupBox ); m_videoOutputComboBox->setEnabled( false ); m_videoOutputComboBox->setEditable( true ); m_videoOutputComboBox->addItems( QString( "xv xvmc x11 gl gl2 sdl tdfxfb s3fb xover dga ggi fbdev fbdev2 v4l2 bl directfb dfbmga null" ).split( ' ' ) ); m_frameDropCheckBox = new QCheckBox( videoGroupBox ); m_frameDropCheckBox->setText( i18n( "Allow frame dropping" ) ); m_hardFrameDropCheckBox = new QCheckBox( videoGroupBox ); m_hardFrameDropCheckBox->setText( i18n( "Allow hard frame dropping" ) ); QGroupBox* audioGroupBox = createGroupBox( i18nc( "@title:group Audio settings", "Audio" ) ); m_audioOutputCheckBox = new QCheckBox( audioGroupBox ); m_audioOutputCheckBox->setText( i18n( "Audio output driver:" ) ); m_audioOutputComboBox = new KComboBox( false, audioGroupBox ); m_audioOutputComboBox->setEnabled( false ); m_audioOutputComboBox->setEditable( true ); m_audioOutputComboBox->addItems( QString( "alsa oss esd jack nas sdl openal v4l2 null" ).split( ' ' ) ); m_avsyncCheckBox = new QCheckBox( audioGroupBox ); m_avsyncCheckBox->setText( i18n( "A/V synchronization factor:" ) ); m_avsyncSpinBox = new KIntSpinBox( audioGroupBox ); m_avsyncSpinBox->setEnabled( false ); m_avsyncSpinBox->setMinimum( 0 ); m_avsyncSpinBox->setMaximum( 50 ); m_volumeNormalizationCheckBox = new QCheckBox( audioGroupBox ); m_volumeNormalizationCheckBox->setText( i18n( "Volume normalization" ) ); QGridLayout* generalLayout = createGridLayout( generalGroupBox ); generalLayout->addWidget( pathLabel, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); generalLayout->addWidget( m_pathUrlRequester, 0, 1 ); QGridLayout* videoLayout = createGridLayout( videoGroupBox ); videoLayout->addWidget( m_videoOutputCheckBox, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); videoLayout->addWidget( m_videoOutputComboBox, 0, 1 ); videoLayout->addWidget( m_frameDropCheckBox, 1, 0, 1, 2 ); videoLayout->addWidget( m_hardFrameDropCheckBox, 2, 0, 1, 2 ); QGridLayout* audioLayout = createGridLayout( audioGroupBox ); audioLayout->addWidget( m_audioOutputCheckBox, 0, 0, Qt::AlignRight|Qt::AlignVCenter ); audioLayout->addWidget( m_audioOutputComboBox, 0, 1 ); audioLayout->addWidget( m_avsyncCheckBox, 1, 0, Qt::AlignRight|Qt::AlignVCenter ); audioLayout->addWidget( m_avsyncSpinBox, 1, 1 ); audioLayout->addWidget( m_volumeNormalizationCheckBox, 2, 0, 1, 2 ); connect( m_audioOutputCheckBox, SIGNAL( toggled(bool) ), m_audioOutputComboBox, SLOT( setEnabled(bool) ) ); connect( m_avsyncCheckBox, SIGNAL( toggled(bool) ), m_avsyncSpinBox, SLOT( setEnabled(bool) ) ); connect( m_videoOutputCheckBox, SIGNAL( toggled(bool) ), m_videoOutputComboBox, SLOT( setEnabled(bool) ) ); connect( m_pathUrlRequester, SIGNAL( textChanged(const QString&) ), this, SIGNAL( settingsChanged() ) ); connect( m_audioOutputCheckBox, SIGNAL( toggled(bool) ), this, SIGNAL( settingsChanged() ) ); connect( m_avsyncCheckBox, SIGNAL( toggled(bool) ), this, SIGNAL( settingsChanged() ) ); connect( m_volumeNormalizationCheckBox, SIGNAL( toggled(bool) ), this, SIGNAL( settingsChanged() ) ); connect( m_videoOutputCheckBox, SIGNAL( toggled(bool) ), this, SIGNAL( settingsChanged() ) ); connect( m_frameDropCheckBox, SIGNAL( toggled(bool) ), this, SIGNAL( settingsChanged() ) ); connect( m_hardFrameDropCheckBox, SIGNAL( toggled(bool) ), this, SIGNAL( settingsChanged() ) ); connect( m_audioOutputComboBox, SIGNAL( textChanged(const QString&) ), this, SIGNAL( settingsChanged() ) ); connect( m_avsyncSpinBox, SIGNAL( valueChanged(int) ), this, SIGNAL( settingsChanged() ) ); connect( m_videoOutputComboBox, SIGNAL( textChanged(const QString&) ), this, SIGNAL( settingsChanged() ) ); setControlsFromConfig(); } MPlayerConfigWidget::~MPlayerConfigWidget() { } void MPlayerConfigWidget::setConfigFromControls() { config()->setExecutablePath( m_pathUrlRequester->url().path() ); config()->setAudioOutput( m_audioOutputCheckBox->isChecked() ? m_audioOutputComboBox->currentText() : QString() ); config()->setVolumeNormalizationEnabled( m_volumeNormalizationCheckBox->isChecked() ); config()->setAutoSyncFactor( m_avsyncCheckBox->isChecked() ? m_avsyncSpinBox->value() : -1 ); config()->setVideoOutput( m_videoOutputCheckBox->isChecked() ? m_videoOutputComboBox->currentText() : QString() ); config()->setFrameDropping( m_frameDropCheckBox->isChecked() ); config()->setHardFrameDropping( m_hardFrameDropCheckBox->isChecked() ); } void MPlayerConfigWidget::setControlsFromConfig() { m_pathUrlRequester->setUrl( config()->executablePath() ); m_audioOutputCheckBox->setChecked( config()->hasAudioOutput() ); if ( m_audioOutputCheckBox->isChecked() ) m_audioOutputComboBox->setEditText( config()->audioOutput() ); m_volumeNormalizationCheckBox->setChecked( config()->volumeNormalizationEnabled() ); m_avsyncCheckBox->setChecked( config()->hasAutoSyncFactor() ); if ( m_avsyncCheckBox->isChecked() ) m_avsyncSpinBox->setValue( config()->autoSyncFactor() ); m_videoOutputCheckBox->setChecked( config()->hasVideoOutput() ); if ( m_videoOutputCheckBox->isChecked() ) m_videoOutputComboBox->setEditText( config()->videoOutput() ); m_frameDropCheckBox->setChecked( config()->frameDropping() ); m_hardFrameDropCheckBox->setChecked( config()->hardFrameDropping() ); } #include "mplayerconfigwidget.moc" subtitlecomposer-0.5.3/src/player/mplayer/slave.txt0000644000175000001440000004123611151345071021744 0ustar sergiousersSLAVE MODE PROTOCOL ------------------- The -slave option switches on slave mode, in which MPlayer works as a backend for other programs. Instead of intercepting keyboard events, MPlayer will read commands separated by a newline (\n) from stdin. To try slave mode out by hand, run mplayer -slave -quiet and type slave commands into the console window. Most slave mode commands are equivalent to command line options, though not necessarily under the same name. Detailed descriptions can be found in the man page. All commands can be prefixed with one of "pausing ", "pausing_keep ", or "pausing_toggle ". "pausing " tells MPlayer to pause as soon as possible after processing the command. "pausing_keep " tells MPlayer to do so only if it was already in paused mode. "pausing_toggle " tells MPlayer to do so only if it was not already in paused mode. Please note that "as soon as possible" can be before the command is fully executed. Available commands ('mplayer -input cmdlist' will print a list): alt_src_step (ASX playlist only) When more than one source is available it selects the next/previous one. audio_delay [abs] Set/adjust the audio delay. If [abs] is not given or is zero, adjust the delay by seconds. If [abs] is nonzero, set the delay to seconds. [brightness|contrast|gamma|hue|saturation] [abs] Set/adjust video parameters. If [abs] is not given or is zero, modifies parameter by . If [abs] is non-zero, parameter is set to . is in the range [-100, 100]. change_rectangle Change the position of the rectangle filter rectangle. Must be one of the following: 0 = width 1 = height 2 = x position 3 = y position If is 0 or 1: Integer amount to add/subtract from the width/height. Positive values add to width/height and negative values subtract from it. If is 2 or 3: Relative integer amount by which to move the upper left rectangle corner. Positive values move the rectangle right/down and negative values move the rectangle left/up. dvb_set_channel Set DVB channel. dvdnav