Skip to content

Commit

Permalink
Merge branch 'release-0.4.5'
Browse files Browse the repository at this point in the history
0.4.5 (2014_10_08)
o feature79 : Dipydocs format #33 (RECORD_EXT, summary files)
o feature74 : added the TextEditor::wheelEvent() method so that zoom value is
  now stored even if it's modified with the mouse.
o +feature83, feature82, feature81, feature80, feature78, feature77, feature76,
  feature75, feature72, feature71, feature70, feature69, feature68
code quality : 9 errors, according to cpplint.py
  • Loading branch information
suizokukan committed Oct 8, 2014
2 parents 6674aa6 + 59a7c98 commit c983b86
Show file tree
Hide file tree
Showing 43 changed files with 916 additions and 798 deletions.
Binary file renamed art/textminux.xcf → art/textminus.xcf
Binary file not shown.
Binary file modified art/textplus.xcf
Binary file not shown.
7 changes: 4 additions & 3 deletions cppdipylon/2win32_static/dipylonreader.pro
Expand Up @@ -16,10 +16,9 @@ TRANSLATIONS = dipylonreader_French.ts
DEFINES += ALLOW_MAXIMIZE_MAINWINDOW
DEFINES += ALLOW_MOVING_THE_MAINWINDOW
DEFINES += ALLOW_RESIZING_THE_MAINWINDOW
DEFINES += ALLOW_SPLASHSCREEN
DEFINES += ALLOW_SPLASHSCREEN_AT_START
DEFINES += COMPILE_TO_32BITS_ARCHITECTURE
DEFINES += CROSSCOMPILE_TO_WIN_USING_MXE
DEFINES += DISPLAY_INTERNAL_MESSAGES_IN_HELP_MENUITEM
DEFINES += MENUACCESS_TO_INTERNAL_MESSAGES
DEFINES += DOWNLOAD_MP3_VERSION_OF_DIPYDOCS
DEFINES += MAXIMIZE_MAINWINDOW_TRUE_METHOD
DEFINES += NO_MAIN_POPUPMENU
Expand Down Expand Up @@ -65,6 +64,7 @@ HEADERS += ./fixedparameters.h \
qt/ui.h \
qt/mainwindow.h \
qt/posintextframeformat.h \
qt/presentationscreen.h \
qt/sourceeditor.h \
qt/sourcetoolbar.h \
qt/sourcezone.h \
Expand All @@ -91,6 +91,7 @@ SOURCES += ./main.cpp \
qt/ui.cpp \
qt/mainwindow.cpp \
qt/posintextframeformat.cpp \
qt/presentationscreen.cpp \
qt/sourceeditor.cpp \
qt/sourcetoolbar.cpp \
qt/sourcezone.cpp \
Expand Down
210 changes: 24 additions & 186 deletions cppdipylon/cpplint_py__output

Large diffs are not rendered by default.

552 changes: 284 additions & 268 deletions cppdipylon/dipydoc/dipydoc.cpp

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions cppdipylon/dipydoc/dipydoc.h
Expand Up @@ -28,8 +28,6 @@
#ifndef CPPDIPYLON_DIPYDOC_DIPYDOC_H_
#define CPPDIPYLON_DIPYDOC_DIPYDOC_H_

#include <QDebug>

#include <QFile>
#include <QFileInfo>
#include <QIODevice>
Expand All @@ -39,17 +37,17 @@
#include <QTextStream>
#include <QXmlStreamReader>

#include <map>
#include <cstring>
#include <map>
#include <utility>

#include "./fixedparameters.h"
#include "dipydoc/menunames.h"
#include "dipydoc/dipydocnotes.h"
#include "languages/languagefromto.h"
#include "pos/posintext/posintext2str.h"
#include "pos/posintext2posinaudio.h"
#include "pos/posinaudio2posintext.h"
#include "languages/languagefromto.h"
#include "qt/arrowformat.h"
#include "qt/blockformat.h"
#include "qt/posintextframeformat.h"
Expand Down Expand Up @@ -267,6 +265,9 @@ friend class CommentaryEditor;
private:
bool _well_initialized;
int _internal_state;
/*
"unspecified" or one of the strings defined in fixedparameters::known_doctypes.
*/
QString doctype;

