Skip to content

Commit

Permalink
Merge branch 'release-0.5.0'
Browse files Browse the repository at this point in the history
0.5.0 (2014_11_19)

o feature140
Fixed a bug relating to the r-mode (=audio mode) :
When the record is been heard, some time slots may match no text extract;
in this case, this->dipydoc->translation() returns an empty
PosInTextRanges object and it would be problematic to modify the text aspect
since no text fragment matches the searched position. In order to avoid any
problem, if this->dipydoc->translation() returns an empty PosInTextRanges
object, no attempt is made to change the text's aspect.
+ feature141

code quality : 3 errors, according to cpplint.py
  • Loading branch information
suizokukan committed Nov 19, 2014
2 parents b9ed2d2 + b517315 commit cd49fd5
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 58 deletions.
17 changes: 13 additions & 4 deletions README
@@ -1,8 +1,6 @@
(C++/Qt5) front-end used to read texts with some annotations

TODO
* virer le terminal sous win
* virer Icons
* si type apparaît dans main.xml sans être défini, boom
* distinguer un DEBUG2 dans la partie la plus sensible de la boucle d'événements.

Expand All @@ -25,11 +23,9 @@ TODO
- [ui] justify ne fonctionne pas (au moins sur Linux)

[+]
- afficher correctement le mode AMODE
- doc. achetés : Fichier>télécharger doc. acheté avec le n° du doc. acheté.
- permettre des variantes dans le texte.
- vector of DipyDocTranslation + current_translation (plusieurs traductions possibles, ...)
- variantes d'un texe
- document image (http://qt-project.org/doc/qt-5/qpixmap.html#details)

[code]
Expand Down Expand Up @@ -59,7 +55,20 @@ TODO
- renommer MXE MXE_Qt5_1
- build : Linux_static/Linux_dynamique/Win32static/Win64static/OSXstatic/IPadStatic/AndroidStatic
- [win] installateur Windows (cf mail de ~)

- [android]
http://qt-project.org/doc/qt-5/portingtoandroid.html

- java :
consulter http://blog.developpez.com/gpu/?p=522
+ http://developer.android.com/training/basics/firstapp/index.html


(OpenJDK 7) $java -version
-> pacman -S apache-ant $ant -version
(http://developer.android.com/sdk/index.html) bundle
(ndk, http://developer.android.com/tools/sdk/ndk/index.html#Installing)

rpm -ivh jdk-<version>-linux-x64.rpm

~/.bashrc
Expand Down
2 changes: 1 addition & 1 deletion cppdipylon/build_number
@@ -1 +1 @@
693
709
2 changes: 1 addition & 1 deletion cppdipylon/fixedparameters.h
Expand Up @@ -59,7 +59,7 @@ const QString organization_domain = "94.23.197.37";
const QString application_name = "dipylonreader";
const QString application_name_for_the_user = "Dipylon-R";
// line read build_dipylonreader_*.py : do not change its format !
const QString application_version = "0.4.9";
const QString application_version = "0.5.0";
const QString application_style = "CleanLooks";

/*
Expand Down
84 changes: 46 additions & 38 deletions cppdipylon/qt/sourceeditor.cpp
Expand Up @@ -540,11 +540,13 @@ void SourceEditor::modify_the_text_format__amode__syntagma(Syntagma* current_syn
SourceEditor::modify_the_text_format__rmode__lmode
This function modify the appearence of the text BUT DOES NOT UPDATE
the .modified_chars_hash attribute.
the SourceEditor::modified_chars_hash attribute.
Use this function only for r-mode and l-mode.
_____________________________________________________________________________*/
void SourceEditor::modify_the_text_format__rmode__lmode(const PosInTextRanges& positions) {
// DEBUG1 DebugMsg() << "SourceEditor::modify_the_text_format__rmode__lmode() positions=" << positions.repr();

int shift = this->number_of_chars_before_source_text;

QTextCursor cur = this->textCursor();
Expand Down Expand Up @@ -602,22 +604,24 @@ void SourceEditor::mouseMoveEvent(QMouseEvent* mouse_event) {
// in the translation, where are the characters linked to "cursor_position" ?
PosInTextRanges pos_in_text = this->dipydoc->translation_contains(cursor_position);

std::size_t text_ranges_hash = pos_in_text.get_hash();
if (pos_in_text.is_empty() == false) {
std::size_t text_ranges_hash = pos_in_text.get_hash();

// if the user is really on another text's segment ...
if (text_ranges_hash != this->modified_chars_hash) {
// ... we refresh the ui :
// if the user is really on another text's segment ...
if (text_ranges_hash != this->modified_chars_hash) {
// ... we refresh the ui :

// the function modifies the appearence of such characters :
this->modify_the_text_format__rmode__lmode(pos_in_text);
// the function modifies the appearence of such characters :
this->modify_the_text_format__rmode__lmode(pos_in_text);

// hash update :
this->modified_chars_hash = text_ranges_hash;
// hash update :
this->modified_chars_hash = text_ranges_hash;

// SIGNAL #S001 (confer documentation)
emit this->signal__update_translation_in_commentary_zone(pos_in_text);
// SIGNAL #S001 (confer documentation)
emit this->signal__update_translation_in_commentary_zone(pos_in_text);

this->update();
this->update();
}
}

break;
Expand Down Expand Up @@ -688,26 +692,28 @@ void SourceEditor::mouseReleaseEvent(QMouseEvent* mouse_event) {
PosInTextRanges pos_in_text = this->dipydoc->translation_contains(x0, x1);
// DEBUG1 DebugMsg() << x0 << "-" << x1 << "; pos_in_text=" << pos_in_text.repr();

/*
we refresh the ui :
*/
std::size_t text_ranges_hash = pos_in_text.get_hash();
if (pos_in_text.is_empty() == false) {
/*
we refresh the ui :
*/
std::size_t text_ranges_hash = pos_in_text.get_hash();

// the function modifies the appearence of such characters :
this->modify_the_text_format__rmode__lmode(pos_in_text);
// the function modifies the appearence of such characters :
this->modify_the_text_format__rmode__lmode(pos_in_text);

// hash update :
this->modified_chars_hash = text_ranges_hash;
// hash update :
this->modified_chars_hash = text_ranges_hash;

this->blocked_commentaries = false;
// SIGNAL #S002 (confer documentation)
emit this->signal__update_translation_in_commentary_zone(pos_in_text);
this->blocked_commentaries = true;
this->blocked_commentaries = false;
// SIGNAL #S002 (confer documentation)
emit this->signal__update_translation_in_commentary_zone(pos_in_text);
this->blocked_commentaries = true;

// SIGNAL #S003 (confer documentation)
emit this->signal__source_zone_update_icons();
// SIGNAL #S003 (confer documentation)
emit this->signal__source_zone_update_icons();

this->update();
this->update();
}

return;
}
Expand All @@ -734,22 +740,24 @@ void SourceEditor::mouseReleaseEvent(QMouseEvent* mouse_event) {
PTRangesAND2PosAudio found_position = this->dipydoc->text2audio_contains(cursor_position);
PosInTextRanges pos_in_text = found_position.first;

std::size_t text_ranges_hash = pos_in_text.get_hash();
if (pos_in_text.is_empty() == false) {
std::size_t text_ranges_hash = pos_in_text.get_hash();

// if the user has really click on another text's segment ...
if (text_ranges_hash != this->modified_chars_hash) {
// ... we refresh the ui :
// if the user has really clicked on another text's segment ...
if (text_ranges_hash != this->modified_chars_hash) {
// ... we refresh the ui :

// the function modifies the appearence of such characters :
this->modify_the_text_format__rmode__lmode(pos_in_text);
// the function modifies the appearence of such characters :
this->modify_the_text_format__rmode__lmode(pos_in_text);

// hash update :
this->modified_chars_hash = text_ranges_hash;
// hash update :
this->modified_chars_hash = text_ranges_hash;

// SIGNAL #S004 (confer documentation)
emit this->signal__update_translation_in_commentary_zone(pos_in_text);
// SIGNAL #S004 (confer documentation)
emit this->signal__update_translation_in_commentary_zone(pos_in_text);

this->update();
this->update();
}
}
break;
}
Expand Down
29 changes: 15 additions & 14 deletions cppdipylon/qt/sourcezone.cpp
Expand Up @@ -333,33 +333,34 @@ void SourceZone::audiocontrols_stop(void) {
________________________________________________________________________________*/
void SourceZone::audio_position_changed(qint64 arg_pos) {
/* LMODE + PLAYING :
*/
/*
LMODE + PLAYING :
*/
if (this->readingmode == READINGMODE_LMODE &&
this->readingmode_details == READINGMODEDETAIL_LMODE_PLAYING) {
// where are the characters linked to "arg_pos" ?
PosInTextRanges text_ranges = this->dipydoc->audio2text_contains(arg_pos);
std::size_t text_ranges_hash = text_ranges.get_hash();

if (text_ranges_hash != this->editor->modified_chars_hash) {
// the function modifies the appearence of such characters :
this->editor->modify_the_text_format__rmode__lmode(text_ranges);
if (text_ranges.is_empty() == false) {
std::size_t text_ranges_hash = text_ranges.get_hash();

if (text_ranges_hash != this->editor->modified_chars_hash) {
// the function modifies the appearence of such characters :
this->editor->modify_the_text_format__rmode__lmode(text_ranges);

// hash update :
this->editor->modified_chars_hash = text_ranges_hash;
// hash update :
this->editor->modified_chars_hash = text_ranges_hash;

// SIGNAL #S009 (confer documentation)
emit this->signal__update_translation_in_commentary_zone(text_ranges);
// SIGNAL #S009 (confer documentation)
emit this->signal__update_translation_in_commentary_zone(text_ranges);
}
}

return;
}

/*
this->readingmode == READINGMODE_LMODE &&
this->readingmode_details == READINGMODEDETAIL_LMODE_ONPAUSE
-> nothing to do.
other reading modes : nothing to do.
*/
}

Expand Down
14 changes: 14 additions & 0 deletions dipylonreader.project
Expand Up @@ -66,6 +66,20 @@ SUMMARY
[0] roadmap
################################################################################

0.5.0 (2014_11_19)

o feature140
Fixed a bug relating to the r-mode (=audio mode) :
When the record is been heard, some time slots may match no text extract;
in this case, this->dipydoc->translation() returns an empty
PosInTextRanges object and it would be problematic to modify the text aspect
since no text fragment matches the searched position. In order to avoid any
problem, if this->dipydoc->translation() returns an empty PosInTextRanges
object, no attempt is made to change the text's aspect.
+ feature141

code quality : 3 errors, according to cpplint.py

0.4.9 (2014_11_12)

Fixed a critical bug preventing to use DipylonReader with arrows in analysis mode,
Expand Down

0 comments on commit cd49fd5

Please sign in to comment.