preferencesAboutTextFull
shibakaneki 13 years ago
commit 88f652245e
  1. 7
      resources/customizations/teacherGuide/indexingParameters.xml
  2. 8
      resources/library/interactivities/Ass sons.wgt/js/script.js
  3. 10
      resources/library/interactivities/Ass sons.wgt/locales/fr/js/script.js
  4. 10
      resources/library/interactivities/Ass sons.wgt/locales/ru/js/script.js
  5. 33
      resources/library/interactivities/Selectionner.wgt/css/basic.css
  6. BIN
      resources/library/interactivities/Selectionner.wgt/img/slate-help-white.png
  7. BIN
      resources/library/interactivities/Selectionner.wgt/img/slate-help.png
  8. 2
      resources/library/interactivities/Selectionner.wgt/index.html
  9. 33
      resources/library/interactivities/Selectionner.wgt/js/script.js
  10. 2
      resources/library/interactivities/Selectionner.wgt/locales/fr/index.html
  11. 45
      resources/library/interactivities/Selectionner.wgt/locales/fr/js/script.js
  12. 2
      resources/library/interactivities/Selectionner.wgt/locales/ru/index.html
  13. 47
      resources/library/interactivities/Selectionner.wgt/locales/ru/js/script.js
  14. 6
      src/adaptors/UBSvgSubsetAdaptor.cpp
  15. 10
      src/board/UBBoardController.cpp
  16. 2
      src/board/UBBoardPaletteManager.h
  17. 4
      src/core/UBApplicationController.cpp
  18. 14
      src/core/UBPersistenceManager.cpp
  19. 6
      src/document/UBDocumentController.cpp
  20. 5
      src/gui/UBDockTeacherGuideWidget.cpp
  21. 2
      src/gui/UBDockTeacherGuideWidget.h
  22. 4
      src/gui/UBDocumentNavigator.cpp
  23. 2
      src/gui/UBPageNavigationWidget.cpp
  24. 126
      src/gui/UBTeacherGuideWidget.cpp
  25. 5
      src/gui/UBTeacherGuideWidget.h

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<teacherGuide> <teacherGuide>
<gradeLevels> <gradeLevels>
<gradeLevel label="" baseLevel="Maternelle"/>
<gradeLevel label="Petite Section (3-4 ans)" baseLevel="Maternelle"/> <gradeLevel label="Petite Section (3-4 ans)" baseLevel="Maternelle"/>
<gradeLevel label="Moyenne Section (4-5 ans)" baseLevel="Maternelle"/> <gradeLevel label="Moyenne Section (4-5 ans)" baseLevel="Maternelle"/>
<gradeLevel label="Grande Section (5-6 ans)" baseLevel="Maternelle"/> <gradeLevel label="Grande Section (5-6 ans)" baseLevel="Maternelle"/>
@ -22,6 +23,7 @@
<gradeLevel label="Education Spécialisée" baseLevel="Enseignement Professionnel" /> <gradeLevel label="Education Spécialisée" baseLevel="Enseignement Professionnel" />
</gradeLevels> </gradeLevels>
<subjects baseLevel="Maternelle"> <subjects baseLevel="Maternelle">
<subject label="" />
<subject label="Percevoir, sentir, imaginer, créer" /> <subject label="Percevoir, sentir, imaginer, créer" />
<subject label="Découvrir l'écrit" /> <subject label="Découvrir l'écrit" />
<subject label="S'approprier le langage" /> <subject label="S'approprier le langage" />
@ -29,6 +31,7 @@
<subject label="Découvrir le monde" /> <subject label="Découvrir le monde" />
</subjects> </subjects>
<subjects baseLevel="Elémentaire"> <subjects baseLevel="Elémentaire">
<subject label="" />
<subject label="Pratiques artistiques" /> <subject label="Pratiques artistiques" />
<subject label="Pratiques artistiques - arts visuels" /> <subject label="Pratiques artistiques - arts visuels" />
<subject label="Pratiques artistiques - éducation musicale" /> <subject label="Pratiques artistiques - éducation musicale" />
@ -50,6 +53,7 @@
<subject label="TUIC" /> <subject label="TUIC" />
</subjects> </subjects>
<subjects baseLevel="Collège"> <subjects baseLevel="Collège">
<subject label="" />
<subject label="Pratiques artistiques" /> <subject label="Pratiques artistiques" />
<subject label="Pratiques artistiques - arts visuels" /> <subject label="Pratiques artistiques - arts visuels" />
<subject label="Pratiques artistiques - éducation musicale" /> <subject label="Pratiques artistiques - éducation musicale" />
@ -80,6 +84,7 @@
<subject label="Education aux médias" /> <subject label="Education aux médias" />
</subjects> </subjects>
<subjects baseLevel="Lycée"> <subjects baseLevel="Lycée">
<subject label="" />
<subject label="Enseignements artistiques" /> <subject label="Enseignements artistiques" />
<subject label="Agriculture" /> <subject label="Agriculture" />
<subject label="Arts" /> <subject label="Arts" />
@ -125,6 +130,7 @@
<subject label="Philosophie" /> <subject label="Philosophie" />
</subjects> </subjects>
<subjects baseLevel="Enseignement Professionnel"> <subjects baseLevel="Enseignement Professionnel">
<subject label="" />
<subject label="Enseignements artistiques" /> <subject label="Enseignements artistiques" />
<subject label="Agriculture" /> <subject label="Agriculture" />
<subject label="Arts" /> <subject label="Arts" />
@ -169,6 +175,7 @@
<subject label="Philosophie" /> <subject label="Philosophie" />
</subjects> </subjects>
<types> <types>
<type label="" />
<type label="Activité : Evaluation/Travail à la maison" /> <type label="Activité : Evaluation/Travail à la maison" />
<type label="Activité : Exercice" /> <type label="Activité : Exercice" />
<type label="Activité : Travaux Pratiques" /> <type label="Activité : Travaux Pratiques" />

@ -700,11 +700,11 @@ function addContainer(){
var close = $("<div class='close_cont'>").appendTo(container); var close = $("<div class='close_cont'>").appendTo(container);
var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container); var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container);
var text = $("<div class='text_cont'>").appendTo(sub_container); var text = $("<div class='text_cont'>").appendTo(sub_container);
text.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).removeClass('gray'); return false;")
.attr("ondragover", "$(this).addClass('gray'); return false;")
.attr("ondrop", "$(this).removeClass('gray'); return onDropAudio(this,event);");
var audio_block = $("<div class='audio_block'>").appendTo(text); var audio_block = $("<div class='audio_block'>").appendTo(text);
audio_block.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).removeClass('audio_gray'); return false;")
.attr("ondragover", "$(this).addClass('audio_gray'); return false;")
.attr("ondrop", "$(this).removeClass('audio_gray'); return onDropAudio(this,event);");
$("<div class='play'>").appendTo(audio_block); $("<div class='play'>").appendTo(audio_block);
$("<div class='replay'>").appendTo(audio_block); $("<div class='replay'>").appendTo(audio_block);
var source = $("<source/>").attr("src", ""); var source = $("<source/>").attr("src", "");