QString path;
Expand Down Expand Up @@ -324,10 +325,11 @@ friend class CommentaryEditor;
bool error(const QString& msg);
bool error(const QString& msg, const QString& error_string);
template<class T> bool error(const T& object, const QString& _error_string, const QString& where);
QString error_string(const QXmlStreamReader& xmlreader);
QString error_string(QXmlStreamReader* xmlreader);
QString get_condensed_extracts_from_the_source_text(PosInTextRanges, int) const;
bool read_mainfile__first_token(QXmlStreamReader& xmlreader); // NOLINT(runtime/references)
bool read_mainfile__rest(QXmlStreamReader& xmlreader); // NOLINT(runtime/references)
bool read_mainfile__first_token(QXmlStreamReader* xmlreader);
bool read_mainfile__text(QXmlStreamReader* xmlreader);
bool read_mainfile__text__init_and_check(void);
QString levels_repr(void) const;
void read_menu_name(const QString& _path);
void set_qsettings_name(void);
Expand All @@ -347,8 +349,8 @@ friend class CommentaryEditor;
bool well_initialized(void) const;

// public constants ...........................................................
static const int min_dipydocformat_version = 32;
static const int max_dipydocformat_version = 32;
static const int min_dipydocformat_version = 33;
static const int max_dipydocformat_version = 33;
// for the following constants, see
// the get_condensed_extracts_from_the_source_text() method :
static const int condensed_extracts_length = 30;
Expand Down
2 changes: 0 additions & 2 deletions cppdipylon/dipydoc/dipydocnotes.cpp
Expand Up @@ -25,8 +25,6 @@

#include <dipydoc/dipydocnotes.h>

#include <QDebug>

#include <utility>

