├── .gitignore ├── ForBeginnersRU.txt ├── LICENSE ├── README.md ├── archive ├── 1_icons │ ├── 108x108 │ │ └── harbour-editor.png │ ├── 128x128 │ │ └── harbour-editor.png │ ├── 256x256 │ │ └── harbour-editor.png │ └── 86x86 │ │ └── harbour-editor.png ├── 2_icons │ ├── 108x108 │ │ └── harbour-editor.png │ ├── 128x128 │ │ └── harbour-editor.png │ ├── 256x256 │ │ └── harbour-editor.png │ └── 86x86 │ │ └── harbour-editor.png └── presentations │ ├── Editor..pdf │ ├── Editor..pptx │ └── Editor.v1.pptx ├── harbour-editor.desktop ├── harbour-editor.pro ├── icons ├── 108x108 │ └── harbour-editor.png ├── 128x128 │ └── harbour-editor.png ├── 172x172 │ └── harbour-editor.png ├── 256x256 │ └── harbour-editor.png └── 86x86 │ └── harbour-editor.png ├── qml ├── components │ ├── AuthorRow.qml │ ├── MenuButton.qml │ └── pullMenus │ │ └── rows │ │ ├── EditRow.qml │ │ ├── MainRow.qml │ │ └── SearchRow.qml ├── cover │ └── CoverPage.qml ├── editFile.py ├── harbour-editor.qml ├── img │ ├── icon-m-code.svg │ ├── icon-m-history.svg │ ├── icon-m-open.svg │ ├── icon-m-qnote.svg │ ├── icon-m-save.svg │ └── icon-m-tab.svg ├── pages │ ├── AboutPage.qml │ ├── FileChooserPage.qml │ ├── FirstPage.qml │ ├── HistoryPage.qml │ ├── QuickNotePage.qml │ ├── SaveAsPage.qml │ └── SettingsPage.qml └── scripts │ └── RecalcLines.js ├── rpm ├── harbour-editor.changes.ex ├── harbour-editor.changes.in ├── harbour-editor.spec └── harbour-editor.yaml ├── src ├── dictionaries │ ├── javascript.txt │ ├── keywords.txt │ ├── properties.txt │ ├── python.txt │ ├── qml.txt │ └── sh.txt ├── dictionarys.qrc ├── documenthandler.cpp ├── documenthandler.h ├── generallogic.cpp ├── generallogic.h ├── harbour-editor.cpp ├── realhighlighter.cpp └── realhighlighter.h └── translations ├── harbour-editor-de.ts ├── harbour-editor-es.ts ├── harbour-editor-fr.ts ├── harbour-editor-nl.ts ├── harbour-editor-pl.ts ├── harbour-editor-ru.ts ├── harbour-editor-sv.ts ├── harbour-editor-zh_CN.ts └── harbour-editor.ts /.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | -------------------------------------------------------------------------------- /ForBeginnersRU.txt: -------------------------------------------------------------------------------- 1 | Infromation for beginners RU 2 | ---------------------------- 3 | 4 | В этом документе описана вся информация, которая может понадобится новичку, чтобы начать вносить вклад в проект "Editor." 5 | 6 | 1. Что такое Sailfish OS? 7 | ------------------------- 8 | 9 | Чтобы понять особенность и философию Sailfish OS, что очень важно, если хотите правильно разрабатывать под эту ОС, прочтите раздел `Общая информация`: https://github.com/GoAlexander/sailfishos-wiki/blob/master/SFOSGetStarted.md#1-Общая-информация 10 | 11 | 2. Устанавливаем Sailfish OS SDK + Hello World 12 | ---------------------------------------------- 13 | 14 | - Читаем статьи по порядку: 15 | https://habrahabr.ru/post/305510/ 16 | https://habrahabr.ru/post/306188/ 17 | 18 | - Также в процессе разработки советую читать все статьи от организации FRUCT: https://habrahabr.ru/users/fruct/topics/ 19 | 20 | - Большое количество вопросов можно задать в чате русскоговорящего сообщества: sailfish.su/telegram 21 | 22 | - Очень советую с кодом и слайдами с летней школы Sailfish OS: 23 | https://github.com/GoAlexander/sailfishos-wiki/tree/master/codeSummerSchool2016 24 | https://github.com/GoAlexander/sailfishos-wiki/tree/master/slidesSummerSchool2016 25 | 26 | -Или просмотреть видео с летней школы Sailfish OS: https://vk.com/videos-40681615?section=album_55658014 27 | Особенно: 28 | https://vk.com/video-40681615_456239031 29 | https://vk.com/video-40681615_456239032 30 | https://vk.com/video-40681615_456239033 31 | 32 | -Несколько шпаргалок: https://github.com/GoAlexander/sailfishos-wiki/tree/master/cheatsheets 33 | 34 | 35 | 3. Описание логики и структуры файлов "Editor." для версии 0.4.2 36 | ---------------------------------------------------------------- 37 | 38 | Дерево проекта в файловом представлении (показаны только самые важные файлы и папки): 39 | (!) - таким занком обозначены файлы, которое обязательно понадобятся 40 | 41 | . 42 | ├── harbour-editor.desktop -> "ярлык" приложения 43 | ├── harbour-editor.pro -> (!)QT-файл проекта (после клонирования репозитория добавьте в QT этот файл - проект автоматически загрузится). Не забываем при добавлении новых библиотек и переводов добавлять их в этот файл 44 | ├── icons -> Папка для иконок 45 | ├── qml -> Папка со всеми qml. QML используется для построения интерфейсов 46 | │   ├── components -> Здесь располагаются самописные/кастомные компоненты (кнопки, меню и т.д.) 47 | │   │   ├── AuthorRow.qml 48 | │   │   └── MenuButton.qml 49 | │   ├── cover -> (!)Папка для интерфейса cover. Cover - это "прямоугольники" с главного экрана ОС 50 | │   │   └── CoverPage.qml 51 | │   ├── editFile.py -> (!)Здесь код для сохранения/загрузки/автосохранения документов + функции для загрузки настроек из .json 52 | │   ├── harbour-editor.qml -> (!)Самая первая qml страница, которая загружается при старте приложения (на самом деле ее пользователь не видит), ее задача подгрузить все остальные qml. Также здесь располагаются глобальные переменные. 53 | │   ├── img -> Здесь лежат все дополнительные картинки/иконки 54 | │   │   └── tab.svg 55 | │   └── pages -> Папка с основными qml. Здесь вы будете проводить большую часть времени :) 56 | │   ├── AboutPage.qml -> Информация о программе. При появлении новых переводчиков - обновляем 57 | │   ├── FileChooserPage.qml -> Файловый браузер для выбора документа 58 | │   ├── FirstPage.qml -> (!) Основная страница приложения. Здесь располагаются: текстовое поле и меню 59 | │   ├── HistoryPage.qml -> Страница с историей ранее открытых документов 60 | │   ├── SaveAsPage.qml -> Файловый браузер для сохранения документа 61 | │   └── SettingsPage.qml -> (!) Страница со всеми настройками 62 | ├── rpm 63 | │   ├── harbour-editor.spec -> Автогенерируемый файл. Руками не трогать! 64 | │   └── harbour-editor.yaml -> (!)Здесь не забываем менять версию приложения, когда выпускаете новую версию :) 65 | ├── src 66 | │   └── harbour-editor.cpp -> С++ код подгружает все qml-файлы. Здесь и находится main() программы :) 67 | └── translations 68 | 69 | 70 | Как показывает практика `FirstPage.qml` самый часто редактируемый файл, там и ведется основная работа. 71 | 72 | 4. Ссылки на ресурсы проекта 73 | ---------------------------- 74 | 75 | Github:https://github.com/GoAlexander/harbour-editor 76 | Trello (todo):https://trello.com/b/Gyu7pPqi/harbour-editor 77 | Openrepos:https://openrepos.net/content/goalexander/editor 78 | Дружественныйпроект - tIDE (можно "воровать фичи", но при этом не забываем тоже делать вклад в его проект): https://github.com/eekkelund/harbour-tIDE 79 | 80 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Editor. 2 | Description is in progress... 3 | 4 | Rules for translation 5 | --------------------- 6 | Translation of buttons on FirstPage has to be NOT longer than 7 symbols (better 4-5 symbols). 7 | Examples: 8 | - `Save as` - maximal length 9 | - `Save` - optimal length 10 | 11 | If you can not do translation of buttons short try solution of @rabauke - empty the translation context. 12 | Screenshot: https://cloud.githubusercontent.com/assets/1159508/22174835/1e7fa1e2-dfe8-11e6-8c81-f1391a6ab08a.png 13 | 14 | Public To Do 15 | ------------ 16 | [Trello](https://trello.com/b/Gyu7pPqi/harbour-editor) 17 | 18 | Markets 19 | ------- 20 | Application published in the following repositories: 21 | - Official Jolla Store 22 | - [openrepos.net](https://openrepos.net/content/goalexander/editor) 23 | 24 | Important notes 25 | --------------- 26 | - Because of OS default File Manager minimal version of Sailfish OS should be 2.0.5 27 | 28 | Some tips for the developers 29 | ---------------------------- 30 | 31 | If you want to have automatically changeable version counter in your QML you can read this thread: 32 | https://lists.sailfishos.org/pipermail/devel/2015-January/005559.html 33 | 34 | >a) in your .yaml add the lines: 35 | QMakeOptions: 36 | \- VERSION=%{version} 37 | b) in your .pro add the lines: 38 | DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\" 39 | c) in your .c's main() function add the lines: 40 | QScopedPointer app(SailfishApp::application(argc, argv)); 41 | app->setApplicationVersion(QString(APP_VERSION)); 42 | d) now your app's version is available in QML through 43 | Qt.application.version 44 | 45 | Alternative: 46 | In .pro file add: 47 | `VERSION = $$system("echo $(awk -F ':' '/Version/ {print $2}' rpm/$${TARGET}.yaml)")` 48 | And then same steps in C++ files... 49 | 50 | License 51 | ------- 52 | 53 | Copyright (c) 2016-2017 Alexander Dydychkin 54 | 55 | Editor. is free software: you can redistribute it and/or modify 56 | it under the terms of the GNU General Public License as published by 57 | the Free Software Foundation, either version 3 of the License, or 58 | (at your option) any later version. 59 | 60 | Editor. is distributed in the hope that it will be useful, 61 | but WITHOUT ANY WARRANTY; without even the implied warranty of 62 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 63 | GNU General Public License for more details. 64 | 65 | You should have received a copy of the GNU General Public License 66 | along with Editor.. If not, see http://www.gnu.org/licenses/. 67 | -------------------------------------------------------------------------------- /archive/1_icons/108x108/harbour-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/archive/1_icons/108x108/harbour-editor.png -------------------------------------------------------------------------------- /archive/1_icons/128x128/harbour-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/archive/1_icons/128x128/harbour-editor.png -------------------------------------------------------------------------------- /archive/1_icons/256x256/harbour-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/archive/1_icons/256x256/harbour-editor.png -------------------------------------------------------------------------------- /archive/1_icons/86x86/harbour-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/archive/1_icons/86x86/harbour-editor.png -------------------------------------------------------------------------------- /archive/2_icons/108x108/harbour-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/archive/2_icons/108x108/harbour-editor.png -------------------------------------------------------------------------------- /archive/2_icons/128x128/harbour-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/archive/2_icons/128x128/harbour-editor.png -------------------------------------------------------------------------------- /archive/2_icons/256x256/harbour-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/archive/2_icons/256x256/harbour-editor.png -------------------------------------------------------------------------------- /archive/2_icons/86x86/harbour-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/archive/2_icons/86x86/harbour-editor.png -------------------------------------------------------------------------------- /archive/presentations/Editor..pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/archive/presentations/Editor..pdf -------------------------------------------------------------------------------- /archive/presentations/Editor..pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/archive/presentations/Editor..pptx -------------------------------------------------------------------------------- /archive/presentations/Editor.v1.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/archive/presentations/Editor.v1.pptx -------------------------------------------------------------------------------- /harbour-editor.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | X-Nemo-Application-Type=silica-qt5 4 | Icon=harbour-editor 5 | Exec=harbour-editor 6 | Name=Editor. 7 | -------------------------------------------------------------------------------- /harbour-editor.pro: -------------------------------------------------------------------------------- 1 | # NOTICE: 2 | # 3 | # Application name defined in TARGET has a corresponding QML filename. 4 | # If name defined in TARGET is changed, the following needs to be done 5 | # to match new name: 6 | # - corresponding QML filename must be changed 7 | # - desktop icon filename must be changed 8 | # - desktop filename must be changed 9 | # - icon definition filename in desktop file must be changed 10 | # - translation filenames have to be changed 11 | 12 | # The name of your application 13 | TARGET = harbour-editor 14 | 15 | CONFIG += sailfishapp 16 | 17 | DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\" 18 | 19 | SOURCES += src/harbour-editor.cpp \ 20 | src/documenthandler.cpp \ 21 | src/realhighlighter.cpp \ 22 | src/generallogic.cpp 23 | 24 | OTHER_FILES += qml/harbour-editor.qml \ 25 | qml/scripts/RecalcLines.js \ 26 | qml/cover/CoverPage.qml \ 27 | qml/pages/FirstPage.qml \ 28 | rpm/harbour-editor.changes.in \ 29 | rpm/harbour-editor.spec \ 30 | rpm/harbour-editor.yaml \ 31 | harbour-editor.desktop \ 32 | qml/editFile.py #You can find better place :) 33 | 34 | SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172 256x256 35 | 36 | # to disable building translations every time, comment out the 37 | # following CONFIG line 38 | CONFIG += sailfishapp_i18n 39 | 40 | # German translation is enabled as an example. If you aren't 41 | # planning to localize your app, remember to comment out the 42 | # following TRANSLATIONS line. And also do not forget to 43 | # modify the localized app name in the the .desktop file. 44 | TRANSLATIONS += translations/harbour-editor-de.ts \ 45 | translations/harbour-editor-ru.ts \ 46 | translations/harbour-editor-sv.ts \ 47 | translations/harbour-editor-fr.ts \ 48 | translations/harbour-editor-es.ts \ 49 | translations/harbour-editor-nl.ts \ 50 | translations/harbour-editor-pl.ts 51 | 52 | DISTFILES += \ 53 | icons/172x172/harbour-editor.png \ 54 | qml/pages/AboutPage.qml \ 55 | qml/pages/SettingsPage.qml \ 56 | qml/pages/FileChooserPage.qml \ 57 | qml/components/MenuButton.qml \ 58 | qml/pages/SaveAsPage.qml \ 59 | qml/pages/HistoryPage.qml \ 60 | qml/components/AuthorRow.qml \ 61 | qml/components/pullMenus/rows/SearchRow.qml \ 62 | qml/components/pullMenus/rows/MainRow.qml \ 63 | qml/components/pullMenus/rows/EditRow.qml \ 64 | qml/pages/QuickNotePage.qml 65 | 66 | HEADERS += \ 67 | src/documenthandler.h \ 68 | src/realhighlighter.h \ 69 | src/generallogic.h 70 | 71 | RESOURCES += \ 72 | src/dictionarys.qrc 73 | -------------------------------------------------------------------------------- /icons/108x108/harbour-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/icons/108x108/harbour-editor.png -------------------------------------------------------------------------------- /icons/128x128/harbour-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/icons/128x128/harbour-editor.png -------------------------------------------------------------------------------- /icons/172x172/harbour-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/icons/172x172/harbour-editor.png -------------------------------------------------------------------------------- /icons/256x256/harbour-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/icons/256x256/harbour-editor.png -------------------------------------------------------------------------------- /icons/86x86/harbour-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/icons/86x86/harbour-editor.png -------------------------------------------------------------------------------- /qml/components/AuthorRow.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.6 2 | import Sailfish.Silica 1.0 3 | 4 | Row { 5 | property string author 6 | property string myText 7 | 8 | x: Theme.horizontalPageMargin 9 | Label { 10 | text: author 11 | color: Theme.highlightColor 12 | font.pixelSize: Theme.fontSizeExtraSmall 13 | } 14 | Label { 15 | text: myText 16 | color: Theme.secondaryColor 17 | font.pixelSize: Theme.fontSizeExtraSmall 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /qml/components/MenuButton.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.6 2 | import Sailfish.Silica 1.0 3 | import QtGraphicalEffects 1.0 4 | 5 | BackgroundItem { 6 | //width: sizeBackgroundItemMainMenu 7 | height: Theme.itemSizeSmall 8 | opacity: enabled ? 1.0 : 0.5 9 | property string mySource 10 | property string myText 11 | property real myRotation 12 | property string myColor 13 | property bool myHighlighted 14 | 15 | highlighted: myHighlighted 16 | Row { 17 | anchors.centerIn: parent 18 | spacing: Theme.paddingSmall 19 | 20 | Image { 21 | id: img 22 | width: Theme.iconSizeSmallPlus 23 | height: Theme.iconSizeSmallPlus 24 | source: mySource 25 | rotation: myRotation ? myRotation : 0 26 | layer { 27 | enabled: true //myColor ? 1 : 0 28 | effect: 29 | ColorOverlay { 30 | cached: true 31 | color: myColor ? myColor : buttonsColor 32 | } 33 | } 34 | } 35 | Label { 36 | anchors.verticalCenter: parent.verticalCenter 37 | width: contentWidth 38 | color: myColor ? myColor : buttonsColor//Theme.primaryColor 39 | font.bold: true 40 | font.pixelSize: Theme.fontSizeTiny 41 | text: myText 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /qml/components/pullMenus/rows/EditRow.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.6 2 | import Sailfish.Silica 1.0 3 | import "../../" //for import of MenuButton 4 | import "../../../pages" //for import of SaveAsPage.qml + to do visible functions 5 | 6 | 7 | //TODO -> use next variables as parameters (don`t use import) 8 | //-saved 9 | //-filePath 10 | //-outputNotifications 11 | //-myTextArea.* 12 | Row { 13 | property int myMenuButtonWidth 14 | 15 | MenuButton { 16 | //width: sizeBackgroundItemMainMenu 17 | width: myMenuButtonWidth 18 | mySource: "image://theme/icon-m-sd-card" 19 | myText: qsTr("Save") 20 | enabled: !saved 21 | onClicked: { 22 | console.log(filePath + " [" + docencoding +"]\n" + myTextArea.text); 23 | if (filePath!=="") { 24 | py.call_sync('editFile.savings', [filePath,myTextArea.text,docencoding]); 25 | //this code is inside to fix problem with async nature of python 26 | outputNotifications.close() 27 | outputNotifications.previewBody = qsTr("Document saved") 28 | outputNotifications.publish() 29 | saved = true; 30 | //filePath is path where you want to save! 31 | } 32 | 33 | if (filePath==="") { 34 | outputNotifications.close() 35 | outputNotifications.previewBody = qsTr("Document can't be saved!") 36 | outputNotifications.publish() 37 | } 38 | } 39 | } 40 | 41 | MenuButton { 42 | width: myMenuButtonWidth 43 | mySource: "image://theme/icon-m-search?" + (searchRowVisible ? Theme.highlightColor : Theme.primaryColor); 44 | myText: qsTr("Search") 45 | onClicked: { 46 | if (searchRowVisible == false) { 47 | searchRowVisible = true; 48 | } 49 | else { 50 | searchRowVisible = false; 51 | } 52 | } 53 | } 54 | 55 | MenuButton { 56 | width: myMenuButtonWidth 57 | mySource: "image://theme/icon-m-rotate-left"; 58 | myText: qsTr("Undo") 59 | enabled: myTextArea._editor.canUndo 60 | onClicked: { 61 | myTextArea._editor.undo() 62 | } 63 | } 64 | 65 | MenuButton { 66 | width: myMenuButtonWidth 67 | mySource: "image://theme/icon-m-rotate-right"; 68 | myText: qsTr("Redo") 69 | enabled: myTextArea._editor.canRedo 70 | onClicked: { 71 | myTextArea._editor.redo() 72 | } 73 | } 74 | 75 | MenuButton { 76 | width: myMenuButtonWidth 77 | mySource: "image://theme/icon-m-transfer" 78 | myText: qsTr("Tab") 79 | myRotation: 90 80 | onClicked: { 81 | var previousCursorPosition = myTextArea.cursorPosition; 82 | myTextArea.text = myTextArea.text.slice(0, myTextArea.cursorPosition) + tabType + myTextArea.text.slice(myTextArea.cursorPosition, myTextArea.text.length); 83 | myTextArea.cursorPosition = previousCursorPosition + tabType.length; 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /qml/components/pullMenus/rows/MainRow.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.6 2 | import Sailfish.Silica 1.0 3 | import "../../" //for import of MenuButton 4 | import "../../../pages" //for import of SaveAsPage.qml + to do visible functions 5 | 6 | 7 | // Save as - Open - New - History 8 | SilicaFlickable 9 | { 10 | property int mainRowButtonWidth: isPortrait ? Screen.width / 4.5 : Screen.height / 4.5 11 | property int mainRowButtonWidth2: isPortrait ? Screen.width / 3.5 : Screen.height / 3.5 12 | Rectangle { 13 | anchors.fill: parent 14 | color: "#1e1e27"//bgColor 15 | opacity: 0.6 16 | } 17 | Row { 18 | id: row1 19 | 20 | width: isPortrait ? Screen.width / 2 : Screen.height / 2 21 | opacity: visible ? 1.0 : 0.0 22 | 23 | Behavior on opacity { 24 | PropertyAnimation { duration: 150; easing.type: Easing.Linear } 25 | } 26 | 27 | MenuButton { 28 | width: mainRowButtonWidth 29 | mySource: "image://theme/icon-m-note"; 30 | myText: qsTr("New") 31 | onClicked: { 32 | 33 | filePath = ""; 34 | myTextArea.text = ""; 35 | } 36 | } 37 | 38 | MenuButton { 39 | width: mainRowButtonWidth 40 | mySource: "image://theme/icon-m-folder" 41 | myText: qsTr("Open") 42 | onClicked: { 43 | console.log(inclHiddenFiles); 44 | pageStack.push(Qt.resolvedUrl("../../../pages/FileChooserPage.qml"), { 45 | showFormat: true, 46 | title: "Select file", 47 | inclHiddenFiles: inclHiddenFiles, 48 | callback: setFilePath 49 | }) 50 | } 51 | } 52 | 53 | MenuButton { 54 | width: mainRowButtonWidth 55 | mySource: "image://theme/icon-m-sd-card" 56 | myText: qsTr("Save as") 57 | onClicked: { 58 | pageStack.push(Qt.resolvedUrl("../../../pages/SaveAsPage.qml"), { 59 | // homePath: "/", 60 | docencoding: docencoding, 61 | filePath: filePath, 62 | showFormat: true, 63 | title: "Select file", 64 | showHiddenFiles: inclHiddenFiles, 65 | callback: saveAsSetFilePath 66 | }) 67 | } 68 | } 69 | 70 | MenuButton { 71 | width: mainRowButtonWidth 72 | mySource: "image://theme/icon-m-time" 73 | myText: qsTr("History") 74 | onClicked: { 75 | pageStack.push(Qt.resolvedUrl("../../../pages/HistoryPage.qml"), { 76 | callback: setFilePath 77 | }) 78 | } 79 | } 80 | 81 | MenuButton { 82 | width: mainRowButtonWidth / 2 83 | mySource: "image://theme/icon-m-right" 84 | onClicked: { 85 | row1.visible=!row1.visible; 86 | row2.visible=!row2.visible; 87 | } 88 | } 89 | } 90 | 91 | Row { 92 | id: row2 93 | width: isPortrait ? Screen.width / 2 : Screen.height / 2 94 | visible: false 95 | opacity: visible ? 1.0 : 0.0 96 | 97 | Behavior on opacity { 98 | PropertyAnimation { duration: 150; easing.type: Easing.Linear } 99 | } 100 | 101 | MenuButton { 102 | width: mainRowButtonWidth / 2 103 | mySource: "image://theme/icon-m-left" 104 | onClicked: { 105 | row1.visible=!row1.visible; 106 | row2.visible=!row2.visible; 107 | // if(mainRowVisible){extendedMenuSource = "image://theme/icon-m-down";} 108 | // else{extendedMenuSource = "image://theme/icon-m-up";} 109 | } 110 | } 111 | 112 | MenuButton { 113 | width: mainRowButtonWidth2 114 | mySource: "image://theme/icon-m-text-input?" + (myTextArea.readOnly ? Theme.highlightColor : Theme.primaryColor); 115 | myText: qsTr("R-only") 116 | onClicked: { 117 | myHighlighted = !myHighlighted; 118 | if (!myTextArea.readOnly) { 119 | myTextArea.readOnly = true; 120 | } 121 | else { 122 | myTextArea.readOnly = false; 123 | } 124 | } 125 | } 126 | 127 | MenuButton { 128 | width: mainRowButtonWidth2 129 | mySource: "image://theme/icon-m-note" 130 | myText: qsTr("Quick note") 131 | onClicked: { 132 | pageStack.push(Qt.resolvedUrl("../../../pages/QuickNotePage.qml")) 133 | } 134 | } 135 | 136 | MenuButton { 137 | width: mainRowButtonWidth2 138 | mySource: "image://theme/icon-m-flashlight" 139 | myText: qsTr("Highlight") 140 | onClicked: { 141 | myHighlighted = !myHighlighted; 142 | mainRowVisible=!mainRowVisible; 143 | id_ret_lbl.visible=!id_ret_lbl.visible 144 | id_lblinfo.visible=!id_lblinfo.visible 145 | if(mainRowVisible){extrabutton.opacity = 1.0;extendedMenuSource = "image://theme/icon-m-down";} 146 | else{extrabutton.opacity = 0.4;extendedMenuSource = "image://theme/icon-m-up";} 147 | 148 | if (highlightingEnabled == false) { 149 | highlightingEnabled = true; //bug 150 | // pageStack.replaceAbove(null, Qt.resolvedUrl("../../../pages/FirstPage.qml"), {filePath: filePath, highlightingEnabled: highlightingEnabled}, PageStackAction.Replace); 151 | pageStatusChange(editorPage); 152 | 153 | } 154 | else { 155 | highlightingEnabled = false; 156 | // pageStack.replaceAbove(null, Qt.resolvedUrl("FirstPage.qml"), {filePath: filePath}, PageStackAction.Replace); 157 | pageStatusChange(editorPage); 158 | 159 | // outputNotifications.close() 160 | } 161 | } 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /qml/components/pullMenus/rows/SearchRow.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.6 2 | import Sailfish.Silica 1.0 3 | import "../../../pages" //to do visible some variables 4 | 5 | //TODO -> use next variables as parameters (don`t use import) 6 | //-searched 7 | //-searchRowVisible 8 | //-myTexstArea.* 9 | 10 | Row { 11 | 12 | function search(text, position, direction, id) { 13 | text = text.toLowerCase() 14 | var myText = myTextArea.text.toLowerCase() 15 | Theme.highlightText(myText,text,Theme.highlightColor) 16 | //var reg = new RegExp(text, "ig") 17 | //var match = myTextArea.text.match(reg) 18 | var match = myText.match(text) 19 | if (match) { 20 | if (direction=="back") { 21 | myTextArea.cursorPosition = myText.lastIndexOf(match[match.length-1], position) 22 | if(myText.lastIndexOf(match[match.length-1], position) != -1) myTextArea.select(myTextArea.cursorPosition, myTextArea.cursorPosition+text.length) 23 | } else { 24 | myTextArea.cursorPosition = myText.indexOf(match[0],position) 25 | if (myText.indexOf(match[0],position)!=-1) myTextArea.select(myTextArea.cursorPosition, myTextArea.cursorPosition+text.length) 26 | } 27 | //myTextArea.forceActiveFocus() 28 | } else { 29 | searchField.errorHighlight = true 30 | } 31 | } 32 | 33 | SearchField { 34 | id:searchField 35 | //width: parent.width / 1.5 36 | width: isPortrait ? Screen.width / 1.8 : Screen.height / 1.8 37 | height: Theme.itemSizeSmall 38 | 39 | font.pixelSize: Theme.fontSizeMedium 40 | EnterKey.iconSource: "image://theme/icon-m-enter-next" 41 | placeholderText: qsTr("Search") 42 | EnterKey.onClicked:{ 43 | //flipable.search(text,0,"forward",searchField); 44 | search(text,0,"forward",searchField); 45 | searched=true 46 | } 47 | onTextChanged: searched = false 48 | inputMethodHints: Qt.ImhNoAutoUppercase 49 | } 50 | 51 | Row { 52 | spacing: Theme.paddingSmall 53 | 54 | IconButton { 55 | id:previous 56 | icon.source: "image://theme/icon-m-previous" 57 | height: searchField.height 58 | scale: 0.8 59 | enabled: searched 60 | onClicked: { 61 | //flipable.search(searchField.text,myTextArea.cursorPosition-1,"back",previous); 62 | search(searchField.text,myTextArea.cursorPosition-1,"back",previous); 63 | myTextArea.forceActiveFocus(); 64 | } 65 | visible: searchField.activeFocus || searchField.text.length>0 66 | } 67 | 68 | IconButton { 69 | id:next 70 | icon.source: "image://theme/icon-m-next" 71 | height: searchField.height 72 | scale: 0.8 73 | enabled: searched 74 | onClicked: { 75 | //flipable.search(searchField.text,myTextArea.cursorPosition+1,"forward",next); 76 | search(searchField.text,myTextArea.cursorPosition+1,"forward",next); 77 | myTextArea.forceActiveFocus(); 78 | } 79 | visible: searchField.activeFocus || searchField.text.length>0 80 | } 81 | 82 | IconButton { 83 | icon.source: "image://theme/icon-m-close" 84 | height: searchField.height 85 | onClicked: { 86 | searchRowVisible = false; 87 | } 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /qml/cover/CoverPage.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.6 2 | import Sailfish.Silica 1.0 3 | import "../pages" 4 | 5 | CoverBackground { 6 | 7 | function setFilePath(filePathFromChooser) { //TODO refactoring of this function (it uses ALSO HistoryPage) 8 | filePath = filePathFromChooser; 9 | var result 10 | result=py2.call_sync('editFile.getSettings'); 11 | encRegion=result.encRegion; 12 | encPreferred=result.encPreferred; 13 | 14 | pageStack.replaceAbove(null, Qt.resolvedUrl("FirstPage.qml"), {filePath: filePathFromChooser, encPreferred: encPreferred, encRegion:encRegion }, PageStackAction.Animated); 15 | pageStack.nextPage(); 16 | } 17 | 18 | Image { 19 | source: "/usr/share/icons/hicolor/256x256/apps/harbour-editor.png" 20 | asynchronous: true 21 | width: parent.width * 0.8 22 | height: parent.height * 0.8 23 | anchors.bottom: parent.bottom 24 | anchors.bottomMargin: Theme.paddingMedium 25 | anchors.horizontalCenter: parent.horizontalCenter 26 | fillMode: Image.PreserveAspectFit 27 | opacity: 0.15 28 | } 29 | 30 | Label { 31 | anchors.top: parent.top 32 | anchors.topMargin: Theme.paddingMedium 33 | horizontalAlignment: Text.Center 34 | anchors.horizontalCenter: parent.horizontalCenter 35 | width: parent.width * 0.8 36 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere 37 | font.pixelSize: Theme.fontSizeSmall 38 | font.family: Theme.fontFamilyHeading 39 | 40 | text: fileName 41 | } 42 | 43 | Label { 44 | id: label 45 | anchors.bottom: parent.bottom 46 | anchors.bottomMargin: Theme.paddingLarge * 3 47 | anchors.horizontalCenter: parent.horizontalCenter 48 | horizontalAlignment: Text.Center 49 | width: parent.width 50 | wrapMode: Text.WordWrap 51 | color: Theme.highlightColor 52 | 53 | text: qsTr("Lines: ") + linesNumber + "\n" + 54 | qsTr("Words: ") + wordsNumber + "\n" + 55 | qsTr("Chars: ") + charNumber; 56 | } 57 | 58 | CoverActionList { 59 | id: coverAction 60 | 61 | CoverAction { 62 | iconSource: "../img/icon-m-open.svg" 63 | onTriggered: { 64 | pageStack.push(Qt.resolvedUrl("../pages/FileChooserPage.qml"), { 65 | showFormat: true, 66 | title: "Select file", 67 | inclHiddenFiles: inclHiddenFiles, 68 | callback: setFilePath 69 | }) 70 | mainwindow.activate(); 71 | } 72 | } 73 | 74 | CoverAction { 75 | iconSource: "../img/icon-m-qnote.svg" 76 | onTriggered: { 77 | pageStack.push(Qt.resolvedUrl("../pages/QuickNotePage.qml")) 78 | mainwindow.activate(); 79 | } 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /qml/editFile.py: -------------------------------------------------------------------------------- 1 | # #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 'windows-1250' 4 | 5 | import pyotherside 6 | import os 7 | import json 8 | 9 | def encOpen(filepath, enctypes): 10 | for encoding_type in enctypes: 11 | if os.path.exists(filepath): 12 | if os.path.exists(filepath + "~"): 13 | file = open(filepath + "~", 'r', encoding=encoding_type) 14 | else: 15 | file = open(filepath, 'r', encoding=encoding_type) 16 | else: 17 | file = open(filepath, 'a+', encoding=encoding_type) 18 | try: 19 | txt = file.read() 20 | file.close() 21 | if txt: 22 | break 23 | except: 24 | continue 25 | return txt, encoding_type 26 | 27 | def openings(filepath, encoding_type): 28 | regions = { 29 | 'Auto': 'Auto', 30 | 'Unicode': ['utf-8', 'utf-16', 'utf-32'], 31 | 'Western Europe': ['windows-1252', 'iso-8859-1'], 32 | 'Central Europe': ['windows-1250', 'iso-8859-2'], 33 | 'Baltic':['windows-1257', 'iso-8859-4'], 34 | 'Middle East':['windows-1254', 'windows-1255','windows-1256'] 35 | #'Chinese' 36 | #'Taiwan' 37 | #'Korean' 38 | } 39 | enctypes=regions.get(encoding_type) 40 | 41 | if encoding_type != '' and enctypes == None: 42 | try: 43 | if os.path.exists(filepath): 44 | if os.path.exists(filepath + "~"): 45 | file = open(filepath + "~", 'r', encoding=encoding_type) 46 | else: 47 | file = open(filepath, 'r', encoding=encoding_type) 48 | else: 49 | file = open(filepath, 'a+', encoding=encoding_type) 50 | try: 51 | txt = file.read() 52 | file.close() 53 | except: 54 | encoding_type = '' 55 | except: 56 | encoding_type = '' 57 | 58 | if encoding_type == '' or enctypes == 'Auto': 59 | if os.path.exists(filepath): 60 | if os.path.exists(filepath + "~"): 61 | file = open(filepath + "~", 'r') 62 | else: 63 | file = open(filepath, 'r') 64 | else: 65 | file = open(filepath, 'a+') 66 | try: 67 | encoding_type=file.encoding 68 | txt = file.read() 69 | file.close() 70 | except: 71 | encoding_type = 'NonAuto' 72 | 73 | if encoding_type == 'NonAuto' or enctypes != ('Auto' or None): 74 | try: 75 | result=encOpen(filepath, enctypes) 76 | txt=result[0] 77 | encoding_type=result[1] 78 | except: 79 | result=encOpen(filepath, ['utf-8', 'windows-1250', 'windows-1251', 'windows-1252', 'windows-1254']) 80 | txt=result[0] 81 | encoding_type=result[1] 82 | 83 | return txt,encoding_type 84 | 85 | def savings(filepath, text, encoding_type): 86 | if encoding_type == '' or encoding_type == None: 87 | encoding_type='utf-8' 88 | if os.path.exists(filepath+"~"): 89 | os.remove(filepath+"~") 90 | file = open(filepath, 'w', encoding=encoding_type) 91 | file.write(text) 92 | file.close() 93 | return encoding_type 94 | 95 | def autosave(filepath, text, encoding_type): 96 | if(filepath.endswith("~")): 97 | file = open(filepath, 'w', encoding=encoding_type) 98 | else: 99 | file = open(filepath+"~", 'w', encoding=encoding_type) 100 | file.write(text) 101 | file.close() 102 | 103 | def isSaved(filepath): 104 | if os.path.exists(filepath + "~"): 105 | return False 106 | else: 107 | return True 108 | 109 | #---------------------------------------- 110 | 111 | PATH_TO_FOLDER = os.environ['HOME'] + "/.local/share/harbour-editor" 112 | PATH_TO_SETTINGS = PATH_TO_FOLDER + "/settings2.json" 113 | PATH_TO_HISTORY = PATH_TO_FOLDER + "/history.json" 114 | 115 | def tryPath(path): 116 | if os.path.exists(path): 117 | if os.path.isdir(path): 118 | msg = "Dir" 119 | else: 120 | msg = "File" 121 | else: 122 | msg = "Not" 123 | return msg 124 | 125 | def _getFromJson(path, type): 126 | try: 127 | with open(path, "r") as data_file: 128 | data = json.load(data_file) 129 | except: 130 | if type == "settings": 131 | createSettingsJson() 132 | elif type == "history": 133 | createHistoryJson() 134 | with open(path, "r") as data_file: 135 | data = json.load(data_file) 136 | return data 137 | 138 | def _setToJson(path, key, value): 139 | with open(path, "r") as data_file: 140 | data = json.load(data_file) 141 | data[key] = value 142 | 143 | with open(path, "w") as data_file: 144 | data_file.write(json.dumps(data)) 145 | return 146 | 147 | def getSettings(): 148 | return _getFromJson(PATH_TO_SETTINGS, "settings") 149 | 150 | def setValue(key, value): 151 | return _setToJson(PATH_TO_SETTINGS, key, value) 152 | 153 | def getHistory(): 154 | return _getFromJson(PATH_TO_HISTORY, "history") 155 | 156 | def setHistory(file, encd): 157 | _setToJson(PATH_TO_HISTORY,"file" , file) 158 | return _setToJson(PATH_TO_HISTORY,"encd", encd) 159 | 160 | def resetHistory(): 161 | os.remove(PATH_TO_HISTORY) 162 | createHistoryJson() 163 | return 164 | 165 | def resetSettings(): 166 | os.remove(PATH_TO_SETTINGS) 167 | createSettingsJson() 168 | return 169 | 170 | def createSettingsJson(): 171 | if not os.path.exists(PATH_TO_FOLDER): 172 | os.mkdir(PATH_TO_FOLDER) 173 | str = '{"headerVisible": true, "lineNumbersVisible": false, "fontType": "Sail Sans Pro Light", "fontSize": 40, "tabType": " ", "showHiddenFiles": false, "darkTheme": "false", "autosave": false, "encRegion": "Unicode", "encPreferred": "utf-8" }' 174 | file = open(PATH_TO_SETTINGS, 'w') 175 | file.write(str) 176 | file.close() 177 | return 178 | 179 | def createHistoryJson(): 180 | if not os.path.exists(PATH_TO_FOLDER): 181 | os.mkdir(PATH_TO_FOLDER) 182 | str = '{"file": [],"encd": []}' 183 | file = open(PATH_TO_HISTORY, 'w') 184 | file.write(str) 185 | file.close() 186 | return 187 | -------------------------------------------------------------------------------- /qml/harbour-editor.qml: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 Jolla Ltd. 3 | Contact: Thomas Perl 4 | All rights reserved. 5 | 6 | You may use this file under the terms of BSD license as follows: 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of the Jolla Ltd nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 23 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | import QtQuick 2.6 32 | import Sailfish.Silica 1.0 33 | import io.thp.pyotherside 1.5 34 | import Nemo.Notifications 1.0 35 | import "pages" 36 | 37 | ApplicationWindow 38 | { 39 | id: mainwindow 40 | cover: Qt.resolvedUrl("cover/CoverPage.qml") 41 | allowedOrientations: Orientation.All 42 | _defaultPageOrientations: Orientation.All 43 | 44 | //These variables are in: FirstPage + SettingsPage + Cover 45 | property bool headerVisible 46 | property bool lineNumbersVisible 47 | 48 | property string fontType 49 | property int fontSize 50 | property string tabType 51 | 52 | property int charNumber: 0 53 | property int linesNumber: 0 54 | 55 | property int wordsNumber: 0 56 | property string fileName 57 | 58 | property bool inclHiddenFiles 59 | property bool autosave 60 | 61 | property string encRegion 62 | property string encPreferred 63 | 64 | property bool darkTheme 65 | property string bgColor 66 | property string textColor 67 | property string buttonsColor 68 | property string qmlHighlightColor 69 | property string keywordsHighlightColor 70 | property string propertiesHighlightColor 71 | property string javascriptHighlightColor 72 | property string stringHighlightColor 73 | property string commentHighlightColor 74 | property string customButtColor 75 | property string theme: Theme._homeBackgroundImage 76 | 77 | function actualButtonColor(){ 78 | if(customButtColor != ""){ 79 | var themeproperties = ["darkPrimaryColor", "darkSecondaryColor", "errorColor", "highlightBackgroundColor", "highlightBackgroundOpacity", "highlightColor", 80 | "highlightDimmerColor", "lightPrimaryColor", "lightSecondaryColor", "overlayBackgroundColor", "primaryColor", "secondaryColor", 81 | "secondaryHighlightColor"] 82 | 83 | var svgcolors = ["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", 84 | "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", 85 | "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", 86 | "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", 87 | "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", 88 | "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", 89 | "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", 90 | "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", 91 | "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", 92 | "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", 93 | "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", 94 | "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", 95 | "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen"] 96 | 97 | var custButtColorTemp= customButtColor.split(".") 98 | 99 | if(custButtColorTemp[0] === "Theme"){ 100 | if(themeproperties.indexOf(custButtColorTemp[1]) != -1){ 101 | console.log(custButtColorTemp[1]); 102 | buttonsColor= Theme[custButtColorTemp[1]]; 103 | } 104 | } 105 | 106 | else{ 107 | if(svgcolors.indexOf(customButtColor) != -1){ 108 | console.log(customButtColor); 109 | buttonsColor=customButtColor; 110 | } 111 | } 112 | } 113 | else{ 114 | if(Theme.colorScheme == 0){ 115 | buttonsColor=Theme.highlightColor;} 116 | else if (Theme.colorScheme == 1){ 117 | buttonsColor=Theme.darkPrimaryColor; 118 | } 119 | } 120 | } 121 | 122 | //Theme.colorScheme = 0 "DarkTheme", 1 "LightTheme" 123 | function applyAmbienceThemeColors(){ 124 | qmlHighlightColor=Theme.highlightColor; 125 | keywordsHighlightColor=Qt.darker(Theme.highlightColor,1.5); 126 | propertiesHighlightColor=Qt.darker(Theme.primaryColor,1.5); 127 | javascriptHighlightColor=Theme.secondaryHighlightColor; 128 | stringHighlightColor=Theme.secondaryColor; 129 | commentHighlightColor= Qt.lighter(Theme.highlightBackgroundColor); 130 | bgColor="transparent"; 131 | 132 | actualButtonColor(); 133 | 134 | if(Theme.colorScheme == 0){ 135 | textColor=Theme.highlightColor; 136 | } 137 | else if (Theme.colorScheme == 1){ 138 | textColor=Theme.primaryColor; 139 | } 140 | } 141 | 142 | Timer { 143 | id: ambiencetimer 144 | interval: 1 145 | onTriggered: {applyAmbienceThemeColors();} 146 | } 147 | 148 | onThemeChanged: { 149 | if (!darkTheme) { 150 | ambiencetimer.start(); 151 | } 152 | } 153 | 154 | onCustomButtColorChanged: { 155 | mainwindow.applyThemeColors(); 156 | } 157 | 158 | Python { 159 | id: py2 //TODO rename! 160 | Component.onCompleted: { 161 | addImportPath(Qt.resolvedUrl(".")); 162 | importModule('editFile', function () {}); 163 | } 164 | } 165 | function applyThemeColors(){ 166 | if (darkTheme) { 167 | textColor="#cfbfad" 168 | qmlHighlightColor="#ff8bff" 169 | keywordsHighlightColor="#808bed" 170 | propertiesHighlightColor="#ff5555" 171 | javascriptHighlightColor="#8888ff" 172 | stringHighlightColor="#ffcd8b" 173 | commentHighlightColor="#cd8b00" 174 | buttonsColor = "white" 175 | bgColor="#1e1e27" 176 | } 177 | else { 178 | applyAmbienceThemeColors() 179 | } 180 | } 181 | 182 | function getSettings(){ 183 | var result 184 | result=py2.call_sync('editFile.getSettings'); 185 | 186 | headerVisible=result.headerVisible; 187 | lineNumbersVisible=result.lineNumbersVisible; 188 | fontType=result.fontType; 189 | fontSize=result.fontSize; 190 | tabType=result.tabType; 191 | inclHiddenFiles=result.showHiddenFiles; 192 | darkTheme=result.darkTheme; 193 | autosave=result.autosave; 194 | encRegion=result.encRegion; 195 | encPreferred=result.encPreferred; 196 | customButtColor=result.customButtColor; 197 | 198 | applyThemeColors(); 199 | console.log("\nheaderVisible:" + headerVisible + "\nlineNumbersVisible:" + lineNumbersVisible + "\nfontType:'" + fontType + "'\nfontSize:" + fontSize + "\ntabType:'" + tabType + "'\nshowHiddenFiles:" + inclHiddenFiles + "\ndarkTheme:" + darkTheme + "\nautosave:" + autosave + "\nencRegion:'" + encRegion + "'\nencPreferred:'" + encPreferred + "'" + "\ncustomButtColor:'" + customButtColor + "'"); 200 | } 201 | 202 | initialPage: Component { 203 | FirstPage { 204 | id: mainPage 205 | Component.onCompleted: { 206 | mainwindow.getSettings(); 207 | //open file from commandline 208 | var args = Qt.application.arguments 209 | if (args.length > 1) { 210 | mainPage.filePath=args[1] 211 | console.log(filePath) 212 | } 213 | } 214 | } 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /qml/img/icon-m-code.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qml/img/icon-m-history.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qml/img/icon-m-open.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qml/img/icon-m-qnote.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qml/img/icon-m-save.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qml/img/icon-m-tab.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qml/pages/AboutPage.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.6 2 | import Sailfish.Silica 1.0 3 | import "../components" 4 | 5 | Page { 6 | id: aboutPage 7 | 8 | SilicaFlickable { 9 | anchors.fill: parent 10 | contentHeight: column.height 11 | 12 | Column { 13 | id: column 14 | spacing: Theme.paddingLarge 15 | width: parent.width 16 | 17 | PageHeader { 18 | title: qsTr("About") 19 | } 20 | 21 | Image { 22 | anchors.horizontalCenter: parent.horizontalCenter 23 | width: Theme.iconSizeExtraLarge 24 | height: Theme.iconSizeExtraLarge 25 | source: "/usr/share/icons/hicolor/256x256/apps/harbour-editor.png" 26 | } 27 | 28 | Label { 29 | width: parent.width 30 | horizontalAlignment: Text.AlignHCenter 31 | text: qsTr("Version") + " " + Qt.application.version 32 | } 33 | 34 | Button { 35 | text: qsTr("Paypal donation - EURO") 36 | anchors.horizontalCenter: parent.horizontalCenter 37 | onClicked: { 38 | Qt.openUrlExternally("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E8CL7QXGEMQEG"); 39 | } 40 | } 41 | 42 | Button { 43 | text: qsTr("Paypal donation - RUB") 44 | anchors.horizontalCenter: parent.horizontalCenter 45 | onClicked: { 46 | Qt.openUrlExternally("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=B6EWFULGLUZR8"); 47 | } 48 | } 49 | 50 | Button { 51 | text: qsTr("Source code") 52 | anchors.horizontalCenter: parent.horizontalCenter 53 | onClicked: { 54 | Qt.openUrlExternally("https://github.com/GoAlexander/harbour-editor"); 55 | } 56 | } 57 | 58 | Text { 59 | id: titleLabel 60 | anchors { horizontalCenter: parent.horizontalCenter } 61 | width: parent.width 62 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere 63 | horizontalAlignment: Text.AlignHCenter 64 | textFormat: Text.RichText 65 | font { family: Theme.fontFamily; pixelSize: Theme.fontSizeSmall } 66 | color: Theme.highlightColor 67 | text: "
" + 68 | qsTr("\"Editor.\" is feature-rich text/code editor!") + 69 | "
" + 70 | qsTr("License: GPLv3") + 71 | "
" + 72 | "
" + 73 | "" + qsTr("If you want to support the developer:") + 74 | "
" + 75 | qsTr("Make a donation (button above)") + 76 | "
" + 77 | qsTr("or") + 78 | "
" + 79 | qsTr("Star the repository at the github \u263a ") + "
" + 80 | "
" + 81 | "
" + 82 | qsTr("Special thanks:") + 83 | "
" + qsTr("-eekkelund for save/load/autosave functions, source code and some dictionaries for syntax highlighting and feedback") + 84 | "
" + qsTr("-osanwe for very often consultations about qml code") + 85 | "
" + qsTr("-coderus for various tips and code") + 86 | "
" + qsTr("-Russian community for feedback and help") + 87 | "
" + qsTr("-Ancelad for tab icon, testing and help") + 88 | "
" + qsTr("-gri4994 for the wonderful app icon") + 89 | "
" + qsTr("-bobsik for the contributions for version 0.9") + 90 | "
" + qsTr("-the team of GtkSourceView for the basis for .sh dictionary") + 91 | "
" + 92 | "
" + 93 | qsTr("Tips:")+ 94 | "
" + 95 | qsTr("-To 'Select all text' hold your finger until 3 vibrations") + 96 | "
" + 97 | qsTr("-Unsaved changes are saved in the file with ending '~' in the same dir where you placed your original file") + 98 | "
" + 99 | qsTr("-You can copy the file path to the clipboard by selecting appropriate MenuItem in pulley menu"); 100 | 101 | onLinkActivated: { 102 | Qt.openUrlExternally("https://github.com/GoAlexander/harbour-editor"); 103 | } 104 | } 105 | 106 | 107 | SectionHeader { text: qsTr("Translators") } 108 | 109 | AuthorRow { 110 | author: "atlochowski" 111 | myText: qsTr(" - Polish translation") 112 | } 113 | 114 | AuthorRow { 115 | author: "carlosgonz" 116 | myText: qsTr(" - Spanish translation") 117 | } 118 | 119 | AuthorRow { 120 | author: "eson57" 121 | myText: qsTr(" - Swedish translation") 122 | } 123 | 124 | AuthorRow { 125 | author: "GoAlexander" 126 | myText: qsTr(" - Russian translation") 127 | } 128 | 129 | AuthorRow { 130 | author: "Quent-in" 131 | myText: qsTr(" - French translation") 132 | } 133 | 134 | AuthorRow { 135 | author: "rabauke" 136 | myText: qsTr(" - German translation") 137 | } 138 | 139 | AuthorRow { 140 | author: "Nathan Follens" 141 | myText: qsTr(" - Dutch translation") 142 | } 143 | 144 | VerticalScrollDecorator {} 145 | } 146 | 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /qml/pages/FileChooserPage.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Taken from https://github.com/CODeRUS/splashscreen-changer/blob/master/settings/SecondPage.qml 3 | * Thanks coderus! 4 | */ 5 | 6 | import QtQuick 2.6 7 | import Sailfish.Silica 1.0 8 | ;import Nemo.FileManager 1.0 9 | ;import Sailfish.FileManager 1.0 10 | import io.thp.pyotherside 1.5 11 | import "../pages" 12 | 13 | Page { 14 | id: page 15 | allowedOrientations: Orientation.All 16 | 17 | property int txtfldwdth 18 | property alias path: fileModel.path 19 | property string homePath 20 | property string title 21 | property bool showFormat 22 | property bool inclHiddenFiles 23 | 24 | signal formatClicked 25 | 26 | property var callback 27 | 28 | function onManual(){ 29 | // console.log(inclHiddenFiles); 30 | var query 31 | query=py3.call_sync('editFile.tryPath',[id_textfield.text]); 32 | if(query == "Dir"){ 33 | pageStack.push(Qt.resolvedUrl("FileChooserPage.qml"), 34 | { path: fileModel.appendPath(id_textfield.text), inclHiddenFiles: inclHiddenFiles, homePath: page.homePath, callback: page.callback }) 35 | id_textfield.text=path; 36 | } 37 | else if(query == "File"){ 38 | var textstring = id_textfield.text + ""; 39 | 40 | if (typeof callback == "function") { 41 | callback(textstring); //return to the page from which this page was called 42 | } 43 | } 44 | } 45 | 46 | Python { 47 | id: py3 //TODO rename! 48 | Component.onCompleted: { 49 | addImportPath(Qt.resolvedUrl(".")); 50 | importModule('editFile', function () {}); 51 | } 52 | } 53 | 54 | backNavigation: !FileEngine.busy 55 | 56 | Rectangle { 57 | id: rect_path 58 | color: Theme.highlightDimmerColor 59 | opacity: 0.7 60 | height: Theme.itemSizeSmall 61 | anchors {left: parent.left; right: parent.right; top: parent.top} 62 | 63 | TextField { 64 | id: id_textfield 65 | anchors {left:parent.left; right: ret.left; top: parent.top; bottom: parent.bottom; topMargin: Theme.paddingSmall; leftMargin: Theme.itemSizeSmall} 66 | text: path 67 | labelVisible: false 68 | font.pixelSize: Theme.fontSizeLarge 69 | Keys.onReturnPressed: { 70 | onManual(); 71 | } 72 | } 73 | 74 | Row{ 75 | id: ret 76 | anchors {right: parent.right;top: parent.top; bottom: parent.bottom;} 77 | width: Theme.itemSizeExtraLarge 78 | Button{ 79 | width: ret.width /2 80 | Image{ 81 | anchors.fill: parent 82 | source: "image://theme/icon-m-forward" 83 | fillMode: Image.PreserveAspectFit 84 | } 85 | onClicked: {onManual()} 86 | } 87 | 88 | Button{ 89 | width: ret.width /2 90 | Image{ 91 | id: butt_nav 92 | anchors.fill: parent 93 | source: "image://theme/icon-m-down" 94 | fillMode: Image.PreserveAspectFit 95 | } 96 | onClicked: { 97 | files_quick.visible = !files_quick.visible; 98 | if(files_quick.visible){ 99 | files_quick.height=ret.width * 2.5; 100 | butt_nav.source="image://theme/icon-m-up" 101 | } 102 | else{ 103 | files_quick.height=0; 104 | butt_nav.source="image://theme/icon-m-down" 105 | } 106 | } 107 | } 108 | } 109 | } 110 | 111 | Column { 112 | id: files_quick 113 | visible: false 114 | anchors {top: rect_path.bottom; left: parent.left; right: parent.right} 115 | height: 0 //ret.width * 3 116 | Behavior on height { 117 | PropertyAnimation { duration: 150; easing.type: Easing.Linear } 118 | } 119 | ListItem { 120 | Label{ 121 | anchors {centerIn: parent} 122 | text: "/" 123 | font.pixelSize: Theme.fontSizeMedium 124 | font.bold: true 125 | } 126 | MouseArea{ 127 | anchors.fill: parent 128 | onClicked: { 129 | if(id_textfield.text!="/"){ 130 | id_textfield.text="/"; onManual(); 131 | } 132 | } 133 | } 134 | } 135 | ListItem { 136 | Label{ 137 | anchors {centerIn: parent} 138 | text: StandardPaths.home 139 | font.pixelSize: Theme.fontSizeMedium 140 | font.bold: true 141 | } 142 | MouseArea{ 143 | anchors.fill: parent 144 | onClicked: { 145 | if(id_textfield.text!=StandardPaths.home){ 146 | id_textfield.text=StandardPaths.home; onManual(); 147 | } 148 | } 149 | } 150 | } 151 | ListItem { 152 | Label{ 153 | anchors {centerIn: parent} 154 | text: "/usr/share" 155 | font.pixelSize: Theme.fontSizeMedium 156 | font.bold: true 157 | } 158 | MouseArea{ 159 | anchors.fill: parent 160 | onClicked: { 161 | if(id_textfield.text!="/usr/share"){ 162 | id_textfield.text="/usr/share"; onManual(); 163 | } 164 | } 165 | } 166 | } 167 | 168 | Rectangle {width: parent.width; height: 2} 169 | ListItem { 170 | Label{ 171 | anchors {centerIn: parent} 172 | text: "History" 173 | font.pixelSize: Theme.fontSizeMedium 174 | font.bold: true 175 | } 176 | MouseArea{ 177 | anchors.fill: parent 178 | onClicked: { 179 | pageStack.push(Qt.resolvedUrl("../pages/HistoryPage.qml")); 180 | } 181 | } 182 | } 183 | // Label { 184 | // text: "Custom" 185 | // font.pixelSize: Theme.fontSizeExtraSmall 186 | //font.bold: true 187 | // } 188 | // Rectangle {width: parent.width; height: 2} 189 | } 190 | 191 | FileModel { 192 | id: fileModel 193 | includeHiddenFiles: inclHiddenFiles 194 | path: StandardPaths.home 195 | active: page.status === PageStatus.Active 196 | directorySort: FileModel.SortDirectoriesBeforeFiles 197 | onPathChanged: {if (path == "/"){ 198 | inclHiddenFiles=inclHiddenFiles; 199 | }} 200 | } 201 | 202 | SilicaListView { 203 | id: fileList 204 | 205 | opacity: FileEngine.busy ? 0.6 : 1.0 206 | Behavior on opacity { FadeAnimator {} } 207 | 208 | anchors {left: parent.left; right: parent.right; bottom: parent.bottom; top: files_quick.bottom} 209 | model: fileModel 210 | 211 | delegate: ListItem { 212 | id: fileItem 213 | 214 | width: ListView.view.width 215 | contentHeight: Theme.itemSizeSmall 216 | Row { 217 | anchors.fill: parent 218 | spacing: Theme.paddingLarge 219 | Rectangle { 220 | width: height 221 | height: parent.height 222 | gradient: Gradient { 223 | GradientStop { position: 0.0; color: Theme.rgba(Theme.primaryColor, 0.1) } 224 | GradientStop { position: 1.0; color: "transparent" } 225 | } 226 | 227 | Image { 228 | anchors.centerIn: parent 229 | source: { 230 | var iconSource 231 | if (model.isDir) { 232 | iconSource = "image://theme/icon-m-file-folder" 233 | } else { 234 | var iconType = "other" 235 | switch (model.mimeType) { 236 | case "application/vnd.android.package-archive": 237 | iconType = "apk" 238 | break 239 | case "application/x-rpm": 240 | iconType = "rpm" 241 | break 242 | case "text/vcard": 243 | iconType = "vcard" 244 | break 245 | case "text/plain": 246 | case "text/x-vnote": 247 | iconType = "note" 248 | break 249 | case "application/pdf": 250 | iconType = "pdf" 251 | break 252 | case "application/vnd.oasis.opendocument.spreadsheet": 253 | case "application/x-kspread": 254 | case "application/vnd.ms-excel": 255 | case "text/csv": 256 | case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": 257 | case "application/vnd.openxmlformats-officedocument.spreadsheetml.template": 258 | iconType = "spreadsheet" 259 | break 260 | case "application/vnd.oasis.opendocument.presentation": 261 | case "application/vnd.oasis.opendocument.presentation-template": 262 | case "application/x-kpresenter": 263 | case "application/vnd.ms-powerpoint": 264 | case "application/vnd.openxmlformats-officedocument.presentationml.presentation": 265 | case "application/vnd.openxmlformats-officedocument.presentationml.template": 266 | iconType = "presentation" 267 | break 268 | case "application/vnd.oasis.opendocument.text-master": 269 | case "application/vnd.oasis.opendocument.text": 270 | case "application/vnd.oasis.opendocument.text-template": 271 | case "application/msword": 272 | case "application/rtf": 273 | case "application/x-mswrite": 274 | case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": 275 | case "application/vnd.openxmlformats-officedocument.wordprocessingml.template": 276 | case "application/vnd.ms-works": 277 | iconType = "formatted" 278 | break 279 | default: 280 | if (mimeType.indexOf("audio/") == 0) { 281 | iconType = "audio" 282 | } else if (mimeType.indexOf("image/") == 0) { 283 | iconType = "image" 284 | } else if (mimeType.indexOf("video/") == 0) { 285 | iconType = "video" 286 | } 287 | } 288 | iconSource = "image://theme/icon-m-file-" + iconType 289 | } 290 | return iconSource + (highlighted ? "?" + Theme.highlightColor : "") 291 | } 292 | } 293 | } 294 | Column { 295 | width: parent.width - parent.height - parent.spacing - Theme.horizontalPageMargin 296 | anchors.verticalCenter: parent.verticalCenter 297 | spacing: -Theme.paddingSmall 298 | Label { 299 | text: model.fileName 300 | width: parent.width 301 | font.pixelSize: Theme.fontSizeMedium 302 | truncationMode: TruncationMode.Fade 303 | color: highlighted ? Theme.highlightColor : Theme.primaryColor 304 | } 305 | Label { 306 | property string dateString: Format.formatDate(model.modified, Formatter.DateLong) 307 | text: model.isDir ? dateString 308 | //: Shows size and modification date, e.g. "15.5MB, 02/03/2016" 309 | //% "%1, %2" 310 | : qsTrId("filemanager-la-file_details").arg(Format.formatFileSize(model.size)).arg(dateString) 311 | width: parent.width 312 | truncationMode: TruncationMode.Fade 313 | font.pixelSize: Theme.fontSizeSmall 314 | color: highlighted ? Theme.secondaryHighlightColor : Theme.secondaryColor 315 | } 316 | } 317 | } 318 | 319 | onClicked: { 320 | // console.log(inclHiddenFiles); 321 | if (model.isDir) { 322 | pageStack.push(Qt.resolvedUrl("FileChooserPage.qml"), 323 | { path: fileModel.appendPath(model.fileName), inclHiddenFiles: inclHiddenFiles, homePath: page.homePath, callback: page.callback }); 324 | } else { 325 | var filePath = fileModel.path + "/" + model.fileName; 326 | console.log("###", mimeType, filePath); 327 | 328 | if (typeof callback == "function") { 329 | callback(filePath); //return to the page from which this page was called 330 | } 331 | } 332 | } 333 | } 334 | ViewPlaceholder { 335 | enabled: fileModel.count === 0 336 | //% "No files" 337 | text: qsTrId("filemanager-la-no_files") 338 | } 339 | VerticalScrollDecorator {} 340 | } 341 | } 342 | -------------------------------------------------------------------------------- /qml/pages/HistoryPage.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.6 2 | import Sailfish.Silica 1.0 3 | 4 | Page { 5 | id: historyPage 6 | 7 | property string file 8 | property string encd 9 | property var callback 10 | 11 | function deleteHistory(){ 12 | py2.call('editFile.resetHistory', [], function(result) {}); 13 | } 14 | 15 | SilicaListView { 16 | id: historyList 17 | anchors {top: parent.top; bottom: rect_deletehistory.top; left: parent.left; right: parent.right; bottomMargin: Theme.itemSizeMedium } 18 | // width: parent.width 19 | anchors.fill: parent 20 | clip: true 21 | 22 | header: PageHeader { 23 | title: qsTr("History") 24 | description: qsTr("Documents are in order of first opening") 25 | } 26 | 27 | model: ListModel { 28 | id: myModel 29 | } 30 | 31 | delegate: ListItem { 32 | id: myListItem 33 | // height: Theme.iconSizeExtraLarge 34 | onClicked: { 35 | console.log(labelPath.text); 36 | //callback(labelPath.text); 37 | pageStack.replaceAbove(null, Qt.resolvedUrl("../pages/FirstPage.qml"), {filePath: file, docencoding: encd}, PageStackAction.Animated); 38 | pageStack.nextPage(); 39 | } 40 | 41 | menu: ContextMenu { 42 | Label { 43 | wrapMode: Text.WordWrap 44 | height: Theme.iconSizeExtraLarge 45 | width: parent.width 46 | font.pixelSize: Theme.fontSizeSmall 47 | text: file 48 | } 49 | MenuItem { 50 | text: qsTr("Move to top") 51 | onClicked: { 52 | var openedFiles = []; 53 | py2.call('editFile.getHistory', ["history"], function(result) { 54 | for (var i = 0; i < result.length; i++) { 55 | if (result[i].history !== labelPath.text) { 56 | openedFiles.push(result[i].history); 57 | } 58 | } 59 | openedFiles.push(labelPath.text); 60 | 61 | // now save new history on file system 62 | // and update qml model (UI) 63 | py2.call('editFile.setHistory', ["history", openedFiles], function(result) { 64 | myModel.clear(); 65 | for (var i = openedFiles.length-1; i >= 0; i--) { 66 | var element = { "value" : openedFiles[i] } 67 | myModel.append(element) 68 | } 69 | }); 70 | }); 71 | } 72 | } 73 | 74 | MenuItem { 75 | text: qsTr("Delete") 76 | onClicked: { 77 | //TODO revisit 78 | var result 79 | result=py2.call_sync('editFile.getHistory'); 80 | var openedFiles = []; 81 | var encodings = []; 82 | openedFiles = result.file; 83 | encodings = result.encd; 84 | for (var i = 0; i < result.length; i++) { 85 | if (result[i] !== labelPath.text) { 86 | openedFiles.push(result[i]); 87 | } 88 | } 89 | 90 | // now save new history on file system 91 | // and update qml model (UI) 92 | py2.call('editFile.setHistory', ["history", openedFiles], function(result) { 93 | myModel.clear(); 94 | for (var i = openedFiles.length-1; i >= 0; i--) { 95 | var element = { "file" : openedFiles[i]} 96 | myModel.append(element) 97 | } 98 | }); 99 | } 100 | } 101 | } 102 | Row{ 103 | anchors { 104 | left: parent.left 105 | right: parent.right 106 | verticalCenter: Text.verticalCenter 107 | margins: Theme.paddingMedium 108 | } 109 | Label { 110 | id: labelPath 111 | width: parent.width - (Theme.itemSizeSmall * 1.8) 112 | wrapMode: Text.Wrap 113 | font.pixelSize: Theme.fontSizeSmall 114 | text: (file.split("/")[(file.split("/").length)-1]) 115 | } 116 | Label { 117 | id: labelEncd 118 | width: Theme.itemSizeSmall * 1.8 119 | horizontalAlignment: Text.AlignRight 120 | font.pixelSize: Theme.fontSizeExtraSmall 121 | color: "lightblue" 122 | text: encd 123 | } 124 | 125 | } 126 | Rectangle {width: parent.width; height: 2; color: Theme.highlightDimmerColor} 127 | } 128 | 129 | Component.onCompleted: { 130 | var result 131 | result=py2.call_sync('editFile.getHistory'); 132 | var openedFiles = []; 133 | var encodings = []; 134 | openedFiles = result.file; 135 | encodings = result.encd; 136 | 137 | for (var i = openedFiles.length-1; i >= 0; i--) { 138 | var element = { "file" : openedFiles[i], "encd": encodings[i] } 139 | myModel.append(element) 140 | } 141 | } 142 | } 143 | Rectangle{ 144 | id: rect_deletehistory 145 | height: Theme.itemSizeMedium 146 | anchors{bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: Theme.paddingSmall} 147 | z: historyList.z + 1 148 | Button{ 149 | anchors {horizontalCenter: parent.horizontalCenter} 150 | text: qsTr("Delete history") 151 | onClicked: deleteHistory(); 152 | } 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /qml/pages/QuickNotePage.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.6 2 | import Sailfish.Silica 1.0 3 | import io.thp.pyotherside 1.5 4 | import harbour.editor.generallogic 1.0 5 | import "../components" 6 | import "../components/pullMenus/rows" 7 | 8 | Page { 9 | id: editorPage 10 | 11 | //for filePath 12 | GeneralLogic { 13 | id: myGeneralLogic 14 | } 15 | 16 | property string filePath: myGeneralLogic.getQuickNotePath(); 17 | property bool searched: false 18 | property bool searchRowVisible: false 19 | 20 | Rectangle { 21 | id:background 22 | color: bgColor 23 | anchors.fill: parent 24 | visible: true 25 | 26 | SilicaFlickable { 27 | id: view 28 | anchors.fill: parent 29 | 30 | PushUpMenu { 31 | MenuLabel { 32 | text: qsTr("Quick note.") 33 | } 34 | MenuLabel { 35 | text: qsTr("Text auto-saved in:") 36 | } 37 | MenuLabel { 38 | text: "~/Documents/harbour-editor-quickNote.txt" 39 | } 40 | } 41 | 42 | Row { 43 | id: header 44 | height: hotActionsMenu.height 45 | width: parent.width 46 | anchors.bottom: parent.bottom 47 | 48 | Row { 49 | id: hotActionsMenu 50 | width: parent.width 51 | height: childrenRect.height 52 | visible: !searchRowVisible 53 | 54 | MenuButton { 55 | width: parent.width / 4 56 | mySource: "image://theme/icon-m-rotate-left"; 57 | myText: qsTr("Undo") 58 | enabled: myTextArea._editor.canUndo 59 | onClicked: { 60 | myTextArea._editor.undo() 61 | } 62 | } 63 | 64 | MenuButton { 65 | width: parent.width / 4 66 | mySource: "image://theme/icon-m-rotate-right"; 67 | myText: qsTr("Redo") 68 | enabled: myTextArea._editor.canRedo 69 | onClicked: { 70 | myTextArea._editor.redo() 71 | } 72 | } 73 | 74 | MenuButton { 75 | width: parent.width / 4 76 | mySource: "image://theme/icon-m-search?" + (searchRowVisible ? Theme.highlightColor : Theme.primaryColor); 77 | myText: qsTr("Search") 78 | onClicked: { 79 | if (searchRowVisible == false) { 80 | searchRowVisible = true; 81 | } 82 | else { 83 | searchRowVisible = false; 84 | } 85 | } 86 | } 87 | 88 | MenuButton { 89 | width: parent.width / 4 90 | mySource: "../img/icon-m-tab.svg"; 91 | myText: qsTr("Tab") 92 | onClicked: { 93 | var previousCursorPosition = myTextArea.cursorPosition; 94 | myTextArea.text = myTextArea.text.slice(0, myTextArea.cursorPosition) + tabType + myTextArea.text.slice(myTextArea.cursorPosition, myTextArea.text.length); 95 | myTextArea.cursorPosition = previousCursorPosition + 1; 96 | } 97 | } 98 | } 99 | 100 | SearchRow { 101 | width: parent.width 102 | height: childrenRect.height 103 | visible: searchRowVisible 104 | } 105 | 106 | } 107 | 108 | SilicaFlickable { 109 | id: editorView 110 | anchors.fill: parent 111 | anchors.bottomMargin: header.visible ? header.height : 0 // для сдвига при отключении quick actions menu 112 | contentHeight: myTextArea.height 113 | clip: true 114 | 115 | TextArea { 116 | id: myTextArea 117 | width: parent.width 118 | font.family: fontType 119 | font.pixelSize: fontSize 120 | background: null 121 | selectionMode: TextEdit.SelectCharacters 122 | focus: true 123 | 124 | onTextChanged: { 125 | // console.log("filePath = " + filePath, fontSize, font.family); 126 | 127 | //Autosave 128 | if (filePath!=="" && myTextArea.text !== "") { 129 | py.call('editFile.savings', [filePath,myTextArea.text,'utf-8'], function() {}); 130 | } 131 | } 132 | } 133 | VerticalScrollDecorator { flickable: editorView } 134 | } 135 | } 136 | } 137 | 138 | onStatusChanged: { 139 | if (status !== PageStatus.Active) { 140 | return 141 | } else { 142 | console.log(filePath) 143 | if (filePath!=="") { 144 | py.call('editFile.openings', [filePath,'utf-8'], function(result) { 145 | myTextArea.text = result[0]; 146 | }); 147 | } 148 | } 149 | } 150 | 151 | Python { 152 | id: py 153 | 154 | Component.onCompleted: { 155 | addImportPath(Qt.resolvedUrl('../.')); 156 | importModule('editFile', function () {}); 157 | } 158 | onError: { 159 | // when an exception is raised, this error handler will be called 160 | console.log('python error: ' + traceback); 161 | } 162 | onReceived: console.log('Unhandled event: ' + data) 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /qml/pages/SaveAsPage.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Taken from https://github.com/CODeRUS/splashscreen-changer/blob/master/settings/SecondPage.qml 3 | * Thanks coderus! 4 | */ 5 | 6 | import QtQuick 2.6 7 | import Sailfish.Silica 1.0 8 | ;import Nemo.FileManager 1.0 9 | ;import Sailfish.FileManager 1.0 10 | 11 | Page { 12 | id: page 13 | allowedOrientations: Orientation.All 14 | 15 | property alias path: fileModel.path 16 | property string homePath 17 | property string title 18 | property bool showFormat 19 | property string filePath 20 | property string docencoding 21 | property bool showHiddenFiles 22 | 23 | signal formatClicked 24 | 25 | property var callback 26 | 27 | function savefile (){ 28 | filePath = nameField.text; 29 | if (typeof callback == "function") { 30 | callback(filePath,docencoding); //return to the page from which this page was called 31 | } 32 | } 33 | 34 | SequentialAnimation { 35 | id: anim_butt_click 36 | alwaysRunToEnd: true 37 | ColorAnimation{target: ret_butt ; property: "color"; to: Theme.highlightColor; duration: 150} 38 | ColorAnimation{target: ret_butt ; property: "color"; to: Theme.highlightDimmerColor; duration: 150} 39 | onStopped: { 40 | savefile(); 41 | } 42 | } 43 | 44 | backNavigation: !FileEngine.busy 45 | 46 | FileModel { 47 | id: fileModel 48 | 49 | path: filePath != "" ? filePath.replace((filePath.split("/")[(filePath.split("/").length)-1]),"") : StandardPaths.home 50 | active: page.status === PageStatus.Active 51 | includeHiddenFiles: showHiddenFiles 52 | } 53 | 54 | PageHeader { 55 | id: header 56 | width: parent.width 57 | height: nameField.height + encodeField.height + Theme.paddingLarge 58 | 59 | Column { 60 | anchors.topMargin: Theme.paddingMedium 61 | anchors.fill: parent 62 | TextField { 63 | id: nameField 64 | width: parent.width 65 | labelVisible: false 66 | text: filePath != "" ? filePath : StandardPaths.home + "/" 67 | 68 | EnterKey.enabled: text.length > 0 69 | EnterKey.onClicked: { 70 | savefile(); 71 | } 72 | } 73 | Row { 74 | width: parent.width 75 | 76 | TextField { 77 | id: encodeField 78 | width: parent.width - ret_butt.width 79 | height: nameField.height 80 | label: "Encoding" 81 | labelVisible: false 82 | text: docencoding 83 | onTextChanged: {docencoding = text;} 84 | } 85 | Rectangle{ 86 | id: ret_butt 87 | color: Theme.highlightDimmerColor; 88 | width: header.height 89 | height: nameField.height 90 | Image{ 91 | anchors.fill: parent; 92 | source: "image://theme/icon-m-forward" 93 | fillMode: Image.PreserveAspectFit 94 | } 95 | MouseArea{ 96 | anchors.fill: parent; 97 | onClicked: { 98 | anim_butt_click.start(); 99 | } 100 | } 101 | } 102 | } 103 | } 104 | } 105 | 106 | 107 | SilicaListView { 108 | id: fileList 109 | 110 | width: parent.width 111 | height: parent.height 112 | anchors.topMargin: header.height; 113 | clip: true // to be below than PageHeader 114 | 115 | opacity: FileEngine.busy ? 0.6 : 1.0 116 | Behavior on opacity { FadeAnimator {} } 117 | 118 | anchors.fill: parent 119 | model: fileModel 120 | 121 | 122 | delegate: ListItem { 123 | id: fileItem 124 | 125 | width: ListView.view.width 126 | contentHeight: Theme.itemSizeSmall 127 | Row { 128 | anchors.fill: parent 129 | spacing: Theme.paddingLarge 130 | Rectangle { 131 | width: height 132 | height: parent.height 133 | gradient: Gradient { 134 | GradientStop { position: 0.0; color: Theme.rgba(Theme.primaryColor, 0.1) } 135 | GradientStop { position: 1.0; color: "transparent" } 136 | } 137 | 138 | Image { 139 | anchors.centerIn: parent 140 | source: { 141 | var iconSource 142 | if (model.isDir) { 143 | iconSource = "image://theme/icon-m-file-folder" 144 | } else { 145 | var iconType = "other" 146 | switch (model.mimeType) { 147 | case "application/vnd.android.package-archive": 148 | iconType = "apk" 149 | break 150 | case "application/x-rpm": 151 | iconType = "rpm" 152 | break 153 | case "text/vcard": 154 | iconType = "vcard" 155 | break 156 | case "text/plain": 157 | case "text/x-vnote": 158 | iconType = "note" 159 | break 160 | case "application/pdf": 161 | iconType = "pdf" 162 | break 163 | case "application/vnd.oasis.opendocument.spreadsheet": 164 | case "application/x-kspread": 165 | case "application/vnd.ms-excel": 166 | case "text/csv": 167 | case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": 168 | case "application/vnd.openxmlformats-officedocument.spreadsheetml.template": 169 | iconType = "spreadsheet" 170 | break 171 | case "application/vnd.oasis.opendocument.presentation": 172 | case "application/vnd.oasis.opendocument.presentation-template": 173 | case "application/x-kpresenter": 174 | case "application/vnd.ms-powerpoint": 175 | case "application/vnd.openxmlformats-officedocument.presentationml.presentation": 176 | case "application/vnd.openxmlformats-officedocument.presentationml.template": 177 | iconType = "presentation" 178 | break 179 | case "application/vnd.oasis.opendocument.text-master": 180 | case "application/vnd.oasis.opendocument.text": 181 | case "application/vnd.oasis.opendocument.text-template": 182 | case "application/msword": 183 | case "application/rtf": 184 | case "application/x-mswrite": 185 | case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": 186 | case "application/vnd.openxmlformats-officedocument.wordprocessingml.template": 187 | case "application/vnd.ms-works": 188 | iconType = "formatted" 189 | break 190 | default: 191 | if (mimeType.indexOf("audio/") == 0) { 192 | iconType = "audio" 193 | } else if (mimeType.indexOf("image/") == 0) { 194 | iconType = "image" 195 | } else if (mimeType.indexOf("video/") == 0) { 196 | iconType = "video" 197 | } 198 | } 199 | iconSource = "image://theme/icon-m-file-" + iconType 200 | } 201 | return iconSource + (highlighted ? "?" + Theme.highlightColor : "") 202 | } 203 | } 204 | } 205 | Column { 206 | width: parent.width - parent.height - parent.spacing - Theme.horizontalPageMargin 207 | anchors.verticalCenter: parent.verticalCenter 208 | spacing: -Theme.paddingSmall 209 | Label { 210 | text: model.fileName 211 | width: parent.width 212 | font.pixelSize: Theme.fontSizeLarge 213 | truncationMode: TruncationMode.Fade 214 | color: highlighted ? Theme.highlightColor : Theme.primaryColor 215 | } 216 | Label { 217 | property string dateString: Format.formatDate(model.modified, Formatter.DateLong) 218 | text: model.isDir ? dateString 219 | //: Shows size and modification date, e.g. "15.5MB, 02/03/2016" 220 | //% "%1, %2" 221 | : qsTrId("filemanager-la-file_details").arg(Format.formatFileSize(model.size)).arg(dateString) 222 | width: parent.width 223 | truncationMode: TruncationMode.Fade 224 | font.pixelSize: Theme.fontSizeSmall 225 | color: highlighted ? Theme.secondaryHighlightColor : Theme.secondaryColor 226 | } 227 | } 228 | } 229 | 230 | 231 | onClicked: { 232 | if (model.isDir) { 233 | pageStack.push(Qt.resolvedUrl("SaveAsPage.qml"), 234 | { path: fileModel.appendPath(model.fileName), homePath: page.homePath, callback: page.callback }) 235 | } else { 236 | filePath = fileModel.path + "/" + model.fileName; 237 | console.log("###", mimeType, filePath); 238 | nameField.text = filePath; 239 | } 240 | } 241 | 242 | } 243 | ViewPlaceholder { 244 | enabled: fileModel.count === 0 245 | //% "No files" 246 | text: qsTrId("filemanager-la-no_files") 247 | } 248 | VerticalScrollDecorator {} 249 | } 250 | } 251 | -------------------------------------------------------------------------------- /qml/scripts/RecalcLines.js: -------------------------------------------------------------------------------- 1 | WorkerScript.onMessage = function(query) { 2 | 3 | var line 4 | var result = ""; 5 | 6 | for(var i = 0; i < query.myTextArea;i++ ) 7 | { 8 | line=query.documentHandler[i]; 9 | if(line == " "){result += "\n";} 10 | else{ 11 | result += line + "\n"; 12 | } 13 | } 14 | WorkerScript.sendMessage({'queryResult': result}) 15 | } 16 | -------------------------------------------------------------------------------- /rpm/harbour-editor.changes.ex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoAlexander/harbour-editor/b3ff03c66a74c19dcd03552ac75ae39ebcb73096/rpm/harbour-editor.changes.ex -------------------------------------------------------------------------------- /rpm/harbour-editor.changes.in: -------------------------------------------------------------------------------- 1 | # Rename this file as harbour-editor.changes to include changelog 2 | # entries in your RPM file. 3 | # 4 | # Add new changelog entries following the format below. 5 | # Add newest entries to the top of the list. 6 | # Separate entries from eachother with a blank line. 7 | 8 | # * date Author's Name version-release 9 | # - Summary of changes 10 | 11 | * Sun Apr 13 2014 Jack Tar 0.0.1-1 12 | - Scrubbed the deck 13 | - Hoisted the sails 14 | 15 | -------------------------------------------------------------------------------- /rpm/harbour-editor.spec: -------------------------------------------------------------------------------- 1 | # 2 | # Do NOT Edit the Auto-generated Part! 3 | # Generated by: spectacle version 0.27 4 | # 5 | 6 | Name: harbour-editor 7 | 8 | # >> macros 9 | # << macros 10 | 11 | %{!?qtc_qmake:%define qtc_qmake %qmake} 12 | %{!?qtc_qmake5:%define qtc_qmake5 %qmake5} 13 | %{!?qtc_make:%define qtc_make make} 14 | %{?qtc_builddir:%define _builddir %qtc_builddir} 15 | Summary: Editor 16 | Version: 0.9.1 17 | Release: 1 18 | Group: Qt/Qt 19 | License: LICENSE 20 | Source0: %{name}-%{version}.tar.bz2 21 | Source100: harbour-editor.yaml 22 | Requires: sailfishsilica-qt5 >= 0.10.9 23 | Requires: libsailfishapp 24 | Requires: pyotherside-qml-plugin-python3-qt5 >= 1.5 25 | BuildRequires: pkgconfig(sailfishapp) >= 1.0.2 26 | BuildRequires: pkgconfig(Qt5Core) 27 | BuildRequires: pkgconfig(Qt5Qml) 28 | BuildRequires: pkgconfig(Qt5Quick) 29 | BuildRequires: desktop-file-utils 30 | 31 | %description 32 | Short description of my Sailfish OS Application 33 | 34 | 35 | %prep 36 | %setup -q -n %{name}-%{version} 37 | 38 | # >> setup 39 | # << setup 40 | 41 | %build 42 | # >> build pre 43 | # << build pre 44 | 45 | %qtc_qmake5 \ 46 | VERSION=%{version} 47 | 48 | %qtc_make %{?_smp_mflags} 49 | 50 | # >> build post 51 | # << build post 52 | 53 | %install 54 | rm -rf %{buildroot} 55 | # >> install pre 56 | # << install pre 57 | %qmake5_install 58 | 59 | # >> install post 60 | # << install post 61 | 62 | desktop-file-install --delete-original \ 63 | --dir %{buildroot}%{_datadir}/applications \ 64 | %{buildroot}%{_datadir}/applications/*.desktop 65 | 66 | %files 67 | %defattr(-,root,root,-) 68 | %defattr(644,root,root,-) 69 | %attr(755,-,-) %{_bindir}/%{name} 70 | %{_bindir} 71 | %{_datadir}/%{name} 72 | %{_datadir}/applications/%{name}.desktop 73 | %{_datadir}/icons/hicolor/*/apps/%{name}.png 74 | # >> files 75 | # << files 76 | -------------------------------------------------------------------------------- /rpm/harbour-editor.yaml: -------------------------------------------------------------------------------- 1 | Name: harbour-editor 2 | Summary: Editor 3 | Version: 0.9.0 4 | Release: 1 5 | # The contents of the Group field should be one of the groups listed here: 6 | # http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS 7 | Group: Qt/Qt 8 | URL: http://example.org/ 9 | License: LICENSE 10 | # This must be generated before uploading a package to a remote build service. 11 | # Usually this line does not need to be modified. 12 | Sources: 13 | - '%{name}-%{version}.tar.bz2' 14 | Description: | 15 | Short description of my Sailfish OS Application 16 | Configure: none 17 | # The qtc5 builder inserts macros to allow QtCreator to have fine 18 | # control over qmake/make execution 19 | Builder: qtc5 20 | 21 | # This section specifies build dependencies that are resolved using pkgconfig. 22 | # This is the preferred way of specifying build dependencies for your package. 23 | PkgConfigBR: 24 | - sailfishapp >= 1.0.2 25 | - Qt5Core 26 | - Qt5Qml 27 | - Qt5Quick 28 | 29 | # Build dependencies without a pkgconfig setup can be listed here 30 | # PkgBR: 31 | # - package-needed-to-build 32 | 33 | # Runtime dependencies which are not automatically detected 34 | Requires: 35 | - sailfishsilica-qt5 >= 0.10.9 36 | - libsailfishapp 37 | - pyotherside-qml-plugin-python3-qt5 >= 1.5 38 | 39 | # All installed files 40 | Files: 41 | - '%defattr(644,root,root,-)' 42 | - '%attr(755,-,-) %{_bindir}/%{name}' 43 | - '%{_bindir}' 44 | - '%{_datadir}/%{name}' 45 | - '%{_datadir}/applications/%{name}.desktop' 46 | - '%{_datadir}/icons/hicolor/*/apps/%{name}.png' 47 | 48 | # For more information about yaml and what's supported in Sailfish OS 49 | # build system, please see https://wiki.merproject.org/wiki/Spectacle 50 | 51 | QMakeOptions: 52 | - VERSION=%{version} 53 | -------------------------------------------------------------------------------- /src/dictionaries/javascript.txt: -------------------------------------------------------------------------------- 1 | Array 2 | E 3 | Function 4 | Infinity 5 | JSON 6 | LN10 7 | LN2 8 | LOG10E 9 | LOG2E 10 | Math 11 | NaN 12 | Object 13 | PI 14 | RegExp 15 | SQRT1_2 16 | SQRT2 17 | String 18 | XMLHttpRequest 19 | __defineGetter__ 20 | __defineSetter__ 21 | __lookupGetter__ 22 | __lookupSetter__ 23 | __noSuchMethod__ 24 | __parent__ 25 | __proto__ 26 | abs 27 | acos 28 | apply 29 | arguments 30 | arity 31 | asin 32 | atan 33 | atan2 34 | bind 35 | call 36 | caller 37 | ceil 38 | charAt 39 | charCodeAt 40 | concat 41 | console 42 | constructor 43 | cos 44 | create 45 | decodeURI 46 | decodeURIComponent 47 | defineProperties 48 | defineProperty 49 | encodeURI 50 | encodeURIComponent 51 | eval 52 | event 53 | every 54 | exec 55 | exp 56 | filter 57 | floor 58 | forEach 59 | fromCharCode 60 | getOwnPropertyDescriptor 61 | getOwnPropertyNames 62 | global 63 | hasOwnProperty 64 | ignoreCase 65 | indexOf 66 | input 67 | isArray 68 | isFinite 69 | isNaN 70 | isPrototypeOf 71 | join 72 | keys 73 | lastIndex 74 | lastIndexOf 75 | localCompare 76 | log 77 | map 78 | match 79 | max 80 | min 81 | multiline 82 | name 83 | navigator 84 | parent 85 | parse 86 | parseFloat 87 | parseInt 88 | pop 89 | pow 90 | propertyIsEnumerable 91 | prototype 92 | push 93 | quote 94 | random 95 | reduce 96 | reduceRight 97 | replace 98 | reverse 99 | round 100 | search 101 | shift 102 | sin 103 | slice 104 | some 105 | sort 106 | splice 107 | split 108 | sqrt 109 | stringify 110 | substr 111 | substring 112 | tan 113 | test 114 | toLocaleLowerCase 115 | toLocaleString 116 | toLocaleUpperCase 117 | toLowerCase 118 | toSource 119 | toString 120 | toUpperCase 121 | trim 122 | trimLeft 123 | trimRight 124 | undefined 125 | unshift 126 | unwatch 127 | userAgent 128 | valueOf 129 | watch 130 | Anchor 131 | Area 132 | Array 133 | Boolean 134 | Button 135 | Checkbox 136 | Date 137 | Document 138 | Element 139 | FileUpload 140 | Form 141 | Frame 142 | Function 143 | Hidden 144 | History 145 | Image 146 | Infinity 147 | JavaArray 148 | JavaClass 149 | JavaObject 150 | JavaPackage 151 | Link 152 | Location 153 | Math 154 | MimeType 155 | NaN 156 | Navigator 157 | Number 158 | Object 159 | Option 160 | Packages 161 | Password 162 | Plugin 163 | Radio 164 | RegExp 165 | Reset 166 | Select 167 | String 168 | Submit 169 | Text 170 | Textarea 171 | Window 172 | alert 173 | arguments 174 | assign 175 | blur 176 | break 177 | callee 178 | caller 179 | captureEvents 180 | case 181 | clearInterval 182 | clearTimeout 183 | close 184 | closed 185 | comment 186 | confirm 187 | constructor 188 | continue 189 | default 190 | defaultStatus 191 | delete 192 | do 193 | document 194 | else 195 | escape 196 | eval 197 | export 198 | find 199 | focus 200 | for 201 | frames 202 | function 203 | getClass 204 | history 205 | home 206 | if 207 | import 208 | in 209 | innerHeight 210 | innerWidth 211 | isFinite 212 | isNan 213 | java 214 | label 215 | length 216 | location 217 | locationbar 218 | menubar 219 | moveBy 220 | moveTo 221 | name 222 | navigate 223 | navigator 224 | netscape 225 | new 226 | onBlur 227 | onError 228 | onFocus 229 | onLoad 230 | onUnload 231 | open 232 | opener 233 | outerHeight 234 | outerWidth 235 | pageXoffset 236 | pageYoffset 237 | parent 238 | parseFloat 239 | parseInt 240 | personalbar 241 | print 242 | prompt 243 | prototype 244 | ref 245 | releaseEvents 246 | resizeBy 247 | resizeTo 248 | return 249 | routeEvent 250 | scroll 251 | scrollBy 252 | scrollTo 253 | scrollbars 254 | self 255 | setInterval 256 | setTimeout 257 | status 258 | statusbar 259 | stop 260 | sun 261 | switch 262 | taint 263 | this 264 | toString 265 | toolbar 266 | top 267 | typeof 268 | unescape 269 | untaint 270 | unwatch 271 | valueOf 272 | var 273 | void 274 | watch 275 | while 276 | window 277 | with 278 | -------------------------------------------------------------------------------- /src/dictionaries/keywords.txt: -------------------------------------------------------------------------------- 1 | alias 2 | bool 3 | break 4 | case 5 | catch 6 | continue 7 | coordinate 8 | date 9 | default 10 | delete 11 | do 12 | double 13 | else 14 | enumeration 15 | false 16 | finally 17 | font 18 | for 19 | function 20 | geocircle 21 | georectangle 22 | geoshape 23 | if 24 | import 25 | in 26 | instanceof 27 | int 28 | list 29 | matrix4x4 30 | new 31 | null 32 | on 33 | point 34 | property 35 | quaternion 36 | real 37 | rect 38 | return 39 | signal 40 | size 41 | string 42 | switch 43 | this 44 | throw 45 | true 46 | try 47 | typeof 48 | url 49 | var 50 | variant 51 | vector2d 52 | vector3d 53 | vector4d 54 | void 55 | while 56 | with 57 | -------------------------------------------------------------------------------- /src/dictionaries/python.txt: -------------------------------------------------------------------------------- 1 | ArithmeticError 2 | AssertionError 3 | AttributeError 4 | BaseException 5 | BufferError 6 | BytesWarning 7 | DeprecationWarning 8 | EOFError 9 | Ellipsis 10 | EnvironmentError 11 | Exception 12 | False 13 | FloatingPointError 14 | FutureWarning 15 | GeneratorExit 16 | IOError 17 | ImportError 18 | ImportWarning 19 | IndentationError 20 | IndexError 21 | KeyError 22 | KeyboardInterrupt 23 | LookupError 24 | MemoryError 25 | NameError 26 | None 27 | NotImplemented 28 | NotImplementedError 29 | OSError 30 | OverflowError 31 | PendingDeprecationWarning 32 | ReferenceError 33 | RuntimeError 34 | RuntimeWarning 35 | StandardError 36 | StopIteration 37 | SyntaxError 38 | SyntaxWarning 39 | SystemError 40 | SystemExit 41 | TabError 42 | True 43 | TypeError 44 | UnboundLocalError 45 | UnicodeDecodeError 46 | UnicodeEncodeError 47 | UnicodeError 48 | UnicodeTranslateError 49 | UnicodeWarning 50 | UserWarning 51 | ValueError 52 | Warning 53 | ZeroDivisionError 54 | __builtins__ 55 | __debug__ 56 | __doc__ 57 | __file__ 58 | __future__ 59 | __import__ 60 | __init__ 61 | __main__ 62 | __name__ 63 | __package__ 64 | _dummy_thread 65 | _thread 66 | abc 67 | abs 68 | aifc 69 | all 70 | and 71 | any 72 | apply 73 | argparse 74 | array 75 | as 76 | assert 77 | ast 78 | asynchat 79 | asyncio 80 | asyncore 81 | atexit 82 | audioop 83 | base64 84 | basestring 85 | bdb 86 | bin 87 | binascii 88 | binhex 89 | bisect 90 | bool 91 | break 92 | buffer 93 | builtins 94 | bytearray 95 | bytes 96 | bz2 97 | calendar 98 | callable 99 | cgi 100 | cgitb 101 | chr 102 | chuck 103 | class 104 | classmethod 105 | cmath 106 | cmd 107 | cmp 108 | code 109 | codecs 110 | codeop 111 | coerce 112 | collections 113 | colorsys 114 | compile 115 | compileall 116 | complex 117 | concurrent 118 | configparser 119 | contextlib 120 | continue 121 | copy 122 | copyreg 123 | copyright 124 | credits 125 | crypt 126 | csv 127 | ctypes 128 | curses 129 | datetime 130 | dbm 131 | decimal 132 | def 133 | del 134 | delattr 135 | dict 136 | difflib 137 | dir 138 | dis 139 | distutils 140 | divmod 141 | doctest 142 | dummy_threading 143 | elif 144 | else 145 | email 146 | enumerate 147 | ensurepip 148 | enum 149 | errno 150 | eval 151 | except 152 | exec 153 | execfile 154 | exit 155 | faulthandler 156 | fcntl 157 | file 158 | filecmp 159 | fileinput 160 | filter 161 | finally 162 | float 163 | fnmatch 164 | for 165 | format 166 | formatter 167 | fpectl 168 | fractions 169 | from 170 | frozenset 171 | ftplib 172 | functools 173 | gc 174 | getattr 175 | getopt 176 | getpass 177 | gettext 178 | glob 179 | global 180 | globals 181 | grp 182 | gzip 183 | hasattr 184 | hash 185 | hashlib 186 | heapq 187 | help 188 | hex 189 | hmac 190 | html 191 | http 192 | id 193 | if 194 | imghdr 195 | imp 196 | impalib 197 | import 198 | importlib 199 | in 200 | input 201 | inspect 202 | int 203 | intern 204 | io 205 | ipaddress 206 | is 207 | isinstance 208 | issubclass 209 | iter 210 | itertools 211 | json 212 | keyword 213 | lambda 214 | len 215 | license 216 | linecache 217 | list 218 | locale 219 | locals 220 | logging 221 | long 222 | lzma 223 | macpath 224 | mailbox 225 | mailcap 226 | map 227 | marshal 228 | math 229 | max 230 | memoryview 231 | mimetypes 232 | min 233 | mmap 234 | modulefinder 235 | msilib 236 | msvcrt 237 | multiprocessing 238 | netrc 239 | next 240 | nis 241 | nntplib 242 | not 243 | numbers 244 | object 245 | oct 246 | open 247 | operator 248 | optparse 249 | or 250 | ord 251 | os 252 | ossaudiodev 253 | parser 254 | pass 255 | pathlib 256 | pdb 257 | pickle 258 | pickletools 259 | pipes 260 | pkgutil 261 | platform 262 | plistlib 263 | poplib 264 | posix 265 | pow 266 | pprint 267 | print 268 | profile 269 | property 270 | pty 271 | pwd 272 | py_compiler 273 | pyclbr 274 | pydoc 275 | queue 276 | quit 277 | quopri 278 | raise 279 | random 280 | range 281 | raw_input 282 | re 283 | readline 284 | reduce 285 | reload 286 | repr 287 | reprlib 288 | resource 289 | return 290 | reversed 291 | rlcompleter 292 | round 293 | runpy 294 | sched 295 | select 296 | selectors 297 | self 298 | set 299 | setattr 300 | shelve 301 | shlex 302 | shutil 303 | signal 304 | site 305 | slice 306 | smtpd 307 | smtplib 308 | sndhdr 309 | socket 310 | socketserver 311 | sorted 312 | spwd 313 | sqlite3 314 | ssl 315 | stat 316 | staticmethod 317 | statistics 318 | str 319 | string 320 | stringprep 321 | struct 322 | subprocess 323 | sum 324 | sunau 325 | super 326 | symbol 327 | symtable 328 | sys 329 | sysconfig 330 | syslog 331 | tabnanny 332 | tarfile 333 | telnetlib 334 | tempfile 335 | termios 336 | test 337 | textwrap 338 | threading 339 | time 340 | timeit 341 | tkinter 342 | token 343 | tokenize 344 | trace 345 | traceback 346 | tracemalloc 347 | try 348 | tty 349 | tuple 350 | turtle 351 | type 352 | types 353 | unichr 354 | unicode 355 | unicodedata 356 | unittest 357 | urllib 358 | uu 359 | uuid 360 | vars 361 | venv 362 | warnings 363 | wave 364 | weakref 365 | webbrowser 366 | while 367 | winsound 368 | winreg 369 | with 370 | wsgiref 371 | xdrlib 372 | xml 373 | xmlrpc 374 | xrange 375 | yield 376 | zip 377 | zipfile 378 | zipimport 379 | zlib 380 | range 381 | xrange 382 | int 383 | float 384 | long 385 | hex 386 | oct 387 | chr 388 | ord 389 | len 390 | abs 391 | None 392 | True 393 | False 394 | __init__ 395 | __del__ 396 | __str__ 397 | __repr__ 398 | __unicode__ 399 | __setattr__ 400 | __getattr__ 401 | __delattr__ 402 | __add__ 403 | __sub__ 404 | __mul__ 405 | __truediv__ 406 | __floordiv__ 407 | __mod__ 408 | __pow__ 409 | __and__ 410 | __or__ 411 | __xor__ 412 | __eq__ 413 | __ne__ 414 | __gt__ 415 | __lt__ 416 | __ge__ 417 | __le__ 418 | __lshift__ 419 | __rshift__ 420 | __contains__ 421 | __pos__ 422 | __neg__ 423 | __inv__ 424 | __abs__ 425 | __len__ 426 | __getitem__ 427 | __setitem__ 428 | __delitem__ 429 | __getslice__ 430 | __setslice__ 431 | __delslice__ 432 | __cmp__ 433 | __hash__ 434 | __nonzero__ 435 | __call__ 436 | __iter__ 437 | __reversed__ 438 | __divmod__ 439 | __int__ 440 | __long__ 441 | __float__ 442 | __complex__ 443 | __hex__ 444 | __oct__ 445 | __index__ 446 | __copy__ 447 | __deepcopy__ 448 | __sizeof__ 449 | __trunc__ 450 | __format__ 451 | __name__ 452 | __module__ 453 | __dict__ 454 | __bases__ 455 | __doc__ 456 | and 457 | as 458 | assert 459 | break 460 | class 461 | continue 462 | def 463 | del 464 | elif 465 | else 466 | except 467 | exec 468 | finally 469 | for 470 | from 471 | global 472 | if 473 | in 474 | is 475 | lambda 476 | not 477 | or 478 | pass 479 | print 480 | raise 481 | return 482 | try 483 | while 484 | with 485 | yield 486 | -------------------------------------------------------------------------------- /src/dictionaries/qml.txt: -------------------------------------------------------------------------------- 1 | AbstractTextureImage 2 | Accelerometer 3 | AccelerometerReading 4 | Accessible 5 | Action 6 | Address 7 | Affector 8 | Age 9 | Altimeter 10 | AltimeterReading 11 | AmbientLightSensor 12 | AmbientTemperatureReading 13 | AmbientTemperatureSensor 14 | AnchorAnimation 15 | AnchorChanges 16 | AngleDirection 17 | AnimatedImage 18 | AnimatedSprite 19 | Animation 20 | AnimationController 21 | Animator 22 | Annotation 23 | ApplicationWindow 24 | ApplicationWindowStyle 25 | AttenuationModelInverse 26 | AttenuationModelLinear 27 | Attractor 28 | Audio 29 | AudioCategory 30 | AudioEngine 31 | AudioListener 32 | AudioSample 33 | Behavior 34 | Binding 35 | Blend 36 | BlendState 37 | BlendStateSeparate 38 | BluetoothDiscoveryModel 39 | BluetoothService 40 | BluetoothSocket 41 | BorderImage 42 | BrightnessContrast 43 | BusyIndicator 44 | BusyIndicatorStyle 45 | Button 46 | ButtonStyle 47 | Calendar 48 | CalendarStyle 49 | Camera 50 | CameraCapture 51 | CameraExposure 52 | CameraFlash 53 | CameraFocus 54 | CameraImageProcessing 55 | CameraLens 56 | CameraRecorder 57 | Canvas 58 | CanvasGradient 59 | CanvasImageData 60 | CanvasPixelArray 61 | Category 62 | CategoryModel 63 | CheckBox 64 | CheckBoxStyle 65 | CircularGauge 66 | CloseEvent 67 | ColorAnimation 68 | ColorDialog 69 | ColorOverlay 70 | Colorize 71 | Column 72 | ColumnLayout 73 | ComboBox 74 | ComboBoxStyle 75 | Compass 76 | CompassReading 77 | Component 78 | Component3D 79 | Configuration 80 | ConicalGradient 81 | Connections 82 | ContactDetail 83 | ContactDetails 84 | Context2D 85 | CoordinateAnimation 86 | CumulativeDirection 87 | CustomParticle 88 | Date 89 | DelayButton 90 | DelegateModel 91 | DelegateModelGroup 92 | Desaturate 93 | Dial 94 | Dialog 95 | Direction 96 | DirectionalBlur 97 | Displace 98 | DistanceReading 99 | DistanceSensor 100 | DoubleValidator 101 | Drag 102 | DragEvent 103 | DropArea 104 | DropShadow 105 | EditorialModel 106 | EllipseShape 107 | Emitter 108 | Entity 109 | EntityLoader 110 | ExclusiveGroup 111 | ExtendedAttributes 112 | FastBlur 113 | FileDialog 114 | Flickable 115 | Flipable 116 | Flow 117 | FocusScope 118 | FolderListModel 119 | FontDialog 120 | FontLoader 121 | FontMetrics 122 | FrameGraph 123 | FrameGraphNode 124 | Friction 125 | GammaAdjust 126 | Gauge 127 | GaussianBlur 128 | GeocodeModel 129 | Glow 130 | Gradient 131 | GradientStop 132 | Gravity 133 | Grid 134 | GridLayout 135 | GridMesh 136 | GridView 137 | GroupBox 138 | GroupGoal 139 | Gyroscope 140 | GyroscopeReading 141 | HolsterReading 142 | HolsterSensor 143 | HueSaturation 144 | IRProximityReading 145 | IRProximitySensor 146 | Icon 147 | Image 148 | ImageModel 149 | ImageParticle 150 | InnerShadow 151 | Instantiator 152 | IntValidator 153 | Item 154 | ItemGrabResult 155 | ItemParticle 156 | KeyEvent 157 | KeyNavigation 158 | Keys 159 | KeyboardController 160 | KeyboardInput 161 | Label 162 | Layer 163 | LayerFilter 164 | Layout 165 | LayoutMirroring 166 | LevelAdjust 167 | LightReading 168 | LightSensor 169 | LineShape 170 | LinearGradient 171 | ListElement 172 | ListModel 173 | ListView 174 | Loader 175 | Locale 176 | Location 177 | Magnetometer 178 | MagnetometerReading 179 | Map 180 | MapCircle 181 | MapGestureArea 182 | MapItemView 183 | MapPinchEvent 184 | MapPolygon 185 | MapPolyline 186 | MapQuickItem 187 | MapRectangle 188 | MapRoute 189 | MapType 190 | MaskShape 191 | MaskedBlur 192 | Matrix4x4 193 | MatrixTransform 194 | MediaPlayer 195 | Menu 196 | MenuBar 197 | MenuBarStyle 198 | MenuItem 199 | MenuSeparator 200 | MenuStyle 201 | MessageDialog 202 | MouseArea 203 | MouseEvent 204 | MultiPointTouchArea 205 | NdefFilter 206 | NdefMimeRecord 207 | NdefRecord 208 | NdefTextRecord 209 | NdefUriRecord 210 | NearField 211 | Node 212 | NodeInstantiator 213 | Number 214 | NumberAnimation 215 | ObjectModel 216 | OpacityAnimator 217 | OpacityMask 218 | OpenGLFilter 219 | OpenGLInfo 220 | OrientationReading 221 | OrientationSensor 222 | Package 223 | ParallelAnimation 224 | ParameterMapping 225 | ParentAnimation 226 | ParentChange 227 | Particle 228 | ParticleGroup 229 | ParticlePainter 230 | ParticleSystem 231 | Path 232 | PathAnimation 233 | PathArc 234 | PathAttribute 235 | PathCubic 236 | PathCurve 237 | PathElement 238 | PathInterpolator 239 | PathLine 240 | PathPercent 241 | PathQuad 242 | PathSvg 243 | PathView 244 | PauseAnimation 245 | Picture 246 | PieMenu 247 | PinchArea 248 | PinchEvent 249 | Place 250 | PlaceAttribute 251 | PlaceSearchModel 252 | PlaceSearchSuggestionModel 253 | PlayVariation 254 | Plugin 255 | PluginParameter 256 | PointDirection 257 | PointLight 258 | Position 259 | PositionSource 260 | Positioner 261 | PressureReading 262 | PressureSensor 263 | ProgressBar 264 | ProgressBarStyle 265 | PropertyAction 266 | PropertyAnimation 267 | PropertyChanges 268 | ProximityReading 269 | ProximitySensor 270 | Qt 271 | QtObject 272 | RadialBlur 273 | RadialGradient 274 | Radio 275 | RadioButton 276 | RadioButtonStyle 277 | RadioData 278 | Ratings 279 | Rectangle 280 | RectangleShape 281 | RectangularGlow 282 | RecursiveBlur 283 | RegExpValidator 284 | Repeater 285 | ReviewModel 286 | Rotation 287 | RotationAnimation 288 | RotationAnimator 289 | RotationReading 290 | RotationSensor 291 | Route 292 | RouteManeuver 293 | RouteModel 294 | RouteQuery 295 | RouteSegment 296 | Row 297 | RowLayout 298 | Scale 299 | ScaleAnimator 300 | Scene3D 301 | Screen 302 | ScriptAction 303 | ScrollView 304 | ScrollViewStyle 305 | Sensor 306 | SensorGesture 307 | SensorGlobal 308 | SensorReading 309 | SequentialAnimation 310 | Settings 311 | ShaderEffect 312 | ShaderEffectSource 313 | Shape 314 | SignalSpy 315 | Slider 316 | SliderStyle 317 | SmoothedAnimation 318 | Sound 319 | SoundEffect 320 | SoundInstance 321 | SpinBox 322 | SpinBoxStyle 323 | SplitView 324 | SpotLight 325 | SpringAnimation 326 | Sprite 327 | SpriteGoal 328 | SpriteSequence 329 | Stack 330 | StackView 331 | StackViewDelegate 332 | State 333 | StateChangeScript 334 | StateGroup 335 | StatusBar 336 | StatusBarStyle 337 | StatusIndicator 338 | String 339 | Supplier 340 | Switch 341 | SwitchStyle 342 | SystemPalette 343 | Tab 344 | TabView 345 | TabViewStyle 346 | TableView 347 | TableViewColumn 348 | TableViewStyle 349 | TapReading 350 | TapSensor 351 | TargetDirection 352 | TestCase 353 | Text 354 | TextArea 355 | TextAreaStyle 356 | TextEdit 357 | TextField 358 | TextFieldStyle 359 | TextInput 360 | TextMetrics 361 | TextureImage 362 | ThresholdMask 363 | TiltReading 364 | TiltSensor 365 | Timer 366 | ToggleButton 367 | ToolBar 368 | ToolBarStyle 369 | ToolButton 370 | Torch 371 | TouchPoint 372 | TrailEmitter 373 | Transform 374 | Transition 375 | Translate 376 | Tumbler 377 | TumblerColumn 378 | Turbulence 379 | UniformAnimator 380 | User 381 | Vector3dAnimation 382 | Video 383 | VideoOutput 384 | ViewTransition 385 | VisualDataGroup 386 | VisualDataModel 387 | VisualItemModel 388 | Wander 389 | WebSocket 390 | WebSocketServer 391 | WheelEvent 392 | Window 393 | WorkerScript 394 | XAnimator 395 | XmlListModel 396 | XmlRole 397 | YAnimator 398 | ZoomBlur 399 | AlignBottom 400 | AlignCenter 401 | AlignHCenter 402 | AlignLeft 403 | AlignRight 404 | AlignTop 405 | AlignVCenter 406 | AnchorAnimation 407 | AnchorChanges 408 | Audio 409 | Behavior 410 | Binding 411 | BorderImage 412 | ColorAnimation 413 | Column 414 | Component 415 | Connections 416 | Easing 417 | Flickable 418 | Flipable 419 | Flow 420 | FocusScope 421 | GestureArea 422 | Grid 423 | GridView 424 | Horizontal 425 | Image 426 | InBack 427 | InBounce 428 | InCirc 429 | InCubic 430 | InElastic 431 | InExpo 432 | InOutBack 433 | InOutBounce 434 | InOutCirc 435 | InOutCubic 436 | InOutElastic 437 | InOutExpo 438 | InOutQuad 439 | InOutQuart 440 | InOutQuint 441 | InQuad 442 | InQuart 443 | InQuint 444 | InQuint 445 | InSine 446 | Item 447 | LayoutItem 448 | LeftButton 449 | Linear 450 | ListElement 451 | ListModel 452 | ListView 453 | Loader 454 | MidButton 455 | MiddleButton 456 | MouseArea 457 | NoButton 458 | NumberAnimation 459 | OutBack 460 | OutBounce 461 | OutCirc 462 | OutCubic 463 | OutElastic 464 | OutExpo 465 | OutInBack 466 | OutInBounce 467 | OutInCirc 468 | OutInCubic 469 | OutInElastic 470 | OutInExpo 471 | OutInQuad 472 | OutInQuart 473 | OutInQuint 474 | OutQuad 475 | OutQuart 476 | OutQuint 477 | OutSine 478 | Package 479 | ParallelAnimation 480 | ParentAnimation 481 | ParentChange 482 | ParticleMotionGravity 483 | ParticleMotionLinear 484 | ParticleMotionWander 485 | Particles 486 | Path 487 | PathAttribute 488 | PathCubic 489 | PathLine 490 | PathPercent 491 | PathQuad 492 | PathView 493 | PauseAnimation 494 | PropertyAction 495 | PropertyAnimation 496 | PropertyChanges 497 | Qt 498 | QtObject 499 | Rectangle 500 | Repeater 501 | RightButton 502 | Rotation 503 | RotationAnimation 504 | Row 505 | Scale 506 | ScriptAction 507 | SequentialAnimation 508 | SmoothedAnimation 509 | SoundEffect 510 | SpringFollow 511 | State 512 | StateChangeScript 513 | StateGroup 514 | SystemPalette 515 | Text 516 | TextEdit 517 | TextInput 518 | Timer 519 | Transition 520 | Translate 521 | Vertical 522 | Video 523 | ViewsPositionersMediaEffects 524 | VisualDataModel 525 | VisualItemModel 526 | WebView 527 | WorkerScript 528 | XmlListModel 529 | XmlRole 530 | AddAnimation 531 | RemoveAnimation 532 | ApplicationWindow 533 | BackgroundItem 534 | Button 535 | BusyIndicator 536 | ColorPicker 537 | ColorPickerDialog 538 | ColorPickerPage 539 | ComboBox 540 | ContextMenu 541 | CoverBackground 542 | DatePicker 543 | DatePickerDialog 544 | DetailItem 545 | Drawer 546 | FadeAnimation 547 | FadeAnimator 548 | FirstTimeUseCounter 549 | HighlightBar 550 | IconButton 551 | InfoLabel 552 | InteractionHintLabel 553 | SilicaListView 554 | SilicaGridView 555 | SilicaFlickable 556 | SilicaWebView 557 | Label 558 | MenuItem 559 | MenuLabel 560 | PullDownMenu 561 | PushUpMenu 562 | PulleyAnimationHint 563 | Page 564 | PageHeader 565 | PageStack 566 | TextArea 567 | TextField 568 | SearchField 569 | SectionHeader 570 | ScrollDecorator 571 | VerticalScrollDecorator 572 | HorizontalScrollDecorator 573 | Slider 574 | SlideshowView 575 | Switch 576 | TapInteractionHint 577 | TimePicker 578 | TimePickerDialog 579 | TouchInteractionHint 580 | Dialog 581 | DialogHeader 582 | RemorsePopup 583 | RemorseItem 584 | ViewPlaceholder 585 | TextSwitch 586 | IconTextSwitch 587 | CoverPlaceholder 588 | ProgressCircle 589 | ProgressCircleBase 590 | OpacityRampEffect 591 | OpacityRampEffectBase 592 | DockedPanel 593 | PanelBackground 594 | ListItem 595 | ProgressBar 596 | Keypad 597 | Separator 598 | ValueButton 599 | ColumnView 600 | NestedGridView 601 | PasswordField 602 | ExpandingSection 603 | ExpandingSectionGroup 604 | -------------------------------------------------------------------------------- /src/dictionaries/sh.txt: -------------------------------------------------------------------------------- 1 | -a 2 | -b 3 | -c 4 | -d 5 | -e 6 | -f 7 | -g 8 | -h 9 | -k 10 | -p 11 | -r 12 | -s 13 | -t 14 | -u 15 | -w 16 | -x 17 | -O 18 | -G 19 | -L 20 | -S 21 | -N 22 | -nt 23 | -ot 24 | -ef 25 | -o 26 | -z 27 | -n 28 | != 29 | -eq 30 | -ne 31 | -lt 32 | -le 33 | -gt 34 | -ge 35 | ! 36 | { 37 | } 38 | : 39 | do 40 | done 41 | elif 42 | else 43 | fi 44 | for 45 | function 46 | if 47 | in 48 | select 49 | then 50 | until 51 | while 52 | alias 53 | bg 54 | bind 55 | break 56 | builtin 57 | cd 58 | command 59 | compgen 60 | complete 61 | continue 62 | declare 63 | dirs 64 | disown 65 | echo 66 | enable 67 | eval 68 | exec 69 | exit 70 | export 71 | fc 72 | fg 73 | getopts 74 | hash 75 | help 76 | history 77 | jobs 78 | let 79 | local 80 | logout 81 | popd 82 | printf 83 | pushd 84 | read 85 | readonly 86 | return 87 | set 88 | shift 89 | shopt 90 | source 91 | suspend 92 | test 93 | times 94 | trap 95 | type 96 | typeset 97 | ulimit 98 | umask 99 | unalias 100 | unset 101 | wait 102 | ar 103 | awk 104 | basename 105 | bash 106 | beep 107 | bunzip2 108 | bzcat 109 | bzcmp 110 | bzdiff 111 | bzegrep 112 | bzfgrep 113 | bzgrep 114 | bzip2recover 115 | bzip2 116 | bzless 117 | bzmore 118 | cc 119 | cat 120 | chattr 121 | chgrp 122 | chmod 123 | chown 124 | chroot 125 | clear 126 | cmp 127 | cpp 128 | cp 129 | cut 130 | date 131 | dd 132 | df 133 | dialog 134 | diff3 135 | diff 136 | dirname 137 | dir 138 | du 139 | egrep 140 | eject 141 | env 142 | expr 143 | false 144 | fgrep 145 | file 146 | find 147 | fmt 148 | free 149 | ftp 150 | funzip 151 | fuser 152 | gawk 153 | gcc 154 | getent 155 | getopt 156 | grep 157 | groups 158 | gunzip 159 | gzip 160 | head 161 | hostname 162 | id 163 | ifconfig 164 | info 165 | insmod 166 | install 167 | join 168 | killall 169 | kill 170 | lastb 171 | last 172 | ld 173 | less 174 | ln 175 | locate 176 | lockfile 177 | login 178 | logname 179 | lp 180 | lpr 181 | lsattr 182 | ls 183 | lsmod 184 | make 185 | man 186 | mkdir 187 | mkfifo 188 | mknod 189 | mktemp 190 | modprobe 191 | more 192 | mount 193 | mv 194 | namei 195 | nawk 196 | nice 197 | nl 198 | passwd 199 | patch 200 | perl 201 | pgawk 202 | pidof 203 | ping 204 | pkg-config 205 | pr 206 | ps 207 | pwd 208 | readlink 209 | renice 210 | rmdir 211 | rm 212 | scp 213 | sed 214 | seq 215 | sh 216 | sleep 217 | sort 218 | split 219 | ssh-add 220 | ssh-agent 221 | ssh-keygen 222 | ssh-keyscan 223 | ssh 224 | stat 225 | sudo 226 | sum 227 | su 228 | sync 229 | tac 230 | tail 231 | tar 232 | tee 233 | tempfile 234 | touch 235 | true 236 | tr 237 | umount 238 | uname 239 | uniq 240 | unlink 241 | unzip 242 | uptime 243 | wall 244 | wc 245 | wget 246 | whereis 247 | which 248 | whoami 249 | who 250 | write 251 | w 252 | xargs 253 | xdialog 254 | zcat 255 | zcmp 256 | zdiff 257 | zegrep 258 | zenity 259 | zfgrep 260 | zforce 261 | zgrep 262 | zip 263 | zless 264 | zmore 265 | znew 266 | #!/bin/bash 267 | case 268 | -------------------------------------------------------------------------------- /src/dictionarys.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | dictionaries/javascript.txt 4 | dictionaries/keywords.txt 5 | dictionaries/properties.txt 6 | dictionaries/qml.txt 7 | dictionaries/python.txt 8 | dictionaries/sh.txt 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/documenthandler.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the Qt Quick Controls module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #include "documenthandler.h" 42 | 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | DocumentHandler::DocumentHandler() : m_target(0) , m_doc(0) , m_cursorPosition(-1) , m_selectionStart(0) , m_selectionEnd(0) , m_realhighlighter(0) 50 | { 51 | } 52 | 53 | QQuickItem *DocumentHandler::target() const 54 | { 55 | return m_target; 56 | } 57 | 58 | int DocumentHandler::cursorPosition() const 59 | { 60 | return m_cursorPosition; 61 | } 62 | 63 | int DocumentHandler::selectionStart() const 64 | { 65 | return m_selectionStart; 66 | } 67 | 68 | int DocumentHandler::selectionEnd() const 69 | { 70 | return m_selectionEnd; 71 | } 72 | 73 | QString DocumentHandler::text() const 74 | { 75 | return m_text; 76 | } 77 | 78 | QStringList DocumentHandler::lines() const 79 | { 80 | QStringList lines; 81 | for (QTextBlock tb = m_doc->begin(); tb != m_doc->end(); tb = tb.next()){ 82 | const int nbLines = tb.layout()->lineCount(); 83 | lines.append(QString::number(tb.blockNumber()+1)); 84 | for (int i=1; i < nbLines; i++){ 85 | lines.append(" "); 86 | } 87 | } 88 | return lines; 89 | } 90 | 91 | void DocumentHandler::setTarget(QQuickItem *target) 92 | { 93 | m_doc = 0; 94 | m_realhighlighter = 0; 95 | m_target = target; 96 | if (!m_target) 97 | return; 98 | QVariant doc = m_target->property("textDocument"); 99 | if (doc.canConvert()) { 100 | QQuickTextDocument *qqdoc = doc.value(); 101 | if (qqdoc) 102 | m_doc = qqdoc->textDocument(); 103 | m_realhighlighter = new RealHighlighter(m_doc); 104 | } 105 | //opravit blockCountChanged 106 | // connect(m_doc, SIGNAL(blockCountChanged()), this, SLOT(lines())); 107 | emit targetChanged(); 108 | } 109 | 110 | void DocumentHandler::setCursorPosition(int position) 111 | { 112 | if (m_cursorPosition == position) 113 | return; 114 | 115 | m_cursorPosition = position; 116 | } 117 | 118 | void DocumentHandler::setSelectionStart(int position) 119 | { 120 | m_selectionStart = position; 121 | } 122 | 123 | void DocumentHandler::setSelectionEnd(int position) 124 | { 125 | m_selectionEnd = position; 126 | } 127 | 128 | void DocumentHandler::setText(QString &arg) 129 | { 130 | if (m_text == arg) 131 | return; 132 | 133 | m_text = arg; 134 | emit textChanged(); 135 | } 136 | 137 | void DocumentHandler::mergeFormatOnWordOrSelection(const QTextCharFormat &format) 138 | { 139 | QTextCursor cursor = textCursor(); 140 | if (!cursor.hasSelection()) 141 | cursor.select(QTextCursor::WordUnderCursor); 142 | cursor.mergeCharFormat(format); 143 | } 144 | void DocumentHandler::setStyle(QString primaryColor, QString secondaryColor, QString highlightColor, QString secondaryHighlightColor, QString highlightBackgroundColor, QString highlightDimmerColor, qreal m_baseFontPointSize) 145 | { 146 | if (m_realhighlighter) { 147 | m_realhighlighter->setStyle(primaryColor, secondaryColor, highlightColor, secondaryHighlightColor, highlightBackgroundColor, highlightDimmerColor, m_baseFontPointSize); 148 | } 149 | } 150 | 151 | void DocumentHandler::setDictionary(QString dictionary) 152 | { 153 | if (m_realhighlighter) { 154 | m_realhighlighter->setDictionary(dictionary); 155 | } 156 | } 157 | 158 | QTextCursor DocumentHandler::textCursor() const 159 | { 160 | QTextCursor cursor = QTextCursor(m_doc); 161 | if (m_selectionStart != m_selectionEnd) { 162 | cursor.setPosition(m_selectionStart); 163 | cursor.setPosition(m_selectionEnd, QTextCursor::KeepAnchor); 164 | } else { 165 | cursor.setPosition(m_cursorPosition); 166 | } 167 | return cursor; 168 | } 169 | -------------------------------------------------------------------------------- /src/documenthandler.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the Qt Quick Controls module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #ifndef DOCUMENTHANDLER_H 42 | #define DOCUMENTHANDLER_H 43 | 44 | #include 45 | #include "realhighlighter.h" 46 | #include 47 | #include 48 | 49 | #include 50 | 51 | QT_BEGIN_NAMESPACE 52 | class QTextDocument; 53 | QT_END_NAMESPACE 54 | 55 | 56 | class DocumentHandler : public QObject 57 | { 58 | Q_OBJECT 59 | Q_ENUMS(HAlignment) 60 | Q_PROPERTY(QQuickItem *target READ target WRITE setTarget NOTIFY targetChanged) 61 | Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged) 62 | Q_PROPERTY(int selectionStart READ selectionStart WRITE setSelectionStart NOTIFY selectionStartChanged) 63 | Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged) 64 | Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) 65 | Q_PROPERTY(QStringList lines READ lines NOTIFY linesChanged) 66 | 67 | public: 68 | DocumentHandler(); 69 | 70 | QQuickItem * target() const; 71 | 72 | int cursorPosition() const; 73 | 74 | int selectionStart() const; 75 | 76 | int selectionEnd() const; 77 | 78 | void setTarget(QQuickItem * target); 79 | void setCursorPosition(int position); 80 | void setSelectionStart(int position); 81 | void setSelectionEnd(int position); 82 | 83 | QString text() const; 84 | 85 | QStringList lines() const; 86 | 87 | Q_SIGNALS: 88 | 89 | void targetChanged(); 90 | 91 | void cursorPositionChanged(); 92 | 93 | void selectionStartChanged(); 94 | 95 | void selectionEndChanged(); 96 | 97 | void textChanged(); 98 | 99 | void linesChanged(); 100 | 101 | public Q_SLOTS: 102 | 103 | void setText(QString &arg); 104 | void setStyle(QString primaryColor, QString secondaryColor, QString highlightColor, QString secondaryHighlightColor, QString highlightBackgroundColor, QString highlightDimmerColor, qreal m_baseFontPointSize); 105 | void setDictionary(QString dictionary); 106 | 107 | private: 108 | 109 | QTextCursor textCursor() const; 110 | void mergeFormatOnWordOrSelection(const QTextCharFormat &format); 111 | 112 | QQuickItem * m_target; 113 | QTextDocument *m_doc; 114 | 115 | int m_cursorPosition; 116 | 117 | int m_selectionStart; 118 | 119 | int m_selectionEnd; 120 | 121 | QString m_text; 122 | 123 | RealHighlighter *m_realhighlighter; 124 | 125 | QStringList m_lines; 126 | }; 127 | 128 | 129 | #endif // DOCUMENTHANDLER_H 130 | -------------------------------------------------------------------------------- /src/generallogic.cpp: -------------------------------------------------------------------------------- 1 | #include "generallogic.h" 2 | #include 3 | #include 4 | #include 5 | 6 | GeneralLogic::GeneralLogic() 7 | { 8 | 9 | } 10 | 11 | //Input can be: 12 | //harbour-editor.desktop 13 | //jolla-notes.desktop 14 | QString GeneralLogic::setDefaultApp(QString app) { 15 | QString code = "xdg-mime default " + app + " text/plain"; 16 | return queryMime(code); 17 | } 18 | 19 | //Check if harbour-editor.desktop is default app 20 | bool GeneralLogic::isDefaultApp() { 21 | QString code = "xdg-mime query default text/plain"; 22 | QString output = queryMime(code); 23 | 24 | return QString::compare(output, "harbour-editor.desktop") == 1; 25 | } 26 | 27 | QString GeneralLogic::queryMime(QString code) { 28 | QProcess exec; 29 | exec.start(code); 30 | exec.waitForFinished(); 31 | QString output = exec.readAllStandardOutput(); 32 | 33 | return output; 34 | } 35 | 36 | 37 | QString GeneralLogic::getQuickNotePath() { 38 | return QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/harbour-editor-quickNote.txt"; 39 | } 40 | -------------------------------------------------------------------------------- /src/generallogic.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERALLOGIC_H 2 | #define GENERALLOGIC_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class GeneralLogic : public QObject { 9 | Q_OBJECT 10 | public: 11 | GeneralLogic(); 12 | private: 13 | QString queryMime(QString code); 14 | 15 | public slots: 16 | QString setDefaultApp(QString app); 17 | bool isDefaultApp(); 18 | QString getQuickNotePath(); 19 | }; 20 | 21 | #endif // GENERALLOGIC_H 22 | -------------------------------------------------------------------------------- /src/harbour-editor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 Jolla Ltd. 3 | Contact: Thomas Perl 4 | All rights reserved. 5 | 6 | You may use this file under the terms of BSD license as follows: 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of the Jolla Ltd nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 23 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | //#ifdef QT_QML_DEBUG 32 | #include 33 | //#endif 34 | 35 | #include 36 | #include "documenthandler.h" 37 | #include "generallogic.h" 38 | 39 | 40 | int main(int argc, char *argv[]) 41 | { 42 | // SailfishApp::main() will display "qml/template.qml", if you need more 43 | // control over initialization, you can use: 44 | // 45 | // - SailfishApp::application(int, char *[]) to get the QGuiApplication * 46 | // - SailfishApp::createView() to get a new QQuickView * instance 47 | // - SailfishApp::pathTo(QString) to get a QUrl to a resource file 48 | // 49 | // To display the view, call "show()" (will show fullscreen on device). 50 | 51 | QGuiApplication *app = SailfishApp::application(argc, argv); 52 | //QScopedPointer app(SailfishApp::application(argc, argv)); 53 | app->setApplicationVersion(QString(APP_VERSION)); 54 | QQuickView *view = SailfishApp::createView(); 55 | 56 | qmlRegisterType("harbour.editor.documenthandler", 1, 0, "DocumentHandler"); 57 | qmlRegisterType("harbour.editor.generallogic", 1, 0, "GeneralLogic"); 58 | 59 | view->setSource(SailfishApp::pathTo("qml/harbour-editor.qml")); 60 | view->showFullScreen(); 61 | return app->exec(); 62 | 63 | //return SailfishApp::main(argc, argv); 64 | } 65 | -------------------------------------------------------------------------------- /src/realhighlighter.cpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * Created: 2016 by Eetu Kahelin / eekkelund 4 | * 5 | * Copyright 2016 Eetu Kahelin. All rights reserved. 6 | * 7 | * This file may be distributed under the terms of GNU Public License version 8 | * 3 (GPL v3) as defined by the Free Software Foundation (FSF). A copy of the 9 | * license should have been included with this file, or the project in which 10 | * this file belongs to. You may also find the details of GPL v3 at: 11 | * http://www.gnu.org/licenses/gpl-3.0.txt 12 | * 13 | * If you have any questions regarding the use of this file, feel free to 14 | * contact the author of this file, or the owner of the project in which 15 | * this file belongs to. 16 | *****************************************************************************/ 17 | 18 | /***************************************************************************** 19 | * 20 | * It is changed version of the original file (disabled italic style, 21 | * added support of *.shand some minor changes). 22 | * It was modified for project "Editor.". 23 | *****************************************************************************/ 24 | 25 | #include "realhighlighter.h" 26 | 27 | #include 28 | 29 | 30 | RealHighlighter::RealHighlighter(QTextDocument *parent): QSyntaxHighlighter(parent) 31 | { 32 | 33 | 34 | } 35 | void RealHighlighter::loadDict(QString path, QStringList &patterns){ 36 | QFile dict(path); 37 | if (dict.open(QIODevice::ReadOnly)) 38 | { 39 | QTextStream textStream(&dict); 40 | while (true) 41 | { 42 | QString line = textStream.readLine(); 43 | if (line.isNull()) 44 | break; 45 | else 46 | patterns.append("\\b"+line+"\\b"); 47 | } 48 | dict.close(); 49 | } 50 | } 51 | 52 | void RealHighlighter::ruleUpdate() 53 | { 54 | HighlightingRule rule; 55 | highlightingRules.clear(); 56 | QStringList keywordPatterns; 57 | QStringList propertiesPatterns; 58 | 59 | //functionFormat.setFontItalic(true); 60 | functionFormat.setForeground(QColor(m_secondaryHighlightColor)); 61 | rule.pattern = QRegExp("\\b[A-Za-z0-9_]+(?=\\()"); 62 | rule.format = functionFormat; 63 | highlightingRules.append(rule); 64 | 65 | if (m_dictionary=="plain") { 66 | jsFormat.setForeground(QColor(m_secondaryHighlightColor)); 67 | //jsFormat.setFontItalic(true); 68 | QStringList jsPatterns; 69 | loadDict(":/dictionaries/javascript.txt",jsPatterns); 70 | 71 | foreach (const QString &pattern, jsPatterns) { 72 | rule.pattern = QRegExp(pattern); 73 | rule.format = jsFormat; 74 | highlightingRules.append(rule); 75 | } 76 | 77 | qmlFormat.setForeground(QColor(m_highlightColor)); 78 | qmlFormat.setFontWeight(QFont::Normal); 79 | QStringList qmlPatterns; 80 | loadDict(":/dictionaries/qml.txt",qmlPatterns); 81 | 82 | foreach (const QString &pattern, qmlPatterns) { 83 | rule.pattern = QRegExp(pattern); 84 | rule.format = qmlFormat; 85 | highlightingRules.append(rule); 86 | } 87 | 88 | keywordFormat.setForeground(QColor(m_highlightDimmerColor)); 89 | keywordFormat.setFontWeight(QFont::Normal); 90 | 91 | loadDict(":/dictionaries/keywords.txt",keywordPatterns); 92 | 93 | foreach (const QString &pattern, keywordPatterns) { 94 | rule.pattern = QRegExp(pattern); 95 | rule.format = keywordFormat; 96 | highlightingRules.append(rule); 97 | } 98 | propertiesFormat.setForeground(QColor(m_primaryColor)); 99 | propertiesFormat.setFontWeight(QFont::Normal); 100 | 101 | loadDict(":/dictionaries/properties.txt",propertiesPatterns); 102 | 103 | foreach (const QString &pattern, propertiesPatterns) { 104 | rule.pattern = QRegExp(pattern); 105 | rule.format = propertiesFormat; 106 | highlightingRules.append(rule); 107 | } 108 | //singleLineCommentFormat.setFontItalic(true); 109 | singleLineCommentFormat.setForeground(QColor(m_highlightBackgroundColor)); 110 | rule.pattern = QRegExp("//[^\n]*"); 111 | rule.format = singleLineCommentFormat; 112 | highlightingRules.append(rule); 113 | 114 | } 115 | else if (m_dictionary=="qml") { 116 | jsFormat.setForeground(QColor(m_secondaryHighlightColor)); 117 | //jsFormat.setFontItalic(true); 118 | QStringList jsPatterns; 119 | loadDict(":/dictionaries/javascript.txt",jsPatterns); 120 | 121 | foreach (const QString &pattern, jsPatterns) { 122 | rule.pattern = QRegExp(pattern); 123 | rule.format = jsFormat; 124 | highlightingRules.append(rule); 125 | } 126 | 127 | qmlFormat.setForeground(QColor(m_highlightColor)); 128 | qmlFormat.setFontWeight(QFont::Bold); 129 | QStringList qmlPatterns; 130 | loadDict(":/dictionaries/qml.txt",qmlPatterns); 131 | 132 | foreach (const QString &pattern, qmlPatterns) { 133 | rule.pattern = QRegExp(pattern); 134 | rule.format = qmlFormat; 135 | highlightingRules.append(rule); 136 | } 137 | 138 | keywordFormat.setForeground(QColor(m_highlightDimmerColor)); 139 | keywordFormat.setFontWeight(QFont::Bold); 140 | QStringList keywordPatterns; 141 | loadDict(":/dictionaries/keywords.txt",keywordPatterns); 142 | 143 | foreach (const QString &pattern, keywordPatterns) { 144 | rule.pattern = QRegExp(pattern); 145 | rule.format = keywordFormat; 146 | highlightingRules.append(rule); 147 | } 148 | propertiesFormat.setForeground(QColor(m_primaryColor)); 149 | propertiesFormat.setFontWeight(QFont::Bold); 150 | 151 | loadDict(":/dictionaries/properties.txt",propertiesPatterns); 152 | 153 | foreach (const QString &pattern, propertiesPatterns) { 154 | rule.pattern = QRegExp(pattern); 155 | rule.format = propertiesFormat; 156 | highlightingRules.append(rule); 157 | } 158 | //singleLineCommentFormat.setFontItalic(true); 159 | singleLineCommentFormat.setForeground(QColor(m_highlightBackgroundColor)); 160 | rule.pattern = QRegExp("//[^\n]*"); 161 | rule.format = singleLineCommentFormat; 162 | highlightingRules.append(rule); 163 | 164 | }else if (m_dictionary=="py") { 165 | pythonFormat.setForeground(QColor(m_secondaryHighlightColor)); 166 | //pythonFormat.setFontItalic(true); 167 | QStringList pythonPatterns; 168 | loadDict(":/dictionaries/python.txt",pythonPatterns); 169 | 170 | foreach (const QString &pattern, pythonPatterns) { 171 | rule.pattern = QRegExp(pattern); 172 | rule.format = pythonFormat; 173 | highlightingRules.append(rule); 174 | } 175 | keywordFormat.setForeground(QColor(m_highlightDimmerColor)); 176 | keywordFormat.setFontWeight(QFont::Bold); 177 | loadDict(":/dictionaries/keywords.txt",keywordPatterns); 178 | 179 | foreach (const QString &pattern, keywordPatterns) { 180 | rule.pattern = QRegExp(pattern); 181 | rule.format = keywordFormat; 182 | highlightingRules.append(rule); 183 | } 184 | }else if (m_dictionary=="js") { 185 | jsFormat.setForeground(QColor(m_secondaryHighlightColor)); 186 | //jsFormat.setFontItalic(true); 187 | QStringList jsPatterns; 188 | loadDict(":/dictionaries/javascript.txt",jsPatterns); 189 | 190 | foreach (const QString &pattern, jsPatterns) { 191 | rule.pattern = QRegExp(pattern); 192 | rule.format = jsFormat; 193 | highlightingRules.append(rule); 194 | } 195 | keywordFormat.setForeground(QColor(m_highlightDimmerColor)); 196 | keywordFormat.setFontWeight(QFont::Bold); 197 | loadDict(":/dictionaries/keywords.txt",keywordPatterns); 198 | 199 | foreach (const QString &pattern, keywordPatterns) { 200 | rule.pattern = QRegExp(pattern); 201 | rule.format = keywordFormat; 202 | highlightingRules.append(rule); 203 | } 204 | //singleLineCommentFormat.setFontItalic(true); 205 | singleLineCommentFormat.setForeground(QColor(m_highlightBackgroundColor)); 206 | rule.pattern = QRegExp("//[^\n]*"); 207 | rule.format = singleLineCommentFormat; 208 | highlightingRules.append(rule); 209 | }else if (m_dictionary=="sh") { 210 | shFormat.setForeground(QColor(m_secondaryHighlightColor)); 211 | //shFormat.setFontItalic(true); 212 | QStringList shPatterns; 213 | loadDict(":/dictionaries/sh.txt",shPatterns); 214 | 215 | foreach (const QString &pattern, shPatterns) { 216 | rule.pattern = QRegExp(pattern); 217 | rule.format = shFormat; 218 | highlightingRules.append(rule); 219 | } 220 | 221 | keywordFormat.setForeground(QColor(m_highlightDimmerColor)); 222 | keywordFormat.setFontWeight(QFont::Bold); 223 | loadDict(":/dictionaries/keywords.txt",keywordPatterns); 224 | 225 | foreach (const QString &pattern, keywordPatterns) { 226 | rule.pattern = QRegExp(pattern); 227 | rule.format = keywordFormat; 228 | highlightingRules.append(rule); 229 | } 230 | }else{ 231 | keywordFormat.setForeground(QColor(m_highlightDimmerColor)); 232 | keywordFormat.setFontWeight(QFont::Bold); 233 | loadDict(":/dictionaries/keywords.txt",keywordPatterns); 234 | 235 | foreach (const QString &pattern, keywordPatterns) { 236 | rule.pattern = QRegExp(pattern); 237 | rule.format = keywordFormat; 238 | highlightingRules.append(rule); 239 | } 240 | } 241 | 242 | quotationFormat.setForeground(QColor(m_secondaryColor)); 243 | //quotationFormat.setFontItalic(true); 244 | rule.pattern = QRegExp("\"([^\"]*)\""); 245 | rule.format = quotationFormat; 246 | highlightingRules.append(rule); 247 | 248 | numberFormat.setForeground(QColor(m_primaryColor)); 249 | rule.pattern = QRegExp("[0-9]"); 250 | rule.format = numberFormat; 251 | highlightingRules.append(rule); 252 | 253 | } 254 | 255 | void RealHighlighter::highlightBlock(const QString &text) 256 | { 257 | foreach (const HighlightingRule &rule, highlightingRules) { 258 | QRegExp expression(rule.pattern); 259 | int index = expression.indexIn(text); 260 | while (index >= 0) { 261 | int length = expression.matchedLength(); 262 | setFormat(index, length, rule.format); 263 | index = expression.indexIn(text, index + length); 264 | } 265 | } 266 | 267 | if((m_dictionary=="js" || (m_dictionary=="qml"))){ 268 | QTextCharFormat tmpFormat; 269 | enum { 270 | Start = 0, 271 | MultiLineComment = 4 272 | }; 273 | 274 | int blockState = previousBlockState(); 275 | int bracketLevel = blockState >> 4; 276 | int state = blockState & 15; 277 | if (blockState < 0) { 278 | bracketLevel = 0; 279 | state = Start; 280 | } 281 | 282 | int start = 0; 283 | int i = 0; 284 | while (i <= text.length()) { 285 | QChar ch = (i < text.length()) ? text.at(i) : QChar(); 286 | QChar next = (i < text.length() - 1) ? text.at(i + 1) : QChar(); 287 | switch (state) { 288 | case Start: 289 | start = i; 290 | if (ch == '/' && next == '*') { 291 | ++i; 292 | ++i; 293 | state = MultiLineComment; 294 | }else{ 295 | ++i; 296 | state = Start; 297 | } 298 | break; 299 | 300 | case MultiLineComment: 301 | if (ch == '*' && next == '/') { 302 | ++i; 303 | ++i; 304 | //tmpFormat.setFontItalic(true); 305 | tmpFormat.setForeground(QColor(m_highlightBackgroundColor)); 306 | setFormat(start, i - start, tmpFormat); 307 | state = Start; 308 | } else { 309 | ++i; 310 | } 311 | break; 312 | 313 | default: 314 | state = Start; 315 | break; 316 | } 317 | } 318 | 319 | if (state == MultiLineComment){ 320 | //tmpFormat.setFontItalic(true); 321 | tmpFormat.setForeground(QColor(m_highlightBackgroundColor)); 322 | setFormat(start, text.length(), tmpFormat); 323 | }else 324 | state = Start; 325 | 326 | blockState = (state & 15) | (bracketLevel << 4); 327 | setCurrentBlockState(blockState); 328 | } 329 | } 330 | 331 | void RealHighlighter::setStyle(QString primaryColor, QString secondaryColor, QString highlightColor, QString secondaryHighlightColor, QString highlightBackgroundColor, QString highlightDimmerColor, qreal baseFontPointSize) 332 | { 333 | m_primaryColor = QString(primaryColor); 334 | m_secondaryColor = QString(secondaryColor); 335 | m_highlightColor = QString(highlightColor); 336 | m_secondaryHighlightColor = QString(secondaryHighlightColor); 337 | m_highlightBackgroundColor = QString(highlightBackgroundColor); 338 | m_highlightDimmerColor = QString(highlightDimmerColor); 339 | m_baseFontPointSize = baseFontPointSize; 340 | this->ruleUpdate(); 341 | // this->rehighlight(); 342 | } 343 | 344 | void RealHighlighter::setDictionary(QString dictionary) 345 | { 346 | m_dictionary = dictionary; 347 | this->ruleUpdate(); 348 | this->rehighlight(); 349 | } 350 | 351 | -------------------------------------------------------------------------------- /src/realhighlighter.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * Created: 2016 by Eetu Kahelin / eekkelund 4 | * 5 | * Copyright 2016 Eetu Kahelin. All rights reserved. 6 | * 7 | * This file may be distributed under the terms of GNU Public License version 8 | * 3 (GPL v3) as defined by the Free Software Foundation (FSF). A copy of the 9 | * license should have been included with this file, or the project in which 10 | * this file belongs to. You may also find the details of GPL v3 at: 11 | * http://www.gnu.org/licenses/gpl-3.0.txt 12 | * 13 | * If you have any questions regarding the use of this file, feel free to 14 | * contact the author of this file, or the owner of the project in which 15 | * this file belongs to. 16 | *****************************************************************************/ 17 | 18 | /***************************************************************************** 19 | * 20 | * It is changed version of the original file (disabled italic style, 21 | * added support of *.shand some minor changes). 22 | * It was modified for project "Editor.". 23 | *****************************************************************************/ 24 | 25 | #ifndef REALHIGHLIGHTER_H 26 | #define REALHIGHLIGHTER_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | class QTextDocument; 34 | 35 | class RealHighlighter : public QSyntaxHighlighter 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | RealHighlighter(QTextDocument *parent = 0); 41 | 42 | void setStyle(QString primaryColor, QString secondaryColor, QString highlightColor, QString secondaryHighlightColor, QString highlightBackgroundColor, QString highlightDimmerColor, qreal m_baseFontPointSize); 43 | void setDictionary(QString dictionary); 44 | 45 | protected: 46 | void highlightBlock(const QString &text) Q_DECL_OVERRIDE; 47 | 48 | private: 49 | void ruleUpdate(); 50 | 51 | class HighlightingRule 52 | { 53 | public: 54 | QRegExp pattern; 55 | QTextCharFormat format; 56 | }; 57 | 58 | QVector highlightingRules; 59 | 60 | QRegExp commentStartExpression; 61 | QRegExp commentEndExpression; 62 | 63 | QString m_primaryColor; 64 | QString m_secondaryColor; 65 | QString m_highlightColor; 66 | QString m_secondaryHighlightColor; 67 | QString m_highlightBackgroundColor; 68 | QString m_highlightDimmerColor; 69 | QString m_dictionary; 70 | qreal m_baseFontPointSize; 71 | 72 | QTextCharFormat keywordFormat; 73 | QTextCharFormat qmlFormat; 74 | QTextCharFormat jsFormat; 75 | QTextCharFormat propertiesFormat; 76 | QTextCharFormat pythonFormat; 77 | QTextCharFormat shFormat; 78 | QTextCharFormat singleLineCommentFormat; 79 | QTextCharFormat multiLineCommentFormat; 80 | QTextCharFormat quotationFormat; 81 | QTextCharFormat functionFormat; 82 | QTextCharFormat numberFormat; 83 | void loadDict(QString path, QStringList &patterns); 84 | }; 85 | 86 | #endif // REALHIGHLIGHTER_H 87 | -------------------------------------------------------------------------------- /translations/harbour-editor-sv.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %1, %2 8 | Shows size and modification date, e.g. "15.5MB, 02/03/2016" 9 | %1, %2 10 | 11 | 12 | No files 13 | Inga filer 14 | 15 | 16 | 17 | AboutPage 18 | 19 | "Editor." is feature-rich text/code editor! 20 | "Editor." är en funktionsrik text-/kodredigerare! 21 | 22 | 23 | License: GPLv3 24 | Licens: GPLv3 25 | 26 | 27 | Special thanks: 28 | Tack till: 29 | 30 | 31 | Tips: 32 | Tips: 33 | 34 | 35 | About 36 | Om 37 | 38 | 39 | -coderus for various tips and code 40 | -coderus, för diverse tips och kod 41 | 42 | 43 | -To 'Select all text' hold your finger until 3 vibrations 44 | -För "Markera all text", långtryck till 3 vibrationer 45 | 46 | 47 | -osanwe for very often consultations about qml code 48 | -osanwe, för återkommande konsultationer om QML-kod 49 | 50 | 51 | or 52 | eller 53 | 54 | 55 | If you want to support the developer: 56 | Om du vill stödja utvecklaren: 57 | 58 | 59 | Make a donation (button above) 60 | Donera (ovanstående knapp) 61 | 62 | 63 | -Russian community for feedback and help 64 | -Ryska gemenskapen, för återkoppling och hjälp 65 | 66 | 67 | -Unsaved changes are saved in the file with ending '~' in the same dir where you placed your original file 68 | -Osparade ändringar sparas i filen som slutar med tilde (~), i samma mapp som där du placerat originalfilen 69 | 70 | 71 | Star the repository at the github ☺ 72 | Stjärnmärk projektet på GitHub ☺ 73 | 74 | 75 | Translators 76 | Översättare 77 | 78 | 79 | - Spanish translation 80 | - Spansk översättning 81 | 82 | 83 | - Swedish translation 84 | - Svensk översättning 85 | 86 | 87 | - Russian translation 88 | - Rysk översättning 89 | 90 | 91 | - French translation 92 | - Fransk översättning 93 | 94 | 95 | - Polish translation 96 | - Polsk översättning 97 | 98 | 99 | -You can copy the file path to the clipboard by selecting appropriate MenuItem in pulley menu 100 | -Du kan kopiera filsökvägen till urklipp genom att välja dra neråt och välja från toppmenyn 101 | 102 | 103 | -Ancelad for tab icon, testing and help 104 | Ancelad för flikikon, testning och hjälp 105 | 106 | 107 | - German translation 108 | - Tysk översättning 109 | 110 | 111 | - Dutch translation 112 | - Nederländsk översättning 113 | 114 | 115 | -gri4994 for the wonderful app icon 116 | -gri4994 för den fina app-ikonen 117 | 118 | 119 | -eekkelund for save/load/autosave functions, source code and some dictionaries for syntax highlighting and feedback 120 | eekelund för funktionerna spara/läs in/spara automatiskt, källkod och ordböcker för kodmarkering och återkoppling 121 | 122 | 123 | -the team of GtkSourceView for the basis for .sh dictionary 124 | GtkSourceView-gruppen för grunderna i .sh-ordboken 125 | 126 | 127 | Source code 128 | Källkod 129 | 130 | 131 | Version 132 | Version 133 | 134 | 135 | Paypal donation - RUB 136 | Paypal-donation - RUB 137 | 138 | 139 | Paypal donation - EURO 140 | Paypal-donation - EURO 141 | 142 | 143 | -bobsik for the contributions for version 0.9 144 | 145 | 146 | 147 | 148 | CoverPage 149 | 150 | Lines: 151 | Rader: 152 | 153 | 154 | Words: 155 | Ord: 156 | 157 | 158 | Chars: 159 | Tecken: 160 | 161 | 162 | 163 | EditRow 164 | 165 | Save 166 | Spara 167 | 168 | 169 | Document can't be saved! 170 | Dokumentet kan inte sparas! 171 | 172 | 173 | Undo 174 | Ångra 175 | 176 | 177 | Redo 178 | Upprepa 179 | 180 | 181 | Tab 182 | Tab 183 | 184 | 185 | Document saved 186 | Dokument sparat 187 | 188 | 189 | Search 190 | Sök 191 | 192 | 193 | 194 | FirstPage 195 | 196 | File path copied to the clipboard 197 | Filsökväg kopierad till urklipp 198 | 199 | 200 | Document saved! 201 | Dokumentet sparat! 202 | 203 | 204 | Settings 205 | Inställningar 206 | 207 | 208 | Error while opening/saving the file 209 | Kunde inte öppna/spara filen 210 | 211 | 212 | Highlighting enabled 213 | Färgmarkering aktiverad 214 | 215 | 216 | Highlighting disabled 217 | Färgmarkering inaktiverad 218 | 219 | 220 | 221 | HistoryPage 222 | 223 | History 224 | Historik 225 | 226 | 227 | Delete 228 | Ta bort 229 | 230 | 231 | Move to top 232 | Flytta till toppen 233 | 234 | 235 | Documents are in order of first opening 236 | Dokument ordnas efter först öppnat 237 | 238 | 239 | Delete history 240 | Ta bort historik 241 | 242 | 243 | 244 | MainRow 245 | 246 | Save as 247 | Spara som 248 | 249 | 250 | Open 251 | Öppna 252 | 253 | 254 | New 255 | Nytt 256 | 257 | 258 | History 259 | Historik 260 | 261 | 262 | R-only 263 | Skrivskyddat 264 | 265 | 266 | Quick note 267 | Snabbnotis 268 | 269 | 270 | Highlight 271 | Färgmarkera 272 | 273 | 274 | 275 | QuickNotePage 276 | 277 | Undo 278 | Ångra 279 | 280 | 281 | Redo 282 | Upprepa 283 | 284 | 285 | Tab 286 | Tab 287 | 288 | 289 | Text auto-saved in: 290 | Text autosparad i: 291 | 292 | 293 | Quick note. 294 | Snabbnotis. 295 | 296 | 297 | Search 298 | Sök 299 | 300 | 301 | 302 | SearchRow 303 | 304 | Search 305 | Sök 306 | 307 | 308 | 309 | SettingsPage 310 | 311 | About 312 | Om 313 | 314 | 315 | Settings 316 | Inställningar 317 | 318 | 319 | Appearance 320 | Utseende 321 | 322 | 323 | Line numeration enabled 324 | Radnumrering aktiverad 325 | 326 | 327 | Line numeration disabled 328 | Radnumrering avaktiverad 329 | 330 | 331 | Dark Theme 332 | Mörkt tema 333 | 334 | 335 | Ambience Theme 336 | Atmosfärtema 337 | 338 | 339 | Custom button color 340 | Anpassad knappfärg 341 | 342 | 343 | Fonts and size 344 | Teckensnitt och storlek 345 | 346 | 347 | Font size 348 | Teckenstorlek 349 | 350 | 351 | Tiny 352 | Pytteliten 353 | 354 | 355 | Extra small 356 | Extra liten 357 | 358 | 359 | Small 360 | Liten 361 | 362 | 363 | Medium (default) 364 | Medium (standard) 365 | 366 | 367 | Large 368 | Stor 369 | 370 | 371 | Extra large 372 | Extra stor 373 | 374 | 375 | Huge 376 | Enorm 377 | 378 | 379 | Font: 380 | Teckensnitt: 381 | 382 | 383 | Type of tab: 384 | Tabulatortyp: 385 | 386 | 387 | Default text editor 388 | Standardtextredigerare 389 | 390 | 391 | Turn off to enable default notes 392 | Stäng av för att aktivera standardanteckningar 393 | 394 | 395 | General 396 | Allmänt 397 | 398 | 399 | Autosave 400 | Spara automatiskt 401 | 402 | 403 | If enabled text will be stored in files with postfix ~ 404 | Vid aktivering sparas text filer med postfixet ~ 405 | 406 | 407 | File browser 408 | Filhanterare 409 | 410 | 411 | Show hidden files 412 | Visa dolda filer 413 | 414 | 415 | Be careful to enable this option! 416 | Var försiktig vid aktivering av detta alternativ! 417 | 418 | 419 | Encoding 420 | Kodning 421 | 422 | 423 | Region: 424 | Region: 425 | 426 | 427 | Reset settings 428 | Återställ inställningarna 429 | 430 | 431 | Save settings 432 | Spara inställningar 433 | 434 | 435 | 436 | -------------------------------------------------------------------------------- /translations/harbour-editor-zh_CN.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %1, %2 8 | Shows size and modification date, e.g. "15.5MB, 02/03/2016" 9 | %1, %2 10 | 11 | 12 | No files 13 | 无文件 14 | 15 | 16 | 17 | AboutPage 18 | 19 | "Editor." is feature-rich text/code editor! 20 | "Editor." 是一个功能丰富的文本及代码编辑器!< 21 | 22 | 23 | License: GPLv3 24 | 许可证: GPLv3 25 | 26 | 27 | Special thanks: 28 | 特别感谢: 29 | 30 | 31 | Tips: 32 | 建议: 33 | 34 | 35 | About 36 | 关于 37 | 38 | 39 | -coderus for various tips and code 40 | -coderus 提供各种建议及代码 41 | 42 | 43 | -To 'Select all text' hold your finger until 3 vibrations 44 | 如果想要 '全选 text' 按住手指直到3次振动 45 | 46 | 47 | -osanwe for very often consultations about qml code 48 | -osanwe 经常提供 qml 代码方面的咨询 49 | 50 | 51 | or 52 | 53 | 54 | 55 | If you want to support the developer: 56 | 如果你想要支持开发者: 57 | 58 | 59 | Make a donation (button above) 60 | 捐赠(上方按钮) 61 | 62 | 63 | -Russian community for feedback and help 64 | -俄罗斯社区提供反馈及帮助 65 | 66 | 67 | -Unsaved changes are saved in the file with ending '~' in the same dir where you placed your original file 68 | 未保存的修改被保存于以下述结尾的文件 '~' 和原文件保存于相同目录。 69 | 70 | 71 | Star the repository at the github ☺ 72 | 在 GitHub Star(标星)☺ 73 | 74 | 75 | Translators 76 | 翻译者 77 | 78 | 79 | - Spanish translation 80 | - 西班牙语翻译 81 | 82 | 83 | - Swedish translation 84 | - 瑞典语翻译 85 | 86 | 87 | - Russian translation 88 | - 俄语翻译 89 | 90 | 91 | - French translation 92 | - 法语翻译 93 | 94 | 95 | - Polish translation 96 | - 波兰语翻译 97 | 98 | 99 | -You can copy the file path to the clipboard by selecting appropriate MenuItem in pulley menu 100 | -你可以通过滑轮菜单项目复制文件目录到剪切板 101 | 102 | 103 | -Ancelad for tab icon, testing and help 104 | Ancelad 提供按钮图标、测试及帮助 105 | 106 | 107 | - German translation 108 | - 德语翻译 109 | 110 | 111 | - Dutch translation 112 | - 尼德兰语翻译 113 | 114 | 115 | -gri4994 for the wonderful app icon 116 | -gri4994 提供精美的软件图标 117 | 118 | 119 | -eekkelund for save/load/autosave functions, source code and some dictionaries for syntax highlighting and feedback 120 | eekelund 提供保存、加载、自动保存功能、代码及某些 syntax 字典强调功能及反馈。 121 | 122 | 123 | -the team of GtkSourceView for the basis for .sh dictionary 124 | GtkSourceView 团队提供 .sh 字典基础 125 | 126 | 127 | Source code 128 | 源代码 129 | 130 | 131 | Version 132 | 版本 133 | 134 | 135 | Paypal donation - RUB 136 | Paypal 捐赠 - 卢布 137 | 138 | 139 | Paypal donation - EURO 140 | Paypal-捐赠 - 欧元 141 | 142 | 143 | 144 | CoverPage 145 | 146 | Lines: 147 | 行数: 148 | 149 | 150 | Words: 151 | 词语: 152 | 153 | 154 | Chars: 155 | 字符: 156 | 157 | 158 | 159 | EditRow 160 | 161 | Save 162 | 保存 163 | 164 | 165 | Document can't be saved! 166 | 文档无法保存! 167 | 168 | 169 | Undo 170 | 取消 171 | 172 | 173 | Redo 174 | 重写 175 | 176 | 177 | Tab 178 | 标签 179 | 180 | 181 | Document saved 182 | 文档已保存 183 | 184 | 185 | Search 186 | 搜索 187 | 188 | 189 | 190 | FirstPage 191 | 192 | File path copied to the clipboard 193 | 文件路径已复制到剪切板 194 | 195 | 196 | Document saved! 197 | 文档已保存! 198 | 199 | 200 | Settings 201 | 设置 202 | 203 | 204 | Error while opening/saving the file 205 | 打开或保存文件时出错 206 | 207 | 208 | Highlighting enabled 209 | 强调已启用 210 | 211 | 212 | Highlighting disabled 213 | 强调已禁用 214 | 215 | 216 | 217 | HistoryPage 218 | 219 | History 220 | 历史 221 | 222 | 223 | Delete 224 | 删除 225 | 226 | 227 | Move to top 228 | 移动到顶部 229 | 230 | 231 | Documents are in order of first opening 232 | 文档按第一次打开的顺序打开 233 | 234 | 235 | Delete history 236 | 删除历史 237 | 238 | 239 | 240 | MainRow 241 | 242 | Save as 243 | 保存为 244 | 245 | 246 | Open 247 | 打开 248 | 249 | 250 | New 251 | 新建 252 | 253 | 254 | History 255 | 历史 256 | 257 | 258 | R-only 259 | R-only 260 | 261 | 262 | Quick note 263 | 快速笔记 264 | 265 | 266 | Highlight 267 | 强调 268 | 269 | 270 | 271 | QuickNotePage 272 | 273 | Undo 274 | 取消 275 | 276 | 277 | Redo 278 | 重写 279 | 280 | 281 | Tab 282 | 标签 283 | 284 | 285 | Text auto-saved in: 286 | 文本自动保存于: 287 | 288 | 289 | Quick note. 290 | 快速笔记。 291 | 292 | 293 | Search 294 | 搜索 295 | 296 | 297 | 298 | SearchRow 299 | 300 | Search 301 | 搜索 302 | 303 | 304 | 305 | SettingsPage 306 | 307 | About 308 | 关于 309 | 310 | 311 | Settings 312 | 设置 313 | 314 | 315 | Appearance 316 | 外观 317 | 318 | 319 | Line numeration enabled 320 | 行数计算已启用 321 | 322 | 323 | Line numeration disabled 324 | 行数计算已禁用 325 | 326 | 327 | Dark Theme 328 | 深色主题 329 | 330 | 331 | Ambience Theme 332 | 氛围主题 333 | 334 | 335 | Custom button color 336 | 自定义按钮颜色 337 | 338 | 339 | Fonts and size 340 | 字体及大小 341 | 342 | 343 | Font size 344 | 字体大小 345 | 346 | 347 | Tiny 348 | 微小号 349 | 350 | 351 | Extra small 352 | 特小号 353 | 354 | 355 | Small 356 | 小号 357 | 358 | 359 | Medium (default) 360 | 中号 (默认) 361 | 362 | 363 | Large 364 | 大号 365 | 366 | 367 | Extra large 368 | 超大号 369 | 370 | 371 | Huge 372 | 巨大号 373 | 374 | 375 | Font: 376 | 字体: 377 | 378 | 379 | Type of tab: 380 | 标签类型: 381 | 382 | 383 | Default text editor 384 | 默认文本编辑器 385 | 386 | 387 | Turn off to enable default notes 388 | 关闭以启用默认备忘录软件 389 | 390 | 391 | General 392 | 常规 393 | 394 | 395 | Autosave 396 | 自动保存 397 | 398 | 399 | If enabled text will be stored in files with postfix ~ 400 | 如果启用,文本会被保存到带有~结尾的文件之中 401 | 402 | 403 | File browser 404 | 文件管理器 405 | 406 | 407 | Show hidden files 408 | 显示隐藏文件 409 | 410 | 411 | Be careful to enable this option! 412 | 请谨慎启用此选项! 413 | 414 | 415 | Encoding 416 | 编码 417 | 418 | 419 | Region: 420 | 区域: 421 | 422 | 423 | Reset settings 424 | 重置设置 425 | 426 | 427 | Save settings 428 | 保存设置 429 | 430 | 431 | 432 | -------------------------------------------------------------------------------- /translations/harbour-editor.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %1, %2 8 | Shows size and modification date, e.g. "15.5MB, 02/03/2016" 9 | 10 | 11 | 12 | No files 13 | 14 | 15 | 16 | 17 | AboutPage 18 | 19 | "Editor." is feature-rich text/code editor! 20 | 21 | 22 | 23 | License: GPLv3 24 | 25 | 26 | 27 | Special thanks: 28 | 29 | 30 | 31 | Tips: 32 | 33 | 34 | 35 | About 36 | 37 | 38 | 39 | -coderus for various tips and code 40 | 41 | 42 | 43 | -To 'Select all text' hold your finger until 3 vibrations 44 | 45 | 46 | 47 | -osanwe for very often consultations about qml code 48 | 49 | 50 | 51 | or 52 | 53 | 54 | 55 | If you want to support the developer: 56 | 57 | 58 | 59 | Make a donation (button above) 60 | 61 | 62 | 63 | -Russian community for feedback and help 64 | 65 | 66 | 67 | -Unsaved changes are saved in the file with ending '~' in the same dir where you placed your original file 68 | 69 | 70 | 71 | Star the repository at the github ☺ 72 | 73 | 74 | 75 | Translators 76 | 77 | 78 | 79 | - Spanish translation 80 | 81 | 82 | 83 | - Swedish translation 84 | 85 | 86 | 87 | - Russian translation 88 | 89 | 90 | 91 | - French translation 92 | 93 | 94 | 95 | - Polish translation 96 | 97 | 98 | 99 | -You can copy the file path to the clipboard by selecting appropriate MenuItem in pulley menu 100 | 101 | 102 | 103 | -Ancelad for tab icon, testing and help 104 | 105 | 106 | 107 | - German translation 108 | 109 | 110 | 111 | - Dutch translation 112 | 113 | 114 | 115 | -gri4994 for the wonderful app icon 116 | 117 | 118 | 119 | -eekkelund for save/load/autosave functions, source code and some dictionaries for syntax highlighting and feedback 120 | 121 | 122 | 123 | -the team of GtkSourceView for the basis for .sh dictionary 124 | 125 | 126 | 127 | Source code 128 | 129 | 130 | 131 | Version 132 | 133 | 134 | 135 | Paypal donation - RUB 136 | 137 | 138 | 139 | Paypal donation - EURO 140 | 141 | 142 | 143 | -bobsik for the contributions for version 0.9 144 | 145 | 146 | 147 | 148 | CoverPage 149 | 150 | Lines: 151 | 152 | 153 | 154 | Words: 155 | 156 | 157 | 158 | Chars: 159 | 160 | 161 | 162 | 163 | EditRow 164 | 165 | Save 166 | 167 | 168 | 169 | Document can't be saved! 170 | 171 | 172 | 173 | Undo 174 | 175 | 176 | 177 | Redo 178 | 179 | 180 | 181 | Tab 182 | 183 | 184 | 185 | Document saved 186 | 187 | 188 | 189 | Search 190 | 191 | 192 | 193 | 194 | FirstPage 195 | 196 | File path copied to the clipboard 197 | 198 | 199 | 200 | Document saved! 201 | 202 | 203 | 204 | Settings 205 | 206 | 207 | 208 | Error while opening/saving the file 209 | 210 | 211 | 212 | Highlighting enabled 213 | 214 | 215 | 216 | Highlighting disabled 217 | 218 | 219 | 220 | 221 | HistoryPage 222 | 223 | History 224 | 225 | 226 | 227 | Delete 228 | 229 | 230 | 231 | Move to top 232 | 233 | 234 | 235 | Documents are in order of first opening 236 | 237 | 238 | 239 | Delete history 240 | 241 | 242 | 243 | 244 | MainRow 245 | 246 | Save as 247 | 248 | 249 | 250 | Open 251 | 252 | 253 | 254 | New 255 | 256 | 257 | 258 | History 259 | 260 | 261 | 262 | R-only 263 | 264 | 265 | 266 | Quick note 267 | 268 | 269 | 270 | Highlight 271 | 272 | 273 | 274 | 275 | QuickNotePage 276 | 277 | Undo 278 | 279 | 280 | 281 | Redo 282 | 283 | 284 | 285 | Tab 286 | 287 | 288 | 289 | Text auto-saved in: 290 | 291 | 292 | 293 | Quick note. 294 | 295 | 296 | 297 | Search 298 | 299 | 300 | 301 | 302 | SearchRow 303 | 304 | Search 305 | 306 | 307 | 308 | 309 | SettingsPage 310 | 311 | About 312 | 313 | 314 | 315 | Settings 316 | 317 | 318 | 319 | Appearance 320 | 321 | 322 | 323 | Line numeration enabled 324 | 325 | 326 | 327 | Line numeration disabled 328 | 329 | 330 | 331 | Dark Theme 332 | 333 | 334 | 335 | Ambience Theme 336 | 337 | 338 | 339 | Custom button color 340 | 341 | 342 | 343 | Fonts and size 344 | 345 | 346 | 347 | Font size 348 | 349 | 350 | 351 | Tiny 352 | 353 | 354 | 355 | Extra small 356 | 357 | 358 | 359 | Small 360 | 361 | 362 | 363 | Medium (default) 364 | 365 | 366 | 367 | Large 368 | 369 | 370 | 371 | Extra large 372 | 373 | 374 | 375 | Huge 376 | 377 | 378 | 379 | Font: 380 | 381 | 382 | 383 | Type of tab: 384 | 385 | 386 | 387 | Default text editor 388 | 389 | 390 | 391 | Turn off to enable default notes 392 | 393 | 394 | 395 | General 396 | 397 | 398 | 399 | Autosave 400 | 401 | 402 | 403 | If enabled text will be stored in files with postfix ~ 404 | 405 | 406 | 407 | File browser 408 | 409 | 410 | 411 | Show hidden files 412 | 413 | 414 | 415 | Be careful to enable this option! 416 | 417 | 418 | 419 | Encoding 420 | 421 | 422 | 423 | Region: 424 | 425 | 426 | 427 | Reset settings 428 | 429 | 430 | 431 | Save settings 432 | 433 | 434 | 435 | 436 | --------------------------------------------------------------------------------