@ -685,11 +685,11 @@ function addContainer(){
var close = $("<div class='close_cont'>").appendTo(container); var close = $("<div class='close_cont'>").appendTo(container);
var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container); var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container);
var text = $("<div class='text_cont'>").appendTo(sub_container); var text = $("<div class='text_cont'>").appendTo(sub_container);
text.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).removeClass('gray'); return false;")
.attr("ondragover", "$(this).addClass('gray'); return false;")
.attr("ondrop", "$(this).removeClass('gray'); return onDropAudio(this,event);");
var audio_block = $("<div class='audio_block'>").appendTo(text); var audio_block = $("<div class='audio_block'>").appendTo(text);
audio_block.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).removeClass('audio_gray'); return false;")
.attr("ondragover", "$(this).addClass('audio_gray'); return false;")
.attr("ondrop", "$(this).removeClass('audio_gray'); return onDropAudio(this,event);");
$("<div class='play'>").appendTo(audio_block); $("<div class='play'>").appendTo(audio_block);
$("<div class='replay'>").appendTo(audio_block); $("<div class='replay'>").appendTo(audio_block);
var source = $("<source/>").attr("src", ""); var source = $("<source/>").attr("src", "");
@ -851,7 +851,7 @@ function onDropAudio(obj, event) {
var tmp = textData.getElementsByTagName("path")[0].firstChild.textContent; var tmp = textData.getElementsByTagName("path")[0].firstChild.textContent;
var tmp_type = textData.getElementsByTagName("type")[0].firstChild.textContent; var tmp_type = textData.getElementsByTagName("type")[0].firstChild.textContent;
if(tmp_type.substr(0, 5) == "audio"){ if(tmp_type.substr(0, 5) == "audio"){
var audio_block = $(obj).find(".audio_block"); var audio_block = $(obj);
$(obj).find("audio").remove(); $(obj).find("audio").remove();
audio_block.find(":first-child").removeClass("stop").addClass("play"); audio_block.find(":first-child").removeClass("stop").addClass("play");
var source = $("<source/>").attr("src", "../../" + tmp); var source = $("<source/>").attr("src", "../../" + tmp);

@ -685,11 +685,11 @@ function addContainer(){
var close = $("<div class='close_cont'>").appendTo(container); var close = $("<div class='close_cont'>").appendTo(container);
var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container); var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container);
var text = $("<div class='text_cont'>").appendTo(sub_container); var text = $("<div class='text_cont'>").appendTo(sub_container);
text.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).removeClass('gray'); return false;")
.attr("ondragover", "$(this).addClass('gray'); return false;")
.attr("ondrop", "$(this).removeClass('gray'); return onDropAudio(this,event);");
var audio_block = $("<div class='audio_block'>").appendTo(text); var audio_block = $("<div class='audio_block'>").appendTo(text);
audio_block.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).removeClass('audio_gray'); return false;")
.attr("ondragover", "$(this).addClass('audio_gray'); return false;")
.attr("ondrop", "$(this).removeClass('audio_gray'); return onDropAudio(this,event);");
$("<div class='play'>").appendTo(audio_block); $("<div class='play'>").appendTo(audio_block);
$("<div class='replay'>").appendTo(audio_block); $("<div class='replay'>").appendTo(audio_block);
var source = $("<source/>").attr("src", ""); var source = $("<source/>").attr("src", "");
@ -851,7 +851,7 @@ function onDropAudio(obj, event) {
var tmp = textData.getElementsByTagName("path")[0].firstChild.textContent; var tmp = textData.getElementsByTagName("path")[0].firstChild.textContent;
var tmp_type = textData.getElementsByTagName("type")[0].firstChild.textContent; var tmp_type = textData.getElementsByTagName("type")[0].firstChild.textContent;
if(tmp_type.substr(0, 5) == "audio"){ if(tmp_type.substr(0, 5) == "audio"){
var audio_block = $(obj).find(".audio_block"); var audio_block = $(obj);
$(obj).find("audio").remove(); $(obj).find("audio").remove();
audio_block.find(":first-child").removeClass("stop").addClass("play"); audio_block.find(":first-child").removeClass("stop").addClass("play");
var source = $("<source/>").attr("src", "../../" + tmp); var source = $("<source/>").attr("src", "../../" + tmp);

@ -4,6 +4,7 @@ html, body{
margin: 0; margin: 0;
padding: 0; padding: 0;
border-radius: 50px; border-radius: 50px;
overflow: hidden;
} }
body{ body{
@ -133,12 +134,12 @@ body{
-moz-box-shadow: #ccc -1px 0 4px; -moz-box-shadow: #ccc -1px 0 4px;
-webkit-box-shadow: #ccc -1px 0 4px; -webkit-box-shadow: #ccc -1px 0 4px;
box-shadow: #ccc -1px 0 4px; box-shadow: #ccc -1px 0 4px;
background-color: white;
} }
.text_block{ .text_block{
display: table; display: table;
text-align: center; text-align: center;
background-color: white;
} }
.audio_block{ .audio_block{
@ -317,7 +318,6 @@ body{
#wgt_name{ #wgt_name{
height: 44px; height: 44px;
width: 200px;
margin: 10px 10px 0 10px; margin: 10px 10px 0 10px;
padding: 0; padding: 0;
float: left; float: left;
@ -326,9 +326,8 @@ body{
color: #8c5730; color: #8c5730;
} }
#wgt_reload, #wgt_edit, #wgt_display{ #wgt_reload, #wgt_edit, #wgt_display, #wgt_help{
cursor: pointer; cursor: pointer;
width: 80px;
height: 44px; height: 44px;
margin: 10px 10px 0 0; margin: 10px 10px 0 0;
float: right; float: right;
@ -338,7 +337,6 @@ body{
} }
#wgt_display{ #wgt_display{
width: 100px;
padding-left: 40px; padding-left: 40px;
background-image: url(../img/slate-edit.png); background-image: url(../img/slate-edit.png);
background-repeat: no-repeat; background-repeat: no-repeat;
@ -347,7 +345,6 @@ body{
} }
#wgt_edit{ #wgt_edit{
width: 100px;
padding-left: 40px; padding-left: 40px;
background-image: url(../img/slate-edit.png); background-image: url(../img/slate-edit.png);
background-repeat: no-repeat; background-repeat: no-repeat;
@ -440,3 +437,27 @@ body{
color: white !important; color: white !important;
background-image: url(../img/ar_down_white.png) !important; background-image: url(../img/ar_down_white.png) !important;
} }
.pad_help{
background-image: url(../img/slate-help-white.png) !important;
}
#wgt_help{
padding-left: 32px;
background-image: url(../img/slate-help.png);
background-repeat: no-repeat;
background-position: top 0;
}
#help{
width: 100%;
height: 100%;
overflow: auto;
display: none;
background-color: #ccc;
padding: 5px;
}
.open{
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -48,6 +48,7 @@
<td class="b_top_left">&nbsp;</td> <td class="b_top_left">&nbsp;</td>
<td class="b_top_center"> <td class="b_top_center">
<div id="wgt_name"></div> <div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_reload"></div> <div id="wgt_reload"></div>
<div id="wgt_display" class="selected"></div> <div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div> <div id="wgt_edit"></div>
@ -63,6 +64,7 @@
<tr> <tr>
<td class="b_center_left">&nbsp;</td> <td class="b_center_left">&nbsp;</td>
<td> <td>
<div id="help"></div>
<div id="data"> <div id="data">
</div> </div>

@ -13,7 +13,9 @@ var sankoreLang = {
reload: "Reload", reload: "Reload",
slate: "Wood", slate: "Wood",
pad: "Pad", pad: "Pad",
none: "None" none: "None",
help: "Help",
help_content: "This is an example of help content ..."
}; };
//main function //main function
@ -23,6 +25,8 @@ function start(){
$("#wgt_edit").text(sankoreLang.edit); $("#wgt_edit").text(sankoreLang.edit);
$("#wgt_name").text(sankoreLang.wgt_name); $("#wgt_name").text(sankoreLang.wgt_name);
$("#wgt_reload").text(sankoreLang.reload); $("#wgt_reload").text(sankoreLang.reload);
$("#wgt_help").text(sankoreLang.help);
$("#help").html(sankoreLang.help_content);
$(".style_select option[value='1']").text(sankoreLang.slate); $(".style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad); $(".style_select option[value='2']").text(sankoreLang.pad);
$(".style_select option[value='3']").text(sankoreLang.none); $(".style_select option[value='3']").text(sankoreLang.none);
@ -50,6 +54,21 @@ function start(){
} }
} }
$("#wgt_help").click(function(){
var tmp = $(this);
if($(this).hasClass("open")){
$("#help").slideUp("100", function(){
tmp.removeClass("open");
$("#data").show();
});
} else {
$("#data").hide();
$("#help").slideDown("100", function(){
tmp.addClass("open");
});
}
});
$("#wgt_reload").click(function(){ $("#wgt_reload").click(function(){
if($("#wgt_display").hasClass("selected")){ if($("#wgt_display").hasClass("selected")){
$(".cont").each(function(){ $(".cont").each(function(){
@ -252,7 +271,7 @@ function exportData(){
tmp_block.src = $(this).find("source").attr("src"); tmp_block.src = $(this).find("source").attr("src");
tmp_block.hidden = $(this).parent().find("input:hidden").val(); tmp_block.hidden = $(this).parent().find("input:hidden").val();
tmp_block.type = "audio"; tmp_block.type = "audio";
tmp_block.checked = $(this).find("input:checkbox").attr("checked"); tmp_block.checked = $(this).parent().find("input:checkbox").attr("checked");
} }
if($(this).hasClass("text_block")){ if($(this).hasClass("text_block")){
tmp_block.text = $(this).find(".text_subblock").text(); tmp_block.text = $(this).find(".text_subblock").text();
@ -294,7 +313,10 @@ function importData(data){
var img_block = $("<div class='img_block' style='text-align: center;'></div>").insertBefore(imgs_container.find(".clear")); var img_block = $("<div class='img_block' style='text-align: center;'></div>").insertBefore(imgs_container.find(".clear"));
$("<input type='hidden' value='" + data[i].blocks[j].hidden + "'/>").appendTo(img_block); $("<input type='hidden' value='" + data[i].blocks[j].hidden + "'/>").appendTo(img_block);
$("<input type='checkbox' class='ch_box'/>").attr("checked",(data[i].blocks[j].state == "display")?((data[i].blocks[j].checked == "checked")?true:false):false).appendTo(img_block) $("<input type='checkbox' class='ch_box'/>").attr("checked",(data[i].blocks[j].state == "display")?((data[i].blocks[j].checked == "checked")?true:false):false).appendTo(img_block)
$("<img src=\"" + data[i].blocks[j].src + "\" width='" + data[i].blocks[j].w + "' height='" + data[i].blocks[j].h + "' style=\"display: inline;\"/>").appendTo(img_block); var img = $("<img src=\"" + data[i].blocks[j].src + "\" style=\"display: inline;\"/>").appendTo(img_block);
img.height(data[i].blocks[j].h);
if((120 - data[i].blocks[j].h) > 0)
img.css("margin",(120 - data[i].blocks[j].h)/2 + "px 0");
break; break;
case "audio": case "audio":
var img_tmp = $("<div class='img_block'>").insertBefore(imgs_container.find(".clear")); var img_tmp = $("<div class='img_block'>").insertBefore(imgs_container.find(".clear"));
@ -422,6 +444,7 @@ function changeStyle(val){
$(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back"); $(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back"); $(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back");
$("#wgt_reload").removeClass("pad_color").removeClass("pad_reload"); $("#wgt_reload").removeClass("pad_color").removeClass("pad_reload");
$("#wgt_help").removeClass("pad_color").removeClass("pad_help");
$("#wgt_edit").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_edit").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_display").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_display").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_name").removeClass("pad_color"); $("#wgt_name").removeClass("pad_color");
@ -438,6 +461,7 @@ function changeStyle(val){
$(".b_bottom_left").addClass("bbl_pad").removeClass("without_back"); $(".b_bottom_left").addClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").addClass("bbc_pad").removeClass("without_back"); $(".b_bottom_center").addClass("bbc_pad").removeClass("without_back");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); $("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); $("#wgt_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_name").addClass("pad_color"); $("#wgt_name").addClass("pad_color");
@ -453,6 +477,7 @@ function changeStyle(val){
$(".b_bottom_right").addClass("without_back").removeClass("bbr_pad"); $(".b_bottom_right").addClass("without_back").removeClass("bbr_pad");
$(".b_bottom_left").addClass("without_back").removeClass("bbl_pad"); $(".b_bottom_left").addClass("without_back").removeClass("bbl_pad");
$(".b_bottom_center").addClass("without_back").removeClass("bbc_pad"); $(".b_bottom_center").addClass("without_back").removeClass("bbc_pad");
$("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); $("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); $("#wgt_display").addClass("pad_color").addClass("pad_edit");
@ -495,6 +520,8 @@ function onDropTarget(obj, event) {
tmp_img.attr("height", "120"); tmp_img.attr("height", "120");
else{ else{
tmp_img.attr("width","120"); tmp_img.attr("width","120");
var h = tmp_img.height();
tmp_img.attr("height",h);
tmp_img.css("margin",(120 - tmp_img.height())/2 + "px 0"); tmp_img.css("margin",(120 - tmp_img.height())/2 + "px 0");
} }
}, 6); }, 6);

@ -22,6 +22,7 @@
<td class="b_top_left">&nbsp;</td> <td class="b_top_left">&nbsp;</td>
<td class="b_top_center"> <td class="b_top_center">
<div id="wgt_name"></div> <div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_reload"></div> <div id="wgt_reload"></div>
<div id="wgt_display" class="selected"></div> <div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div> <div id="wgt_edit"></div>
@ -37,6 +38,7 @@
<tr> <tr>
<td class="b_center_left">&nbsp;</td> <td class="b_center_left">&nbsp;</td>
<td> <td>
<div id="help"></div>
<div id="data"> <div id="data">
</div> </div>

@ -13,7 +13,9 @@ var sankoreLang = {
reload: "Recharger", reload: "Recharger",
slate: "ardoise", slate: "ardoise",
pad: "tablette", pad: "tablette",
none: "aucun" none: "aucun",
help: "aide",
help_content: "Ceci est un exemple de contenu de l'aide ..."
}; };
//main function //main function
@ -23,6 +25,8 @@ function start(){
$("#wgt_edit").text(sankoreLang.edit); $("#wgt_edit").text(sankoreLang.edit);
$("#wgt_name").text(sankoreLang.wgt_name); $("#wgt_name").text(sankoreLang.wgt_name);
$("#wgt_reload").text(sankoreLang.reload); $("#wgt_reload").text(sankoreLang.reload);
$("#wgt_help").text(sankoreLang.help);
$("#help").html(sankoreLang.help_content);
$(".style_select option[value='1']").text(sankoreLang.slate); $(".style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad); $(".style_select option[value='2']").text(sankoreLang.pad);
$(".style_select option[value='3']").text(sankoreLang.none); $(".style_select option[value='3']").text(sankoreLang.none);
@ -50,8 +54,33 @@ function start(){
} }
} }
$("#wgt_help").click(function(){
var tmp = $(this);
if($(this).hasClass("open")){
$("#help").slideUp("100", function(){
tmp.removeClass("open");
$("#data").show();
});
} else {
$("#data").hide();
$("#help").slideDown("100", function(){
tmp.addClass("open");
});
}
});
$("#wgt_reload").click(function(){ $("#wgt_reload").click(function(){
window.location.reload(); if($("#wgt_display").hasClass("selected")){
$(".cont").each(function(){
var container = $(this);
container.find(".img_block, .text_block").each(function(){
$(this).find("input:checkbox").removeAttr("checked");
$(this).find("input:checkbox").parent().parent().removeClass("right");
});
});
}
else
$("#wgt_display").trigger("click");
}); });
$(".style_select").change(function (event){ $(".style_select").change(function (event){
@ -240,7 +269,7 @@ function exportData(){
tmp_block.src = $(this).find("source").attr("src").replace("../../",""); tmp_block.src = $(this).find("source").attr("src").replace("../../","");
tmp_block.hidden = $(this).parent().find("input:hidden").val(); tmp_block.hidden = $(this).parent().find("input:hidden").val();
tmp_block.type = "audio"; tmp_block.type = "audio";
tmp_block.checked = $(this).find("input:checkbox").attr("checked"); tmp_block.checked = $(this).parent().find("input:checkbox").attr("checked");
} }
if($(this).hasClass("text_block")){ if($(this).hasClass("text_block")){
tmp_block.text = $(this).find(".text_subblock").text(); tmp_block.text = $(this).find(".text_subblock").text();
@ -282,7 +311,10 @@ function importData(data){
var img_block = $("<div class='img_block' style='text-align: center;'></div>").insertBefore(imgs_container.find(".clear")); var img_block = $("<div class='img_block' style='text-align: center;'></div>").insertBefore(imgs_container.find(".clear"));
$("<input type='hidden' value='" + data[i].blocks[j].hidden + "'/>").appendTo(img_block); $("<input type='hidden' value='" + data[i].blocks[j].hidden + "'/>").appendTo(img_block);
$("<input type='checkbox' class='ch_box'/>").attr("checked",(data[i].blocks[j].state == "display")?((data[i].blocks[j].checked == "checked")?true:false):false).appendTo(img_block) $("<input type='checkbox' class='ch_box'/>").attr("checked",(data[i].blocks[j].state == "display")?((data[i].blocks[j].checked == "checked")?true:false):false).appendTo(img_block)
$("<img src=\"../../" + data[i].blocks[j].src + "\" width='" + data[i].blocks[j].w + "' height='" + data[i].blocks[j].h + "' style=\"display: inline;\"/>").appendTo(img_block); var img = $("<img src=\"../../" + data[i].blocks[j].src + "\" style=\"display: inline;\"/>").appendTo(img_block);
img.height(data[i].blocks[j].h);
if((120 - data[i].blocks[j].h) > 0)
img.css("margin",(120 - data[i].blocks[j].h)/2 + "px 0");
break; break;
case "audio": case "audio":
var img_tmp = $("<div class='img_block'>").insertBefore(imgs_container.find(".clear")); var img_tmp = $("<div class='img_block'>").insertBefore(imgs_container.find(".clear"));
@ -411,6 +443,7 @@ function changeStyle(val){
$(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back"); $(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back"); $(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back");
$("#wgt_reload").removeClass("pad_color").removeClass("pad_reload"); $("#wgt_reload").removeClass("pad_color").removeClass("pad_reload");
$("#wgt_help").removeClass("pad_color").removeClass("pad_help");
$("#wgt_edit").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_edit").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_display").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_display").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_name").removeClass("pad_color"); $("#wgt_name").removeClass("pad_color");
@ -427,6 +460,7 @@ function changeStyle(val){
$(".b_bottom_left").addClass("bbl_pad").removeClass("without_back"); $(".b_bottom_left").addClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").addClass("bbc_pad").removeClass("without_back"); $(".b_bottom_center").addClass("bbc_pad").removeClass("without_back");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); $("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); $("#wgt_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_name").addClass("pad_color"); $("#wgt_name").addClass("pad_color");
@ -442,6 +476,7 @@ function changeStyle(val){
$(".b_bottom_right").addClass("without_back").removeClass("bbr_pad"); $(".b_bottom_right").addClass("without_back").removeClass("bbr_pad");
$(".b_bottom_left").addClass("without_back").removeClass("bbl_pad"); $(".b_bottom_left").addClass("without_back").removeClass("bbl_pad");
$(".b_bottom_center").addClass("without_back").removeClass("bbc_pad"); $(".b_bottom_center").addClass("without_back").removeClass("bbc_pad");
$("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); $("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); $("#wgt_display").addClass("pad_color").addClass("pad_edit");
@ -484,6 +519,8 @@ function onDropTarget(obj, event) {
tmp_img.attr("height", "120"); tmp_img.attr("height", "120");
else{ else{
tmp_img.attr("width","120"); tmp_img.attr("width","120");
var h = tmp_img.height();
tmp_img.attr("height",h);
tmp_img.css("margin",(120 - tmp_img.height())/2 + "px 0"); tmp_img.css("margin",(120 - tmp_img.height())/2 + "px 0");
} }
}, 6); }, 6);

@ -22,6 +22,7 @@
<td class="b_top_left">&nbsp;</td> <td class="b_top_left">&nbsp;</td>
<td class="b_top_center"> <td class="b_top_center">
<div id="wgt_name"></div> <div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_reload"></div> <div id="wgt_reload"></div>
<div id="wgt_display" class="selected"></div> <div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div> <div id="wgt_edit"></div>
@ -37,6 +38,7 @@
<tr> <tr>
<td class="b_center_left">&nbsp;</td> <td class="b_center_left">&nbsp;</td>
<td> <td>
<div id="help"></div>
<div id="data"> <div id="data">
</div> </div>

@ -13,7 +13,9 @@ var sankoreLang = {
reload: "Обновить", reload: "Обновить",
slate: "Узор", slate: "Узор",
pad: "Планшет", pad: "Планшет",
none: "Нет" none: "Нет",
help: "Помощь",
help_content: "Пример текста помощи ..."
}; };
//main function //main function
@ -23,6 +25,8 @@ function start(){
$("#wgt_edit").text(sankoreLang.edit); $("#wgt_edit").text(sankoreLang.edit);
$("#wgt_name").text(sankoreLang.wgt_name); $("#wgt_name").text(sankoreLang.wgt_name);
$("#wgt_reload").text(sankoreLang.reload); $("#wgt_reload").text(sankoreLang.reload);
$("#wgt_help").text(sankoreLang.help);
$("#help").html(sankoreLang.help_content);
$(".style_select option[value='1']").text(sankoreLang.slate); $(".style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad); $(".style_select option[value='2']").text(sankoreLang.pad);
$(".style_select option[value='3']").text(sankoreLang.none); $(".style_select option[value='3']").text(sankoreLang.none);
@ -50,8 +54,33 @@ function start(){
} }
} }
$("#wgt_help").click(function(){
var tmp = $(this);
if($(this).hasClass("open")){
$("#help").slideUp("100", function(){
tmp.removeClass("open");
$("#data").show();
});
} else {
$("#data").hide();
$("#help").slideDown("100", function(){
tmp.addClass("open");
});
}
});
$("#wgt_reload").click(function(){ $("#wgt_reload").click(function(){
window.location.reload(); if($("#wgt_display").hasClass("selected")){
$(".cont").each(function(){
var container = $(this);
container.find(".img_block, .text_block").each(function(){
$(this).find("input:checkbox").removeAttr("checked");
$(this).find("input:checkbox").parent().parent().removeClass("right");
});
});
}
else
$("#wgt_display").trigger("click");
}); });
$(".style_select").change(function (event){ $(".style_select").change(function (event){
@ -209,6 +238,8 @@ function start(){
$(".close_img").live("click", function(){ $(".close_img").live("click", function(){
$(this).parent().remove(); $(this).parent().remove();
}); });
} }
//export //export
@ -238,7 +269,7 @@ function exportData(){
tmp_block.src = $(this).find("source").attr("src").replace("../../",""); tmp_block.src = $(this).find("source").attr("src").replace("../../","");
tmp_block.hidden = $(this).parent().find("input:hidden").val(); tmp_block.hidden = $(this).parent().find("input:hidden").val();
tmp_block.type = "audio"; tmp_block.type = "audio";
tmp_block.checked = $(this).find("input:checkbox").attr("checked"); tmp_block.checked = $(this).parent().find("input:checkbox").attr("checked");
} }
if($(this).hasClass("text_block")){ if($(this).hasClass("text_block")){
tmp_block.text = $(this).find(".text_subblock").text(); tmp_block.text = $(this).find(".text_subblock").text();
@ -280,7 +311,10 @@ function importData(data){
var img_block = $("<div class='img_block' style='text-align: center;'></div>").insertBefore(imgs_container.find(".clear")); var img_block = $("<div class='img_block' style='text-align: center;'></div>").insertBefore(imgs_container.find(".clear"));
$("<input type='hidden' value='" + data[i].blocks[j].hidden + "'/>").appendTo(img_block); $("<input type='hidden' value='" + data[i].blocks[j].hidden + "'/>").appendTo(img_block);
$("<input type='checkbox' class='ch_box'/>").attr("checked",(data[i].blocks[j].state == "display")?((data[i].blocks[j].checked == "checked")?true:false):false).appendTo(img_block) $("<input type='checkbox' class='ch_box'/>").attr("checked",(data[i].blocks[j].state == "display")?((data[i].blocks[j].checked == "checked")?true:false):false).appendTo(img_block)
$("<img src=\"../../" + data[i].blocks[j].src + "\" width='" + data[i].blocks[j].w + "' height='" + data[i].blocks[j].h + "' style=\"display: inline;\"/>").appendTo(img_block); var img = $("<img src=\"../../" + data[i].blocks[j].src + "\" style=\"display: inline;\"/>").appendTo(img_block);
img.height(data[i].blocks[j].h);
if((120 - data[i].blocks[j].h) > 0)
img.css("margin",(120 - data[i].blocks[j].h)/2 + "px 0");
break; break;
case "audio": case "audio":
var img_tmp = $("<div class='img_block'>").insertBefore(imgs_container.find(".clear")); var img_tmp = $("<div class='img_block'>").insertBefore(imgs_container.find(".clear"));
@ -409,6 +443,7 @@ function changeStyle(val){
$(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back"); $(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back"); $(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back");
$("#wgt_reload").removeClass("pad_color").removeClass("pad_reload"); $("#wgt_reload").removeClass("pad_color").removeClass("pad_reload");
$("#wgt_help").removeClass("pad_color").removeClass("pad_help");
$("#wgt_edit").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_edit").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_display").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_display").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_name").removeClass("pad_color"); $("#wgt_name").removeClass("pad_color");
@ -425,6 +460,7 @@ function changeStyle(val){
$(".b_bottom_left").addClass("bbl_pad").removeClass("without_back"); $(".b_bottom_left").addClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").addClass("bbc_pad").removeClass("without_back"); $(".b_bottom_center").addClass("bbc_pad").removeClass("without_back");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); $("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); $("#wgt_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_name").addClass("pad_color"); $("#wgt_name").addClass("pad_color");
@ -440,6 +476,7 @@ function changeStyle(val){
$(".b_bottom_right").addClass("without_back").removeClass("bbr_pad"); $(".b_bottom_right").addClass("without_back").removeClass("bbr_pad");
$(".b_bottom_left").addClass("without_back").removeClass("bbl_pad"); $(".b_bottom_left").addClass("without_back").removeClass("bbl_pad");
$(".b_bottom_center").addClass("without_back").removeClass("bbc_pad"); $(".b_bottom_center").addClass("without_back").removeClass("bbc_pad");
$("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); $("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); $("#wgt_display").addClass("pad_color").addClass("pad_edit");
@ -482,6 +519,8 @@ function onDropTarget(obj, event) {
tmp_img.attr("height", "120"); tmp_img.attr("height", "120");
else{ else{
tmp_img.attr("width","120"); tmp_img.attr("width","120");
var h = tmp_img.height();
tmp_img.attr("height",h);
tmp_img.css("margin",(120 - tmp_img.height())/2 + "px 0"); tmp_img.css("margin",(120 - tmp_img.height())/2 + "px 0");
} }
}, 6); }, 6);

@ -45,6 +45,7 @@
#include "board/UBBoardView.h" #include "board/UBBoardView.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "board/UBDrawingController.h" #include "board/UBDrawingController.h"
#include "board/UBBoardPaletteManager.h"
#include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBFileSystemUtils.h"
#include "frameworks/UBStringUtils.h" #include "frameworks/UBStringUtils.h"
@ -54,6 +55,9 @@
#include "core/UBPersistenceManager.h" #include "core/UBPersistenceManager.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "gui/UBTeacherGuideWidget.h"
#include "gui/UBDockTeacherGuideWidget.h"
#include "interfaces/IDataStorage.h" #include "interfaces/IDataStorage.h"
#include "document/UBDocumentContainer.h" #include "document/UBDocumentContainer.h"
@ -1142,7 +1146,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::writeSvgElement()
bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex) bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
{ {
if (mScene->isModified()) if (mScene->isModified() || (UBApplication::boardController->paletteManager()->teacherGuideDockWidget() && UBApplication::boardController->paletteManager()->teacherGuideDockWidget()->teacherGuideWidget()->isModified()))
{ {
//Creating dom structure to store information //Creating dom structure to store information

@ -38,6 +38,9 @@
#include "gui/UBToolWidget.h" #include "gui/UBToolWidget.h"
#include "gui/UBKeyboardPalette.h" #include "gui/UBKeyboardPalette.h"
#include "gui/UBMagnifer.h" #include "gui/UBMagnifer.h"
#include "gui/UBDockPaletteWidget.h"
#include "gui/UBDockTeacherGuideWidget.h"
#include "gui/UBTeacherGuideWidget.h"
#include "domain/UBGraphicsPixmapItem.h" #include "domain/UBGraphicsPixmapItem.h"
#include "domain/UBGraphicsItemUndoCommand.h" #include "domain/UBGraphicsItemUndoCommand.h"
@ -1464,7 +1467,10 @@ void UBBoardController::lastWindowClosed()
{ {
if (!mCleanupDone) if (!mCleanupDone)
{ {
if (selectedDocument()->pageCount() == 1 && (!mActiveScene || mActiveScene->isEmpty())) bool teacherGuideModified = false;
if(UBApplication::boardController->paletteManager()->teacherGuideDockWidget())
teacherGuideModified = UBApplication::boardController->paletteManager()->teacherGuideDockWidget()->teacherGuideWidget()->isModified();
if (selectedDocument()->pageCount() == 1 && (!mActiveScene || mActiveScene->isEmpty()) && !teacherGuideModified)
{ {
UBPersistenceManager::persistenceManager()->deleteDocument(selectedDocument()); UBPersistenceManager::persistenceManager()->deleteDocument(selectedDocument());
} }
@ -1591,7 +1597,7 @@ void UBBoardController::persistCurrentScene()
if(UBPersistenceManager::persistenceManager() if(UBPersistenceManager::persistenceManager()
&& selectedDocument() && mActiveScene && selectedDocument() && mActiveScene
&& (mActiveSceneIndex >= 0) && (mActiveSceneIndex >= 0)
&& mActiveScene->isModified()) && (mActiveScene->isModified() || (UBApplication::boardController->paletteManager()->teacherGuideDockWidget() && UBApplication::boardController->paletteManager()->teacherGuideDockWidget()->teacherGuideWidget()->isModified())))
{ {
emit activeSceneWillBePersisted(); emit activeSceneWillBePersisted();

@ -69,6 +69,8 @@ class UBBoardPaletteManager : public QObject
void setCurrentWebToolsPalette(UBWebToolsPalette *palette) {mWebToolsCurrentPalette = palette;} void setCurrentWebToolsPalette(UBWebToolsPalette *palette) {mWebToolsCurrentPalette = palette;}
UBWebToolsPalette* mWebToolsCurrentPalette; UBWebToolsPalette* mWebToolsCurrentPalette;
UBDockTeacherGuideWidget* teacherGuideDockWidget() { return mpTeacherGuideWidget;}
void processPalettersWidget(UBDockPalette *paletter, eUBDockPaletteWidgetMode mode); void processPalettersWidget(UBDockPalette *paletter, eUBDockPaletteWidgetMode mode);
void changeMode(eUBDockPaletteWidgetMode newMode, bool isInit = false); void changeMode(eUBDockPaletteWidgetMode newMode, bool isInit = false);
void startDownloads(); void startDownloads();

@ -40,6 +40,8 @@
#include "gui/UBScreenMirror.h" #include "gui/UBScreenMirror.h"
#include "gui/UBMainWindow.h" #include "gui/UBMainWindow.h"
#include "gui/UBDockTeacherGuideWidget.h"
#include "gui/UBTeacherGuideWidget.h"
#include "domain/UBGraphicsPixmapItem.h" #include "domain/UBGraphicsPixmapItem.h"
#include "domain/UBW3CWidget.h" #include "domain/UBW3CWidget.h"
@ -418,7 +420,7 @@ void UBApplicationController::showDocument()
if (UBApplication::boardController) if (UBApplication::boardController)
{ {
if (UBApplication::boardController->activeScene()->isModified()) if (UBApplication::boardController->activeScene()->isModified() || (UBApplication::boardController->paletteManager()->teacherGuideDockWidget() && UBApplication::boardController->paletteManager()->teacherGuideDockWidget()->teacherGuideWidget()->isModified()))
UBApplication::boardController->persistCurrentScene(); UBApplication::boardController->persistCurrentScene();
UBApplication::boardController->hide(); UBApplication::boardController->hide();
} }

@ -25,6 +25,9 @@
#include "core/UBSettings.h" #include "core/UBSettings.h"
#include "core/UBSetting.h" #include "core/UBSetting.h"
#include "gui/UBDockTeacherGuideWidget.h"
#include "gui/UBTeacherGuideWidget.h"
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
#include "adaptors/UBExportPDF.h" #include "adaptors/UBExportPDF.h"
@ -33,6 +36,7 @@
#include "adaptors/UBMetadataDcSubsetAdaptor.h" #include "adaptors/UBMetadataDcSubsetAdaptor.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "board/UBBoardPaletteManager.h"
#include "interfaces/IDataStorage.h" #include "interfaces/IDataStorage.h"
@ -591,7 +595,6 @@ UBGraphicsScene* UBPersistenceManager::loadDocumentScene(UBDocumentProxy* proxy,
} }
} }
void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy, UBGraphicsScene* pScene, const int pSceneIndex) void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy, UBGraphicsScene* pScene, const int pSceneIndex)
{ {
checkIfDocumentRepositoryExists(); checkIfDocumentRepositoryExists();
@ -603,10 +606,15 @@ void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy,
QDir dir(pDocumentProxy->persistencePath()); QDir dir(pDocumentProxy->persistencePath());
dir.mkpath(pDocumentProxy->persistencePath()); dir.mkpath(pDocumentProxy->persistencePath());
if (pDocumentProxy->isModified()) UBBoardPaletteManager* paletteManager = UBApplication::boardController->paletteManager();
bool teacherGuideModified = false;
if(paletteManager->teacherGuideDockWidget())
teacherGuideModified = paletteManager->teacherGuideDockWidget()->teacherGuideWidget()->isModified();
if (pDocumentProxy->isModified() || teacherGuideModified)
UBMetadataDcSubsetAdaptor::persist(pDocumentProxy); UBMetadataDcSubsetAdaptor::persist(pDocumentProxy);
if (pScene->isModified()) if (pScene->isModified() || teacherGuideModified)
{ {
UBSvgSubsetAdaptor::persistScene(pDocumentProxy, pScene, pSceneIndex); UBSvgSubsetAdaptor::persistScene(pDocumentProxy, pScene, pSceneIndex);

@ -1624,7 +1624,11 @@ void UBDocumentController::refreshDocumentThumbnailsView(UBDocumentContainer*)
} }
items << pixmapItem; items << pixmapItem;
labels << tr("Page %1").arg(pageFromSceneIndex(i)); int pageIndex = pageFromSceneIndex(i);
if(pageIndex)
labels << tr("Page %1").arg(pageIndex);
else
labels << tr("Title page");
itemsPath.append(QUrl::fromLocalFile(proxy->persistencePath() + QString("/pages/%1").arg(UBDocumentContainer::pageFromSceneIndex(i)))); itemsPath.append(QUrl::fromLocalFile(proxy->persistencePath() + QString("/pages/%1").arg(UBDocumentContainer::pageFromSceneIndex(i))));
} }

@ -44,3 +44,8 @@ UBDockTeacherGuideWidget::~UBDockTeacherGuideWidget()
DELETEPTR(mpTeacherGuideWidget); DELETEPTR(mpTeacherGuideWidget);
DELETEPTR(mpLayout); DELETEPTR(mpLayout);
} }
UBTeacherGuideWidget* UBDockTeacherGuideWidget::teacherGuideWidget()
{
return mpTeacherGuideWidget;
}

@ -31,6 +31,8 @@ public:
bool visibleInMode(eUBDockPaletteWidgetMode mode){ return mode == eUBDockPaletteWidget_BOARD; } bool visibleInMode(eUBDockPaletteWidgetMode mode){ return mode == eUBDockPaletteWidget_BOARD; }
UBTeacherGuideWidget* teacherGuideWidget();
private: private:
QVBoxLayout* mpLayout; QVBoxLayout* mpLayout;
UBTeacherGuideWidget* mpTeacherGuideWidget; UBTeacherGuideWidget* mpTeacherGuideWidget;

@ -86,7 +86,9 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
{ {
const QPixmap* pix = source->pageAt(i); const QPixmap* pix = source->pageAt(i);
UBSceneThumbnailNavigPixmap* pixmapItem = new UBSceneThumbnailNavigPixmap(*pix, source->selectedDocument(), i); UBSceneThumbnailNavigPixmap* pixmapItem = new UBSceneThumbnailNavigPixmap(*pix, source->selectedDocument(), i);
UBThumbnailTextItem *labelItem = new UBThumbnailTextItem(tr("Page %0").arg(UBDocumentContainer::pageFromSceneIndex(i))); int pageIndex = UBDocumentContainer::pageFromSceneIndex(i);
QString label = pageIndex == 0 ? tr("Title page") : tr("Page %0").arg(pageIndex);
UBThumbnailTextItem *labelItem = new UBThumbnailTextItem(label);
UBImgTextThumbnailElement thumbWithText(pixmapItem, labelItem); UBImgTextThumbnailElement thumbWithText(pixmapItem, labelItem);
thumbWithText.setBorder(border()); thumbWithText.setBorder(border());

@ -74,8 +74,6 @@ UBPageNavigationWidget::UBPageNavigationWidget(QWidget *parent, const char *name
mTimeFormat = mTimeFormat.remove(":s"); mTimeFormat = mTimeFormat.remove(":s");
mTimerID = startTimer(1000); mTimerID = startTimer(1000);
//connect(mNavigator, SIGNAL(changeCurrentPage()), this, SLOT(changeCurrentPage()));
//connect(UBApplication::boardController, SIGNAL(setDocOnPageNavigator(UBDocumentProxy*)), this, SLOT(onSetDocOnPageNavigator(UBDocumentProxy*)));
} }
/** /**

@ -49,16 +49,13 @@
#define UBTG_SEPARATOR_FIXED_HEIGHT 3 #define UBTG_SEPARATOR_FIXED_HEIGHT 3
typedef enum typedef enum {
{
eUBTGAddSubItemWidgetType_None, eUBTGAddSubItemWidgetType_None,
eUBTGAddSubItemWidgetType_Action, eUBTGAddSubItemWidgetType_Action,
eUBTGAddSubItemWidgetType_Media, eUBTGAddSubItemWidgetType_Media,
eUBTGAddSubItemWidgetType_Url eUBTGAddSubItemWidgetType_Url
} eUBTGAddSubItemWidgetType; } eUBTGAddSubItemWidgetType;
/*************************************************************************** /***************************************************************************
* class UBTeacherGuideEditionWidget * * class UBTeacherGuideEditionWidget *
***************************************************************************/ ***************************************************************************/
@ -108,6 +105,7 @@ UBTeacherGuideEditionWidget::UBTeacherGuideEditionWidget(QWidget *parent, const
mpLayout->addWidget(mpSeparator); mpLayout->addWidget(mpSeparator);
mpTreeWidget = new QTreeWidget(this); mpTreeWidget = new QTreeWidget(this);
mpTreeWidget->setStyleSheet("selection-background-color:transparent; padding-bottom:5px; padding-top:5px;");
mpLayout->addWidget(mpTreeWidget); mpLayout->addWidget(mpTreeWidget);
mpRootWidgetItem = mpTreeWidget->invisibleRootItem(); mpRootWidgetItem = mpTreeWidget->invisibleRootItem();
@ -121,6 +119,7 @@ UBTeacherGuideEditionWidget::UBTeacherGuideEditionWidget(QWidget *parent, const
mpTreeWidget->header()->setResizeMode(0, QHeaderView::Stretch); mpTreeWidget->header()->setResizeMode(0, QHeaderView::Stretch);
mpTreeWidget->header()->setResizeMode(1, QHeaderView::Fixed); mpTreeWidget->header()->setResizeMode(1, QHeaderView::Fixed);
mpTreeWidget->header()->setDefaultSectionSize(18); mpTreeWidget->header()->setDefaultSectionSize(18);
mpTreeWidget->setSelectionMode(QAbstractItemView::NoSelection);
connect(mpTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onAddItemClicked(QTreeWidgetItem*,int))); connect(mpTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onAddItemClicked(QTreeWidgetItem*,int)));
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged())); connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged()));
@ -135,7 +134,6 @@ UBTeacherGuideEditionWidget::UBTeacherGuideEditionWidget(QWidget *parent, const
if (UBSettings::settings()->teacherGuideLessonPagesActivated->get().toBool()) { if (UBSettings::settings()->teacherGuideLessonPagesActivated->get().toBool()) {
UBSvgSubsetAdaptor::addElementToBeStored(QString("teacherGuide"), this); UBSvgSubsetAdaptor::addElementToBeStored(QString("teacherGuide"), this);
//connect(UBApplication::boardController,SIGNAL(activeDocumentChanged()),this,SLOT(onActiveDocumentChanged()));
connect(UBApplication::boardController, SIGNAL(documentSet(UBDocumentProxy*)), this, SLOT(onActiveDocumentChanged())); connect(UBApplication::boardController, SIGNAL(documentSet(UBDocumentProxy*)), this, SLOT(onActiveDocumentChanged()));
} }
} }
@ -150,7 +148,7 @@ UBTeacherGuideEditionWidget::~UBTeacherGuideEditionWidget()
DELETEPTR(mpAddAnActionItem); DELETEPTR(mpAddAnActionItem);
DELETEPTR(mpAddAMediaItem); DELETEPTR(mpAddAMediaItem);
DELETEPTR(mpAddALinkItem); DELETEPTR(mpAddALinkItem);
DELETEPTR(mpTreeWidget) DELETEPTR(mpTreeWidget);
DELETEPTR(mpLayout); DELETEPTR(mpLayout);
} }
@ -173,7 +171,8 @@ void UBTeacherGuideEditionWidget::load(QString element)
QDomDocument doc("TeacherGuide"); QDomDocument doc("TeacherGuide");
doc.setContent(element); doc.setContent(element);
for(QDomElement element = doc.documentElement().firstChildElement(); !element.isNull(); element = element.nextSiblingElement()) { for (QDomElement element = doc.documentElement().firstChildElement();
!element.isNull(); element = element.nextSiblingElement()) {
QString tagName = element.tagName(); QString tagName = element.tagName();
if (tagName == "title") if (tagName == "title")
mpPageTitle->setInitialText(element.attribute("value")); mpPageTitle->setInitialText(element.attribute("value"));
@ -188,8 +187,6 @@ void UBTeacherGuideEditionWidget::load(QString element)
} }
} }
QVector<tIDataStorage*> UBTeacherGuideEditionWidget::save(int pageIndex) QVector<tIDataStorage*> UBTeacherGuideEditionWidget::save(int pageIndex)
{ {
QVector<tIDataStorage*> result; QVector<tIDataStorage*> result;
@ -198,16 +195,15 @@ QVector<tIDataStorage*> UBTeacherGuideEditionWidget::save(int pageIndex)
tIDataStorage* data = new tIDataStorage(); tIDataStorage* data = new tIDataStorage();
data->name = "teacherGuide"; data->name = "teacherGuide";
data->type = eElementType_START; data->type = eElementType_START;
data->attributes.insert("version","1.50"); data->attributes.insert("version", "2.00");
result << data; result << data;
data = new tIDataStorage(); data = new tIDataStorage();
data->name = "title"; data->name = "title";
data->type = eElementType_UNIQUE; data->type = eElementType_UNIQUE;
data->attributes.insert("value", mpPageTitle->text()); data->attributes.insert("value", mpPageTitle->text());
if(mpPageTitle->text().length()){ if (mpPageTitle->text().length())
result << data; result << data;
}
data = new tIDataStorage(); data = new tIDataStorage();
data->name = "comment"; data->name = "comment";
@ -312,23 +308,25 @@ void UBTeacherGuideEditionWidget::onAddItemClicked(QTreeWidgetItem* widget, int
newWidgetItem->setData(1, Qt::UserRole, eUBTGAddSubItemWidgetType_None); newWidgetItem->setData(1, Qt::UserRole, eUBTGAddSubItemWidgetType_None);
newWidgetItem->setIcon(1, QIcon(":images/close.svg")); newWidgetItem->setIcon(1, QIcon(":images/close.svg"));
switch(addSubItemWidgetType) switch (addSubItemWidgetType) {
{
case eUBTGAddSubItemWidgetType_Action: { case eUBTGAddSubItemWidgetType_Action: {
UBTGActionWidget* actionWidget = new UBTGActionWidget(widget); UBTGActionWidget* actionWidget = new UBTGActionWidget(widget);
if(element) actionWidget->initializeWithDom(*element); if (element)
actionWidget->initializeWithDom(*element);
mpTreeWidget->setItemWidget(newWidgetItem, 0, actionWidget); mpTreeWidget->setItemWidget(newWidgetItem, 0, actionWidget);
break; break;
} }
case eUBTGAddSubItemWidgetType_Media: { case eUBTGAddSubItemWidgetType_Media: {
UBTGMediaWidget* mediaWidget = new UBTGMediaWidget(widget); UBTGMediaWidget* mediaWidget = new UBTGMediaWidget(widget);
if(element) mediaWidget->initializeWithDom(*element); if (element)
mediaWidget->initializeWithDom(*element);
mpTreeWidget->setItemWidget(newWidgetItem, 0, mediaWidget); mpTreeWidget->setItemWidget(newWidgetItem, 0, mediaWidget);
break; break;
} }
case eUBTGAddSubItemWidgetType_Url: { case eUBTGAddSubItemWidgetType_Url: {
UBTGUrlWidget* urlWidget = new UBTGUrlWidget(); UBTGUrlWidget* urlWidget = new UBTGUrlWidget();
if(element) urlWidget->initializeWithDom(*element); if (element)
urlWidget->initializeWithDom(*element);
mpTreeWidget->setItemWidget(newWidgetItem, 0, urlWidget); mpTreeWidget->setItemWidget(newWidgetItem, 0, urlWidget);
break; break;
} }
@ -348,32 +346,42 @@ void UBTeacherGuideEditionWidget::onAddItemClicked(QTreeWidgetItem* widget, int
} }
else if (column == 1 && addSubItemWidgetType == eUBTGAddSubItemWidgetType_None) { else if (column == 1 && addSubItemWidgetType == eUBTGAddSubItemWidgetType_None) {
UBTGMediaWidget* media = dynamic_cast<UBTGMediaWidget*>(mpTreeWidget->itemWidget(widget, 0)); UBTGMediaWidget* media = dynamic_cast<UBTGMediaWidget*>(mpTreeWidget->itemWidget(widget, 0));
if(media) media->removeSource(); if (media)
media->removeSource();
int index = mpTreeWidget->currentIndex().row(); int index = mpTreeWidget->currentIndex().row();
QTreeWidgetItem* toBeDeletedWidgetItem = widget->parent()->takeChild(index); QTreeWidgetItem* toBeDeletedWidgetItem = widget->parent()->takeChild(index);
delete toBeDeletedWidgetItem; delete toBeDeletedWidgetItem;
} }
} }
bool UBTeacherGuideEditionWidget::isModified()
{
bool result = false;
result |= mpPageTitle->text().length() > 0;
result |= mpComment->text().length() > 0;
result |= mpAddAnActionItem->childCount() > 0;
result |= mpAddAMediaItem->childCount() > 0;
result |= mpAddALinkItem->childCount() > 0;
return result;
}
/*************************************************************************** /***************************************************************************
* class UBTeacherGuidePresentationWidget * * class UBTeacherGuidePresentationWidget *
***************************************************************************/ ***************************************************************************/
typedef enum typedef enum {
{
tUBTGActionAssociateOnClickItem_NONE, tUBTGActionAssociateOnClickItem_NONE,
tUBTGActionAssociateOnClickItem_URL, tUBTGActionAssociateOnClickItem_URL,
tUBTGActionAssociateOnClickItem_MEDIA, tUBTGActionAssociateOnClickItem_MEDIA,
tUBTGActionAssociateOnClickItem_EXPAND tUBTGActionAssociateOnClickItem_EXPAND
} tUBTGActionAssociateOnClickItem; } tUBTGActionAssociateOnClickItem;
typedef enum typedef enum {
{
tUBTGTreeWidgetItemRole_HasAnAction = Qt::UserRole, tUBTGTreeWidgetItemRole_HasAnAction = Qt::UserRole,
tUBTGTreeWidgetItemRole_HasAnUrl tUBTGTreeWidgetItemRole_HasAnUrl
} tUBTGTreeWidgetItemRole; } tUBTGTreeWidgetItemRole;
UBTeacherGuidePresentationWidget::UBTeacherGuidePresentationWidget(QWidget *parent, const char *name) :
UBTeacherGuidePresentationWidget::UBTeacherGuidePresentationWidget(QWidget *parent, const char *name) : QWidget(parent) QWidget(parent)
, mpPageTitle(NULL) , mpPageTitle(NULL)
, mpComment(NULL) , mpComment(NULL)
, mpLayout(NULL) , mpLayout(NULL)
@ -435,12 +443,14 @@ UBTeacherGuidePresentationWidget::UBTeacherGuidePresentationWidget(QWidget *pare
mpLayout->addWidget(mpTreeWidget); mpLayout->addWidget(mpTreeWidget);
mpRootWidgetItem = mpTreeWidget->invisibleRootItem(); mpRootWidgetItem = mpTreeWidget->invisibleRootItem();
mpTreeWidget->setSelectionMode(QAbstractItemView::NoSelection);
mpTreeWidget->setDragEnabled(true); mpTreeWidget->setDragEnabled(true);
mpTreeWidget->setRootIsDecorated(false); mpTreeWidget->setRootIsDecorated(false);
mpTreeWidget->setIndentation(0); mpTreeWidget->setIndentation(0);
mpTreeWidget->setDropIndicatorShown(false); mpTreeWidget->setDropIndicatorShown(false);
mpTreeWidget->header()->close(); mpTreeWidget->header()->close();
mpTreeWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); mpTreeWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
mpTreeWidget->setStyleSheet("selection-background-color:transparent; padding-bottom:5px; padding-top:5px; ");
connect(mpTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onAddItemClicked(QTreeWidgetItem*,int))); connect(mpTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onAddItemClicked(QTreeWidgetItem*,int)));
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged())); connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged()));
} }
@ -503,7 +513,6 @@ void UBTeacherGuidePresentationWidget::createMediaButtonItem()
} }
} }
void UBTeacherGuidePresentationWidget::showData( QVector<tUBGEElementNode*> data) void UBTeacherGuidePresentationWidget::showData( QVector<tUBGEElementNode*> data)
{ {
cleanData(); cleanData();
@ -566,10 +575,10 @@ void UBTeacherGuidePresentationWidget::showData(QVector<tUBGEElementNode*> data)
void UBTeacherGuidePresentationWidget::onAddItemClicked(QTreeWidgetItem* widget, int column) void UBTeacherGuidePresentationWidget::onAddItemClicked(QTreeWidgetItem* widget, int column)
{ {
int associateAction = widget->data(column,tUBTGTreeWidgetItemRole_HasAnAction).toInt(); int associateAction = widget->data(column,
tUBTGTreeWidgetItemRole_HasAnAction).toInt();
if (column == 0 && associateAction != tUBTGActionAssociateOnClickItem_NONE) { if (column == 0 && associateAction != tUBTGActionAssociateOnClickItem_NONE) {
switch(associateAction) switch (associateAction) {
{
case tUBTGActionAssociateOnClickItem_EXPAND: case tUBTGActionAssociateOnClickItem_EXPAND:
widget->setExpanded(!widget->isExpanded()); widget->setExpanded(!widget->isExpanded());
if (widget->isExpanded()) if (widget->isExpanded())
@ -590,11 +599,11 @@ void UBTeacherGuidePresentationWidget::onAddItemClicked(QTreeWidgetItem* widget,
} }
} }
/*************************************************************************** /***************************************************************************
* class UBTeacherGuidePageZeroEditionWidget * * class UBTeacherGuidePageZeroWidget *
***************************************************************************/ ***************************************************************************/
UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, const char* name): QWidget(parent) UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, const char* name) :
QWidget(parent)
, mpLayout(NULL) , mpLayout(NULL)
, mpButtonTitleLayout(NULL) , mpButtonTitleLayout(NULL)
, mpModePushButton(NULL) , mpModePushButton(NULL)
@ -635,7 +644,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpPageNumberLabel = new QLabel(this); mpPageNumberLabel = new QLabel(this);
mpPageNumberLabel->setAlignment(Qt::AlignRight); mpPageNumberLabel->setAlignment(Qt::AlignRight);
mpPageNumberLabel->setObjectName("UBTGPageNumberLabel"); mpPageNumberLabel->setObjectName("UBTGPageNumberLabel");
mpPageNumberLabel->setText(tr("Page 0")); mpPageNumberLabel->setText(tr("Title page"));
mpLayout->addWidget(mpPageNumberLabel); mpLayout->addWidget(mpPageNumberLabel);
mpButtonTitleLayout = new QHBoxLayout(0); mpButtonTitleLayout = new QHBoxLayout(0);
@ -772,7 +781,6 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpLayout->addLayout(mpLicenceLayout); mpLayout->addLayout(mpLicenceLayout);
mpLayout->addStretch(1); mpLayout->addStretch(1);
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged())); connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged()));
fillComboBoxes(); fillComboBoxes();
} }
@ -850,7 +858,6 @@ void UBTeacherGuidePageZeroWidget::fillComboBoxes()
mpSchoolLevelBox->addItem( gradeLevels.at(i).toElement().attribute("label")); mpSchoolLevelBox->addItem( gradeLevels.at(i).toElement().attribute("label"));
} }
QDomNodeList types = rootElement.elementsByTagName("types").at(0).childNodes(); QDomNodeList types = rootElement.elementsByTagName("types").at(0).childNodes();
for (int i = 0; i < types.count(); i += 1) for (int i = 0; i < types.count(); i += 1)
mpSchoolTypeBox->addItem(types.at(i).toElement().attribute("label")); mpSchoolTypeBox->addItem(types.at(i).toElement().attribute("label"));
@ -858,10 +865,18 @@ void UBTeacherGuidePageZeroWidget::fillComboBoxes()
parametersFile.close(); parametersFile.close();
QStringList licences; QStringList licences;
licences << tr("Attribution CC BY") << tr("Attribution-NoDerivs CC BY-ND") << tr("Attribution-ShareAlike CC BY-SA") << tr("Attribution-NonCommercial CC BY-NC") << tr("Attribution-NonCommercial-NoDerivs CC BY-NC-ND") << tr("Attribution-NonCommercial-ShareAlike CC BY-NC-SA") << tr("Public domain") << tr("Copyright"); licences << tr("Attribution CC BY") << tr("Attribution-NoDerivs CC BY-ND")
<< tr("Attribution-ShareAlike CC BY-SA")
<< tr("Attribution-NonCommercial CC BY-NC")
<< tr("Attribution-NonCommercial-NoDerivs CC BY-NC-ND")
<< tr("Attribution-NonCommercial-ShareAlike CC BY-NC-SA")
<< tr("Public domain") << tr("Copyright");
mpLicenceBox->addItems(licences); mpLicenceBox->addItems(licences);
QStringList licenceIconList; QStringList licenceIconList;
licenceIconList << ":images/licenses/ccby.png" << ":images/licenses/ccbynd.png" << ":images/licenses/ccbysa.png" << ":images/licenses/ccbync.png" << ":images/licenses/ccbyncnd.png" << ":images/licenses/ccbyncsa.png"; licenceIconList << ":images/licenses/ccby.png"
<< ":images/licenses/ccbynd.png" << ":images/licenses/ccbysa.png"
<< ":images/licenses/ccbync.png" << ":images/licenses/ccbyncnd.png"
<< ":images/licenses/ccbyncsa.png";
for (int i = 0; i < licenceIconList.count(); i += 1) for (int i = 0; i < licenceIconList.count(); i += 1)
mpLicenceBox->setItemData(i, licenceIconList.at(i)); mpLicenceBox->setItemData(i, licenceIconList.at(i));
} }
@ -874,8 +889,7 @@ void UBTeacherGuidePageZeroWidget::onSchoolLevelChanged(QString schoolLevel)
mpSchoolSubjectsItemLabel->setEnabled(true); mpSchoolSubjectsItemLabel->setEnabled(true);
mpSchoolSubjectsBox->setEnabled(true); mpSchoolSubjectsBox->setEnabled(true);
mpSchoolSubjectsBox->addItems(subjects); mpSchoolSubjectsBox->addItems(subjects);
} } else {
else{
mpSchoolSubjectsItemLabel->setDisabled(true); mpSchoolSubjectsItemLabel->setDisabled(true);
mpSchoolSubjectsBox->setDisabled(true); mpSchoolSubjectsBox->setDisabled(true);
} }
@ -1064,10 +1078,25 @@ QVector<tUBGEElementNode*> UBTeacherGuidePageZeroWidget::getData()
return result; return result;
} }
bool UBTeacherGuidePageZeroWidget::isModified()
{
bool result = false;
result |= mpSessionTitle->text().length() > 0;
result |= mpAuthors->text().length() > 0;
result |= mpObjectives->text().length() > 0;
result |= mpKeywords->text().length() > 0;
result |= mpSchoolLevelBox->currentIndex() > 0;
result |= mpSchoolSubjectsBox->currentIndex() > 0;
result |= mpSchoolTypeBox->currentIndex() > 0;
result |= mpLicenceBox->currentIndex() > 0;
return result;
}
/*************************************************************************** /***************************************************************************
* class UBTeacherGuideWidget * * class UBTeacherGuideWidget *
***************************************************************************/ ***************************************************************************/
UBTeacherGuideWidget::UBTeacherGuideWidget(QWidget* parent, const char* name): QStackedWidget(parent) UBTeacherGuideWidget::UBTeacherGuideWidget(QWidget* parent, const char* name) :
QStackedWidget(parent)
, mpPageZeroWidget(NULL) , mpPageZeroWidget(NULL)
, mpEditionWidget(NULL) , mpEditionWidget(NULL)
, mpPresentationWidget(NULL) , mpPresentationWidget(NULL)
@ -1084,12 +1113,13 @@ UBTeacherGuideWidget::UBTeacherGuideWidget(QWidget* parent, const char* name): Q
addWidget(mpPresentationWidget); addWidget(mpPresentationWidget);
} }
connect(UBApplication::boardController->controlView(),SIGNAL(clickOnBoard()),this,SLOT(showPresentationMode())); connect(UBApplication::boardController->controlView(),
SIGNAL(clickOnBoard()), this, SLOT(showPresentationMode()));
connectToStylusPalette(); connectToStylusPalette();
connect(UBApplication::boardController,SIGNAL(activeSceneChanged()),this,SLOT(onActiveSceneChanged())); connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this,
SLOT(onActiveSceneChanged()));
} }
UBTeacherGuideWidget::~UBTeacherGuideWidget() UBTeacherGuideWidget::~UBTeacherGuideWidget()
{ {
DELETEPTR(mpPageZeroWidget); DELETEPTR(mpPageZeroWidget);
@ -1097,13 +1127,13 @@ UBTeacherGuideWidget::~UBTeacherGuideWidget()
DELETEPTR(mpPresentationWidget); DELETEPTR(mpPresentationWidget);
} }
void UBTeacherGuideWidget::onActiveSceneChanged() void UBTeacherGuideWidget::onActiveSceneChanged()
{ {
if (UBApplication::boardController->currentPage() == 0) { if (UBApplication::boardController->currentPage() == 0) {
setCurrentWidget(mpPageZeroWidget); setCurrentWidget(mpPageZeroWidget);
mpPageZeroWidget->switchToMode(tUBTGZeroPageMode_EDITION); mpPageZeroWidget->switchToMode(tUBTGZeroPageMode_EDITION);
}else }
else
setCurrentWidget(mpEditionWidget); setCurrentWidget(mpEditionWidget);
} }
@ -1137,3 +1167,11 @@ void UBTeacherGuideWidget::changeMode()
setCurrentWidget(mpEditionWidget); setCurrentWidget(mpEditionWidget);
} }
bool UBTeacherGuideWidget::isModified()
{
if (currentWidget() == mpPageZeroWidget)
return mpPageZeroWidget->isModified();
else
return mpEditionWidget->isModified();
}