/*______________________________________________________________________________
Expand Down
6 changes: 4 additions & 2 deletions cppdipylon/dipylonreader.pro
Expand Up @@ -14,12 +14,12 @@ TRANSLATIONS = dipylonreader_French.ts
#
#_______________________________________________________________________________
DEFINES += ALLOW_LOADING_DIPYDOC_FROM_THE_COMMAND_LINE
DEFINES += ALLOW_SPLASHSCREEN
DEFINES += ALLOW_SPLASHSCREEN_AT_START
DEFINES += ALLOW_RESIZING_THE_MAINWINDOW
DEFINES += ALLOW_MOVING_THE_MAINWINDOW
DEFINES += ALLOW_MAXIMIZE_MAINWINDOW
DEFINES += DEBUG_MESSAGES_TO_CERR
DEFINES += DISPLAY_INTERNAL_MESSAGES_IN_HELP_MENUITEM
DEFINES += MENUACCESS_TO_INTERNAL_MESSAGES
DEFINES += DOWNLOAD_OGG_VERSION_OF_DIPYDOCS
DEFINES += MAXIMIZE_MAINWINDOW_LINUXDESKTOPX11_METHOD
DEFINES += NO_MAIN_POPUPMENU
Expand Down Expand Up @@ -55,6 +55,7 @@ HEADERS += ./fixedparameters.h \
qt/ui.h \
qt/mainwindow.h \
qt/posintextframeformat.h \
qt/presentationscreen.h \
qt/sourceeditor.h \
qt/sourcetoolbar.h \
qt/sourcezone.h \
Expand All @@ -81,6 +82,7 @@ SOURCES += ./main.cpp \
qt/ui.cpp \
qt/mainwindow.cpp \
qt/posintextframeformat.cpp \
qt/presentationscreen.cpp \
qt/sourceeditor.cpp \
qt/sourcetoolbar.cpp \
qt/sourcezone.cpp \
Expand Down
8 changes: 4 additions & 4 deletions cppdipylon/fixedparameters.h
Expand Up @@ -52,7 +52,7 @@ static const QString organization_name = "suizokukanfactory";
static const QString organization_domain = "94.23.197.37";
static const QString application_name = "dipylonreader";
static const QString application_name_for_the_user = "Dipylon-R";
static const QString application_version = "0.4.4";
static const QString application_version = "0.4.5";
static const QString application_style = "CleanLooks";

/*
Expand Down Expand Up @@ -113,11 +113,11 @@ static const int maximum_number_of_items_in_submenu_open = 10;

// source site with '%1' for the version string.
#if defined DOWNLOAD_OGG_VERSION_OF_DIPYDOCS
constexpr static const char* DEMODIPYDOCS__SOURCE_SITE = "http://94.23.197.37/dipylonreader/freedipydocs/%1/ogg";
constexpr static const char* DEMODIPYDOCS__SOURCE_SITE = "http://94.23.197.37/dipylon/freedipydocs/%1/ogg";
#elif defined DOWNLOAD_MP3_VERSION_OF_DIPYDOCS
constexpr static const char* DEMODIPYDOCS__SOURCE_SITE = "http://94.23.197.37/dipylonreader/freedipydocs/%1/mp3";
constexpr static const char* DEMODIPYDOCS__SOURCE_SITE = "http://94.23.197.37/dipylon/freedipydocs/%1/mp3";
#else
constexpr static const char* DEMODIPYDOCS__SOURCE_SITE = "http://94.23.197.37/dipylonreader/freedipydocs/%1/ogg";
constexpr static const char* DEMODIPYDOCS__SOURCE_SITE = "http://94.23.197.37/dipylon/freedipydocs/%1/ogg";
#endif

// regex used to detect 'demo' dipydocs's names :
Expand Down
1 change: 0 additions & 1 deletion cppdipylon/languages/languagefromto.h
Expand Up @@ -46,7 +46,6 @@
#ifndef CPPDIPYLON_LANGUAGES_LANGUAGEFROMTO_H_
#define CPPDIPYLON_LANGUAGES_LANGUAGEFROMTO_H_

#include <QDebug>
#include <QString>
#include <QStringList>

Expand Down
2 changes: 0 additions & 2 deletions cppdipylon/pos/posinaudio2posintext.cpp
Expand Up @@ -27,8 +27,6 @@

#include "pos/posinaudio2posintext.h"

#include <QDebug>

/*______________________________________________________________________________
PosInAudio2PosInText::PosInAudio2PosInText(const PosInText2PosInAudio)
Expand Down
79 changes: 39 additions & 40 deletions cppdipylon/qt/arrowformat.cpp
Expand Up @@ -56,7 +56,6 @@ int ArrowFormat::init_from_string(const QString& source_string) {
int res = ArrowFormat::INTERNALSTATE::OK;

for (auto &keyword : list_of_keywords) {

// spaces are not taken in account :
keyword.replace(" ", "");

Expand All @@ -67,11 +66,11 @@ int ArrowFormat::init_from_string(const QString& source_string) {
/*
thickness
*/
if( keyword.startsWith("thickness:") == true ) {
QString str_value = keyword.right( keyword.length() - QString("thickness:").length() );
if (keyword.startsWith("thickness:") == true) {
QString str_value = keyword.right(keyword.length() - QString("thickness:").length());
bool ok;
int value = str_value.toInt(&ok, 10);
if( (ok == true) && (value>0) ) {
if ((ok == true) && (value > 0)) {
this->_thickness = value;
} else {
res = ArrowFormat::INTERNALSTATE::WRONG_DECIMAL_VALUE_FOR_THICKNESS;
Expand All @@ -84,11 +83,11 @@ int ArrowFormat::init_from_string(const QString& source_string) {
main color
*/
// main color with hexadecimal value ?
if( keyword.startsWith("main-color:#") == true ) {
QString str_value = keyword.right( keyword.length() - QString("main-color:#").length() );
if (keyword.startsWith("main-color:#") == true) {
QString str_value = keyword.right(keyword.length() - QString("main-color:#").length());
bool ok;
int value = str_value.toInt(&ok, 16);
if( ok == true ) {
if (ok == true) {
this->_maincolor = QColor(static_cast<unsigned int>(value));
} else {
res = ArrowFormat::INTERNALSTATE::WRONG_HEX_VALUE_FOR_MAIN_COLOR;
Expand All @@ -97,25 +96,25 @@ int ArrowFormat::init_from_string(const QString& source_string) {
continue;
}
// main colors with a keyword like "black", ... ?
if (keyword == "main-color:black") { this->_maincolor = QColor(Qt::black); continue; }
if (keyword == "main-color:blue") { this->_maincolor = QColor(Qt::blue); continue; }
if (keyword == "main-color:cyan") { this->_maincolor = QColor(Qt::cyan); continue; }
if (keyword == "main-color:gray") { this->_maincolor = QColor(Qt::gray); continue; }
if (keyword == "main-color:green") { this->_maincolor = QColor(Qt::green); continue; }
if (keyword == "main-color:magenta"){ this->_maincolor = QColor(Qt::magenta); continue; }
if (keyword == "main-color:red") { this->_maincolor = QColor(Qt::red); continue; }
if (keyword == "main-color:white") { this->_maincolor = QColor(Qt::white); continue; }
if (keyword == "main-color:yellow") { this->_maincolor = QColor(Qt::yellow); continue; }
if (keyword == "main-color:black") { this->_maincolor = QColor(Qt::black); continue; }
if (keyword == "main-color:blue") { this->_maincolor = QColor(Qt::blue); continue; }
if (keyword == "main-color:cyan") { this->_maincolor = QColor(Qt::cyan); continue; }
if (keyword == "main-color:gray") { this->_maincolor = QColor(Qt::gray); continue; }
if (keyword == "main-color:green") { this->_maincolor = QColor(Qt::green); continue; }
if (keyword == "main-color:magenta") { this->_maincolor = QColor(Qt::magenta); continue; }
if (keyword == "main-color:red") { this->_maincolor = QColor(Qt::red); continue; }
if (keyword == "main-color:white") { this->_maincolor = QColor(Qt::white); continue; }
if (keyword == "main-color:yellow") { this->_maincolor = QColor(Qt::yellow); continue; }

/*
start color
*/
// start color with hexadecimal value ?
if( keyword.startsWith("start-color:#") == true ) {
QString str_value = keyword.right( keyword.length() - QString("start-color:#").length() );
if (keyword.startsWith("start-color:#") == true) {
QString str_value = keyword.right(keyword.length() - QString("start-color:#").length());
bool ok;
int value = str_value.toInt(&ok, 16);
if( ok == true ) {
if (ok == true) {
this->_startcolor = QColor(static_cast<unsigned int>(value));
} else {
res = ArrowFormat::INTERNALSTATE::WRONG_HEX_VALUE_FOR_START_COLOR;
Expand All @@ -124,25 +123,25 @@ int ArrowFormat::init_from_string(const QString& source_string) {
continue;
}
// start colors with a keyword like "black", ... ?
if (keyword == "start-color:black") { this->_startcolor = QColor(Qt::black); continue; }
if (keyword == "start-color:blue") { this->_startcolor = QColor(Qt::blue); continue; }
if (keyword == "start-color:cyan") { this->_startcolor = QColor(Qt::cyan); continue; }
if (keyword == "start-color:gray") { this->_startcolor = QColor(Qt::gray); continue; }
if (keyword == "start-color:green") { this->_startcolor = QColor(Qt::green); continue; }
if (keyword == "start-color:magenta"){ this->_startcolor = QColor(Qt::magenta); continue; }
if (keyword == "start-color:red") { this->_startcolor = QColor(Qt::red); continue; }
if (keyword == "start-color:white") { this->_startcolor = QColor(Qt::white); continue; }
if (keyword == "start-color:yellow") { this->_startcolor = QColor(Qt::yellow); continue; }
if (keyword == "start-color:black") { this->_startcolor = QColor(Qt::black); continue; }
if (keyword == "start-color:blue") { this->_startcolor = QColor(Qt::blue); continue; }
if (keyword == "start-color:cyan") { this->_startcolor = QColor(Qt::cyan); continue; }
if (keyword == "start-color:gray") { this->_startcolor = QColor(Qt::gray); continue; }
if (keyword == "start-color:green") { this->_startcolor = QColor(Qt::green); continue; }
if (keyword == "start-color:magenta") { this->_startcolor = QColor(Qt::magenta); continue; }
if (keyword == "start-color:red") { this->_startcolor = QColor(Qt::red); continue; }
if (keyword == "start-color:white") { this->_startcolor = QColor(Qt::white); continue; }
if (keyword == "start-color:yellow") { this->_startcolor = QColor(Qt::yellow); continue; }

/*
end color
*/
// end color with hexadecimal value ?
if( keyword.endsWith("end-color:#") == true ) {
QString str_value = keyword.right( keyword.length() - QString("end-color:#").length() );
if (keyword.endsWith("end-color:#") == true) {
QString str_value = keyword.right(keyword.length() - QString("end-color:#").length());
bool ok;
int value = str_value.toInt(&ok, 16);
if( ok == true ) {
if (ok == true) {
this->_endcolor = QColor(static_cast<unsigned int>(value));
} else {
res = ArrowFormat::INTERNALSTATE::WRONG_HEX_VALUE_FOR_END_COLOR;
Expand All @@ -151,15 +150,15 @@ int ArrowFormat::init_from_string(const QString& source_string) {
continue;
}
// end colors with a keyword like "black", ... ?
if (keyword == "end-color:black") { this->_endcolor = QColor(Qt::black); continue; }
if (keyword == "end-color:blue") { this->_endcolor = QColor(Qt::blue); continue; }
if (keyword == "end-color:cyan") { this->_endcolor = QColor(Qt::cyan); continue; }
if (keyword == "end-color:gray") { this->_endcolor = QColor(Qt::gray); continue; }
if (keyword == "end-color:green") { this->_endcolor = QColor(Qt::green); continue; }
if (keyword == "end-color:magenta"){ this->_endcolor = QColor(Qt::magenta); continue; }
if (keyword == "end-color:red") { this->_endcolor = QColor(Qt::red); continue; }
if (keyword == "end-color:white") { this->_endcolor = QColor(Qt::white); continue; }
if (keyword == "end-color:yellow") { this->_endcolor = QColor(Qt::yellow); continue; }
if (keyword == "end-color:black") { this->_endcolor = QColor(Qt::black); continue; }
if (keyword == "end-color:blue") { this->_endcolor = QColor(Qt::blue); continue; }
if (keyword == "end-color:cyan") { this->_endcolor = QColor(Qt::cyan); continue; }
if (keyword == "end-color:gray") { this->_endcolor = QColor(Qt::gray); continue; }
if (keyword == "end-color:green") { this->_endcolor = QColor(Qt::green); continue; }
if (keyword == "end-color:magenta") { this->_endcolor = QColor(Qt::magenta); continue; }
if (keyword == "end-color:red") { this->_endcolor = QColor(Qt::red); continue; }
if (keyword == "end-color:white") { this->_endcolor = QColor(Qt::white); continue; }
if (keyword == "end-color:yellow") { this->_endcolor = QColor(Qt::yellow); continue; }

DebugMsg() << "ArrowFormat::init_from_string(); unknown keyword=" << keyword;
res = ArrowFormat::INTERNALSTATE::BADSRCSTRING_UNKNOWNKEYWORD;
Expand Down
1 change: 0 additions & 1 deletion cppdipylon/qt/arrowformat.h
Expand Up @@ -43,7 +43,6 @@
#ifndef CPPDIPYLON_QT_ARROWFORMAT_H_
#define CPPDIPYLON_QT_ARROWFORMAT_H_

#include <QDebug>
#include <QColor>
#include <QString>
#include <QStringList>
Expand Down
8 changes: 3 additions & 5 deletions cppdipylon/qt/blockformat.cpp
Expand Up @@ -55,7 +55,6 @@ int BlockFormat::init_from_string(const QString& source_string) {
int res = BlockFormat::INTERNALSTATE::OK;

for (auto &keyword : list_of_keywords) {

// spaces are not taken in account :
keyword.replace(" ", "");

Expand All @@ -66,12 +65,12 @@ int BlockFormat::init_from_string(const QString& source_string) {
/*
line-height
*/
if( keyword.startsWith("line-height:") == true ) {
QString str_value = keyword.right( keyword.length() - QString("line-height:").length() );
if (keyword.startsWith("line-height:") == true) {
QString str_value = keyword.right(keyword.length() - QString("line-height:").length());

bool ok = true;

if (str_value.endsWith("%") == false ) {
if (str_value.endsWith("%") == false) {
ok = false;
res = BlockFormat::INTERNALSTATE::LINE_HEIGHT_IS_NOT_A_PERCENTAGE;
this->_well_initialized = false;
Expand All @@ -82,7 +81,6 @@ int BlockFormat::init_from_string(const QString& source_string) {

int value = str_value.toInt(&ok, 10);
if (ok == true) {

if (value < 0) {
res = BlockFormat::INTERNALSTATE::LINE_HEIGHT_IS_NOT_A_VALID_PERCENTAGE;
this->_well_initialized = false;
Expand Down
3 changes: 1 addition & 2 deletions cppdipylon/qt/blockformat.h
Expand Up @@ -41,10 +41,9 @@
#ifndef CPPDIPYLON_QT_BLOCKFORMAT_H_
#define CPPDIPYLON_QT_BLOCKFORMAT_H_

#include <QDebug>
#include <QTextBlockFormat>
#include <QString>
#include <QStringList>
#include <QTextBlockFormat>

/*______________________________________________________________________________
Expand Down
7 changes: 3 additions & 4 deletions cppdipylon/qt/commentaryeditor.cpp
Expand Up @@ -33,8 +33,8 @@
CommentaryEditor constructor
______________________________________________________________________________*/
CommentaryEditor::CommentaryEditor(UI& _ui) : TextEditor(_ui) {
this->setObjectName("commentary zone::editor");
CommentaryEditor::CommentaryEditor(UI& _ui, QWidget *_parent) : TextEditor(_ui, _parent) {
this->setObjectName("commentary_zone__editor");

this->setReadOnly(true);
this->update_aspect_from_dipydoc_aspect_informations();
Expand Down Expand Up @@ -65,8 +65,7 @@ void CommentaryEditor::set_the_text_formats(void) {
only if ui.selected_text_and_blocked_commentaries is false.
______________________________________________________________________________*/
void CommentaryEditor::update_content__translation_expected(const PosInTextRanges& posintext) {

if( this->ui.selected_text_and_blocked_commentaries == false ) {
if (this->ui.selected_text_and_blocked_commentaries == false) {
PosInText x0 = posintext.min();
PosInText x1 = posintext.max();

Expand Down
2 changes: 1 addition & 1 deletion cppdipylon/qt/commentaryeditor.h
Expand Up @@ -46,7 +46,7 @@ friend class UI;
Q_OBJECT

public:
explicit CommentaryEditor(UI&);
explicit CommentaryEditor(UI& _ui, QWidget *_parent);

void set_the_appearance(void);
void set_the_text_formats(void);
Expand Down

0 comments on commit c983b86

Please sign in to comment.