├── .gitignore ├── CHANGELOG ├── COPYING ├── InterText.icns ├── InterText.ico ├── InterText.pro ├── InterText.qrc ├── InterText.rc ├── LICENSE ├── README.md ├── examples ├── Obama-Inauguracni_rec.cs-00.no-00.alignment.xml ├── Obama-Inauguracni_rec.cs-00.txt ├── Obama-Inauguracni_rec.cs-00.unseg.txt ├── Obama-Inauguracni_rec.cs-00.unseg.xml ├── Obama-Inauguracni_rec.cs-00.xml ├── Obama-Inauguracni_rec.no-00.txt ├── Obama-Inauguracni_rec.no-00.unseg.txt ├── Obama-Inauguracni_rec.no-00.unseg.xml └── Obama-Inauguracni_rec.no-00.xml ├── images ├── 16 │ ├── InterText.ico │ ├── arrow-down-double.png │ ├── arrow-down.png │ ├── arrow-up-double.png │ ├── arrow-up.png │ ├── arrow.png │ ├── automatic.png │ ├── close.png │ ├── confirmed.png │ ├── conflicting.png │ ├── dblarrow.png │ ├── document-save.png │ ├── edit-redo.png │ ├── edit-rename.png │ ├── edit-undo.png │ ├── go-down-search.png │ ├── go-down.png │ ├── go-next-view.png │ ├── go-previous-view.png │ ├── go-up-search.png │ ├── go-up.png │ ├── insert.png │ ├── list-add.png │ ├── list-remove.png │ ├── local.png │ ├── locally-modified.png │ ├── manager.png │ ├── mark.png │ ├── nomark.png │ ├── nonlocal.png │ ├── plain.png │ ├── search.png │ ├── swap.png │ ├── synchronize.png │ ├── unconfirmed.png │ └── update-required.png ├── 22 │ ├── arrow-down-double.png │ ├── arrow-down.png │ ├── arrow-up-double.png │ ├── arrow-up.png │ ├── confirmed.png │ ├── document-save.png │ ├── edit-redo.png │ ├── edit-rename.png │ ├── edit-undo.png │ ├── go-down.png │ ├── go-next-view.png │ ├── go-previous-view.png │ ├── go-up.png │ ├── insert.png │ ├── manager.png │ ├── mark.png │ ├── search.png │ ├── swap.png │ ├── synchronize.png │ └── unconfirmed.png ├── 32 │ ├── InterText.ico │ ├── arrow-down-double.png │ ├── arrow-down.png │ ├── arrow-up-double.png │ ├── arrow-up.png │ ├── confirmed.png │ ├── document-save.png │ ├── edit-redo.png │ ├── edit-rename.png │ ├── edit-undo.png │ ├── go-down.png │ ├── go-next-view.png │ ├── go-previous-view.png │ ├── go-up.png │ ├── insert.png │ ├── manager.png │ ├── mark.png │ ├── search.png │ ├── swap.png │ ├── synchronize.png │ └── unconfirmed.png ├── 48 │ ├── arrow-down-double.png │ ├── arrow-down.png │ ├── arrow-up-double.png │ ├── arrow-up.png │ ├── confirmed.png │ ├── document-save.png │ ├── edit-redo.png │ ├── edit-rename.png │ ├── edit-undo.png │ ├── go-down.png │ ├── go-next-view.png │ ├── go-previous-view.png │ ├── go-up.png │ ├── insert.png │ ├── manager.png │ ├── mark.png │ ├── search.png │ ├── swap.png │ ├── synchronize.png │ └── unconfirmed.png ├── .directory ├── COPYING.LESSER ├── LICENSE └── svg │ ├── arrow-down-double.svgz │ ├── arrow-down.svgz │ ├── arrow-up-double.svgz │ ├── arrow-up.svgz │ ├── automatic.svgz │ ├── close.svgz │ ├── confirmed.svgz │ ├── conflicting.svgz │ ├── document-save.svgz │ ├── edit-redo.svgz │ ├── edit-rename.svgz │ ├── edit-undo.svgz │ ├── go-down-search.svgz │ ├── go-down.svgz │ ├── go-next-view.svgz │ ├── go-previous-view.svgz │ ├── go-up-search.svgz │ ├── go-up.svgz │ ├── insert.svgz │ ├── list-add.svgz │ ├── list-remove.svgz │ ├── local.svgz │ ├── locally-modified.svgz │ ├── manager.svgz │ ├── mark.svgz │ ├── merge.svgz │ ├── non-local.svgz │ ├── non11.svgz │ ├── plain.svgz │ ├── search.svgz │ ├── swap.svgz │ ├── synchronize.svgz │ ├── unconfirmed.svgz │ └── update-required.svgz ├── manual ├── InterText_Editor-User_Guide-doublesided.pdf ├── InterText_Editor-User_Guide.pdf ├── demo_potter-crop.pdf ├── icon.png ├── intertext.kilepr ├── manual.tex ├── merge.pdf ├── non11.pdf └── screenshots │ ├── autoaligner.png │ ├── change.png │ ├── customize_contextmenu.png │ ├── customize_shortcuts.png │ ├── customize_toolbar.png │ ├── empty_doc_template.png │ ├── mainwindow.png │ ├── mainwindow_naum.png │ ├── new_alignment.png │ ├── numbering_dialog.png │ ├── properties.png │ ├── remote_manager.png │ ├── remote_props1.png │ ├── remote_props2.png │ ├── rep_manager.png │ ├── settings_aligner.png │ ├── settings_aligner_profile.png │ ├── settings_editor.png │ ├── settings_export.png │ ├── settings_general.png │ ├── settings_highlight.png │ ├── settings_looknfeel.png │ ├── settings_server.png │ ├── settings_splitter.png │ ├── settings_view.png │ ├── text_import.png │ ├── text_import_type.png │ └── xml_import.png └── src ├── AlignerProfileDialog.cpp ├── AlignerProfileDialog.h ├── AlignerProfileDialog.ui ├── AlignerView.cpp ├── AlignerView.h ├── AlignerView.ui ├── AlignmentAttrDialog.cpp ├── AlignmentAttrDialog.h ├── AlignmentAttrDialog.ui ├── AlignmentManager.cpp ├── AlignmentManager.h ├── AlignmentManager.ui ├── AutoAlignDialog.cpp ├── AutoAlignDialog.h ├── AutoAlignDialog.ui ├── ChangeDialog.cpp ├── ChangeDialog.h ├── ChangeDialog.ui ├── CustomizeDialog.cpp ├── CustomizeDialog.h ├── CustomizeDialog.ui ├── ImportTxtDialog.cpp ├── ImportTxtDialog.h ├── ImportTxtDialog.ui ├── ImportXmlDialog.cpp ├── ImportXmlDialog.h ├── ImportXmlDialog.ui ├── ItAbstractDelegate.cpp ├── ItAbstractDelegate.h ├── ItAlignment.cpp ├── ItAlignment.h ├── ItAlignmentDelegate.cpp ├── ItAlignmentDelegate.h ├── ItAlignmentModel.cpp ├── ItAlignmentModel.h ├── ItAlignmentView.cpp ├── ItAlignmentView.h ├── ItCommands.cpp ├── ItCommands.h ├── ItCommon.h ├── ItCustomVarsDialog.cpp ├── ItCustomVarsDialog.h ├── ItCustomVarsDialog.ui ├── ItDocument.cpp ├── ItDocument.h ├── ItElement.cpp ├── ItElement.h ├── ItFloatControls.cpp ├── ItFloatControls.h ├── ItPlainTextEdit.cpp ├── ItPlainTextEdit.h ├── ItQuestionDialog.cpp ├── ItQuestionDialog.h ├── ItQuestionDialog.ui ├── ItSearchBar.cpp ├── ItSearchBar.h ├── ItSegmentDelegate.cpp ├── ItSegmentDelegate.h ├── ItSegmentView.cpp ├── ItSegmentView.h ├── ItSentenceSplitter.cpp ├── ItSentenceSplitter.h ├── ItServerConn.cpp ├── ItServerConn.h ├── ItThreads.cpp ├── ItThreads.h ├── ItWindow.cpp ├── ItWindow.h ├── NewAlignmentDialog.cpp ├── NewAlignmentDialog.h ├── NewAlignmentDialog.ui ├── RemoteAttrDialog.cpp ├── RemoteAttrDialog.h ├── RemoteAttrDialog.ui ├── ServerDialog.cpp ├── ServerDialog.h ├── ServerDialog.ui ├── SettingsDialog.cpp ├── SettingsDialog.h ├── SettingsDialog.ui ├── itdomitem.cpp ├── itdomitem.h ├── itdommodel.cpp ├── itdommodel.h ├── main.cpp ├── main.o ├── numberingdialog.cpp ├── numberingdialog.h ├── numberingdialog.ui ├── simplecrypt.cpp ├── simplecrypt.h ├── xmltreedialog.cpp ├── xmltreedialog.h └── xmltreedialog.ui /.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | *.user.* 3 | manual/manual.aux 4 | manual/manual.log 5 | manual/manual.out 6 | manual/manual.pdf 7 | manual/manual.toc 8 | *.backup 9 | -------------------------------------------------------------------------------- /InterText.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/InterText.icns -------------------------------------------------------------------------------- /InterText.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/InterText.ico -------------------------------------------------------------------------------- /InterText.pro: -------------------------------------------------------------------------------- 1 | # InterText qmake project file 2 | QT += widgets xml network svg 3 | QTPLUGIN += qico 4 | TEMPLATE = app 5 | TARGET = InterText 6 | DEPENDPATH += . src 7 | INCLUDEPATH += . src 8 | RESOURCES = InterText.qrc 9 | CODECFORTR = UTF-8 10 | CODECFORSRC = UTF-8 11 | RC_FILE = InterText.rc 12 | ICON = InterText.icns 13 | 14 | # Input 15 | HEADERS += \ 16 | src/ItWindow.h \ 17 | src/ItAlignment.h \ 18 | src/ItDocument.h \ 19 | src/ItElement.h \ 20 | src/ItAlignmentModel.h \ 21 | src/ItAlignmentView.h \ 22 | src/ItAlignmentDelegate.h \ 23 | src/ItSegmentView.h \ 24 | src/ItPlainTextEdit.h \ 25 | src/ItCommands.h \ 26 | src/numberingdialog.h \ 27 | src/ItSearchBar.h \ 28 | src/ItAbstractDelegate.h \ 29 | src/AutoAlignDialog.h \ 30 | src/AlignerView.h \ 31 | src/ImportXmlDialog.h \ 32 | src/ItSentenceSplitter.h \ 33 | src/ImportTxtDialog.h \ 34 | src/AlignmentManager.h \ 35 | src/SettingsDialog.h \ 36 | src/AlignerProfileDialog.h \ 37 | src/ServerDialog.h \ 38 | src/simplecrypt.h \ 39 | src/ChangeDialog.h \ 40 | src/RemoteAttrDialog.h \ 41 | src/AlignmentAttrDialog.h \ 42 | src/NewAlignmentDialog.h \ 43 | src/ItCustomVarsDialog.h \ 44 | src/ItSegmentDelegate.h \ 45 | src/ItCommon.h \ 46 | src/ItQuestionDialog.h \ 47 | src/ItFloatControls.h \ 48 | src/CustomizeDialog.h \ 49 | src/ItServerConn.h \ 50 | src/itdommodel.h \ 51 | src/itdomitem.h \ 52 | src/xmltreedialog.h 53 | SOURCES += \ 54 | src/ItWindow.cpp \ 55 | src/ItAlignment.cpp \ 56 | src/ItDocument.cpp \ 57 | src/main.cpp \ 58 | src/ItElement.cpp \ 59 | src/ItAlignmentModel.cpp \ 60 | src/ItAlignmentView.cpp \ 61 | src/ItAlignmentDelegate.cpp \ 62 | src/ItSegmentView.cpp \ 63 | src/ItPlainTextEdit.cpp \ 64 | src/ItCommands.cpp \ 65 | src/numberingdialog.cpp \ 66 | src/ItSearchBar.cpp \ 67 | src/ItAbstractDelegate.cpp \ 68 | src/AutoAlignDialog.cpp \ 69 | src/AlignerView.cpp \ 70 | src/ImportXmlDialog.cpp \ 71 | src/ItSentenceSplitter.cpp \ 72 | src/ImportTxtDialog.cpp \ 73 | src/AlignmentManager.cpp \ 74 | src/SettingsDialog.cpp \ 75 | src/AlignerProfileDialog.cpp \ 76 | src/ServerDialog.cpp \ 77 | src/simplecrypt.cpp \ 78 | src/ChangeDialog.cpp \ 79 | src/RemoteAttrDialog.cpp \ 80 | src/AlignmentAttrDialog.cpp \ 81 | src/NewAlignmentDialog.cpp \ 82 | src/ItCustomVarsDialog.cpp \ 83 | src/ItSegmentDelegate.cpp \ 84 | src/ItQuestionDialog.cpp \ 85 | src/ItFloatControls.cpp \ 86 | src/CustomizeDialog.cpp \ 87 | src/ItServerConn.cpp \ 88 | src/itdommodel.cpp \ 89 | src/itdomitem.cpp \ 90 | src/xmltreedialog.cpp 91 | 92 | FORMS += \ 93 | src/numberingdialog.ui \ 94 | src/AutoAlignDialog.ui \ 95 | src/AlignerView.ui \ 96 | src/ImportXmlDialog.ui \ 97 | src/ImportTxtDialog.ui \ 98 | src/AlignmentManager.ui \ 99 | src/SettingsDialog.ui \ 100 | src/AlignerProfileDialog.ui \ 101 | src/ServerDialog.ui \ 102 | src/ChangeDialog.ui \ 103 | src/RemoteAttrDialog.ui \ 104 | src/AlignmentAttrDialog.ui \ 105 | src/NewAlignmentDialog.ui \ 106 | src/ItCustomVarsDialog.ui \ 107 | src/ItQuestionDialog.ui \ 108 | src/CustomizeDialog.ui \ 109 | src/xmltreedialog.ui 110 | 111 | OTHER_FILES += \ 112 | Changelog.txt 113 | 114 | DISTFILES += \ 115 | CHANGELOG 116 | 117 | -------------------------------------------------------------------------------- /InterText.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "InterText.ico" 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | *************************************************************************** 2 | Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 3 | Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 4 | Institute of the Czech National Corpus 5 | *************************************************************************** 6 | 7 | This package contains InterText Editor. 8 | 9 | InterText Editor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | InterText Editor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with InterText Editor. If not, see . 21 | 22 | *************************************************************************** 23 | 24 | The subdirectory "images" contains files from the KDE project Oxygen 25 | (http://www.kde.org/) licensed under LGPL v3. See images/LICENSE 26 | for details. 27 | 28 | *************************************************************************** 29 | 30 | The "simplecrypt" module is Copyright (c) 2011 by Andre Somers; the license 31 | is part of the appropriate source files src/simplecrypt.{h|cpp} 32 | 33 | *************************************************************************** -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # InterText Editor 2 | 3 | InterText is an editor for aligned parallel texts. It has been developed for the project [InterCorp](http://www.korpus.cz/intercorp/?lang=en) to edit and manage alignments of multiple parallel language versions of texts at the level of sentences, but it is designed with flexibility in mind and supports custom XML documents and Unicode character set. 4 | 5 | _InterText Editor_ is a younger brother of the _InterText Server_, a server application with web-based interface aimed at large, collaborative projects. InterText Editor is a desktop application for personal use, but it can also be used as an off-line editor for InterText Servers. Unlike InterText Server, it should be very easy to install and use even for common users. 6 | 7 | See the [InterText project homepage](http://wanthalf.saga.cz/intertext) for more details. 8 | 9 | ## Compilation 10 | 11 | InterText Editor is implemented using the current version of [Qt toolkit](http://www.qt.io/) to ease platform independency. The project can be easilly compiled using the standard _QtCreator_ development environment or the _qmake_ tool from the Qt distribution. The compilation from the source code has no special dependencies beyond the standard Qt toolkit libraries (and possibly (Open)SSL library in order to support HTTPS communication with InterText Server, if required; SSL support for Qt is commonly available in Linux and MacOS X, but may require additional installation or compilation on Microsoft Windows). 12 | 13 | ## Precompiled binary packages 14 | 15 | See the [InterText project homepage](http://wanthalf.saga.cz/intertext) for binary distribution packages precompiled for Linux, MacOS X and Microsoft Windows. 16 | 17 | ## Disclaimer 18 | 19 | The code of InterText Editor is not a pruduct of an organized professional development team. Actually, it is the first larger C++ project of the author and bears clear traces of "patchwork". It may also contain fragments of unfinished new features. Please, feel free to contact the author in order to get help with quicker orientation in the code in case of any uncertainity. Any submissions, improvements or suggestions are welcome! 20 | 21 | ## Acknowledgement: 22 | 23 | This software and documentation resulted from the implementation of the Czech National Corpus project (LM2011023) funded by the _Ministry of Education, Youth and Sports_ of the Czech republic within the framework of _Large Research, Development and Innovation Infrastructures_. 24 | 25 | ## License: 26 | 27 | This software is licensed under the GNU General Public License v3. (http://www.gnu.org/licenses/gpl-3.0.html) 28 | 29 | - Copyright (c) 2010-2016 Pavel Vondřička 30 | - Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, Institute of the Czech National Corpus 31 | -------------------------------------------------------------------------------- /images/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | PreviewsShown=true 3 | ShowPreview=true 4 | Timestamp=2012,9,12,20,36,7 5 | Version=2 6 | -------------------------------------------------------------------------------- /images/16/InterText.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/InterText.ico -------------------------------------------------------------------------------- /images/16/arrow-down-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/arrow-down-double.png -------------------------------------------------------------------------------- /images/16/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/arrow-down.png -------------------------------------------------------------------------------- /images/16/arrow-up-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/arrow-up-double.png -------------------------------------------------------------------------------- /images/16/arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/arrow-up.png -------------------------------------------------------------------------------- /images/16/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/arrow.png -------------------------------------------------------------------------------- /images/16/automatic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/automatic.png -------------------------------------------------------------------------------- /images/16/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/close.png -------------------------------------------------------------------------------- /images/16/confirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/confirmed.png -------------------------------------------------------------------------------- /images/16/conflicting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/conflicting.png -------------------------------------------------------------------------------- /images/16/dblarrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/dblarrow.png -------------------------------------------------------------------------------- /images/16/document-save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/document-save.png -------------------------------------------------------------------------------- /images/16/edit-redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/edit-redo.png -------------------------------------------------------------------------------- /images/16/edit-rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/edit-rename.png -------------------------------------------------------------------------------- /images/16/edit-undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/edit-undo.png -------------------------------------------------------------------------------- /images/16/go-down-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/go-down-search.png -------------------------------------------------------------------------------- /images/16/go-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/go-down.png -------------------------------------------------------------------------------- /images/16/go-next-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/go-next-view.png -------------------------------------------------------------------------------- /images/16/go-previous-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/go-previous-view.png -------------------------------------------------------------------------------- /images/16/go-up-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/go-up-search.png -------------------------------------------------------------------------------- /images/16/go-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/go-up.png -------------------------------------------------------------------------------- /images/16/insert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/insert.png -------------------------------------------------------------------------------- /images/16/list-add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/list-add.png -------------------------------------------------------------------------------- /images/16/list-remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/list-remove.png -------------------------------------------------------------------------------- /images/16/local.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/local.png -------------------------------------------------------------------------------- /images/16/locally-modified.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/locally-modified.png -------------------------------------------------------------------------------- /images/16/manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/manager.png -------------------------------------------------------------------------------- /images/16/mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/mark.png -------------------------------------------------------------------------------- /images/16/nomark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/nomark.png -------------------------------------------------------------------------------- /images/16/nonlocal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/nonlocal.png -------------------------------------------------------------------------------- /images/16/plain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/plain.png -------------------------------------------------------------------------------- /images/16/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/search.png -------------------------------------------------------------------------------- /images/16/swap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/swap.png -------------------------------------------------------------------------------- /images/16/synchronize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/synchronize.png -------------------------------------------------------------------------------- /images/16/unconfirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/unconfirmed.png -------------------------------------------------------------------------------- /images/16/update-required.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/16/update-required.png -------------------------------------------------------------------------------- /images/22/arrow-down-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/arrow-down-double.png -------------------------------------------------------------------------------- /images/22/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/arrow-down.png -------------------------------------------------------------------------------- /images/22/arrow-up-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/arrow-up-double.png -------------------------------------------------------------------------------- /images/22/arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/arrow-up.png -------------------------------------------------------------------------------- /images/22/confirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/confirmed.png -------------------------------------------------------------------------------- /images/22/document-save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/document-save.png -------------------------------------------------------------------------------- /images/22/edit-redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/edit-redo.png -------------------------------------------------------------------------------- /images/22/edit-rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/edit-rename.png -------------------------------------------------------------------------------- /images/22/edit-undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/edit-undo.png -------------------------------------------------------------------------------- /images/22/go-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/go-down.png -------------------------------------------------------------------------------- /images/22/go-next-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/go-next-view.png -------------------------------------------------------------------------------- /images/22/go-previous-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/go-previous-view.png -------------------------------------------------------------------------------- /images/22/go-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/go-up.png -------------------------------------------------------------------------------- /images/22/insert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/insert.png -------------------------------------------------------------------------------- /images/22/manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/manager.png -------------------------------------------------------------------------------- /images/22/mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/mark.png -------------------------------------------------------------------------------- /images/22/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/search.png -------------------------------------------------------------------------------- /images/22/swap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/swap.png -------------------------------------------------------------------------------- /images/22/synchronize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/synchronize.png -------------------------------------------------------------------------------- /images/22/unconfirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/22/unconfirmed.png -------------------------------------------------------------------------------- /images/32/InterText.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/InterText.ico -------------------------------------------------------------------------------- /images/32/arrow-down-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/arrow-down-double.png -------------------------------------------------------------------------------- /images/32/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/arrow-down.png -------------------------------------------------------------------------------- /images/32/arrow-up-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/arrow-up-double.png -------------------------------------------------------------------------------- /images/32/arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/arrow-up.png -------------------------------------------------------------------------------- /images/32/confirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/confirmed.png -------------------------------------------------------------------------------- /images/32/document-save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/document-save.png -------------------------------------------------------------------------------- /images/32/edit-redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/edit-redo.png -------------------------------------------------------------------------------- /images/32/edit-rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/edit-rename.png -------------------------------------------------------------------------------- /images/32/edit-undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/edit-undo.png -------------------------------------------------------------------------------- /images/32/go-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/go-down.png -------------------------------------------------------------------------------- /images/32/go-next-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/go-next-view.png -------------------------------------------------------------------------------- /images/32/go-previous-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/go-previous-view.png -------------------------------------------------------------------------------- /images/32/go-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/go-up.png -------------------------------------------------------------------------------- /images/32/insert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/insert.png -------------------------------------------------------------------------------- /images/32/manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/manager.png -------------------------------------------------------------------------------- /images/32/mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/mark.png -------------------------------------------------------------------------------- /images/32/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/search.png -------------------------------------------------------------------------------- /images/32/swap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/swap.png -------------------------------------------------------------------------------- /images/32/synchronize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/synchronize.png -------------------------------------------------------------------------------- /images/32/unconfirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/32/unconfirmed.png -------------------------------------------------------------------------------- /images/48/arrow-down-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/arrow-down-double.png -------------------------------------------------------------------------------- /images/48/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/arrow-down.png -------------------------------------------------------------------------------- /images/48/arrow-up-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/arrow-up-double.png -------------------------------------------------------------------------------- /images/48/arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/arrow-up.png -------------------------------------------------------------------------------- /images/48/confirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/confirmed.png -------------------------------------------------------------------------------- /images/48/document-save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/document-save.png -------------------------------------------------------------------------------- /images/48/edit-redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/edit-redo.png -------------------------------------------------------------------------------- /images/48/edit-rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/edit-rename.png -------------------------------------------------------------------------------- /images/48/edit-undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/edit-undo.png -------------------------------------------------------------------------------- /images/48/go-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/go-down.png -------------------------------------------------------------------------------- /images/48/go-next-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/go-next-view.png -------------------------------------------------------------------------------- /images/48/go-previous-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/go-previous-view.png -------------------------------------------------------------------------------- /images/48/go-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/go-up.png -------------------------------------------------------------------------------- /images/48/insert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/insert.png -------------------------------------------------------------------------------- /images/48/manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/manager.png -------------------------------------------------------------------------------- /images/48/mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/mark.png -------------------------------------------------------------------------------- /images/48/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/search.png -------------------------------------------------------------------------------- /images/48/swap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/swap.png -------------------------------------------------------------------------------- /images/48/synchronize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/synchronize.png -------------------------------------------------------------------------------- /images/48/unconfirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/48/unconfirmed.png -------------------------------------------------------------------------------- /images/LICENSE: -------------------------------------------------------------------------------- 1 | This directory and its subdirectories contain images from the KDE project Oxygen: 2 | http://www.kde.org 3 | https://techbase.kde.org/Projects/Oxygen 4 | 5 | These icons are licensed under LGPL v3 (see COPYING.LESSER). 6 | 7 | The only exception is the InterText icon (files with the name "InterText.png" 8 | in different sizes and thus different subdirectories), which is part of 9 | InterText Editor and is covered by the GPL v3 license (or newer) 10 | like the rest of the software. -------------------------------------------------------------------------------- /images/svg/arrow-down-double.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/arrow-down-double.svgz -------------------------------------------------------------------------------- /images/svg/arrow-down.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/arrow-down.svgz -------------------------------------------------------------------------------- /images/svg/arrow-up-double.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/arrow-up-double.svgz -------------------------------------------------------------------------------- /images/svg/arrow-up.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/arrow-up.svgz -------------------------------------------------------------------------------- /images/svg/automatic.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/automatic.svgz -------------------------------------------------------------------------------- /images/svg/close.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/close.svgz -------------------------------------------------------------------------------- /images/svg/confirmed.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/confirmed.svgz -------------------------------------------------------------------------------- /images/svg/conflicting.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/conflicting.svgz -------------------------------------------------------------------------------- /images/svg/document-save.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/document-save.svgz -------------------------------------------------------------------------------- /images/svg/edit-redo.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/edit-redo.svgz -------------------------------------------------------------------------------- /images/svg/edit-rename.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/edit-rename.svgz -------------------------------------------------------------------------------- /images/svg/edit-undo.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/edit-undo.svgz -------------------------------------------------------------------------------- /images/svg/go-down-search.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/go-down-search.svgz -------------------------------------------------------------------------------- /images/svg/go-down.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/go-down.svgz -------------------------------------------------------------------------------- /images/svg/go-next-view.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/go-next-view.svgz -------------------------------------------------------------------------------- /images/svg/go-previous-view.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/go-previous-view.svgz -------------------------------------------------------------------------------- /images/svg/go-up-search.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/go-up-search.svgz -------------------------------------------------------------------------------- /images/svg/go-up.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/go-up.svgz -------------------------------------------------------------------------------- /images/svg/insert.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/insert.svgz -------------------------------------------------------------------------------- /images/svg/list-add.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/list-add.svgz -------------------------------------------------------------------------------- /images/svg/list-remove.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/list-remove.svgz -------------------------------------------------------------------------------- /images/svg/local.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/local.svgz -------------------------------------------------------------------------------- /images/svg/locally-modified.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/locally-modified.svgz -------------------------------------------------------------------------------- /images/svg/manager.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/manager.svgz -------------------------------------------------------------------------------- /images/svg/mark.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/mark.svgz -------------------------------------------------------------------------------- /images/svg/merge.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/merge.svgz -------------------------------------------------------------------------------- /images/svg/non-local.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/non-local.svgz -------------------------------------------------------------------------------- /images/svg/non11.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/non11.svgz -------------------------------------------------------------------------------- /images/svg/plain.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/plain.svgz -------------------------------------------------------------------------------- /images/svg/search.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/search.svgz -------------------------------------------------------------------------------- /images/svg/swap.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/swap.svgz -------------------------------------------------------------------------------- /images/svg/synchronize.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/synchronize.svgz -------------------------------------------------------------------------------- /images/svg/unconfirmed.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/unconfirmed.svgz -------------------------------------------------------------------------------- /images/svg/update-required.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/images/svg/update-required.svgz -------------------------------------------------------------------------------- /manual/InterText_Editor-User_Guide-doublesided.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/InterText_Editor-User_Guide-doublesided.pdf -------------------------------------------------------------------------------- /manual/InterText_Editor-User_Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/InterText_Editor-User_Guide.pdf -------------------------------------------------------------------------------- /manual/demo_potter-crop.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/demo_potter-crop.pdf -------------------------------------------------------------------------------- /manual/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/icon.png -------------------------------------------------------------------------------- /manual/intertext.kilepr: -------------------------------------------------------------------------------- 1 | [General] 2 | def_graphic_ext= 3 | img_extIsRegExp=false 4 | img_extensions=.eps .jpg .jpeg .png .pdf .ps .fig .gif 5 | kileprversion=2 6 | kileversion=2.1.3 7 | lastDocument=manual.tex 8 | masterDocument= 9 | name=InterText 10 | pkg_extIsRegExp=false 11 | pkg_extensions=.cls .sty .bbx .cbx .lbx 12 | src_extIsRegExp=false 13 | src_extensions=.tex .ltx .latex .dtx .ins 14 | 15 | [Tools] 16 | MakeIndex= 17 | QuickBuild= 18 | 19 | [document-settings,item:manual.tex] 20 | Bookmarks= 21 | Encoding=UTF-8 22 | FoldedColumns= 23 | FoldedLines= 24 | Highlighting=LaTeX 25 | Indentation Mode=none 26 | Mode=LaTeX 27 | ReadWrite=true 28 | 29 | [item:intertext.kilepr] 30 | archive=true 31 | column=1 32 | encoding= 33 | highlight= 34 | line=0 35 | mode= 36 | open=false 37 | order=-1 38 | 39 | [item:manual.tex] 40 | archive=true 41 | column=1 42 | encoding=UTF-8 43 | highlight=LaTeX 44 | line=0 45 | mode=LaTeX 46 | open=true 47 | order=0 48 | 49 | [view-settings,view=0,item:manual.tex] 50 | CursorColumn=1 51 | CursorLine=0 52 | JumpList= 53 | ViMarks=.,0,0,[,0,0,],0,0 54 | -------------------------------------------------------------------------------- /manual/merge.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/merge.pdf -------------------------------------------------------------------------------- /manual/non11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/non11.pdf -------------------------------------------------------------------------------- /manual/screenshots/autoaligner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/autoaligner.png -------------------------------------------------------------------------------- /manual/screenshots/change.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/change.png -------------------------------------------------------------------------------- /manual/screenshots/customize_contextmenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/customize_contextmenu.png -------------------------------------------------------------------------------- /manual/screenshots/customize_shortcuts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/customize_shortcuts.png -------------------------------------------------------------------------------- /manual/screenshots/customize_toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/customize_toolbar.png -------------------------------------------------------------------------------- /manual/screenshots/empty_doc_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/empty_doc_template.png -------------------------------------------------------------------------------- /manual/screenshots/mainwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/mainwindow.png -------------------------------------------------------------------------------- /manual/screenshots/mainwindow_naum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/mainwindow_naum.png -------------------------------------------------------------------------------- /manual/screenshots/new_alignment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/new_alignment.png -------------------------------------------------------------------------------- /manual/screenshots/numbering_dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/numbering_dialog.png -------------------------------------------------------------------------------- /manual/screenshots/properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/properties.png -------------------------------------------------------------------------------- /manual/screenshots/remote_manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/remote_manager.png -------------------------------------------------------------------------------- /manual/screenshots/remote_props1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/remote_props1.png -------------------------------------------------------------------------------- /manual/screenshots/remote_props2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/remote_props2.png -------------------------------------------------------------------------------- /manual/screenshots/rep_manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/rep_manager.png -------------------------------------------------------------------------------- /manual/screenshots/settings_aligner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/settings_aligner.png -------------------------------------------------------------------------------- /manual/screenshots/settings_aligner_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/settings_aligner_profile.png -------------------------------------------------------------------------------- /manual/screenshots/settings_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/settings_editor.png -------------------------------------------------------------------------------- /manual/screenshots/settings_export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/settings_export.png -------------------------------------------------------------------------------- /manual/screenshots/settings_general.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/settings_general.png -------------------------------------------------------------------------------- /manual/screenshots/settings_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/settings_highlight.png -------------------------------------------------------------------------------- /manual/screenshots/settings_looknfeel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/settings_looknfeel.png -------------------------------------------------------------------------------- /manual/screenshots/settings_server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/settings_server.png -------------------------------------------------------------------------------- /manual/screenshots/settings_splitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/settings_splitter.png -------------------------------------------------------------------------------- /manual/screenshots/settings_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/settings_view.png -------------------------------------------------------------------------------- /manual/screenshots/text_import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/text_import.png -------------------------------------------------------------------------------- /manual/screenshots/text_import_type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/text_import_type.png -------------------------------------------------------------------------------- /manual/screenshots/xml_import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/manual/screenshots/xml_import.png -------------------------------------------------------------------------------- /src/AlignerProfileDialog.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #include "AlignerProfileDialog.h" 23 | #include "ui_AlignerProfileDialog.h" 24 | #include 25 | 26 | AlignerProfileDialog::AlignerProfileDialog(QWidget *parent, QString name, QString params) : 27 | QDialog(parent), 28 | ui(new Ui::AlignerProfileDialog) 29 | { 30 | ui->setupUi(this); 31 | ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); 32 | connect(ui->edit_name, SIGNAL(textChanged(QString)), this, SLOT(validate(QString))); 33 | ui->edit_name->setText(name); 34 | ui->edit_params->setText(params); 35 | adjustSize(); 36 | } 37 | 38 | AlignerProfileDialog::~AlignerProfileDialog() 39 | { 40 | delete ui; 41 | } 42 | 43 | QString AlignerProfileDialog::getName() 44 | { 45 | return ui->edit_name->text(); 46 | } 47 | 48 | QString AlignerProfileDialog::getParams() 49 | { 50 | return ui->edit_params->text(); 51 | } 52 | 53 | void AlignerProfileDialog::validate(QString text) 54 | { 55 | if (text.isEmpty()) 56 | ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); 57 | else 58 | ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); 59 | } 60 | -------------------------------------------------------------------------------- /src/AlignerProfileDialog.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef ALIGNERPROFILEDIALOG_H 23 | #define ALIGNERPROFILEDIALOG_H 24 | 25 | #include 26 | 27 | namespace Ui { 28 | class AlignerProfileDialog; 29 | } 30 | 31 | class AlignerProfileDialog : public QDialog 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit AlignerProfileDialog(QWidget *parent = 0, QString name = QString(), QString params = QString()); 37 | ~AlignerProfileDialog(); 38 | QString getName(); 39 | QString getParams(); 40 | 41 | private: 42 | Ui::AlignerProfileDialog *ui; 43 | 44 | private slots: 45 | void validate(QString text); 46 | 47 | }; 48 | 49 | #endif // ALIGNERPROFILEDIALOG_H 50 | -------------------------------------------------------------------------------- /src/AlignerProfileDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AlignerProfileDialog 4 | 5 | 6 | Qt::WindowModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 472 13 | 162 14 | 15 | 16 | 17 | 18 | 0 19 | 0 20 | 21 | 22 | 23 | Aligner profile 24 | 25 | 26 | true 27 | 28 | 29 | 30 | 31 | 32 | Profile name: 33 | 34 | 35 | 36 | 37 | 38 | 39 | Aligner parameters: 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 0 48 | 0 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 0 58 | 0 59 | 60 | 61 | 62 | Qt::Horizontal 63 | 64 | 65 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 0 74 | 0 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 0 84 | 0 85 | 86 | 87 | 88 | (strings {TXT1} and {TXT2} will be replaced with input file names; {EXEPATH}/ can be used to point to the directory of the executable) 89 | 90 | 91 | true 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | buttonBox 101 | accepted() 102 | AlignerProfileDialog 103 | accept() 104 | 105 | 106 | 248 107 | 254 108 | 109 | 110 | 157 111 | 274 112 | 113 | 114 | 115 | 116 | buttonBox 117 | rejected() 118 | AlignerProfileDialog 119 | reject() 120 | 121 | 122 | 316 123 | 260 124 | 125 | 126 | 286 127 | 274 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /src/AlignerView.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #include "AlignerView.h" 23 | #include "ui_AlignerView.h" 24 | #include 25 | #include 26 | #include 27 | 28 | AlignerView::AlignerView(QString cmd, QString params, QString &fname1, QString &fname2, int fromPos, int toPos, bool autoClose, QWidget *parent) : 29 | QDialog(parent), 30 | ui(new Ui::AlignerView) 31 | { 32 | ui->setupUi(this); 33 | setAttribute(Qt::WA_DeleteOnClose); 34 | close_me = autoClose; 35 | userAbort = false; 36 | filename1 = fname1; 37 | filename2 = fname2; 38 | startPos = fromPos; 39 | endPos = toPos; 40 | command = cmd; 41 | args = params;//.split(" "); 42 | my_proc = new QProcess(this); 43 | connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonPressed(QAbstractButton*))); 44 | my_proc->setReadChannel(QProcess::StandardError); 45 | connect(my_proc, SIGNAL(readyRead()), this, SLOT(readProc())); 46 | connect(my_proc, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(proc_finished(int,QProcess::ExitStatus))); 47 | } 48 | 49 | void AlignerView::run_aligner() 50 | { 51 | show(); 52 | my_proc->start(QString("\"%1\" %2").arg(command, args)); 53 | if (!my_proc->waitForStarted()) { 54 | QMessageBox::critical(this, tr("Automatic alignment"), tr("Error: Cannot execute external aligner (%1). Please, check your settings.").arg(command.split(" ").first())); 55 | QFile::remove(filename1); 56 | QFile::remove(filename2); 57 | close(); 58 | } 59 | } 60 | 61 | AlignerView::~AlignerView() 62 | { 63 | delete my_proc; 64 | delete ui; 65 | } 66 | 67 | void AlignerView::readProc() 68 | { 69 | QTextCursor c = ui->textView->textCursor(); 70 | c.insertText(my_proc->readAll()); 71 | QScrollBar * sb = ui->textView->verticalScrollBar(); 72 | sb->setValue(sb->maximum()); 73 | } 74 | 75 | void AlignerView::buttonPressed(QAbstractButton * button) 76 | { 77 | if (ui->buttonBox->standardButton(button)==QDialogButtonBox::Abort) { 78 | bool tempClose = close_me; 79 | close_me = false; 80 | QMessageBox::StandardButton resp = QMessageBox::question(this, tr("Automatic alignment"), tr("Do you really want to cancel the automatic alignment?"), 81 | QMessageBox::Ok | QMessageBox::Cancel); 82 | if (resp==QMessageBox::Ok) { 83 | userAbort = true; 84 | my_proc->terminate(); 85 | if (!my_proc->waitForFinished(10000)) 86 | my_proc->kill(); 87 | } 88 | close_me = tempClose; 89 | } 90 | } 91 | 92 | void AlignerView::proc_finished(int ret, QProcess::ExitStatus stat) 93 | { 94 | QFile::remove(filename1); 95 | QFile::remove(filename2); 96 | 97 | if (!userAbort) { 98 | if (stat!=QProcess::NormalExit) { 99 | close_me = false; 100 | QMessageBox::critical(this, tr("Automatic alignment"), tr("Error: External aligner failed.")); 101 | } else { 102 | emit result(my_proc->readAllStandardOutput(), startPos, endPos); 103 | } 104 | } 105 | 106 | if (close_me) 107 | close(); 108 | else { 109 | ui->buttonBox->setStandardButtons(QDialogButtonBox::Close); 110 | connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close())); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/AlignerView.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef ALIGNERVIEW_H 23 | #define ALIGNERVIEW_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | namespace Ui { 30 | class AlignerView; 31 | } 32 | 33 | class AlignerView : public QDialog 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit AlignerView(QString cmd, QString params, QString &fname1, QString &fname2, int fromPos, int toPos, bool autoClose, QWidget *parent); 39 | ~AlignerView(); 40 | void run_aligner(); 41 | 42 | signals: 43 | void result(QString res, int fromPos, int toPos); 44 | 45 | private: 46 | Ui::AlignerView *ui; 47 | QProcess * my_proc; 48 | QString command, filename1, filename2; 49 | QString args; 50 | int startPos, endPos; 51 | bool userAbort, close_me; 52 | 53 | private slots: 54 | void buttonPressed(QAbstractButton * button); 55 | void readProc(); 56 | void proc_finished(int ret, QProcess::ExitStatus stat); 57 | }; 58 | 59 | #endif // ALIGNERVIEW_H 60 | -------------------------------------------------------------------------------- /src/AlignerView.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AlignerView 4 | 5 | 6 | Qt::WindowModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 506 13 | 300 14 | 15 | 16 | 17 | Automatic aligner 18 | 19 | 20 | true 21 | 22 | 23 | 24 | 25 | 26 | true 27 | 28 | 29 | 30 | 31 | 32 | 33 | Qt::Horizontal 34 | 35 | 36 | QDialogButtonBox::Abort 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/AlignmentAttrDialog.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef ALIGNMENTATTRDIALOG_H 23 | #define ALIGNMENTATTRDIALOG_H 24 | 25 | #include 26 | #include "ItAlignment.h" 27 | 28 | namespace Ui { 29 | class AlignmentAttrDialog; 30 | } 31 | 32 | class AlignmentAttrDialog : public QDialog 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit AlignmentAttrDialog(QWidget *parent, ItAlignment *a, bool del=false); 38 | ~AlignmentAttrDialog(); 39 | public slots: 40 | void accept(); 41 | void reject(); 42 | 43 | private: 44 | Ui::AlignmentAttrDialog *ui; 45 | ItAlignment *alignment; 46 | ItAlignment::alignmentInfo attrs; 47 | bool del_on_close; 48 | private slots: 49 | void setTextName(QString str); 50 | void setAlSource(QString str); 51 | void setV1Name(QString str); 52 | void setV1Source(QString str); 53 | void setV1Levels(int val); 54 | void setV1Prefix(QString str); 55 | void setV1Separ(QString str); 56 | void changeV1Editing(int val); 57 | void changeV1ChStruct(int val); 58 | void setV2Name(QString str); 59 | void setV2Source(QString str); 60 | void setV2Levels(int val); 61 | void setV2Prefix(QString str); 62 | void setV2Separ(QString str); 63 | void changeV2Editing(int val); 64 | void changeV2ChStruct(int val); 65 | }; 66 | 67 | #endif // ALIGNMENTATTRDIALOG_H 68 | -------------------------------------------------------------------------------- /src/AlignmentManager.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef ALIGNMENTMANAGER_H 23 | #define ALIGNMENTMANAGER_H 24 | 25 | #include 26 | #include 27 | #include "AlignmentAttrDialog.h" 28 | 29 | namespace Ui { 30 | class AlignmentManager; 31 | } 32 | 33 | class ItWindow; 34 | 35 | class AlListModel : public QAbstractListModel 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | 41 | AlListModel(QString repository, QObject *parent); 42 | ~AlListModel(); 43 | 44 | QVariant data(const QModelIndex &index, int role) const; 45 | //bool setData(const QModelIndex &index, const QVariant &value, int role); 46 | //Qt::ItemFlags flags(const QModelIndex &index) const; 47 | //QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; 48 | //QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; 49 | //QModelIndex parent(const QModelIndex &index) const; 50 | int rowCount(const QModelIndex &parent = QModelIndex()) const; 51 | int columnCount(const QModelIndex &parent = QModelIndex()) const; 52 | 53 | QString getName(int i); 54 | void deleteAl(QString al); 55 | QStringList listTexts(); 56 | QStringList listVersions(); 57 | 58 | public slots: 59 | 60 | void externalChange(); 61 | 62 | private: 63 | QString repository_path; 64 | 65 | }; 66 | 67 | 68 | class AlignmentManager : public QDialog 69 | { 70 | Q_OBJECT 71 | 72 | public: 73 | explicit AlignmentManager(QString repository, QWidget *parent); 74 | ~AlignmentManager(); 75 | QStringList listTexts(); 76 | QStringList listVersions(); 77 | 78 | public slots: 79 | void show(bool openonly=false); 80 | void externalChange(); 81 | 82 | signals: 83 | void alDeletedInRepo(QString alname); 84 | 85 | private: 86 | Ui::AlignmentManager *ui; 87 | AlListModel * model; 88 | ItWindow * window; 89 | QString repository_path; 90 | 91 | QPushButton * openButton; 92 | QPushButton * newButton; 93 | QPushButton * importButton; 94 | QPushButton * delButton; 95 | QPushButton * propButton; 96 | 97 | private slots: 98 | void alDelete(); 99 | void alOpen(); 100 | void alNew(); 101 | void alProp(); 102 | void alImport(); 103 | void curAlChanged(QModelIndex index); 104 | }; 105 | 106 | 107 | #endif // ALIGNMENTMANAGER_H 108 | -------------------------------------------------------------------------------- /src/AlignmentManager.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AlignmentManager 4 | 5 | 6 | 7 | 0 8 | 0 9 | 561 10 | 298 11 | 12 | 13 | 14 | Repository manager 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Qt::Vertical 24 | 25 | 26 | QDialogButtonBox::Close 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | buttonBox 36 | accepted() 37 | AlignmentManager 38 | accept() 39 | 40 | 41 | 248 42 | 254 43 | 44 | 45 | 157 46 | 274 47 | 48 | 49 | 50 | 51 | buttonBox 52 | rejected() 53 | AlignmentManager 54 | reject() 55 | 56 | 57 | 316 58 | 260 59 | 60 | 61 | 286 62 | 274 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/AutoAlignDialog.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #include "AutoAlignDialog.h" 23 | #include "ui_AutoAlignDialog.h" 24 | #include 25 | #include 26 | 27 | AutoAlignDialog::AutoAlignDialog(QWidget *parent, int max) : 28 | QDialog(parent), 29 | ui(new Ui::AutoAlignDialog) 30 | { 31 | from_validator = new QIntValidator(this); 32 | to_validator = new QIntValidator(this); 33 | ui->setupUi(this); 34 | from_validator->setBottom(1); 35 | from_validator->setTop(max); 36 | to_validator->setBottom(1); 37 | to_validator->setTop(max); 38 | ui->edit_from->setValidator(from_validator); 39 | ui->edit_to->setValidator(to_validator); 40 | connect(ui->edit_from, SIGNAL(textChanged(QString)), this, SLOT(fromChanged())); 41 | connect(ui->edit_to, SIGNAL(textChanged(QString)), this, SLOT(toChanged())); 42 | connect(ui->selector_aligner, SIGNAL(currentIndexChanged(int)), this, SLOT(alignerChanged(int))); 43 | adjustSize(); 44 | } 45 | 46 | AutoAlignDialog::~AutoAlignDialog() 47 | { 48 | delete ui; 49 | delete from_validator; 50 | delete to_validator; 51 | } 52 | 53 | void AutoAlignDialog::addAligner(QString name, QStringList a_profiles) 54 | { 55 | ui->selector_aligner->addItem(name); 56 | profiles.append(a_profiles); 57 | alignerChanged(ui->selector_aligner->currentIndex()); 58 | } 59 | 60 | void AutoAlignDialog::setStartPos(int pos) 61 | { 62 | ui->edit_from->setText(QString::number(pos)); 63 | fromChanged(); 64 | } 65 | 66 | void AutoAlignDialog::setEndPos(int pos) 67 | { 68 | ui->edit_to->setText(QString::number(pos)); 69 | } 70 | 71 | int AutoAlignDialog::getStartPos() 72 | { 73 | return ui->edit_from->text().toInt(); 74 | } 75 | 76 | int AutoAlignDialog::getEndPos() 77 | { 78 | return ui->edit_to->text().toInt(); 79 | } 80 | 81 | int AutoAlignDialog::getAligner() 82 | { 83 | return ui->selector_aligner->currentIndex(); 84 | } 85 | 86 | int AutoAlignDialog::getProfile() 87 | { 88 | return ui->selector_profile->currentIndex(); 89 | } 90 | 91 | void AutoAlignDialog::fromChanged() 92 | { 93 | to_validator->setBottom(getStartPos()); 94 | checkValidity(); 95 | } 96 | 97 | void AutoAlignDialog::toChanged() 98 | { 99 | from_validator->setTop(getEndPos()); 100 | checkValidity(); 101 | } 102 | 103 | void AutoAlignDialog::checkValidity() 104 | { 105 | if (getStartPos()>getEndPos()) 106 | ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); 107 | else 108 | ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); 109 | } 110 | 111 | void AutoAlignDialog::alignerChanged(int al) 112 | { 113 | ui->selector_profile->clear(); 114 | ui->selector_profile->addItems(profiles.value(al,QStringList())); 115 | } 116 | 117 | bool AutoAlignDialog::getAutoClose() 118 | { 119 | return (ui->autoCloseSel->checkState()!=Qt::Checked); 120 | } 121 | -------------------------------------------------------------------------------- /src/AutoAlignDialog.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef AUTOALIGNDIALOG_H 23 | #define AUTOALIGNDIALOG_H 24 | 25 | #include 26 | #include 27 | 28 | namespace Ui { 29 | class AutoAlignDialog; 30 | } 31 | 32 | class AutoAlignDialog : public QDialog 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit AutoAlignDialog(QWidget *parent = 0, int max = 0); 38 | ~AutoAlignDialog(); 39 | void addAligner(QString name, QStringList a_profiles); 40 | void setStartPos(int pos); 41 | void setEndPos(int pos); 42 | int getStartPos(); 43 | int getEndPos(); 44 | int getAligner(); 45 | int getProfile(); 46 | bool getAutoClose(); 47 | 48 | private: 49 | Ui::AutoAlignDialog *ui; 50 | QIntValidator * from_validator; 51 | QIntValidator * to_validator; 52 | QList profiles; 53 | void checkValidity(); 54 | 55 | private slots: 56 | void fromChanged(); 57 | void toChanged(); 58 | void alignerChanged(int al); 59 | }; 60 | 61 | #endif // AUTOALIGNDIALOG_H 62 | -------------------------------------------------------------------------------- /src/AutoAlignDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AutoAlignDialog 4 | 5 | 6 | Qt::WindowModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 400 13 | 226 14 | 15 | 16 | 17 | 18 | 0 19 | 0 20 | 21 | 22 | 23 | Automatic alignment 24 | 25 | 26 | true 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | from 36 | 37 | 38 | 39 | 40 | 41 | 42 | positions: 43 | 44 | 45 | 46 | 47 | 48 | 49 | to 50 | 51 | 52 | 53 | 54 | 55 | 56 | keep aligner log open 57 | 58 | 59 | false 60 | 61 | 62 | 63 | 64 | 65 | 66 | Qt::ImhDigitsOnly 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | Qt::ImhDigitsOnly 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | Aligner: 87 | 88 | 89 | 90 | 91 | 92 | 93 | Profile: 94 | 95 | 96 | 97 | 98 | 99 | 100 | Qt::Horizontal 101 | 102 | 103 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | Align automatically using: 114 | 115 | 116 | 117 | 118 | 119 | 120 | selector_aligner 121 | selector_profile 122 | edit_from 123 | edit_to 124 | autoCloseSel 125 | buttonBox 126 | 127 | 128 | 129 | 130 | buttonBox 131 | accepted() 132 | AutoAlignDialog 133 | accept() 134 | 135 | 136 | 248 137 | 254 138 | 139 | 140 | 157 141 | 274 142 | 143 | 144 | 145 | 146 | buttonBox 147 | rejected() 148 | AutoAlignDialog 149 | reject() 150 | 151 | 152 | 316 153 | 260 154 | 155 | 156 | 286 157 | 274 158 | 159 | 160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /src/ChangeDialog.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef CHANGEDIALOG_H 23 | #define CHANGEDIALOG_H 24 | 25 | #include 26 | #include 27 | #include "ItAlignment.h" 28 | 29 | class ServerDialog; 30 | class ItWindow; 31 | 32 | namespace Ui { 33 | class ChangeDialog; 34 | } 35 | 36 | class ChangeDialog : public QDialog 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | explicit ChangeDialog(ServerDialog *parent, ItWindow * win, ItAlignment * a, aligned_doc d, QDomNodeList &changes, bool * mark, bool acceptonly=false); 42 | ~ChangeDialog(); 43 | void setCounter(QString num, QString total); 44 | void setTextFont(const QFont &font); 45 | public slots: 46 | void updateRStrings(QDomNodeList nodelist); 47 | 48 | private: 49 | ServerDialog * server; 50 | ItWindow * window; 51 | ItAlignment * alignment; 52 | QPushButton * appendButton; 53 | QPushButton * detachButton; 54 | aligned_doc doc; 55 | QDomNodeList changeList; 56 | int changenum, nextChangeNum, startnum, lstartnum, lcount; 57 | QStringList rstringlist; 58 | QList rparbreaks; 59 | bool autoAccept; 60 | int joinConsChanges; 61 | Ui::ChangeDialog * ui; 62 | //QStringList * m_rstrings; 63 | //QList * m_rparbr; 64 | //int m_rstartnum; 65 | bool * markState; 66 | void nextChange(); 67 | void commitChange(); 68 | void rejectChange(); 69 | void syncFailure(QString text); 70 | void showChange(QStringList &lstrings, QList &lparbr); 71 | private slots: 72 | void action(QAbstractButton * button); 73 | void changeMark(int state); 74 | void renderRStrings(); 75 | void appendChange(); 76 | void detachChange(); 77 | }; 78 | 79 | #endif // CHANGEDIALOG_H 80 | -------------------------------------------------------------------------------- /src/ChangeDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ChangeDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 751 10 | 516 11 | 12 | 13 | 14 | Change 15 | 16 | 17 | 18 | 19 | 20 | current local text to be changed 21 | 22 | 23 | 24 | 25 | 26 | 27 | remote text change to be applied 28 | 29 | 30 | 31 | 32 | 33 | 34 | Qt::Horizontal 35 | 36 | 37 | QDialogButtonBox::Abort|QDialogButtonBox::No|QDialogButtonBox::Yes|QDialogButtonBox::YesToAll 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | mark changes 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/CustomizeDialog.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef CUSTOMIZEDIALOG_H 23 | #define CUSTOMIZEDIALOG_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | class ItWindow; 30 | 31 | namespace Ui { 32 | class CustomizeDialog; 33 | } 34 | 35 | class CustomizeDialog : public QDialog 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | explicit CustomizeDialog(ItWindow *parent = 0); 41 | ~CustomizeDialog(); 42 | public slots: 43 | void accept(); 44 | 45 | protected: 46 | bool eventFilter(QObject *obj, QEvent *ev); 47 | 48 | private: 49 | Ui::CustomizeDialog *ui; 50 | ItWindow *window; 51 | int scanKeysToRow; 52 | QString lastKeys; 53 | QMenu ctxMenu; 54 | QAction *setAct, *delAct; 55 | void reconfigureToolBar(); 56 | void reconfigureContextMenu(); 57 | void reconfigureShortcuts(); 58 | 59 | private slots: 60 | void addTBItem(); 61 | void delTBItem(); 62 | void addCMItem(); 63 | void delCMItem(); 64 | void shortCutEdit(QModelIndex index); 65 | void shortCutChange(int row, int col, int prerow, int precol); 66 | void showShortcutsMenu(const QPoint& pos); 67 | void requestShortcutEdit(); 68 | void requestShortcutDelete(); 69 | }; 70 | 71 | #endif // CUSTOMIZEDIALOG_H 72 | -------------------------------------------------------------------------------- /src/CustomizeDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CustomizeDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 539 10 | 484 11 | 12 | 13 | 14 | Customize 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 22 | 23 | 24 | ToolBar 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Current actions 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | << 47 | 48 | 49 | 50 | 51 | 52 | 53 | >> 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | Available actions 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | ContextMenu 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | Current actions 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | << 100 | 101 | 102 | 103 | 104 | 105 | 106 | >> 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | Available actions 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | Shortcuts 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | Qt::Horizontal 144 | 145 | 146 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | buttonBox 156 | accepted() 157 | CustomizeDialog 158 | accept() 159 | 160 | 161 | 248 162 | 254 163 | 164 | 165 | 157 166 | 274 167 | 168 | 169 | 170 | 171 | buttonBox 172 | rejected() 173 | CustomizeDialog 174 | reject() 175 | 176 | 177 | 316 178 | 260 179 | 180 | 181 | 286 182 | 274 183 | 184 | 185 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /src/ImportTxtDialog.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef IMPORTTXTDIALOG_H 23 | #define IMPORTTXTDIALOG_H 24 | 25 | #include 26 | #include 27 | 28 | namespace Ui { 29 | class ImportTxtDialog; 30 | } 31 | 32 | class ImportTxtDialog : public QDialog 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit ImportTxtDialog(QWidget *parent = 0); 38 | ~ImportTxtDialog(); 39 | void setHeaderFooterModeOnly(bool set = true); 40 | void setEncoding(QString text); 41 | QString getEncoding(); 42 | void setXmlHeader(QString text); 43 | QString getXmlHeader(); 44 | void setParSep(QString sep); 45 | QString getParSep(); 46 | void setParEl(QString name); 47 | QString getParEl(); 48 | void setSplit(bool set); 49 | bool getSplit(); 50 | void setSentEl(QString name); 51 | QString getSentEl(); 52 | void setSentSep(QString sep); 53 | QString getSentSep(); 54 | void setSplitProfiles(QStringList list); 55 | int getSplitProfile(); 56 | void setXmlFooter(QString text); 57 | QString getXmlFooter(); 58 | void setKeepMarkup(bool set); 59 | bool getKeepMarkup(); 60 | bool dontAsk(); 61 | 62 | private: 63 | Ui::ImportTxtDialog *ui; 64 | QStringList encodings; 65 | QString importXmlHeader, importXmlFooter; 66 | bool checkXml(QString xml, int linedec = 0); 67 | 68 | private slots: 69 | void editXmlHeader(); 70 | void editXmlFooter(); 71 | }; 72 | 73 | #endif // IMPORTTXTDIALOG_H 74 | -------------------------------------------------------------------------------- /src/ImportXmlDialog.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #include "ImportXmlDialog.h" 23 | #include "ui_ImportXmlDialog.h" 24 | 25 | ImportXmlDialog::ImportXmlDialog(QWidget *parent) : 26 | QDialog(parent), 27 | ui(new Ui::ImportXmlDialog) 28 | { 29 | ui->setupUi(this); 30 | adjustSize(); 31 | } 32 | 33 | ImportXmlDialog::~ImportXmlDialog() 34 | { 35 | delete ui; 36 | } 37 | 38 | void ImportXmlDialog::setAlignableOnlyMode(bool set) 39 | { 40 | if (set) { 41 | ui->label_alelements->setText(tr("Give a comma-separated list of names of all elements containing alignable text (e.g. \"head,s,verse\").")); 42 | ui->label_textelements->hide(); 43 | ui->label_neweledit->hide(); 44 | ui->edit_newelname->hide(); 45 | ui->sel_textelements->hide(); 46 | ui->edit_textelements->hide(); 47 | ui->label_profilesel->hide(); 48 | ui->sel_profile->hide(); 49 | ui->label_txteledit->hide(); 50 | adjustSize(); 51 | } 52 | } 53 | 54 | bool ImportXmlDialog::isSegmented() 55 | { 56 | if (ui->sel_alelements->isChecked()) 57 | return true; 58 | else 59 | return false; 60 | } 61 | 62 | void ImportXmlDialog::setSplitter() 63 | { 64 | ui->sel_textelements->setChecked(true); 65 | } 66 | 67 | bool ImportXmlDialog::getSplitter() 68 | { 69 | return ui->sel_textelements->isChecked(); 70 | } 71 | 72 | void ImportXmlDialog::setAlElements(QStringList &list) 73 | { 74 | ui->edit_alelements->setText(list.join(",")); 75 | } 76 | 77 | void ImportXmlDialog::setTextElements(QStringList &list) 78 | { 79 | ui->edit_textelements->setText(list.join(",")); 80 | } 81 | 82 | void ImportXmlDialog::setProfiles(QStringList list) 83 | { 84 | ui->sel_profile->insertItems(0, list); 85 | } 86 | 87 | void ImportXmlDialog::setNewElName(QString name) 88 | { 89 | ui->edit_newelname->setText(name); 90 | } 91 | 92 | QStringList ImportXmlDialog::getAlElements() 93 | { 94 | QStringList list; 95 | QString elname; 96 | foreach (elname, ui->edit_alelements->text().split(",", QString::SkipEmptyParts)) { 97 | list.append(elname.trimmed()); 98 | } 99 | return list; 100 | } 101 | 102 | QStringList ImportXmlDialog::getTextElements() 103 | { 104 | QStringList list; 105 | QString elname; 106 | foreach (elname, ui->edit_textelements->text().split(",", QString::SkipEmptyParts)) { 107 | list.append(elname.trimmed()); 108 | } 109 | return list; 110 | } 111 | 112 | int ImportXmlDialog::getProfile() 113 | { 114 | return ui->sel_profile->currentIndex(); 115 | } 116 | 117 | QString ImportXmlDialog::getNewElName() 118 | { 119 | return ui->edit_newelname->text(); 120 | } 121 | 122 | bool ImportXmlDialog::dontAsk() 123 | { 124 | return ui->dontAsk->isChecked(); 125 | } 126 | -------------------------------------------------------------------------------- /src/ImportXmlDialog.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef IMPORTXMLDIALOG_H 23 | #define IMPORTXMLDIALOG_H 24 | 25 | #include 26 | 27 | namespace Ui { 28 | class ImportXmlDialog; 29 | } 30 | 31 | class ImportXmlDialog : public QDialog 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit ImportXmlDialog(QWidget *parent = 0); 37 | ~ImportXmlDialog(); 38 | void setAlignableOnlyMode(bool set = true); 39 | bool isSegmented(); 40 | void setSplitter(); 41 | bool getSplitter(); 42 | void setAlElements(QStringList &list); 43 | void setTextElements(QStringList &list); 44 | void setProfiles(QStringList list); 45 | void setNewElName(QString name); 46 | QStringList getAlElements(); 47 | QStringList getTextElements(); 48 | int getProfile(); 49 | QString getNewElName(); 50 | bool dontAsk(); 51 | 52 | private: 53 | Ui::ImportXmlDialog *ui; 54 | }; 55 | 56 | #endif // IMPORTXMLDIALOG_H 57 | -------------------------------------------------------------------------------- /src/ImportXmlDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ImportXmlDialog 4 | 5 | 6 | Qt::WindowModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 465 13 | 358 14 | 15 | 16 | 17 | 18 | 0 19 | 0 20 | 21 | 22 | 23 | XML Import settings 24 | 25 | 26 | true 27 | 28 | 29 | 30 | 31 | 32 | alignable elements: 33 | 34 | 35 | true 36 | 37 | 38 | 39 | 40 | 41 | 42 | automatically segment text 43 | 44 | 45 | 46 | 47 | 48 | 49 | using profile: 50 | 51 | 52 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | within elements: 66 | 67 | 68 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 69 | 70 | 71 | 72 | 73 | 74 | 75 | If the text is not segmented into sentences yet, give a comma-separated list of names of all elements containing alignable text (e.g. "p"), choose a profile for automatic segmentation and select name for elements created by the segmentator (e.g. "s"). 76 | 77 | 78 | true 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | If the text is segmented, give a comma-separated list of names of all elements containing alignable text (e.g. "head,s,verse"). 89 | 90 | 91 | true 92 | 93 | 94 | 95 | 96 | 97 | 98 | create elements: 99 | 100 | 101 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | Qt::Horizontal 112 | 113 | 114 | QDialogButtonBox::Ok 115 | 116 | 117 | true 118 | 119 | 120 | 121 | 122 | 123 | 124 | don't ask me every time 125 | 126 | 127 | 128 | 129 | 130 | 131 | Qt::Horizontal 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | buttonBox 141 | accepted() 142 | ImportXmlDialog 143 | accept() 144 | 145 | 146 | 248 147 | 254 148 | 149 | 150 | 157 151 | 274 152 | 153 | 154 | 155 | 156 | buttonBox 157 | rejected() 158 | ImportXmlDialog 159 | reject() 160 | 161 | 162 | 316 163 | 260 164 | 165 | 166 | 286 167 | 274 168 | 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /src/ItAbstractDelegate.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef IT_ABSTRACTDELEGATE_H 23 | #define IT_ABSTRACTDELEGATE_H 24 | 25 | #include 26 | #include "ItCommon.h" 27 | #include "ItAlignmentModel.h" 28 | #include "ItQuestionDialog.h" 29 | #include "ItPlainTextEdit.h" 30 | 31 | class ItAbstractDelegate : public QStyledItemDelegate 32 | { 33 | Q_OBJECT 34 | public: 35 | //static AutoState autoSaveElement; 36 | explicit ItAbstractDelegate(QObject *parent = 0); 37 | //ItSegmentView * segview; 38 | //QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; 39 | //void setEditorData(QWidget *editor, const QModelIndex &index) const; 40 | //void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; 41 | void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; 42 | void paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; 43 | QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const; 44 | bool getHtmlView() const; 45 | void setHtmlView(bool set); 46 | //static void setAutoSaveElement(AutoState value); 47 | //static AutoState getAutoSaveElement(); 48 | signals: 49 | void commitData(QWidget *editor, QAbstractItemDelegate::EndEditHint hint = QAbstractItemDelegate::NoHint); 50 | void insertNextRequested(); 51 | public slots: 52 | //void onClose ( QWidget * editor, QAbstractItemDelegate::EndEditHint hint = NoHint ); 53 | void editorCloseRequested(QWidget * editor, QAbstractItemDelegate::EndEditHint hint = QAbstractItemDelegate::NoHint, bool insertNext = false); 54 | protected: 55 | QWidget * myparent; 56 | //bool eventFilter(QObject *obj, QEvent *ev); 57 | //void registerSegView(ItSegmentView * view); 58 | private: 59 | bool htmlView; 60 | void createContents(QTextDocument * doc, const QStyleOptionViewItem & option, const QModelIndex & index) const; 61 | private slots: 62 | }; 63 | 64 | #endif // ITABSTRACTDELEGATE_H 65 | -------------------------------------------------------------------------------- /src/ItAlignmentDelegate.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef IT_ALIGNMENT_DELEGATE_H 23 | #define IT_ALIGNMENT_DELEGATE_H 24 | 25 | #include 26 | #include 27 | #include "ItAbstractDelegate.h" 28 | // #include "ItSegmentView.h" 29 | #include "ItSegmentDelegate.h" 30 | #include "ItAlignmentModel.h" 31 | // #include "ItAlignmentView.h" 32 | 33 | class ItAlignmentView; 34 | class ItSegmentView; 35 | 36 | class ItAlignmentDelegate : public ItAbstractDelegate 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | //ItSegmentView * segview; 42 | ItAlignmentDelegate(QObject *parent = 0); 43 | QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; 44 | void setEditorData(QWidget *editor, const QModelIndex &index) const; 45 | void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; 46 | //void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; 47 | //void paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; 48 | QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const; 49 | protected: 50 | bool eventFilter(QObject *obj, QEvent *ev); 51 | //bool validateXML(QWidget *editor); 52 | //void registerSegView(ItSegmentView * view); 53 | protected slots: 54 | //void editorSizeHintChanged(int height); 55 | private: 56 | ItAlignmentView * alview; 57 | //ItPlainTextEdit * mytxtedit; 58 | //void createContents(QTextDocument * doc, const QStyleOptionViewItem & option, const QModelIndex & index) const; 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /src/ItAlignmentView.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef IT_ALIGNMENT_VIEW_H 23 | #define IT_ALIGNMENT_VIEW_H 24 | 25 | #include 26 | #include "ItCommon.h" 27 | #include "ItAlignmentModel.h" 28 | #include "ItAlignmentDelegate.h" 29 | #include "ItCommands.h" 30 | #include "ItPlainTextEdit.h" 31 | #include "ItSegmentView.h" 32 | #include "ItFloatControls.h" 33 | 34 | #define BACKWARD_RESIZE_ROWS 0 35 | #define FORWARD_RESIZE_ROWS 2 36 | #define INVALID_ROW 2147483647 37 | 38 | 39 | class ItWindow; 40 | 41 | class ItAlignmentView : public QTableView 42 | { 43 | Q_OBJECT 44 | 45 | public: 46 | ItAlignmentView(QWidget * parent = 0 ); 47 | ~ItAlignmentView(); 48 | void createContextMenu(); 49 | //void cacheAllSizeHints(); 50 | //void updateSizeHints(int from, int to); 51 | void setModel(QAbstractItemModel * model); 52 | bool isEditing(); 53 | void setSegView(ItSegmentView * cursegview); 54 | void setEditor(ItPlainTextEdit * cureditor); 55 | bool htmlView(); 56 | void setHtmlView(bool set); 57 | void setFont( const QFont &f ); 58 | bool realign(int fromPos, int toPos, QList alignedIDs [2]); 59 | void setHighlNon11(bool set); 60 | void setHighlMarked(bool set); 61 | bool highlNon11(); 62 | bool highlMarked(); 63 | int skipMargin; 64 | int controlsHideTimeOut; 65 | void setAutoSaveElement(AutoState value); 66 | AutoState getAutoSaveElement(); 67 | void setShowControls(ShowControlsType mode); 68 | void setSizeControls(int size); 69 | ShowControlsType getShowControls(); 70 | int getSizeControls(); 71 | void setEditorKeys(EditorKeys keys); 72 | EditorKeys getEditorKeys() const; 73 | //void setRowHeight(int row, int height); 74 | QAbstractItemDelegate::EndEditHint nexthint; 75 | ItSegmentView * segview; 76 | ItPlainTextEdit * txteditor; 77 | bool insertingElement; 78 | public slots: 79 | void resizeRowToContents ( int row ); 80 | void moveUp(int row = INVALID_ROW, int doc = 0); 81 | void moveDown(int row = INVALID_ROW, int doc = 0); 82 | void moveBothUp(int row = INVALID_ROW); 83 | void moveBothDown(int row = INVALID_ROW); 84 | void moveText(); 85 | void shift(int row = INVALID_ROW, int doc = 0); 86 | void pop(int row = INVALID_ROW, int doc = 0); 87 | void swapSegments(int row = INVALID_ROW, int doc = 0); 88 | void toggleStat(); 89 | void toggleMark(); 90 | void confirmAll(); 91 | bool openEditor(); 92 | void insertElement(); 93 | void splitParent(); 94 | void mergeParent(); 95 | void edit(const QModelIndex &index); 96 | void closeEditor(QWidget* editor,QAbstractItemDelegate::EndEditHint hint); 97 | void updateRowSize(); 98 | void focusIndex(QModelIndex idx); 99 | void optimizeSize(QStatusBar * statusBar); 100 | void resizeRows(); 101 | void showContextMenu(const QPoint& pos); 102 | void keepMargin(); 103 | //void updateRowHeight(QModelIndex index, int height); 104 | signals: 105 | void editingStarted(); 106 | void editingFinished(); 107 | void cursorChanged(); 108 | void segViewChanged(ItSegmentView * cursegview); 109 | void focusChanged(); 110 | protected: 111 | void keyPressEvent (QKeyEvent * event); 112 | void mousePressEvent (QMouseEvent * event); 113 | void mouseMoveEvent ( QMouseEvent * event ); 114 | void wheelEvent(QWheelEvent * event); 115 | void leaveEvent(QEvent * event); 116 | void focusOutEvent( QFocusEvent * event ); 117 | void focusInEvent( QFocusEvent * event ); 118 | void currentChanged ( const QModelIndex & current, const QModelIndex & previous ); 119 | //void resizeEvent ( QResizeEvent * event ); 120 | bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event); 121 | QIcon composeIcon(QString fname); 122 | QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers); 123 | void handleCloseHint(QAbstractItemDelegate::EndEditHint hint, bool insertNext = false); 124 | protected slots: 125 | void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); 126 | void commitData (QWidget * editor); 127 | void commitData ( QWidget * editor, QAbstractItemDelegate::EndEditHint hint ); 128 | void mayCloseEditor ( QWidget * editor, QAbstractItemDelegate::EndEditHint hint = QAbstractItemDelegate::NoHint ); 129 | //void currentChanged (const QModelIndex & current, const QModelIndex & previous); 130 | void insertNextRequested(); 131 | private: 132 | ItWindow * window; 133 | ItAlignmentDelegate * delegate; 134 | bool editorOpen; 135 | ItAlignmentModel * itmodel; 136 | bool hNon11, hMarked; 137 | //int nextToResize; 138 | int resizerow, llastrow, lfirstrow; 139 | bool resizeNextTime; 140 | bool keepMarginNextTime; 141 | QTimer timer; 142 | ShowControlsType showControls; 143 | int sizeControls; 144 | AutoState autoSaveElement; 145 | ItFloatControls * floatControl; 146 | QMenu ctxMenu; 147 | EditorKeys edKeys; 148 | //int calcItemHeight(const QModelIndex &index); 149 | }; 150 | 151 | #endif 152 | -------------------------------------------------------------------------------- /src/ItCommon.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef ITCOMMON_H 23 | #define ITCOMMON_H 24 | 25 | #define TINY 16 26 | #define SMALL 22 27 | #define MEDIUM 32 28 | #define LARGE 48 29 | #define XLARGE 64 30 | #define XXLARGE 72 31 | #define XXXLARGE 96 32 | #define ULARGE 128 33 | 34 | #include 35 | 36 | enum AutoState { AutoNo = 0, AutoYes, AutoAsk }; 37 | enum ShowControlsType { HiddenCtrl = 0, OnMove, OnClick }; 38 | 39 | /*struct EditorKeys 40 | { 41 | int saveExit; 42 | int discardExit; 43 | int saveNext; 44 | int savePrev; 45 | };*/ 46 | 47 | struct EditorKeys 48 | { 49 | QKeySequence saveExit; 50 | QKeySequence discardExit; 51 | QKeySequence saveNext; 52 | QKeySequence savePrev; 53 | QKeySequence saveInsertNext; 54 | }; 55 | 56 | struct Replacement 57 | { 58 | QString src; 59 | QString repl; 60 | }; 61 | 62 | #endif // ITCOMMON_H 63 | -------------------------------------------------------------------------------- /src/ItCustomVarsDialog.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #include "ItCustomVarsDialog.h" 23 | #include "ui_ItCustomVarsDialog.h" 24 | #include "ItWindow.h" 25 | 26 | ItCustomVarsDialog::ItCustomVarsDialog(ItWindow *parent, ExTextProfile &prof) : 27 | QDialog(parent), 28 | ui(new Ui::ItCustomVarsDialog) 29 | { 30 | ui->setupUi(this); 31 | window = parent; 32 | QLineEdit * edit; 33 | QString defaultVal; 34 | for (int i=0; imodel->alignment->info.docId); 37 | defaultVal.replace("%v1%", window->model->alignment->info.ver[0].name); 38 | defaultVal.replace("%v2%", window->model->alignment->info.ver[1].name); 39 | edit = new QLineEdit(defaultVal, this); 40 | editors.append(edit); 41 | ui->formLayout->addRow(prof.customVars.at(i).desc, edit); 42 | } 43 | } 44 | 45 | ItCustomVarsDialog::~ItCustomVarsDialog() 46 | { 47 | delete ui; 48 | qDeleteAll(editors); 49 | } 50 | 51 | QStringList ItCustomVarsDialog::getStringList() 52 | { 53 | QStringList ret; 54 | for (int i=0; itext()); 56 | } 57 | return ret; 58 | } 59 | -------------------------------------------------------------------------------- /src/ItCustomVarsDialog.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef ITCUSTOMVARSDIALOG_H 23 | #define ITCUSTOMVARSDIALOG_H 24 | 25 | #include 26 | #include 27 | 28 | class ItWindow; 29 | struct ExTextProfile; 30 | 31 | namespace Ui { 32 | class ItCustomVarsDialog; 33 | } 34 | 35 | class ItCustomVarsDialog : public QDialog 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | explicit ItCustomVarsDialog(ItWindow *parent, ExTextProfile &prof); 41 | ~ItCustomVarsDialog(); 42 | QStringList getStringList(); 43 | 44 | private: 45 | Ui::ItCustomVarsDialog *ui; 46 | ItWindow * window; 47 | QList< QLineEdit* > editors; 48 | }; 49 | 50 | #endif // ITCUSTOMVARSDIALOG_H 51 | -------------------------------------------------------------------------------- /src/ItCustomVarsDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ItCustomVarsDialog 4 | 5 | 6 | Qt::WindowModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 400 13 | 72 14 | 15 | 16 | 17 | 18 | 0 19 | 0 20 | 21 | 22 | 23 | Custom variables 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Qt::Horizontal 33 | 34 | 35 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | buttonBox 45 | accepted() 46 | ItCustomVarsDialog 47 | accept() 48 | 49 | 50 | 248 51 | 254 52 | 53 | 54 | 157 55 | 274 56 | 57 | 58 | 59 | 60 | buttonBox 61 | rejected() 62 | ItCustomVarsDialog 63 | reject() 64 | 65 | 66 | 316 67 | 260 68 | 69 | 70 | 286 71 | 274 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/ItDocument.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef IT_DOCUMENT_H 23 | #define IT_DOCUMENT_H 24 | 25 | #include 26 | #include "ItElement.h" 27 | 28 | #define NO_IDS_IN_DOCUMENT -2 29 | 30 | class ItDocument 31 | { 32 | public: 33 | ItDocument(); 34 | ~ItDocument(); 35 | bool load(const QString &filename); 36 | bool setXml(QByteArray &xml); 37 | bool setXml(QString &xml); 38 | QString getXml(); 39 | bool save(const QString &filename); 40 | bool hasIndex(); 41 | void destroyIndex(QStringList alignedIds); 42 | int numLevels(); 43 | QString numPrefix(); 44 | QString numParentPrefix(); 45 | void setNumLevels(int &value); 46 | void setNumPrefix(QString &prefix); 47 | void setNumParentPrefix(QString &prefix); 48 | void setIdNamespaceURI(QString &uri); 49 | ItElement* elementById(QString &id); 50 | void detectIdSystem(QStringList alignedIds); 51 | void collectElements(QList * elements, QStringList &elNames, QDomNode node = QDomNode()); 52 | QString errorMessage; 53 | QDomDocument getDomDoc(); 54 | 55 | private: 56 | int numbering_levels; 57 | QString numbering_prefix; 58 | QString numbering_parent_prefix; 59 | QString idNamespaceURI; 60 | QString filename; 61 | QString alignables; 62 | QDomDocument doc; 63 | QHash index; 64 | bool createIndex(); 65 | bool scanNode(QDomNode node); 66 | void setUnknownNumbering(int numbering = 0); 67 | //QDomElement searchById(QDomElement &e, QString &id); 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/ItElement.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #include "ItElement.h" 23 | 24 | ItElement::ItElement(QDomElement el) 25 | { 26 | element = el; 27 | } 28 | 29 | QString ItElement::getContents(bool prepend) 30 | { 31 | QString string; 32 | QTextStream* str = new QTextStream(&string); 33 | element.save(*str,-1); 34 | delete str; 35 | string.remove(QRegExp("^<[^>]+>")); 36 | string.remove(QRegExp("]+>$")); 37 | if (prepend) { 38 | string = ' ' + string; 39 | if (first()) string = QString(QChar(0x25BA))+string; 40 | else string = QString(QChar(0x25A0))+string; 41 | //if (first()) string = QString::fromUtf8("‣‣")+string; 42 | //else string = QString::fromUtf8("‣")+string; 43 | } 44 | return string; 45 | } 46 | 47 | bool ItElement::updateContents(QString &string, bool trackChanges) 48 | { 49 | QDomElement replacement = makeDuplicate(string); 50 | if (replacement.nodeName().isEmpty()) 51 | return false; 52 | element.parentNode().replaceChild(replacement,element); 53 | element = replacement; 54 | if (trackChanges) 55 | replEnsure(); 56 | return true; 57 | } 58 | 59 | void ItElement::replEnsure() 60 | { 61 | if (!element.hasAttribute("it_tc_repl")) 62 | element.setAttribute("it_tc_repl", 1); 63 | } 64 | 65 | void ItElement::replInc() 66 | { 67 | if (!element.hasAttribute("it_tc_repl")) 68 | element.setAttribute("it_tc_repl", 2); 69 | else 70 | element.setAttribute("it_tc_repl", element.attribute("it_tc_repl").toInt()+1); 71 | } 72 | 73 | int ItElement::repl() 74 | { 75 | return element.attribute("it_tc_repl", "1").toInt(); 76 | } 77 | 78 | void ItElement::setRepl(int val) 79 | { 80 | element.setAttribute("it_tc_repl", val); 81 | } 82 | 83 | void ItElement::delRepl() 84 | { 85 | if (element.hasAttribute("it_tc_repl")) 86 | element.removeAttribute("it_tc_repl"); 87 | } 88 | 89 | QString ItElement::parbr() 90 | { 91 | return element.attribute("it_tc_parbr",""); 92 | } 93 | 94 | void ItElement::setParbr(QString val) 95 | { 96 | if (val.isEmpty()) { 97 | if (element.hasAttribute("it_tc_parbr")) 98 | element.removeAttribute("it_tc_parbr"); 99 | } else 100 | element.setAttribute("it_tc_parbr", val); 101 | } 102 | 103 | bool ItElement::isVirgin() 104 | { 105 | return !element.hasAttribute("it_tc_repl"); 106 | } 107 | 108 | void ItElement::setVirgin() 109 | { 110 | element.removeAttribute("it_tc_repl"); 111 | } 112 | 113 | ItElement * ItElement::clone(QString &newcontents, bool trackChanges) { 114 | QDomElement copy = makeDuplicate(newcontents); 115 | if (copy.isNull()) 116 | return 0; 117 | if (trackChanges) { 118 | copy.setAttribute("it_tc_repl",0); 119 | copy.removeAttribute("it_tc_parbr"); 120 | } 121 | element.parentNode().insertAfter(copy,element); 122 | return new ItElement(copy); 123 | } 124 | 125 | QDomElement ItElement::makeDuplicate(QString &newcontents) { 126 | QDomDocument tmp; 127 | QString string = QString("\n%1\n").arg(newcontents.trimmed()); 128 | if (!tmp.setContent(string)) return QDomElement(); 129 | QDomElement newel = tmp.documentElement(); 130 | // make newel have the same name and attributes as the original node 131 | newel.setTagName(element.tagName()); 132 | QDomNamedNodeMap atts = element.attributes(); 133 | for (int i = 0; i < atts.count(); i++) { 134 | newel.setAttribute(atts.item(i).toAttr().name(), atts.item(i).toAttr().value()); 135 | } 136 | return element.ownerDocument().importNode(newel,true).toElement(); 137 | } 138 | 139 | QString ItElement::getID(QString &namespaceURI) 140 | { 141 | if (namespaceURI.isEmpty()) { 142 | return element.attribute("id", ""); 143 | } else { 144 | return element.attributeNS(namespaceURI, "id", ""); 145 | } 146 | } 147 | 148 | void ItElement::setID(const QString &id, QString &namespaceURI) { 149 | if (namespaceURI.isEmpty()) { 150 | element.setAttribute("id", id); 151 | } else { 152 | element.setAttributeNS(namespaceURI, "id", id); 153 | } 154 | } 155 | 156 | void ItElement::setParentID(const QString &id, QString &namespaceURI) { 157 | if (namespaceURI.isEmpty()) { 158 | element.parentNode().toElement().setAttribute("id", id); 159 | } else { 160 | element.parentNode().toElement().setAttributeNS(namespaceURI, "id", id); 161 | } 162 | } 163 | 164 | QString ItElement::getParentID(QString &namespaceURI) 165 | { 166 | if (namespaceURI.isEmpty()) { 167 | return element.parentNode().toElement().attribute("id", ""); 168 | } else { 169 | return element.parentNode().toElement().attributeNS(namespaceURI, "id", ""); 170 | } 171 | } 172 | 173 | bool ItElement::first() 174 | { 175 | if (element==element.parentNode().firstChildElement()) return true; 176 | else return false; 177 | } 178 | 179 | QDomElement ItElement::getParent() { 180 | return element.parentNode().toElement(); 181 | } 182 | 183 | QList ItElement::getDomElPath() 184 | { 185 | QList path; 186 | QDomElement el = this->element; 187 | path.prepend(el); 188 | while (el.parentNode().isElement()) { 189 | el = el.parentNode().toElement(); 190 | path.prepend(el); 191 | } 192 | return path; 193 | } 194 | -------------------------------------------------------------------------------- /src/ItElement.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef IT_ELEMENT_H 23 | #define IT_ELEMENT_H 24 | 25 | #include 26 | #include 27 | 28 | class ItElement 29 | { 30 | public: 31 | QDomElement element; 32 | ItElement(QDomElement el); 33 | QString getContents(bool prepend = true); 34 | bool updateContents(QString &string, bool trackChanges = false); 35 | ItElement * clone(QString &newcontents, bool trackChanges = false); 36 | QString getID(QString &namespaceURI); 37 | QString getParentID(QString &namespaceURI); 38 | QDomElement getParent(); 39 | int num; 40 | void setID(const QString &id, QString &namespaceURI); 41 | void setParentID(const QString &id, QString &namespaceURI); 42 | bool first(); 43 | // tracking changes 44 | int repl(); 45 | void setRepl(int val); 46 | void delRepl(); 47 | QString parbr(); 48 | void setParbr(QString val); 49 | bool isVirgin(); 50 | void setVirgin(); 51 | QList getDomElPath(); 52 | 53 | private: 54 | QDomElement makeDuplicate(QString &newcontents); 55 | // tracking changes 56 | void replEnsure(); 57 | void replInc(); 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/ItFloatControls.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef ITFLOATCONTROLS_H 23 | #define ITFLOATCONTROLS_H 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | class ItFloatControls : public QWidget 31 | { 32 | Q_OBJECT 33 | public: 34 | explicit ItFloatControls(QWidget *parent = 0); 35 | ~ItFloatControls(); 36 | void setRow(int row); 37 | int row(); 38 | void setEnabledLeft(bool set = true); 39 | void setEnabledRight(bool set = true); 40 | signals: 41 | void sglUp(int row, int doc); 42 | void sglDown(int row, int doc); 43 | void txtUp(int row, int doc); 44 | void txtDown(int row, int doc); 45 | void bothUp(int row); 46 | void bothDown(int row); 47 | public slots: 48 | void show(int autohide = 0); 49 | void setIconSize(int size = 16); 50 | 51 | private: 52 | QGridLayout *layout; 53 | QPushButton *lSglUp, *lSglDown, *lDblUp, *lDblDown, *bUp, *bDown, *rDblUp, *rDblDown, *rSglUp, *rSglDown; 54 | QTimer timer; 55 | QIcon composeIcon(QString fname); 56 | int currow; 57 | private slots: 58 | void lsglUpPressed(); 59 | void lsglDownPressed(); 60 | void ldblUpPressed(); 61 | void ldblDownPressed(); 62 | void rsglUpPressed(); 63 | void rsglDownPressed(); 64 | void rdblUpPressed(); 65 | void rdblDownPressed(); 66 | void bUpPressed(); 67 | void bDownPressed(); 68 | }; 69 | 70 | #endif // ITFLOATCONTROLS_H 71 | -------------------------------------------------------------------------------- /src/ItPlainTextEdit.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef ITPLAINTEXTEDIT_H 23 | #define ITPLAINTEXTEDIT_H 24 | 25 | #include 26 | #include "ItCommon.h" 27 | 28 | class ItPlainTextEdit : public QPlainTextEdit 29 | { 30 | Q_OBJECT 31 | int fitting_height; 32 | 33 | public: 34 | AutoState haveAsked; 35 | bool insertNext; 36 | QModelIndex index; 37 | ItPlainTextEdit(QWidget *parent, EditorKeys keys); 38 | ~ItPlainTextEdit(); 39 | QSize sizeHint() const; 40 | bool hasBeenChanged(); 41 | void setGeometry(const QRect &rect); 42 | QShortcut * saveExit; 43 | QShortcut * discardExit; 44 | QShortcut * saveNext; 45 | QShortcut * savePrev; 46 | public slots: 47 | //void fitHeightToDocument(); 48 | void resetChangeFlag(); 49 | void showContextMenu(const QPoint &pt); 50 | void splitAtCursor(); 51 | //void setPlainText(const QString &text); 52 | //void updateGeometry(); 53 | signals: 54 | void closeEditor(QWidget * editor, QAbstractItemDelegate::EndEditHint hint = QAbstractItemDelegate::NoHint); 55 | void sizeHintChanged(int row); 56 | protected: 57 | bool textChangeFlag; 58 | void mousePressEvent(QMouseEvent *mouseEvent); 59 | //bool event ( QEvent * e ); 60 | QAction * splitAct; 61 | protected slots: 62 | void setTextChangeFlagTrue(); 63 | }; 64 | 65 | #endif // ITPLAINTEXTEDIT_H 66 | -------------------------------------------------------------------------------- /src/ItQuestionDialog.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #include "ItQuestionDialog.h" 23 | #include "ui_ItQuestionDialog.h" 24 | 25 | ItQuestionDialog::ItQuestionDialog(QWidget *parent) : 26 | QDialog(parent), 27 | ui(new Ui::ItQuestionDialog) 28 | { 29 | ui->setupUi(this); 30 | adjustSize(); 31 | } 32 | 33 | ItQuestionDialog::~ItQuestionDialog() 34 | { 35 | delete ui; 36 | } 37 | 38 | bool ItQuestionDialog::getRememberChoice() { 39 | return ui->checkBox->isChecked(); 40 | } 41 | -------------------------------------------------------------------------------- /src/ItQuestionDialog.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef ITQUESTIONDIALOG_H 23 | #define ITQUESTIONDIALOG_H 24 | 25 | #include 26 | 27 | namespace Ui { 28 | class ItQuestionDialog; 29 | } 30 | 31 | class ItQuestionDialog : public QDialog 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit ItQuestionDialog(QWidget *parent = 0); 37 | ~ItQuestionDialog(); 38 | //void setText(QString text); 39 | bool getRememberChoice(); 40 | 41 | 42 | private: 43 | Ui::ItQuestionDialog *ui; 44 | }; 45 | 46 | #endif // ITQUESTIONDIALOG_H 47 | -------------------------------------------------------------------------------- /src/ItQuestionDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ItQuestionDialog 4 | 5 | 6 | Qt::WindowModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 379 13 | 89 14 | 15 | 16 | 17 | 18 | 0 19 | 0 20 | 21 | 22 | 23 | Dialog 24 | 25 | 26 | 27 | 28 | 29 | Editor will be closed. Do you want to save the changes? 30 | 31 | 32 | 33 | 34 | 35 | 36 | Remember my choice and do not ask again. 37 | 38 | 39 | 40 | 41 | 42 | 43 | Qt::Horizontal 44 | 45 | 46 | QDialogButtonBox::No|QDialogButtonBox::Yes 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | buttonBox 56 | accepted() 57 | ItQuestionDialog 58 | accept() 59 | 60 | 61 | 248 62 | 254 63 | 64 | 65 | 157 66 | 274 67 | 68 | 69 | 70 | 71 | buttonBox 72 | rejected() 73 | ItQuestionDialog 74 | reject() 75 | 76 | 77 | 316 78 | 260 79 | 80 | 81 | 286 82 | 274 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /src/ItSearchBar.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef IT_SEARCHBAR_H 23 | #define IT_SEARCHBAR_H 24 | 25 | #include 26 | #include 27 | 28 | class ItWindow; 29 | 30 | class ItSearchBar : public QWidget 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | enum searchType { SubStr = 0, SubStrCS, RegExp, RegExpCS, ElementId, Bookmark, EmptySeg, Non1Seg, UnConfirmed }; 36 | enum searchSide { Left = 1, Right = 2, Both = 0 }; 37 | enum barMode { Replace = 0, Search }; 38 | ItSearchBar(ItWindow *parent); 39 | ~ItSearchBar(); 40 | searchType getSearchType(); 41 | searchSide getSearchSide(); 42 | QString getSearchString(); 43 | QString getReplacementString(); 44 | void addCurrentQuery(); 45 | bool emptySearch(); 46 | 47 | public slots: 48 | void showSearch(); 49 | void showReplace(); 50 | void hide(); 51 | void enableReplace(bool enable); 52 | 53 | signals: 54 | void findNext(); 55 | void findPrev(); 56 | void replFind(); 57 | void hiding(); 58 | 59 | private: 60 | QComboBox * findEdit; 61 | QComboBox * replEdit; 62 | QComboBox * searchTypeSel; 63 | QComboBox * searchSideSel; 64 | QToolButton * toggleButton; 65 | QPushButton * findNextButton; 66 | QPushButton * findPrevButton; 67 | QPushButton * findAllButton; 68 | QPushButton * replaceButton; 69 | QPushButton * replFindButton; 70 | QPushButton * replAllButton; 71 | barMode mode; 72 | void showAs(barMode startMode); 73 | bool eventFilter(QObject *obj, QEvent *ev); 74 | ItWindow * window; 75 | bool ensureNoHtmlView(); 76 | 77 | private slots: 78 | void toggleMode(); 79 | void searchTypeChanged(int index); 80 | }; 81 | 82 | #endif // IT_SEARCHBAR_H 83 | -------------------------------------------------------------------------------- /src/ItSegmentDelegate.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef IT_SEGMENT_DELEGATE_H 23 | #define IT_SEGMENT_DELEGATE_H 24 | 25 | #include 26 | #include 27 | #include "ItAbstractDelegate.h" 28 | // #include "ItSegmentView.h" 29 | //#include "ItPlainTextEdit.h" 30 | 31 | class ItSegmentView; 32 | class ItAlignmentView; 33 | 34 | class ItSegmentDelegate : public ItAbstractDelegate 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | ItSegmentDelegate(QObject *parent, ItAlignmentView * aview); 40 | QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; 41 | void setEditorData(QWidget *editor, const QModelIndex &index) const; 42 | void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; 43 | void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; 44 | QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const; 45 | protected: 46 | bool eventFilter(QObject *obj, QEvent *ev); 47 | ItAlignmentView * alview; 48 | //private slots: 49 | // void onClose ( QWidget * editor, QAbstractItemDelegate::EndEditHint hint = NoHint ); 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/ItSegmentView.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef IT_SEGMENT_VIEW_H 23 | #define IT_SEGMENT_VIEW_H 24 | 25 | #include 26 | #include "ItSegmentDelegate.h" 27 | #include "ItAlignmentModel.h" 28 | #include "ItCommands.h" 29 | 30 | class ItAlignmentView; 31 | 32 | class ItSegmentView : public QListView 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | QModelIndex index; 38 | ItPlainTextEdit * myeditor; 39 | ItSegmentView(QWidget * parent, ItAlignmentView * parAlView); 40 | ~ItSegmentView(); 41 | //int heightHint(); 42 | void setHtmlView(bool set); 43 | bool isEditing(); 44 | void setEditor(ItPlainTextEdit * editor); 45 | QSize sizeHint() const; 46 | void setGeometry(const QRect &rect); 47 | void adjustGeometry(); 48 | public slots: 49 | void closeAnyEditor(); 50 | void closeEditor(QWidget* editor,QAbstractItemDelegate::EndEditHint hint); 51 | void resizeRowToContents(int row); 52 | void autoOpenEditor(QAbstractItemDelegate::EndEditHint hint); 53 | signals: 54 | void editingStarted(); 55 | void editingFinished(); 56 | void cursorChanged(); 57 | void focusChanged(); 58 | void sizeHintChanged(int row); 59 | void wantBeClosed(QWidget * widget, QAbstractItemDelegate::EndEditHint hint = QAbstractItemDelegate::NoHint, bool insertNext = false); 60 | protected: 61 | void keyPressEvent (QKeyEvent * event); 62 | void focusOutEvent( QFocusEvent * event ); 63 | void focusInEvent( QFocusEvent * event ); 64 | void currentChanged ( const QModelIndex & current, const QModelIndex & previous ); 65 | // bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event); 66 | protected slots: 67 | void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); 68 | void commitData (QWidget * editor ); 69 | void commitData (QWidget * editor , QAbstractItemDelegate::EndEditHint hint ); 70 | void mayCloseEditor ( QWidget * editor, QAbstractItemDelegate::EndEditHint hint = QAbstractItemDelegate::NoHint ); 71 | private: 72 | void handleCloseHint(QAbstractItemDelegate::EndEditHint hint); 73 | //bool editorOpen; 74 | ItSegmentDelegate * delegate; 75 | ItAlignmentView * alView; 76 | QAbstractItemDelegate::EndEditHint autoEditHint; 77 | }; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/ItSentenceSplitter.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #include "ItSentenceSplitter.h" 23 | #include 24 | #include 25 | 26 | ItSentenceSplitter::ItSentenceSplitter() 27 | { 28 | selectedProfile = 0; 29 | } 30 | 31 | QStringList ItSentenceSplitter::getProfileNames() 32 | { 33 | QStringList list; 34 | SplitterProfile p; 35 | foreach(p, profiles) { 36 | list << p.name; 37 | } 38 | return list; 39 | } 40 | 41 | QString ItSentenceSplitter::split(QString text, QString sep) 42 | { 43 | SplitterProfile p = profiles.at(selectedProfile); 44 | Replacement r; 45 | // apply all rules (regular expressions) 46 | foreach (r, p.expressions) { 47 | text.replace(QRegularExpression(r.src, QRegularExpression::UseUnicodePropertiesOption), r.repl); 48 | } 49 | // remove break after abbreviations 50 | QString abbr; 51 | foreach (abbr, p.abbrevs) { 52 | text.replace(QRegularExpression(QString("(\\b%1)#!#").arg(abbr.replace(".","\\.")), QRegularExpression::UseUnicodePropertiesOption),"\\1 "); 53 | //text.replace(QRegularExpression(QString("(\\b%1)#!#").arg(QRegularExpression::escape(abbr))),"\\1 "); 54 | } 55 | // fix broken XML tags 56 | text.replace("#!#", " #!# "); 57 | int pos = 0; 58 | int len; 59 | QString open, body, close; 60 | QRegExp re("(<([a-zA-Z]+)[^>]*>)(.*)(<\\/\\2>)"); 61 | re.setMinimal(true); 62 | while ((pos=re.indexIn(text, pos))>=0) { 63 | len = re.capturedTexts().at(0).length(); 64 | open = re.capturedTexts().at(1); 65 | body = re.capturedTexts().at(3); 66 | close = re.capturedTexts().at(4); 67 | if (body.contains("#!#")) { 68 | body.replace(QRegularExpression("((?:<\\/[^>]+>)*#!#(?:<[^\\/][^>]*>)*)"),QString("%1\\1%2").arg(close, open)); 69 | text.replace(pos, len, QString("%1%2%3").arg(open, body, close)); 70 | } 71 | pos++; 72 | } 73 | text.replace(QRegularExpression("\\s*((?:<\\/[^>]+>)*#!#(?:<[^\\/][^>]*>)*)\\s*"), "\\1"); 74 | 75 | return text.replace("#!#", sep); 76 | } 77 | 78 | void ItSentenceSplitter::selectProfile(int n) 79 | { 80 | selectedProfile = n; 81 | } 82 | 83 | void ItSentenceSplitter::setProfiles(QList newprofiles) 84 | { 85 | profiles = newprofiles; 86 | } 87 | 88 | QList ItSentenceSplitter::getProfiles() 89 | { 90 | return profiles; 91 | } 92 | -------------------------------------------------------------------------------- /src/ItSentenceSplitter.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef IT_SENTENCESPLITTER_H 23 | #define IT_SENTENCESPLITTER_H 24 | 25 | #include 26 | 27 | class ItSentenceSplitter 28 | { 29 | public: 30 | 31 | struct Replacement 32 | { 33 | QString src; 34 | QString repl; 35 | }; 36 | 37 | struct SplitterProfile 38 | { 39 | QString name; 40 | QList expressions; 41 | QStringList abbrevs; 42 | }; 43 | 44 | QList profiles; 45 | int selectedProfile; 46 | 47 | ItSentenceSplitter(); 48 | QStringList getProfileNames(); 49 | QString split(QString text, QString sep); 50 | void selectProfile(int n); 51 | void setProfiles(QList newprofiles); 52 | QList getProfiles(); 53 | 54 | }; 55 | 56 | #endif // ITSENTENCESPLITTER_H 57 | -------------------------------------------------------------------------------- /src/ItServerConn.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef ITSERVER_H 23 | #define ITSERVER_H 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #define ERR_NOERR 0 31 | #define ERR_UNAUTH_USER 1 32 | #define ERR_UNKNOWN_CMD 2 33 | #define ERR_PERM_DENIED 3 34 | #define ERR_NOT_FOUND 4 35 | #define ERR_TEXT_CHANGED 5 36 | #define ERR_OTHER 65535 37 | 38 | class ItWindow; 39 | 40 | class ItServerConn : public QObject 41 | { 42 | Q_OBJECT 43 | 44 | public: 45 | ItServerConn(QString url, QString username, QString passwd, ItWindow *parent); 46 | ~ItServerConn(); 47 | 48 | int getLastErrCode(); 49 | bool netAvailable(); 50 | bool login(); 51 | int canMerge(int aid, QString text, QString ver, QString ver2, int n, int count, QDateTime lastsynced, QString * message = 0); 52 | // 1=yes; 0=no; -1=don't know (cannot connect, etc.) 53 | void docGetLastChange(QString text, QString ver); 54 | 55 | signals: 56 | void statusChanged(QString status); 57 | void error(int code, QString message); 58 | void failure(); 59 | void connected(); 60 | void docGetLastChangeMessage(QString text, QString ver, QDateTime ret); 61 | 62 | protected: 63 | bool checkVersion(); 64 | 65 | private: 66 | QString server_url; 67 | QString server_username; 68 | QString server_passwd; 69 | ItWindow *parent_object; 70 | int server_version; 71 | int server_userid; 72 | QNetworkAccessManager * net; 73 | int lastErrCode; 74 | 75 | bool extractReply(QNetworkReply * reply, QDomElement * body = 0, bool firsttouch = false); 76 | 77 | private slots: 78 | void handleNetworkError(QNetworkReply * reply); 79 | void handleRequestError(int errcode, QString message); 80 | void handleSSLErrors(QNetworkReply * reply, const QList & errors); 81 | void invalidResponse(QString addmessage); 82 | }; 83 | 84 | #endif // ITSERVER_H 85 | -------------------------------------------------------------------------------- /src/ItThreads.cpp: -------------------------------------------------------------------------------- 1 | #include "ItThreads.h" 2 | #include "ItWindow.h" 3 | 4 | ReplaceAllThread::ReplaceAllThread(ItWindow * parent) : QThread(parent) 5 | { 6 | window = parent; 7 | } 8 | 9 | void ReplaceAllThread::run() 10 | {/* 11 | #ifndef QT_NO_CURSOR 12 | QApplication::setOverrideCursor(Qt::BusyCursor); 13 | #endif 14 | uint count = 0; 15 | //window->statusBar()->showMessage(tr("Replace all in progress..."),0);*/ 16 | 17 | /* // ItWindow: replaceAll at this level 18 | search_wrapper(true, true); 19 | if (model->canReplace()) { 20 | double prog = 0; 21 | uint max = model->rowCount(); 22 | uint cur = 0; 23 | stopButtonPressed = false; 24 | model->undoStack->beginMacro("Replace all"); 25 | while (model->canReplace() && !stopButtonPressed) { 26 | cur = model->lastMatchIndex.parent().row(); 27 | prog = ((cur*1.0) / max)*100; 28 | statusBar()->showMessage(tr("Replace all in progress... %1% (segment: %2 of %3; occurrence: %4)").arg(QString::number(prog,'f',1), 29 | QString::number(cur), 30 | QString::number(max), 31 | QString::number(count)),0); 32 | model->replace(searchBar->getReplacementString()); //replace(); 33 | count++; 34 | //search_wrapper(true, false, true); //findNext(); 35 | //find(INVALID_POSITION, true, searchBar->getSearchType(), searchBar->getSearchSide(), searchBar->getSearchString(), true); 36 | model->find(INVALID_POSITION, true, searchBar->getSearchSide(), searchBar->getSearchType(), searchBar->getSearchString()); 37 | } 38 | model->undoStack->endMacro(); 39 | //delete stop; 40 | } 41 | */ 42 | 43 | // call the model to replace all 44 | /* if ((window->searchBar->getSearchType()==ItSearchBar::RegExp || window->searchBar->getSearchType()==ItSearchBar::RegExpCS) && !QRegExp(window->searchBar->getSearchString()).isValid()) { 45 | QMessageBox::warning(window, tr("Search"), tr("Invalid regular expression.")); 46 | return; 47 | } 48 | window->newSearchQuery(0); 49 | window->searchBar->addCurrentQuery(); 50 | if (!window->model->replaceAll(window->statusBar(), &count, window->searchBar->getSearchSide(), window->searchBar->getSearchType(), window->searchBar->getSearchString(), window->searchBar->getReplacementString())) 51 | QMessageBox::information(window, tr("Search"), 52 | tr("Not found."), QMessageBox::Ok); 53 | 54 | #ifndef QT_NO_CURSOR 55 | QApplication::restoreOverrideCursor(); 56 | #endif 57 | //window->statusBar()->removeWidget(stop); 58 | //window->statusBar()->showMessage(tr("Ready."),500); 59 | if (count>0) 60 | QMessageBox::information(window, tr("Replace"), 61 | tr("Replaced %1 occurrences.").arg(QString::number(count)), QMessageBox::Ok);*/ 62 | } 63 | 64 | -------------------------------------------------------------------------------- /src/ItThreads.h: -------------------------------------------------------------------------------- 1 | #ifndef IT_THREADS_H 2 | #define IT_THREADS_H 3 | 4 | #include 5 | 6 | class ItWindow; 7 | 8 | class ReplaceAllThread : public QThread 9 | { 10 | public: 11 | ReplaceAllThread(ItWindow * parent = 0); 12 | void run(); 13 | private: 14 | ItWindow * window; 15 | }; 16 | 17 | #endif // IT_THREADS_H 18 | -------------------------------------------------------------------------------- /src/NewAlignmentDialog.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef NEWALIGNMENTDIALOG_H 23 | #define NEWALIGNMENTDIALOG_H 24 | 25 | #include 26 | #include "ItAlignment.h" 27 | 28 | class ItWindow; 29 | 30 | namespace Ui { 31 | class NewAlignmentDialog; 32 | } 33 | 34 | class NewAlignmentDialog : public QDialog 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | explicit NewAlignmentDialog(ItWindow *parent, ItAlignment * a, QStringList texts, QStringList versions); 40 | ~NewAlignmentDialog(); 41 | void accept(); 42 | void enableOnly(int ver = 0); 43 | 44 | private: 45 | Ui::NewAlignmentDialog *ui; 46 | ItAlignment * alignment; 47 | ItWindow *window; 48 | QStringList m_texts; 49 | QStringList m_versions; 50 | QStringList remoteDocs [2]; 51 | QString textname; 52 | QStringList getRemoteDocs(QString server); 53 | QStringList filterDocs(int doc, QString filter); 54 | private slots: 55 | void textNameChanged(QString val); 56 | void src1Changed(int val); 57 | void src2Changed(int val); 58 | }; 59 | 60 | #endif // NEWALIGNMENTDIALOG_H 61 | -------------------------------------------------------------------------------- /src/NewAlignmentDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | NewAlignmentDialog 4 | 5 | 6 | Qt::WindowModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 418 13 | 130 14 | 15 | 16 | 17 | 18 | 0 19 | 0 20 | 21 | 22 | 23 | New alignment 24 | 25 | 26 | true 27 | 28 | 29 | 30 | 31 | 32 | 10 33 | 34 | 35 | 36 | 37 | 38 | 0 39 | 0 40 | 41 | 42 | 43 | true 44 | 45 | 46 | 47 | 48 | 49 | 50 | Document name: 51 | 52 | 53 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 54 | 55 | 56 | 57 | 58 | 59 | 60 | Version 2 name: 61 | 62 | 63 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 64 | 65 | 66 | 67 | 68 | 69 | 70 | Version 1 name: 71 | 72 | 73 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 0 82 | 0 83 | 84 | 85 | 86 | true 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 0 101 | 0 102 | 103 | 104 | 105 | true 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | false 115 | 116 | 117 | Qt::Horizontal 118 | 119 | 120 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 121 | 122 | 123 | 124 | 125 | 126 | 127 | docNameEdit 128 | ver1nameEdit 129 | ver2nameEdit 130 | selSource1 131 | selSource2 132 | buttonBox 133 | 134 | 135 | 136 | 137 | buttonBox 138 | accepted() 139 | NewAlignmentDialog 140 | accept() 141 | 142 | 143 | 248 144 | 254 145 | 146 | 147 | 157 148 | 274 149 | 150 | 151 | 152 | 153 | buttonBox 154 | rejected() 155 | NewAlignmentDialog 156 | reject() 157 | 158 | 159 | 316 160 | 260 161 | 162 | 163 | 286 164 | 274 165 | 166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /src/RemoteAttrDialog.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef REMOTEATTRDIALOG_H 23 | #define REMOTEATTRDIALOG_H 24 | 25 | #include 26 | #include "ServerDialog.h" 27 | 28 | namespace Ui { 29 | class RemoteAttrDialog; 30 | } 31 | 32 | class RemoteAttrDialog : public QDialog 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit RemoteAttrDialog(ServerDialog *parent, QString key); 38 | ~RemoteAttrDialog(); 39 | 40 | private: 41 | Ui::RemoteAttrDialog *ui; 42 | ServerDialog *sd; 43 | ServerDialog::RemoteAlignment al; 44 | void setRemoteUser(int userid); 45 | QSortFilterProxyModel *selEditorProxyModel; 46 | QAbstractItemModel *oldSelEditorModel; 47 | QSortFilterProxyModel *selRespProxyModel; 48 | QAbstractItemModel *oldSelRespModel; 49 | QSortFilterProxyModel *selREditorProxyModel; 50 | QAbstractItemModel *oldSelREditorModel; 51 | 52 | private slots: 53 | void changeEditor(int n); 54 | void changeResp(int n); 55 | void changeRemoteUser(int n); 56 | void changeStatus(int n); 57 | void changeEdit(int state); 58 | void changeCChstruct(int state); 59 | void setAccess(); 60 | void apply(); 61 | }; 62 | 63 | #endif // REMOTEATTRDIALOG_H 64 | -------------------------------------------------------------------------------- /src/RemoteAttrDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | RemoteAttrDialog 4 | 5 | 6 | Qt::WindowModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 418 13 | 186 14 | 15 | 16 | 17 | 18 | 0 19 | 0 20 | 21 | 22 | 23 | Remote alignment attributes 24 | 25 | 26 | true 27 | 28 | 29 | 30 | 31 | 32 | QFormLayout::ExpandingFieldsGrow 33 | 34 | 35 | 36 | 37 | Editor: 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | Responsible: 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | can edit text 58 | 59 | 60 | 61 | 62 | 63 | 64 | can change central text version 65 | 66 | 67 | 68 | 69 | 70 | 71 | Status: 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | Qt::Horizontal 91 | 92 | 93 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | buttonBox 103 | rejected() 104 | RemoteAttrDialog 105 | reject() 106 | 107 | 108 | 316 109 | 260 110 | 111 | 112 | 286 113 | 274 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /src/ServerDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ServerDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 531 10 | 379 11 | 12 | 13 | 14 | Remote server 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | true 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 24 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Qt::Vertical 46 | 47 | 48 | QDialogButtonBox::Close 49 | 50 | 51 | 52 | 53 | 54 | 55 | alignmentList 56 | buttonBox 57 | 58 | 59 | 60 | 61 | buttonBox 62 | accepted() 63 | ServerDialog 64 | accept() 65 | 66 | 67 | 248 68 | 254 69 | 70 | 71 | 157 72 | 274 73 | 74 | 75 | 76 | 77 | buttonBox 78 | rejected() 79 | ServerDialog 80 | reject() 81 | 82 | 83 | 316 84 | 260 85 | 86 | 87 | 286 88 | 274 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /src/itdomitem.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #include 23 | 24 | #include "itdomitem.h" 25 | 26 | ItDomItem::ItDomItem(QDomNode &node, int row, ItDomItem *parent) 27 | { 28 | domNode = node; 29 | // Record the item's location within its parent. 30 | rowNumber = row; 31 | parentItem = parent; 32 | type = ItDomItem::Element; 33 | if (node.isAttr()) 34 | type = ItDomItem::Attribute; 35 | } 36 | 37 | ItDomItem::~ItDomItem() 38 | { 39 | for (int i = 0; i < childItems.size() ; i++) 40 | delete childItems[i]; 41 | } 42 | 43 | QDomNode ItDomItem::node() const 44 | { 45 | return domNode; 46 | } 47 | 48 | ItDomItem *ItDomItem::parent() 49 | { 50 | return parentItem; 51 | } 52 | 53 | ItDomItem *ItDomItem::child(int i) 54 | { 55 | if (childItems.size()>0) 56 | return childItems[i]; 57 | 58 | int attrCnt = domNode.attributes().count(); 59 | int childCnt = 0; 60 | if (type == Element) 61 | childCnt = domNode.childNodes().count(); 62 | 63 | for (int n = 0; n < attrCnt; n++) { 64 | QDomNode childNode = domNode.attributes().item(n); 65 | ItDomItem *childItem = new ItDomItem(childNode, n, this); 66 | childItems.append(childItem); 67 | } 68 | 69 | for (int n = attrCnt; n < attrCnt+childCnt; n++) { 70 | QDomNode childNode = domNode.childNodes().item(n-attrCnt); 71 | ItDomItem *childItem = new ItDomItem(childNode, n, this); 72 | childItems.append(childItem); 73 | } 74 | return childItems[i]; 75 | } 76 | 77 | int ItDomItem::row() 78 | { 79 | return rowNumber; 80 | } 81 | 82 | void ItDomItem::incRow() 83 | { 84 | rowNumber++; 85 | } 86 | 87 | void ItDomItem::decRow() 88 | { 89 | rowNumber--; 90 | } 91 | 92 | ItDomItem::Type ItDomItem::getType() 93 | { 94 | return type; 95 | } 96 | 97 | QString ItDomItem::getInnerXml() 98 | { 99 | QString string; 100 | QTextStream* str = new QTextStream(&string); 101 | node().save(*str,-1); 102 | delete str; 103 | string.remove(QRegExp("^<[^>]+>")); 104 | string.remove(QRegExp("]+>$")); 105 | return string; 106 | } 107 | 108 | void ItDomItem::setValue(const QString &value) 109 | { 110 | domNode.setNodeValue(value); 111 | } 112 | 113 | QDomNode ItDomItem::cutChild(int i) 114 | { 115 | if (type == Attribute) 116 | return QDomNode(); 117 | 118 | ItDomItem * itchild = childItems.takeAt(i); 119 | QDomNode node = itchild->node(); 120 | if (itchild->getType() == Attribute) { 121 | domNode.toElement().removeAttribute(node.nodeName()); 122 | } else { 123 | domNode.removeChild(node); 124 | } 125 | delete itchild; 126 | for (int j=i; jdecRow(); 128 | } 129 | return node; 130 | } 131 | 132 | bool ItDomItem::insertChild(QDomNode &node, int pos) 133 | { 134 | if (type == Attribute) 135 | return false; 136 | 137 | QDomElement el = domNode.toElement(); 138 | 139 | if (node.isAttr()) { 140 | pos = domNode.attributes().count(); 141 | if (el.hasAttribute(node.nodeName())) 142 | return false; 143 | 144 | el.setAttributeNode(node.toAttr()); 145 | } else { 146 | if (pos < domNode.attributes().count()) 147 | return false; 148 | 149 | QDomNode tmp; 150 | if (pos < childItems.count()) { 151 | if (( tmp = el.insertBefore(node, childItems.at(pos)->node()) )==QDomNode()) 152 | return false; 153 | } else { 154 | pos = childItems.count() - 1; 155 | if (( tmp = el.insertAfter(node, childItems.at(pos)->node()) )==QDomNode()) 156 | return false; 157 | } 158 | } 159 | ItDomItem * newitchild = new ItDomItem(node, pos, this); 160 | childItems.insert(pos, newitchild); 161 | for (int j=pos+1; jincRow(); 163 | } 164 | return true; 165 | } 166 | -------------------------------------------------------------------------------- /src/itdomitem.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef ITDOMITEM_H 23 | #define ITDOMITEM_H 24 | 25 | #include 26 | #include 27 | 28 | class ItDomItem 29 | { 30 | public: 31 | enum Type { Attribute = 0, Element }; 32 | 33 | ItDomItem(QDomNode &node, int row, ItDomItem *parent = 0); 34 | ~ItDomItem(); 35 | ItDomItem *child(int i); 36 | ItDomItem *parent(); 37 | QDomNode node() const; 38 | int row(); 39 | Type getType(); 40 | QString getInnerXml(); 41 | void setValue(const QString &value); 42 | QDomNode cutChild(int i); 43 | bool insertChild(QDomNode &node, int pos = 0); 44 | 45 | protected: 46 | void incRow(); 47 | void decRow(); 48 | 49 | private: 50 | QDomNode domNode; 51 | Type type; 52 | QList childItems; 53 | ItDomItem *parentItem; 54 | int rowNumber; 55 | 56 | }; 57 | 58 | #endif // ITDOMITEM_H 59 | -------------------------------------------------------------------------------- /src/itdommodel.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef ITDOMMODEL_H 23 | #define ITDOMMODEL_H 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include "itdomitem.h" 31 | #include "ItAlignment.h" 32 | 33 | class ItDomModel : public QAbstractItemModel 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | ItDomModel(ItAlignment * alignment, aligned_doc doc, QObject *parent = 0); 39 | ~ItDomModel(); 40 | 41 | QVariant data(const QModelIndex &index, int role) const; 42 | Qt::ItemFlags flags(const QModelIndex &index) const; 43 | QVariant headerData(int section, Qt::Orientation orientation, 44 | int role = Qt::DisplayRole) const; 45 | QModelIndex index(int row, int column, 46 | const QModelIndex &parent = QModelIndex()) const; 47 | QModelIndex parent(const QModelIndex &child) const; 48 | int rowCount(const QModelIndex &parent = QModelIndex()) const; 49 | int columnCount(const QModelIndex &parent = QModelIndex()) const; 50 | bool setData(const QModelIndex &index, const QVariant &value, int role); 51 | QDomNode getRootNode(); 52 | aligned_doc getDocNum(); 53 | QDomNode getPasteNode(); 54 | void setPasteNode(QDomNode &node); 55 | 56 | bool setValue(const QModelIndex &index, const QString &value); 57 | bool addAttribute(const QModelIndex &index, const QString &name); 58 | bool delAttribute(const QModelIndex &index, const QString &name); 59 | bool addChildEl(const QModelIndex &parent, int beforePos, const QString &name); 60 | bool cutItem(const QModelIndex &index); 61 | bool pasteItem(const QModelIndex &parent, int beforePos = 0); 62 | 63 | ItAlignment * al; 64 | 65 | private: 66 | aligned_doc docNum; 67 | ItDomItem *rootItem; 68 | QStringList atomicElementNames; 69 | QDomNode lastRemovedNode; 70 | }; 71 | 72 | #endif // ITDOMMODEL_H 73 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #include 23 | #include "ItWindow.h" 24 | 25 | int main (int argc, char *argv[]) 26 | { 27 | //QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); 28 | //QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); 29 | //QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); 30 | QApplication itApp(argc, argv); 31 | itApp.setApplicationName("InterText"); 32 | //itApp.setAttribute(Qt::AA_DontShowIconsInMenus); 33 | #ifndef Q_OS_MAC 34 | itApp.setWindowIcon(QIcon(":/images/16/InterText.ico")); 35 | #endif 36 | ItWindow itWin; 37 | return itApp.exec(); 38 | } 39 | -------------------------------------------------------------------------------- /src/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_editor/5a345ac93b6b5eff5148f0d40e75cf6eb4201f7b/src/main.o -------------------------------------------------------------------------------- /src/numberingdialog.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #include "numberingdialog.h" 23 | #include "ui_numberingdialog.h" 24 | 25 | numberingDialog::numberingDialog(QWidget *parent, ItAlignment * a, int document, bool allowLock) : 26 | QDialog(parent), 27 | ui(new Ui::numberingDialog) 28 | { 29 | ui->setupUi(this); 30 | alignment = a; 31 | doc = document; 32 | ui->mainLabel->setText(tr("The document version '%1' uses uknown element numbering scheme. Choose how to treat it:").arg(a->info.ver[doc].name)); 33 | if (!allowLock) 34 | ui->lockButton->hide(); 35 | adjustSize(); 36 | } 37 | 38 | numberingDialog::~numberingDialog() 39 | { 40 | delete ui; 41 | } 42 | 43 | void numberingDialog::accept() { 44 | if (ui->lockButton->isChecked()) { 45 | alignment->info.ver[doc].numLevels=1; 46 | alignment->info.ver[doc].perm_chstruct=false; 47 | } else if (ui->singleButton->isChecked()) { 48 | alignment->info.ver[doc].numLevels=1; 49 | } else { 50 | alignment->info.ver[doc].numLevels=2; 51 | alignment->info.ver[doc].numPrefix=":"; 52 | } 53 | QDialog::accept(); 54 | } 55 | 56 | void numberingDialog::setDefaultLevels(int level) 57 | { 58 | if (level==0) 59 | ui->lockButton->setChecked(true); 60 | else if (level==1) 61 | ui->singleButton->setChecked(true); 62 | else if (level==2) 63 | ui->twolevelButton->setChecked(true); 64 | } 65 | -------------------------------------------------------------------------------- /src/numberingdialog.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef NUMBERINGDIALOG_H 23 | #define NUMBERINGDIALOG_H 24 | 25 | #include 26 | #include "ItAlignment.h" 27 | 28 | namespace Ui { 29 | class numberingDialog; 30 | } 31 | 32 | class numberingDialog : public QDialog 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit numberingDialog(QWidget *parent, ItAlignment * a, int document, bool allowLock = true); 38 | ~numberingDialog(); 39 | void accept(); 40 | void setDefaultLevels(int level); 41 | 42 | private: 43 | Ui::numberingDialog *ui; 44 | ItAlignment * alignment; 45 | int doc; 46 | }; 47 | 48 | #endif // NUMBERINGDIALOG_H 49 | -------------------------------------------------------------------------------- /src/numberingdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | numberingDialog 4 | 5 | 6 | Qt::WindowModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 410 13 | 187 14 | 15 | 16 | 17 | 18 | 0 19 | 0 20 | 21 | 22 | 23 | Unknown numbering scheme 24 | 25 | 26 | true 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 0 36 | 0 37 | 38 | 39 | 40 | 41 | 380 42 | 16777215 43 | 44 | 45 | 46 | The document version 'X' uses uknown numbering scheme. Choose how to treat it: 47 | 48 | 49 | true 50 | 51 | 52 | 53 | 54 | 55 | 56 | Use two level numbering 57 | (IDs of alignable elements and their parents may change) 58 | 59 | 60 | true 61 | 62 | 63 | 64 | 65 | 66 | 67 | Use single level numbering 68 | (IDs of aligned elements may change) 69 | 70 | 71 | 72 | 73 | 74 | 75 | Lock the text for structure changes 76 | (IDs will be preserved, no structure changes allowed) 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 0 87 | 0 88 | 89 | 90 | 91 | Qt::Horizontal 92 | 93 | 94 | QDialogButtonBox::Ok 95 | 96 | 97 | true 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | buttonBox 107 | accepted() 108 | numberingDialog 109 | accept() 110 | 111 | 112 | 248 113 | 254 114 | 115 | 116 | 157 117 | 274 118 | 119 | 120 | 121 | 122 | buttonBox 123 | rejected() 124 | numberingDialog 125 | reject() 126 | 127 | 128 | 316 129 | 260 130 | 131 | 132 | 286 133 | 274 134 | 135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /src/xmltreedialog.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #include "xmltreedialog.h" 23 | #include "ui_xmltreedialog.h" 24 | #include 25 | 26 | XMLTreeDialog::XMLTreeDialog(ItAlignment *alignment, aligned_doc doc, QWidget *parent): 27 | QDialog(parent), 28 | ui(new Ui::XMLTreeDialog) 29 | { 30 | ui->setupUi(this); 31 | setAttribute(Qt::WA_DeleteOnClose, true); 32 | model = new ItDomModel(alignment, doc, this); 33 | ui->treeView->setModel(model); 34 | } 35 | 36 | XMLTreeDialog::~XMLTreeDialog() 37 | { 38 | delete ui; 39 | delete model; 40 | } 41 | 42 | void XMLTreeDialog::openPath(QList path, int expandNext) 43 | { 44 | QModelIndex paridx = QModelIndex(); 45 | QDomNode item = model->getRootNode(); 46 | QDomNode el; 47 | int i = 0; 48 | while (path.count()) { 49 | el = item; 50 | QDomElement step = path.takeFirst(); 51 | i = 0; 52 | while (item != step && iindex(i, 0, paridx); 59 | ui->treeView->expand(paridx); 60 | } 61 | } 62 | while (expandNext) { 63 | expandNext--; 64 | i++; 65 | QModelIndex idx = model->index(i, 0, paridx.parent()); 66 | ui->treeView->expand(idx); 67 | } 68 | ui->treeView->setCurrentIndex(paridx); 69 | ui->treeView->scrollTo(paridx); 70 | } 71 | -------------------------------------------------------------------------------- /src/xmltreedialog.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010-2016 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 2 | * Copyright (c) 2010-2016 Charles University in Prague, Faculty of Arts, 3 | * Institute of the Czech National Corpus 4 | * 5 | * This file is part of InterText Editor. 6 | * 7 | * InterText Editor is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * InterText Editor is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with InterText Editor. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef XMLTREEDIALOG_H 23 | #define XMLTREEDIALOG_H 24 | 25 | #include 26 | #include "itdommodel.h" 27 | #include "ItAlignment.h" 28 | 29 | namespace Ui { 30 | class XMLTreeDialog; 31 | } 32 | 33 | class XMLTreeDialog : public QDialog 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit XMLTreeDialog(ItAlignment * alignment, aligned_doc doc, QWidget *parent = 0); 39 | ~XMLTreeDialog(); 40 | void openPath(QList path, int expandNext=0); 41 | 42 | private: 43 | Ui::XMLTreeDialog *ui; 44 | ItDomModel * model; 45 | 46 | }; 47 | 48 | #endif // XMLTREEDIALOG_H 49 | -------------------------------------------------------------------------------- /src/xmltreedialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | XMLTreeDialog 4 | 5 | 6 | Qt::WindowModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 578 13 | 460 14 | 15 | 16 | 17 | XML Tree Editor 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Qt::Horizontal 27 | 28 | 29 | QDialogButtonBox::Close 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | buttonBox 39 | accepted() 40 | XMLTreeDialog 41 | accept() 42 | 43 | 44 | 248 45 | 254 46 | 47 | 48 | 157 49 | 274 50 | 51 | 52 | 53 | 54 | buttonBox 55 | rejected() 56 | XMLTreeDialog 57 | reject() 58 | 59 | 60 | 316 61 | 260 62 | 63 | 64 | 286 65 | 274 66 | 67 | 68 | 69 | 70 | 71 | --------------------------------------------------------------------------------