diff options
author | Kandrashin Denis <mail@lintest.ru> | 2022-07-18 22:54:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-18 22:54:48 +0300 |
commit | 378ed15f58979325dcd97bb65c375f388f577933 (patch) | |
tree | 14c605fff68017a9beaf3e255b1f6d6a97001b2c | |
parent | 6d9f937d6b7a58fabd2dbaba85add201a334407b (diff) | |
parent | ebce26c9b0fe333865a500d96835d55dad1c288e (diff) |
Merge pull request #7 from vitlav/master
Qt5 build patches
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 43 | ||||
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | fb2edit.pro | 3 | ||||
-rw-r--r-- | source/fb2app.cpp | 8 | ||||
-rw-r--r-- | source/fb2app.hpp | 2 | ||||
-rw-r--r-- | source/fb2code.cpp | 3 | ||||
-rw-r--r-- | source/fb2logs.cpp | 1 | ||||
-rw-r--r-- | source/fb2main.cpp | 3 | ||||
-rw-r--r-- | source/ts/ru.qm | bin | 11267 -> 15732 bytes | |||
-rw-r--r-- | source/ts/ru.ts | 158 |
11 files changed, 124 insertions, 104 deletions
@@ -1 +1,2 @@ Denis Kandrashin <mail@lintest.ru> +Aleksei Vasiliev <aleksvassiliev@gmail.com> diff --git a/CMakeLists.txt b/CMakeLists.txt index 00ba27e..ab88e0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,21 +7,29 @@ # ######################################################### -cmake_minimum_required(VERSION 2.6.0) +cmake_minimum_required(VERSION 3.1.0) project(fb2edit) -set(PACKAGE_VERSION "0.0.9") +set(PACKAGE_VERSION "0.1.0") set(PACKAGE_VENDOR "LinTest") set(PACKAGE_NAME ${PROJECT_NAME}) set(PACKAGE_STRING "${PROJECT_NAME} ${PACKAGE_VERSION}") -set(PACKAGE_BUGREPORT "mail@lintest.ru") +set(PACKAGE_BUGREPORT "lav@etersoft.ru") +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +if(CMAKE_VERSION VERSION_LESS "3.7.0") + set(CMAKE_INCLUDE_CURRENT_DIR ON) +endif() + message( STATUS "PACKAGE_NAME = ${PACKAGE_STRING}") set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/cmake) -find_program( QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 qmake-mac ) -find_package( Qt4 4.6.0 COMPONENTS QtCore QtGui QtNetwork QtWebkit QtXml QtXmlPatterns REQUIRED ) +#find_program( QT_QMAKE_EXECUTABLE NAMES qmake5 qmake-qt5 qmake-mac ) +find_package( Qt5 5.5.0 COMPONENTS Core Gui Network Widgets WebKitWidgets Xml XmlPatterns LinguistTools REQUIRED ) find_package( LibXML2 ) file( GLOB FB2_HEAD source/*.hpp ) @@ -29,7 +37,7 @@ file( GLOB FB2_SRCS source/*.cpp ) file( GLOB FB2_UIS source/*.ui ) file( GLOB FB2_TSS source/ts/*.ts ) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GTK_PKG_FLAGS}") +#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GTK_PKG_FLAGS}") if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git) exec_program("git --git-dir=${CMAKE_SOURCE_DIR}/.git log --format=%ai//%h%d -1" OUTPUT_VARIABLE COMMIT_INFO) @@ -50,21 +58,26 @@ set(CMAKE_IN_SOURCE_BUILD TRUE) add_definitions(-Wall -g) -qt4_wrap_ui(UI_HEADERS ${FB2_UIS}) -qt4_wrap_cpp(MOC_SRCS ${FB2_HEAD}) -qt4_add_resources(RCC_SRCS ${FB2_RES}) -qt4_add_translation(QMS_FILES ${FB2_TSS}) +qt5_wrap_ui(UI_HEADERS ${FB2_UIS}) +qt5_wrap_cpp(MOC_SRCS ${FB2_HEAD}) +qt5_add_resources(RCC_SRCS ${FB2_RES}) +qt5_add_translation(QMS_FILES ${FB2_TSS}) + +message( STATUS "PACKAGE_NAME_ = ${CMAKE_PREFIX_PATH}") add_executable(fb2edit ${FB2_SRCS} ${FB2_HEAD} ${UI_HEADERS} ${MOC_SRCS} ${RCC_SRCS} ${QMS_FILES}) -include(${QT_USE_FILE}) +#include(${QT_USE_FILE}) +#include_directories(${QT_INCLUDES}) include_directories(${CMAKE_BINARY_DIR}) -target_link_libraries(fb2edit ${QT_LIBRARIES}) -add_definitions(${QT_DEFINITIONS}) +target_link_libraries(fb2edit PUBLIC + Qt5::Core Qt5::Gui Qt5::Network Qt5::Widgets Qt5::WebKitWidgets Qt5::Xml Qt5::XmlPatterns + ${LIBXML2_LIBRARIES} + ) +#add_definitions(${QT_DEFINITIONS}) +include_directories(${LIBXML2_INCLUDE_DIRS}) if (LIBXML2_FOUND) - include_directories(${LIBXML2_INCLUDE_DIRS}) - target_link_libraries(fb2edit ${LIBXML2_LIBRARIES}) add_definitions(${LIBXML2_DEFINITIONS}) add_definitions(-DFB2_USE_LIBXML2) endif (LIBXML2_FOUND) @@ -1,9 +1,5 @@ -fb2edit 0.0.9 (c) Denis Kandrashin, 2014 +fork of fb2edit 0.0.9 (http://fb2edit.lintest.ru) Distribution: source codes are distributed under the terms of GNU General Public License (GPL). See LICENSE file for details. - -Project homepage: http://fb2edit.lintest.ru - -You can contact author by email: mail@lintest.ru diff --git a/fb2edit.pro b/fb2edit.pro index 9516135..d7c7f23 100644 --- a/fb2edit.pro +++ b/fb2edit.pro @@ -52,8 +52,9 @@ TARGET = fb2edit TRANSLATIONS = source/ts/ru.ts
+QT += widgets
QT += xml
-QT += webkit
+QT += webkitwidgets
QT += network
QT += xmlpatterns
diff --git a/source/fb2app.cpp b/source/fb2app.cpp index df8c65b..fd5256a 100644 --- a/source/fb2app.cpp +++ b/source/fb2app.cpp @@ -21,12 +21,12 @@ QString FbApplication::lastCommit() #endif // PACKAGE_VERSION } -void FbApplication::handleMessage(QtMsgType type, const char *msg) +void FbApplication::handleMessage(QtMsgType type, const QString& msg) { - emit logMessage(type, QString::fromUtf8(msg)); + emit logMessage(type, msg); } -static void fb2MessageHandler(QtMsgType type, const char *msg) +static void fb2MessageHandler(QtMsgType type, const QMessageLogContext&, const QString& msg) { ((FbApplication*)qApp)->handleMessage(type, msg); } @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) } if (count == 1) (new FbMainWindow)->show(); - qInstallMsgHandler(fb2MessageHandler); + qInstallMessageHandler(fb2MessageHandler); return app.exec(); } diff --git a/source/fb2app.hpp b/source/fb2app.hpp index 8715377..1a3d51a 100644 --- a/source/fb2app.hpp +++ b/source/fb2app.hpp @@ -11,7 +11,7 @@ public: FbApplication(int &argc, char **argv, int = QT_VERSION)
: QApplication(argc, argv, QT_VERSION) {}
- void handleMessage(QtMsgType type, const char *msg);
+ void handleMessage(QtMsgType type, const QString& msg);
static QString lastCommit();
diff --git a/source/fb2code.cpp b/source/fb2code.cpp index 8d564df..37afde1 100644 --- a/source/fb2code.cpp +++ b/source/fb2code.cpp @@ -1,5 +1,6 @@ #include "fb2code.hpp" +#include <QApplication> #include <QXmlSchema> #include <QAbstractMessageHandler> #include <QXmlSchemaValidator> @@ -238,7 +239,7 @@ void FbHighlighter::highlightBlock(const QString& text) const int len = text.length(); for (; i < len; ++i) { - switch (text.at(i).toAscii()) + switch (text.at(i).toLatin1()) { case '<': ++brackets; diff --git a/source/fb2logs.cpp b/source/fb2logs.cpp index c185022..6dd4964 100644 --- a/source/fb2logs.cpp +++ b/source/fb2logs.cpp @@ -9,6 +9,7 @@ QVariant FbLogModel::FbLogItem::icon() const
{
switch (m_type) {
+ case QtInfoMsg: return QVariant();
case QtDebugMsg: return FbIcon("dialog-information");
case QtWarningMsg: return FbIcon("dialog-warning");
case QtCriticalMsg: return FbIcon("dialog-error");
diff --git a/source/fb2main.cpp b/source/fb2main.cpp index 20f46a0..fdcc84f 100644 --- a/source/fb2main.cpp +++ b/source/fb2main.cpp @@ -4,6 +4,9 @@ #include <QtDebug> #include <QTreeView> #include <QWebFrame> +#include <QMessageBox> +#include <QMenuBar> +#include <QStatusBar> #include "fb2app.hpp" #include "fb2logs.hpp" diff --git a/source/ts/ru.qm b/source/ts/ru.qm Binary files differindex 8474b5c..0fdc6a7 100644 --- a/source/ts/ru.qm +++ b/source/ts/ru.qm diff --git a/source/ts/ru.ts b/source/ts/ru.ts index 3c176f0..bdc4d69 100644 --- a/source/ts/ru.ts +++ b/source/ts/ru.ts @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> -<TS version="2.0" language="ru_RU"> +<TS version="2.1" language="ru_RU"> <context> <name>FbAuthorDlg</name> <message> @@ -36,11 +36,11 @@ <name>FbCodeEdit</name> <message> <source>Schema is not valid: </source> - <translation type="unfinished"></translation> + <translation>Схема некорректна: </translation> </message> <message> <source>Validation successful</source> - <translation>Проверка выполнена успешно </translation> + <translation>Проверка выполнена успешно</translation> </message> </context> <context> @@ -82,7 +82,7 @@ </message> <message> <source>&Case sensitive </source> - <translation>С &учетом регистра</translation> + <translation>С &учётом регистра</translation> </message> <message> <source>&Highlights all</source> @@ -101,15 +101,15 @@ <name>FbHeadEdit</name> <message> <source>&Append</source> - <translation type="unfinished">&Добавить</translation> + <translation>&Добавить</translation> </message> <message> <source>&Modify</source> - <translation type="unfinished">&Изменить</translation> + <translation>&Изменить</translation> </message> <message> <source>&Delete</source> - <translation type="unfinished">&Удалить</translation> + <translation>&Удалить</translation> </message> </context> <context> @@ -215,15 +215,15 @@ </message> <message> <source>Can edit</source> - <translation type="unfinished"></translation> + <translation>Можно редактировать</translation> </message> <message> <source>Min</source> - <translation type="unfinished"></translation> + <translation>Мин</translation> </message> <message> <source>Max</source> - <translation type="unfinished"></translation> + <translation>Макс</translation> </message> </context> <context> @@ -245,58 +245,58 @@ <name>FbImageDlg</name> <message> <source>File name:</source> - <translation type="unfinished"></translation> + <translation>Имя файла:</translation> </message> <message> <source>Insert picture</source> - <translation type="unfinished"></translation> + <translation>Вставить изображение</translation> </message> <message> <source>Select file</source> - <translation type="unfinished"></translation> + <translation>Выбрать файл</translation> </message> <message> <source>From collection</source> - <translation type="unfinished"></translation> + <translation>Из коллекции</translation> </message> <message> <source>Common Graphics (*.png *.jpg *.jpeg *.gif)</source> - <translation type="unfinished"></translation> + <translation>Все графические форматы (*.png *.jpg *.jpeg *.gif)</translation> </message> <message> <source>Portable Network Graphics (PNG) (*.png)</source> - <translation type="unfinished"></translation> + <translation>Portable Network Graphics (PNG) (*.png)</translation> </message> <message> <source>JPEG (*.jpg *.jpeg)</source> - <translation type="unfinished"></translation> + <translation>JPEG (*.jpg *.jpeg)</translation> </message> <message> <source>Graphics Interchange Format (*.gif)</source> - <translation type="unfinished"></translation> + <translation>Graphics Interchange Format (*.gif)</translation> </message> <message> <source>All Files (*)</source> - <translation type="unfinished"></translation> + <translation>Все файлы (*)</translation> </message> <message> <source>Insert image...</source> - <translation type="unfinished"></translation> + <translation>Вставить изображение...</translation> </message> </context> <context> <name>FbImgsModel</name> <message> <source>File name</source> - <translation type="unfinished">Имя файла</translation> + <translation>Имя файла</translation> </message> <message> <source>Type</source> - <translation type="unfinished">Тип</translation> + <translation>Тип</translation> </message> <message> <source>Size</source> - <translation type="unfinished">Размер</translation> + <translation>Размер</translation> </message> </context> <context> @@ -406,7 +406,7 @@ </message> <message> <source>&About</source> - <translation>&О программе...</translation> + <translation>&О программе</translation> </message> <message> <source>&Close</source> @@ -494,7 +494,7 @@ </message> <message> <source>About fb2edit</source> - <translation>О программе...</translation> + <translation>О программе</translation> </message> <message> <source>&Settings</source> @@ -643,7 +643,7 @@ </message> <message> <source>Clear format</source> - <translation>&Очистить формат</translation> + <translation>Очистить формат</translation> </message> <message> <source>Paste (no style)</source> @@ -668,41 +668,45 @@ </message> <message> <source>&HTML</source> - <translation type="unfinished"></translation> + <translation>&HTML</translation> </message> <message> <source><b>fb2edit</b> is an application for creating and editing FB2-files.</source> - <translation type="unfinished"></translation> + <translation><b>fb2edit</b> это приложение для создания и редактирования файлов FB2.</translation> </message> <message> <source>&Check...</source> - <translation type="unfinished"></translation> + <translation>&Проверить...</translation> </message> <message> <source>&Footnotes</source> <translation>&Сноски</translation> </message> + <message> + <source>&Export HTML</source> + <translation>&Экспорт в HTML</translation> + </message> </context> <context> <name>FbNodeDlg</name> <message> <source>Insert tag</source> - <translation type="unfinished"></translation> + <translation>Вставить тэг</translation> </message> <message> <source>Tag name:</source> - <translation type="unfinished"></translation> + <translation>Название тэга:</translation> </message> </context> <context> <name>FbNodeEditDlg</name> <message> <source>Modify tag</source> - <translation type="unfinished"></translation> + <translation>Изменить тэг</translation> </message> <message> <source>Value:</source> - <translation type="unfinished"></translation> + <translation>Значение:</translation> </message> </context> <context> @@ -758,22 +762,22 @@ <name>FbSaveDialog</name> <message> <source>Fiction book files (*.fb2)</source> - <translation type="unfinished"></translation> + <translation>Файлы Fiction book (*.fb2)</translation> </message> <message> <source>Any files (*.*)</source> - <translation type="unfinished"></translation> + <translation>Все файлы (*.*)</translation> </message> <message> <source>&Encoding</source> - <translation type="unfinished"></translation> + <translation>&Кодировка</translation> </message> </context> <context> <name>FbSetup</name> <message> <source>Settings</source> - <translation type="unfinished">Настройки</translation> + <translation>Настройки</translation> </message> <message> <source>Tab 1</source> @@ -781,11 +785,11 @@ </message> <message> <source>Default font:</source> - <translation type="unfinished"></translation> + <translation>Шрифт по умолчанию:</translation> </message> <message> <source>Style file name:</source> - <translation type="unfinished"></translation> + <translation>Название файла со стилями:</translation> </message> <message> <source>Tab 2</source> @@ -796,77 +800,81 @@ <name>FbTextEdit</name> <message> <source>Insert hyperlink</source> - <translation type="unfinished"></translation> + <translation>Вставить гиперссылку</translation> </message> <message> <source>URL:</source> - <translation type="unfinished"></translation> + <translation>URL:</translation> </message> <message> <source>Fo&rmat</source> - <translation type="unfinished">Фо&рмат</translation> + <translation>Фо&рмат</translation> </message> <message> <source>Contents</source> - <translation type="unfinished">Содержание</translation> + <translation>Содержание</translation> </message> <message> <source>Pictures</source> - <translation type="unfinished">Иллюстрации</translation> + <translation>Иллюстрации</translation> </message> <message> <source>Web inspector</source> - <translation type="unfinished"></translation> + <translation>Инспектор</translation> </message> <message> <source>Footnotes</source> <translation>Сноски</translation> </message> + <message> + <source>Save As...</source> + <translation>Сохранить как...</translation> + </message> </context> <context> <name>FbTextPage</name> <message> <source>Append section</source> - <translation type="unfinished"></translation> + <translation>Добавить секцию</translation> </message> <message> <source>Append body</source> - <translation type="unfinished"></translation> + <translation>Добавить тело</translation> </message> <message> <source>Insert title</source> - <translation type="unfinished"></translation> + <translation>Вставить заголовок</translation> </message> <message> <source>Insert subtitle</source> - <translation type="unfinished"></translation> + <translation>Вставить подзаголовок</translation> </message> <message> <source>Insert poem</source> - <translation type="unfinished"></translation> + <translation>Вставить стих</translation> </message> <message> <source>Append stanza</source> - <translation type="unfinished"></translation> + <translation>Добавить строфу</translation> </message> <message> <source>Insert epigraph</source> - <translation type="unfinished"></translation> + <translation>Вставить эпиграф</translation> </message> <message> <source>Create <%1></source> - <translation type="unfinished"></translation> + <translation>Создать <%1></translation> </message> <message> <source>Remove section</source> - <translation type="unfinished">Удалить секцию</translation> + <translation>Удалить секцию</translation> </message> </context> <context> <name>FbTreeModel</name> <message> <source>Move section</source> - <translation type="unfinished"></translation> + <translation>Переместить секцию</translation> </message> </context> <context> @@ -941,86 +949,82 @@ </message> <message> <source>+ Simple text</source> - <translation type="unfinished"></translation> + <translation>+ Простой текст</translation> </message> </context> <context> <name>QObject</name> <message> <source>The file is not an FB2 file.</source> - <translation></translation> + <translation>Файл не является файлом FB2.</translation> </message> <message> <source>Cannot read file %1: %2.</source> <translation></translation> </message> <message> - <source>Parse error at line %1, column %2: %3</source> - <translation></translation> - </message> - <message> <source>The tag <html> was not found.</source> - <translation type="unfinished"></translation> + <translation>Тэг <html> не найден.</translation> </message> <message> <source>&Undo</source> - <translation type="unfinished">&Отменить</translation> + <translation>&Отменить</translation> </message> <message> <source>&Redo</source> - <translation type="unfinished">&Повторить</translation> + <translation>&Повторить</translation> </message> <message> <source>Cu&t</source> - <translation type="unfinished">Вы&резать</translation> + <translation>Вы&резать</translation> </message> <message> <source>Cut the current selection's contents to the clipboard</source> - <translation type="unfinished"></translation> + <translation>Вырезать выделенное содержимое в буфер обмена</translation> </message> <message> <source>&Copy</source> - <translation type="unfinished">&Копировать</translation> + <translation>&Копировать</translation> </message> <message> <source>Copy the current selection's contents to the clipboard</source> - <translation type="unfinished"></translation> + <translation>Скопировать выделенное содержимое в буфер обмена</translation> </message> <message> <source>&Paste</source> - <translation type="unfinished">&Вставить</translation> + <translation>&Вставить</translation> </message> <message> <source>Paste the clipboard's contents into the current selection</source> - <translation type="unfinished"></translation> + <translation>Вставить содержимое буфера обмена в текущее выделение</translation> </message> <message> <source>&Bold</source> - <translation type="unfinished">&Жирный</translation> + <translation>&Жирный</translation> </message> <message> <source>&Italic</source> - <translation type="unfinished">&Курсив</translation> + <translation>&Курсив</translation> </message> <message> <source>&Strikethrough</source> - <translation type="unfinished">&Зачеркнутый</translation> + <translation>&Зачёркнутый</translation> </message> <message> <source>Su&perscript</source> - <translation type="unfinished">&Верхний индекс</translation> + <translation>&Верхний индекс</translation> </message> <message> <source>Su&bscript</source> - <translation type="unfinished">&Нижний индекс</translation> + <translation>&Нижний индекс</translation> </message> <message> <source>Unknown image format: %1</source> - <translation type="unfinished"></translation> + <translation>Неизвестный формат изображения: %1</translation> </message> <message> <source>Clear format</source> - <translation type="unfinished">&Очистить формат</translation> + <translation>Очистить формат</translation> </message> </context> </TS> |