@ -50,6 +50,8 @@ public:
void load(QString element); void load(QString element);
QVector<tIDataStorage*> save(int pageIndex); QVector<tIDataStorage*> save(int pageIndex);
bool isModified();
public slots: public slots:
void onAddItemClicked(QTreeWidgetItem* widget, int column, QDomElement* element = 0); void onAddItemClicked(QTreeWidgetItem* widget, int column, QDomElement* element = 0);
void onActiveSceneChanged(); void onActiveSceneChanged();
@ -124,6 +126,7 @@ public:
~UBTeacherGuidePageZeroWidget(); ~UBTeacherGuidePageZeroWidget();
QVector<tUBGEElementNode*> getData(); QVector<tUBGEElementNode*> getData();
bool isModified();
public slots: public slots:
@ -198,6 +201,8 @@ public:
explicit UBTeacherGuideWidget(QWidget* parent = 0, const char* name="UBTeacherGuideWidget"); explicit UBTeacherGuideWidget(QWidget* parent = 0, const char* name="UBTeacherGuideWidget");
~UBTeacherGuideWidget(); ~UBTeacherGuideWidget();
bool isModified();
public slots: public slots:
void changeMode(); void changeMode();
void showPresentationMode(); void showPresentationMode();

Loading…
Cancel
Save