Merge branch 'master' into widget_fix

preferencesAboutTextFull
Yimgo 13 years ago
commit 23bf38edda
  1. BIN
      JournalDesModifications.pdf
  2. BIN
      ReleaseNotes.pdf
  3. 26
      buildDebianPackage
  4. 23
      buildDebianPackageQmake-Qt4
  5. 7
      resources/customizations/teacherGuide/indexingParameters.xml
  6. 5
      resources/etc/Uniboard.css
  7. 8
      resources/library/interactivities/Ass sons.wgt/js/script.js
  8. 10
      resources/library/interactivities/Ass sons.wgt/locales/fr/js/script.js
  9. 10
      resources/library/interactivities/Ass sons.wgt/locales/ru/js/script.js
  10. 32
      resources/library/interactivities/Etudier.wgt/css/basic.css
  11. 2
      resources/library/interactivities/Etudier.wgt/index.html
  12. 67
      resources/library/interactivities/Etudier.wgt/js/script.js
  13. 2
      resources/library/interactivities/Etudier.wgt/locales/fr/index.html
  14. 67
      resources/library/interactivities/Etudier.wgt/locales/fr/js/script.js
  15. 2
      resources/library/interactivities/Etudier.wgt/locales/ru/index.html
  16. 67
      resources/library/interactivities/Etudier.wgt/locales/ru/js/script.js
  17. 13
      resources/style.qss
  18. 2
      src/adaptors/UBImportPDF.cpp
  19. 6
      src/adaptors/UBSvgSubsetAdaptor.cpp
  20. 10
      src/board/UBBoardController.cpp
  21. 6
      src/board/UBBoardPaletteManager.cpp
  22. 6
      src/board/UBBoardPaletteManager.h
  23. 2
      src/board/UBBoardView.h
  24. 4
      src/board/UBDrawingController.h
  25. 311
      src/board/UBFeaturesController.cpp
  26. 87
      src/board/UBFeaturesController.h
  27. 17
      src/core/UBApplicationController.cpp
  28. 14
      src/core/UBPersistenceManager.cpp
  29. 4
      src/core/UBSetting.cpp
  30. 1
      src/core/UBSetting.h
  31. 2
      src/core/UBSettings.cpp
  32. 2
      src/core/UBSettings.h
  33. 3
      src/desktop/UBDesktopAnnotationController.cpp
  34. 6
      src/document/UBDocumentController.cpp
  35. 33
      src/domain/UBGraphicsDelegateFrame.cpp
  36. 2
      src/domain/UBGraphicsDelegateFrame.h
  37. 7
      src/domain/UBGraphicsItemDelegate.cpp
  38. 3
      src/domain/UBGraphicsItemDelegate.h
  39. 17
      src/domain/UBGraphicsMediaItem.cpp
  40. 62
      src/domain/UBGraphicsMediaItem.h
  41. 40
      src/domain/UBGraphicsMediaItemDelegate.cpp
  42. 26
      src/domain/UBGraphicsProxyWidget.cpp
  43. 14
      src/domain/UBGraphicsScene.cpp
  44. 13
      src/frameworks/UBFileSystemUtils.cpp
  45. 6
      src/frameworks/UBFileSystemUtils.h
  46. 1
      src/gui/UBActionPalette.cpp
  47. 1
      src/gui/UBActionPalette.h
  48. 5
      src/gui/UBDockTeacherGuideWidget.cpp
  49. 2
      src/gui/UBDockTeacherGuideWidget.h
  50. 4
      src/gui/UBDocumentNavigator.cpp
  51. 69
      src/gui/UBFeaturesActionBar.cpp
  52. 20
      src/gui/UBFeaturesActionBar.h
  53. 761
      src/gui/UBFeaturesWidget.cpp
  54. 120
      src/gui/UBFeaturesWidget.h
  55. 2
      src/gui/UBPageNavigationWidget.cpp
  56. 2
      src/gui/UBRubberBand.cpp
  57. 155
      src/gui/UBTeacherGuideWidget.cpp
  58. 10
      src/gui/UBTeacherGuideWidget.h
  59. 2
      src/web/UBWebController.cpp

Binary file not shown.

Binary file not shown.

@ -15,12 +15,19 @@
# ---------------------------------------------------------------------
MAKE_TAG=true
CREATE_DIENA_DISTRIBUTION_ZIP=false
if [ $# == "1" ]; then
if [ $1 == "notag" ]; then
for var in "$@"
do
if [ $var == "notag" ]; then
MAKE_TAG=false;
fi
if [ $var == "diena" ]; then
CREATE_DIENA_DISTRIBUTION_ZIP=true;
fi
done
notifyError(){
notify-send -t 0 "Error occoured" "An error occours during the sankore build:\n\t$1" -i /usr/share/icons/oxygen/64x64/status/dialog-error.png
@ -39,7 +46,6 @@ alertIfPreviousVersionInstalled(){
fi
}
alertIfPreviousVersionInstalled
@ -318,11 +324,23 @@ chmod 755 "$BASE_WORKING_DIR/DEBIAN/prerm"
chmod 755 "$BASE_WORKING_DIR/DEBIAN/postint"
mkdir -p "install/linux"
DEBIAN_PACKAGE_NAME="Open-Sankore_${VERSION}_$ARCHITECTURE.deb"
fakeroot chown -R root:root $BASE_WORKING_DIR
dpkg -b "$BASE_WORKING_DIR" install/linux/Open-Sankore_${VERSION}_$ARCHITECTURE.deb
dpkg -b "$BASE_WORKING_DIR" "install/linux/$DEBIAN_PACKAGE_NAME"
notify-send "Open-Sankore" "Package built"
#clean up mess
fakeroot rm -rf $BASE_WORKING_DIR
if [ $CREATE_DIENA_DISTRIBUTION_ZIP == true ]; then
ZIP_NAME="Open-Sankoré_`lsb_release -is`_`lsb_release -rs`_${VERSION}_${ARCHITECTURE}.zip"
cd install/linux
`which zip` -1 --junk-paths ${ZIP_NAME} ${DEBIAN_PACKAGE_NAME} ../../ReleaseNotes.pdf ../../JournalDesModifications.pdf
cd -
notify-send "Open-Sankore" "Build Diena zip file for distribution"
fi

@ -21,13 +21,18 @@ notifyError(){
}
MAKE_TAG=true
CREATE_DIENA_DISTRIBUTION_ZIP=false
if [ $# == "1" ]; then
if [ $1 == "notag" ]; then
for var in "$@"
do
if [ $var == "notag" ]; then
MAKE_TAG=false;
fi
if [ $var == "diena" ]; then
CREATE_DIENA_DISTRIBUTION_ZIP=true;
fi
done
alertIfPreviousVersionInstalled(){
APT_CACHE=`which apt-cache`
@ -320,11 +325,21 @@ chmod 755 "$BASE_WORKING_DIR/DEBIAN/prerm"
chmod 755 "$BASE_WORKING_DIR/DEBIAN/postint"
mkdir -p "install/linux"
DEBIAN_PACKAGE_NAME="Open-Sankore_${VERSION}_$ARCHITECTURE.deb"
fakeroot chown -R root:root $BASE_WORKING_DIR
dpkg -b "$BASE_WORKING_DIR" install/linux/Open-Sankore_${VERSION}_$ARCHITECTURE.deb
dpkg -b "$BASE_WORKING_DIR" "install/linux/$DEBIAN_PACKAGE_NAME"
notify-send "Open-Sankore" "Package built"
#clean up mess
fakeroot rm -rf $BASE_WORKING_DIR
if [ $CREATE_DIENA_DISTRIBUTION_ZIP == true ]; then
ZIP_NAME="Open-Sankoré_`lsb_release -is`_`lsb_release -rs`_${VERSION}_${ARCHITECTURE}.zip"
cd install/linux
`which zip` -1 --junk-paths ${ZIP_NAME} ${DEBIAN_PACKAGE_NAME} ../../ReleaseNotes.pdf ../../JournalDesModifications.pdf
cd -
notify-send "Open-Sankore" "Build Diena zip file for distribution"
fi

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

@ -1,4 +1,9 @@
*
{
color: #3F3F3F;
}
QMainWindow
{
background-color: #F1F1F1;
}

@ -700,11 +700,11 @@ function addContainer(){
var close = $("<div class='close_cont'>").appendTo(container);
var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").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);
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='replay'>").appendTo(audio_block);
var source = $("<source/>").attr("src", "");

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

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

@ -4,6 +4,7 @@ html, body{
margin: 0;
padding: 0;
border-radius: 50px;
overflow: hidden;
}
body{
@ -212,6 +213,7 @@ li>div{
.real_text{
width: 100%;
height: 100%;
word-wrap: break-word;
}
.block_border{
@ -357,7 +359,6 @@ li>div{
#wgt_name{
height: 44px;
width: 200px;
margin: 10px 10px 0 10px;
padding: 0;
float: left;
@ -366,9 +367,8 @@ li>div{
color: #8c5730;
}
#wgt_reload, #wgt_edit, #wgt_display{
#wgt_reload, #wgt_edit, #wgt_display, #wgt_help{
cursor: pointer;
width: 80px;
height: 44px;
margin: 10px 10px 0 0;
float: right;
@ -378,7 +378,6 @@ li>div{
}
#wgt_display{
width: 100px;
padding-left: 40px;
background-image: url(../img/slate-edit.png);
background-repeat: no-repeat;
@ -387,7 +386,6 @@ li>div{
}
#wgt_edit{
width: 100px;
padding-left: 40px;
background-image: url(../img/slate-edit.png);
background-repeat: no-repeat;
@ -480,3 +478,27 @@ li>div{
color: white !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 0 5px 5px;
}
.open{
}

@ -49,6 +49,7 @@
<td class="b_top_left">&nbsp;</td>
<td class="b_top_center">
<div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div>
<select class="style_select">
@ -63,6 +64,7 @@
<tr>
<td class="b_center_left">&nbsp;</td>
<td>
<div id="help"></div>
<div id="slider">
<ul>
</ul>

@ -7,7 +7,9 @@ var sankoreLang = {
wgt_name: "Slider",
slate: "Wood",
pad: "Pad",
none: "None"
none: "None",
help: "Help",
help_content: "This is an example of help content ..."
};
//some flags
@ -27,6 +29,8 @@ function start(){
$("#wgt_display").text(sankoreLang.display);
$("#wgt_edit").text(sankoreLang.edit);
$("#wgt_name").text(sankoreLang.wgt_name);
$("#wgt_help").text(sankoreLang.help);
$("#help").html(sankoreLang.help_content);
$(".style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad);
$(".style_select option[value='3']").text(sankoreLang.none);
@ -50,6 +54,7 @@ function start(){
//events
if (window.widget) {
window.widget.onleave = function(){
if(!$("#wgt_help").hasClass("open")){
exportData();
sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val());
sankore.setPreference("etudier_cur_page", $("#slider").getPage());
@ -57,11 +62,30 @@ function start(){
sankore.setPreference("etudier_right_nav", $("#nextBtn a").css("display"));
}
}
}
$(".style_select").change(function (event){
changeStyle($(this).find("option:selected").val());
})
$("#wgt_help").click(function(){
var tmp = $(this);
if($(this).hasClass("open")){
$("#help").hide();
tmp.removeClass("open");
$("#slider").show();
} else {
exportData();
sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val());
sankore.setPreference("etudier_cur_page", $("#slider").getPage());
sankore.setPreference("etudier_left_nav", $("#prevBtn a").css("display"));
sankore.setPreference("etudier_right_nav", $("#nextBtn a").css("display"));
$("#slider").hide();
$("#help").show();
tmp.addClass("open");
}
});
$("#wgt_display, #wgt_edit").click(function(event){
if(this.id == "wgt_display"){
if(!$(this).hasClass("selected")){
@ -124,9 +148,9 @@ function start(){
$("#slider li>div").each(function(){
var container = $(this);
container.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;")
.attr("ondragleave", "$(this).css(\"background\",\"none\"); return false;")
.attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;")
.attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);");
.attr("ondrop", "$(this).css(\"background\",\"none\"); return onDropTarget(this,event);");
container.find(".text_block").each(function(){
$(this).draggable("destroy");
@ -156,6 +180,7 @@ function start(){
$("<div class='add_right'>").appendTo(container);
$("<div class='close_slide'>").appendTo(container);
$("<div class='add_text'>").appendTo(container);
$(window).trigger("resize")
});
$(this).css("display", "none");
$("#wgt_display").css("display", "block");
@ -266,13 +291,13 @@ function start(){
if(resize_obj.clicked){
if(resize_obj.object.parent().hasClass("text_block")){
var width = resize_obj.object.parent().width() - resize_obj.left + event.clientX;
var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
//var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
resize_obj.left = event.clientX;
resize_obj.top = event.clientY;
resize_obj.object.parent().width(width).height(height);
resize_obj.object.parent().width(width).height("");
} else {
width = resize_obj.object.parent().width() - resize_obj.left + event.clientX;
height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
var img_width = resize_obj.object.parent().find("img").width() - resize_obj.left + event.clientX;
var img_height = resize_obj.object.parent().find("img").height() - resize_obj.top + event.clientY;
resize_obj.left = event.clientX;
@ -296,12 +321,15 @@ function start(){
new_li.width(cur_li.width()).height(cur_li.height()).css("float","left");
var new_div = $("<div>").appendTo(new_li);
new_div.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"\"); return false;")
.attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;")
.attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' contenteditable='true'>" + sankoreLang.new_slide + "</div>").addClass("block_border");
.attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' style='position: absolute;'>").addClass("block_border");
$("<div class='real_text' contenteditable='true'>" + sankoreLang.new_slide + "</div>").appendTo(example);
$("<div class='move_block' contenteditable='false'>").appendTo(example);
$("<div class='close_img' contenteditable='false'>").appendTo(example);
$("<div class='size_up' contenteditable='false'>").appendTo(example);
$("<div class='size_down' contenteditable='false'>").appendTo(example);
$("<div class='resize_block' contenteditable='false'>").appendTo(example);
example.css("top","40%").css("left","40%");
new_div.append(example);
@ -319,12 +347,15 @@ function start(){
new_li.width(cur_li.width()).height(cur_li.height()).css("float","left");
var new_div = $("<div>").appendTo(new_li);
new_div.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"\"); return false;")
.attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;")
.attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' contenteditable='true'>" + sankoreLang.new_slide + "</div>").addClass("block_border");
.attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' style='position: absolute;'>").addClass("block_border");
$("<div class='real_text' contenteditable='true'>" + sankoreLang.new_slide + "</div>").appendTo(example);
$("<div class='move_block' contenteditable='false'>").appendTo(example);
$("<div class='close_img' contenteditable='false'>").appendTo(example);
$("<div class='size_up' contenteditable='false'>").appendTo(example);
$("<div class='size_down' contenteditable='false'>").appendTo(example);
$("<div class='resize_block' contenteditable='false'>").appendTo(example);
example.css("top","40%").css("left","40%");
new_div.append(example);
@ -360,7 +391,6 @@ function exportData(){
var txt_block = new Object();
txt_block.top = $(this).position().top;
txt_block.left = $(this).position().left;
txt_block.h = $(this).height();
txt_block.w = $(this).width();
txt_block.fz = $(this).css("font-size");
txt_block.val = $(this).find(".real_text").html();
@ -408,7 +438,6 @@ function importData(data){
var text_div = $("<div class='text_block'><div class='real_text'>" + data[i].text[j].val + "</div></div>");
text_div.draggable().css("position","absolute")
.width(data[i].text[j].w)
.height(data[i].text[j].h)
.css("top", data[i].text[j].top)
.css("left", data[i].text[j].left)
.css("font-size", data[i].text[j].fz)
@ -525,7 +554,7 @@ function changeStyle(val){
$(".b_bottom_right").removeClass("bbr_pad").removeClass("without_back");
$(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back");
$("#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_display").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_name").removeClass("pad_color");
@ -541,7 +570,7 @@ function changeStyle(val){
$(".b_bottom_right").addClass("bbr_pad").removeClass("without_back");
$(".b_bottom_left").addClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").addClass("bbc_pad").removeClass("without_back");
$("#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_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_name").addClass("pad_color");
@ -557,7 +586,7 @@ function changeStyle(val){
$(".b_bottom_right").addClass("without_back").removeClass("bbr_pad");
$(".b_bottom_left").addClass("without_back").removeClass("bbl_pad");
$(".b_bottom_center").addClass("without_back").removeClass("bbc_pad");
$("#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_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_name").addClass("pad_color");
@ -580,7 +609,7 @@ function onDropTarget(obj, event) {
var tmp_type = textData.getElementsByTagName("type")[0].firstChild.textContent;
if(tmp_type.substr(0, 5) == "audio"){
var audio_block = $("<div class='audio_block'>").draggable().appendTo($(obj));
audio_block.css("position","absolute").css("top",event.clientY).css("left",event.clientX);
audio_block.css("position","absolute").css("top",event.clientY - 54).css("left",event.clientX - 54);
$("<div class='close_img' contenteditable='false'>").appendTo(audio_block);
audio_block.addClass("block_border");
$("<div class='play'>").appendTo(audio_block);
@ -590,7 +619,7 @@ function onDropTarget(obj, event) {
audio.append(source);
} else {
var img_block = $("<div class='img_block' style='text-align: center;'></div>").appendTo($(obj));
img_block.css("top",event.clientY).css("left",event.clientX);
img_block.css("top",event.clientY - 54).css("left",event.clientX - 54);
$("<div class='move_block' contenteditable='false'>").appendTo(img_block);
$("<div class='close_img' contenteditable='false'>").appendTo(img_block);
$("<div class='resize_block' contenteditable='false'>").appendTo(img_block);

@ -23,6 +23,7 @@
<td class="b_top_left">&nbsp;</td>
<td class="b_top_center">
<div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div>
<select class="style_select">
@ -37,6 +38,7 @@
<tr>
<td class="b_center_left">&nbsp;</td>
<td>
<div id="help"></div>
<div id="slider">
<ul>
</ul>

@ -7,7 +7,9 @@ var sankoreLang = {
wgt_name: "Etudier",
slate: "Bois",
pad: "Pad",
none: "Aucun"
none: "Aucun",
help: "Aide",
help_content: "Ceci est un exemple de contenu de l'aide ..."
};
//some flags
@ -27,6 +29,8 @@ function start(){
$("#wgt_display").text(sankoreLang.display);
$("#wgt_edit").text(sankoreLang.edit);
$("#wgt_name").text(sankoreLang.wgt_name);
$("#wgt_help").text(sankoreLang.help);
$("#help").html(sankoreLang.help_content);
$(".style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad);
$(".style_select option[value='3']").text(sankoreLang.none);
@ -50,6 +54,7 @@ function start(){
//events
if (window.widget) {
window.widget.onleave = function(){
if(!$("#wgt_help").hasClass("open")){
exportData();
sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val());
sankore.setPreference("etudier_cur_page", $("#slider").getPage());
@ -57,11 +62,30 @@ function start(){
sankore.setPreference("etudier_right_nav", $("#nextBtn a").css("display"));
}
}
}
$(".style_select").change(function (event){
changeStyle($(this).find("option:selected").val());
})
$("#wgt_help").click(function(){
var tmp = $(this);
if($(this).hasClass("open")){
$("#help").hide();
tmp.removeClass("open");
$("#slider").show();
} else {
exportData();
sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val());
sankore.setPreference("etudier_cur_page", $("#slider").getPage());
sankore.setPreference("etudier_left_nav", $("#prevBtn a").css("display"));
sankore.setPreference("etudier_right_nav", $("#nextBtn a").css("display"));
$("#slider").hide();
$("#help").show();
tmp.addClass("open");
}
});
$("#wgt_display, #wgt_edit").click(function(event){
if(this.id == "wgt_display"){
if(!$(this).hasClass("selected")){
@ -124,9 +148,9 @@ function start(){
$("#slider li>div").each(function(){
var container = $(this);
container.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;")
.attr("ondragleave", "$(this).css(\"background\",\"none\"); return false;")
.attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;")
.attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);");
.attr("ondrop", "$(this).css(\"background\",\"none\"); return onDropTarget(this,event);");
container.find(".text_block").each(function(){
$(this).draggable("destroy");
@ -156,6 +180,7 @@ function start(){
$("<div class='add_right'>").appendTo(container);
$("<div class='close_slide'>").appendTo(container);
$("<div class='add_text'>").appendTo(container);
$(window).trigger("resize")
});
$(this).css("display", "none");
$("#wgt_display").css("display", "block");
@ -266,13 +291,13 @@ function start(){
if(resize_obj.clicked){
if(resize_obj.object.parent().hasClass("text_block")){
var width = resize_obj.object.parent().width() - resize_obj.left + event.clientX;
var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
//var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
resize_obj.left = event.clientX;
resize_obj.top = event.clientY;
resize_obj.object.parent().width(width).height(height);
resize_obj.object.parent().width(width);
} else {
width = resize_obj.object.parent().width() - resize_obj.left + event.clientX;
height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
var img_width = resize_obj.object.parent().find("img").width() - resize_obj.left + event.clientX;
var img_height = resize_obj.object.parent().find("img").height() - resize_obj.top + event.clientY;
resize_obj.left = event.clientX;
@ -296,12 +321,15 @@ function start(){
new_li.width(cur_li.width()).height(cur_li.height()).css("float","left");
var new_div = $("<div>").appendTo(new_li);
new_div.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"\"); return false;")
.attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;")
.attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' contenteditable='true'>" + sankoreLang.new_slide + "</div>").addClass("block_border");
.attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' style='position: absolute;'>").addClass("block_border");
$("<div class='real_text' contenteditable='true'>" + sankoreLang.new_slide + "</div>").appendTo(example);
$("<div class='move_block' contenteditable='false'>").appendTo(example);
$("<div class='close_img' contenteditable='false'>").appendTo(example);
$("<div class='size_up' contenteditable='false'>").appendTo(example);
$("<div class='size_down' contenteditable='false'>").appendTo(example);
$("<div class='resize_block' contenteditable='false'>").appendTo(example);
example.css("top","40%").css("left","40%");
new_div.append(example);
@ -319,12 +347,15 @@ function start(){
new_li.width(cur_li.width()).height(cur_li.height()).css("float","left");
var new_div = $("<div>").appendTo(new_li);
new_div.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"\"); return false;")
.attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;")
.attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' contenteditable='true'>" + sankoreLang.new_slide + "</div>").addClass("block_border");
.attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' style='position: absolute;'>").addClass("block_border");
$("<div class='real_text' contenteditable='true'>" + sankoreLang.new_slide + "</div>").appendTo(example);
$("<div class='move_block' contenteditable='false'>").appendTo(example);
$("<div class='close_img' contenteditable='false'>").appendTo(example);
$("<div class='size_up' contenteditable='false'>").appendTo(example);
$("<div class='size_down' contenteditable='false'>").appendTo(example);
$("<div class='resize_block' contenteditable='false'>").appendTo(example);
example.css("top","40%").css("left","40%");
new_div.append(example);
@ -360,7 +391,6 @@ function exportData(){
var txt_block = new Object();
txt_block.top = $(this).position().top;
txt_block.left = $(this).position().left;
txt_block.h = $(this).height();
txt_block.w = $(this).width();
txt_block.fz = $(this).css("font-size");
txt_block.val = $(this).find(".real_text").html();
@ -408,7 +438,6 @@ function importData(data){
var text_div = $("<div class='text_block'><div class='real_text'>" + data[i].text[j].val + "</div></div>");
text_div.draggable().css("position","absolute")
.width(data[i].text[j].w)
.height(data[i].text[j].h)
.css("top", data[i].text[j].top)
.css("left", data[i].text[j].left)
.css("font-size", data[i].text[j].fz)
@ -526,7 +555,7 @@ function changeStyle(val){
$(".b_bottom_right").removeClass("bbr_pad").removeClass("without_back");
$(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back");
$("#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_display").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_name").removeClass("pad_color");
@ -542,7 +571,7 @@ function changeStyle(val){
$(".b_bottom_right").addClass("bbr_pad").removeClass("without_back");
$(".b_bottom_left").addClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").addClass("bbc_pad").removeClass("without_back");
$("#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_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_name").addClass("pad_color");
@ -558,7 +587,7 @@ function changeStyle(val){
$(".b_bottom_right").addClass("without_back").removeClass("bbr_pad");
$(".b_bottom_left").addClass("without_back").removeClass("bbl_pad");
$(".b_bottom_center").addClass("without_back").removeClass("bbc_pad");
$("#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_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_name").addClass("pad_color");
@ -581,7 +610,7 @@ function onDropTarget(obj, event) {
var tmp_type = textData.getElementsByTagName("type")[0].firstChild.textContent;
if(tmp_type.substr(0, 5) == "audio"){
var audio_block = $("<div class='audio_block'>").draggable().appendTo($(obj));
audio_block.css("position","absolute").css("top",event.clientY).css("left",event.clientX);
audio_block.css("position","absolute").css("top",event.clientY - 54).css("left",event.clientX - 54);
$("<div class='close_img' contenteditable='false'>").appendTo(audio_block);
audio_block.addClass("block_border");
$("<div class='play'>").appendTo(audio_block);
@ -591,7 +620,7 @@ function onDropTarget(obj, event) {
audio.append(source);
} else {
var img_block = $("<div class='img_block' style='text-align: center;'></div>").appendTo($(obj));
img_block.css("top",event.clientY).css("left",event.clientX);
img_block.css("top",event.clientY - 54).css("left",event.clientX - 54);
$("<div class='move_block' contenteditable='false'>").appendTo(img_block);
$("<div class='close_img' contenteditable='false'>").appendTo(img_block);
$("<div class='resize_block' contenteditable='false'>").appendTo(img_block);

@ -23,6 +23,7 @@
<td class="b_top_left">&nbsp;</td>
<td class="b_top_center">
<div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div>
<select class="style_select">
@ -37,6 +38,7 @@
<tr>
<td class="b_center_left">&nbsp;</td>
<td>
<div id="help"></div>
<div id="slider">
<ul>
</ul>

@ -7,7 +7,9 @@ var sankoreLang = {
wgt_name: "Слайдер",
slate: "Узор",
pad: "Планшет",
none: "Нет"
none: "Нет",
help: "Помощь",
help_content: "Пример текста помощи ..."
};
//some flags
@ -27,6 +29,8 @@ function start(){
$("#wgt_display").text(sankoreLang.display);
$("#wgt_edit").text(sankoreLang.edit);
$("#wgt_name").text(sankoreLang.wgt_name);
$("#wgt_help").text(sankoreLang.help);
$("#help").html(sankoreLang.help_content);
$(".style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad);
$(".style_select option[value='3']").text(sankoreLang.none);
@ -50,6 +54,7 @@ function start(){
//events
if (window.widget) {
window.widget.onleave = function(){
if(!$("#wgt_help").hasClass("open")){
exportData();
sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val());
sankore.setPreference("etudier_cur_page", $("#slider").getPage());
@ -57,11 +62,30 @@ function start(){
sankore.setPreference("etudier_right_nav", $("#nextBtn a").css("display"));
}
}
}
$(".style_select").change(function (event){
changeStyle($(this).find("option:selected").val());
})
$("#wgt_help").click(function(){
var tmp = $(this);
if($(this).hasClass("open")){
$("#help").hide();
tmp.removeClass("open");
$("#slider").show();
} else {
exportData();
sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val());
sankore.setPreference("etudier_cur_page", $("#slider").getPage());
sankore.setPreference("etudier_left_nav", $("#prevBtn a").css("display"));
sankore.setPreference("etudier_right_nav", $("#nextBtn a").css("display"));
$("#slider").hide();
$("#help").show();
tmp.addClass("open");
}
});
$("#wgt_display, #wgt_edit").click(function(event){
if(this.id == "wgt_display"){
if(!$(this).hasClass("selected")){
@ -123,9 +147,9 @@ function start(){
$("#slider li>div").each(function(){
var container = $(this);
container.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;")
.attr("ondragleave", "$(this).css(\"background\",\"none\"); return false;")
.attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;")
.attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);");
.attr("ondrop", "$(this).css(\"background\",\"none\"); return onDropTarget(this,event);");
container.find(".text_block").each(function(){
$(this).draggable("destroy");
@ -154,6 +178,7 @@ function start(){
$("<div class='add_right'>").appendTo(container);
$("<div class='close_slide'>").appendTo(container);
$("<div class='add_text'>").appendTo(container);
$(window).trigger("resize")
});
$(this).css("display", "none");
$("#wgt_display").css("display", "block");
@ -264,13 +289,13 @@ function start(){
if(resize_obj.clicked){
if(resize_obj.object.parent().hasClass("text_block")){
var width = resize_obj.object.parent().width() - resize_obj.left + event.clientX;
var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
//var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
resize_obj.left = event.clientX;
resize_obj.top = event.clientY;
resize_obj.object.parent().width(width).height(height);
resize_obj.object.parent().width(width).height("");
} else {
width = resize_obj.object.parent().width() - resize_obj.left + event.clientX;
height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
var img_width = resize_obj.object.parent().find("img").width() - resize_obj.left + event.clientX;
var img_height = resize_obj.object.parent().find("img").height() - resize_obj.top + event.clientY;
resize_obj.left = event.clientX;
@ -294,12 +319,15 @@ function start(){
new_li.width(cur_li.width()).height(cur_li.height()).css("float","left");
var new_div = $("<div>").appendTo(new_li);
new_div.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"\"); return false;")
.attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;")
.attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' contenteditable='true'>" + sankoreLang.new_slide + "</div>").addClass("block_border");
.attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' style='position: absolute;'>").addClass("block_border");
$("<div class='real_text' contenteditable='true'>" + sankoreLang.new_slide + "</div>").appendTo(example);
$("<div class='move_block' contenteditable='false'>").appendTo(example);
$("<div class='close_img' contenteditable='false'>").appendTo(example);
$("<div class='size_up' contenteditable='false'>").appendTo(example);
$("<div class='size_down' contenteditable='false'>").appendTo(example);
$("<div class='resize_block' contenteditable='false'>").appendTo(example);
example.css("top","40%").css("left","40%");
new_div.append(example);
@ -317,12 +345,15 @@ function start(){
new_li.width(cur_li.width()).height(cur_li.height()).css("float","left");
var new_div = $("<div>").appendTo(new_li);
new_div.attr("ondragenter", "return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;")
.attr("ondragleave", "$(this).css(\"background-color\",\"\"); return false;")
.attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;")
.attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' contenteditable='true'>" + sankoreLang.new_slide + "</div>").addClass("block_border");
.attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' style='position: absolute;'>").addClass("block_border");
$("<div class='real_text' contenteditable='true'>" + sankoreLang.new_slide + "</div>").appendTo(example);
$("<div class='move_block' contenteditable='false'>").appendTo(example);
$("<div class='close_img' contenteditable='false'>").appendTo(example);
$("<div class='size_up' contenteditable='false'>").appendTo(example);
$("<div class='size_down' contenteditable='false'>").appendTo(example);
$("<div class='resize_block' contenteditable='false'>").appendTo(example);
example.css("top","40%").css("left","40%");
new_div.append(example);
@ -358,7 +389,6 @@ function exportData(){
var txt_block = new Object();
txt_block.top = $(this).position().top;
txt_block.left = $(this).position().left;
txt_block.h = $(this).height();
txt_block.w = $(this).width();
txt_block.fz = $(this).css("font-size");
txt_block.val = $(this).text();
@ -406,7 +436,6 @@ function importData(data){
var text_div = $("<div class='text_block'>" + data[i].text[j].val + "</div>");
text_div.draggable().css("position","absolute")
.width(data[i].text[j].w)
.height(data[i].text[j].h)
.css("top", data[i].text[j].top)
.css("left", data[i].text[j].left)
.css("font-size", data[i].text[j].fz)
@ -524,7 +553,7 @@ function changeStyle(val){
$(".b_bottom_right").removeClass("bbr_pad").removeClass("without_back");
$(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back");
$("#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_display").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_name").removeClass("pad_color");
@ -540,7 +569,7 @@ function changeStyle(val){
$(".b_bottom_right").addClass("bbr_pad").removeClass("without_back");
$(".b_bottom_left").addClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").addClass("bbc_pad").removeClass("without_back");
$("#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_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_name").addClass("pad_color");
@ -556,7 +585,7 @@ function changeStyle(val){
$(".b_bottom_right").addClass("without_back").removeClass("bbr_pad");
$(".b_bottom_left").addClass("without_back").removeClass("bbl_pad");
$(".b_bottom_center").addClass("without_back").removeClass("bbc_pad");
$("#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_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_name").addClass("pad_color");
@ -579,7 +608,7 @@ function onDropTarget(obj, event) {
var tmp_type = textData.getElementsByTagName("type")[0].firstChild.textContent;
if(tmp_type.substr(0, 5) == "audio"){
var audio_block = $("<div class='audio_block'>").draggable().appendTo($(obj));
audio_block.css("position","absolute").css("top",event.clientY).css("left",event.clientX);
audio_block.css("position","absolute").css("top",event.clientY - 54).css("left",event.clientX - 54);
$("<div class='close_img' contenteditable='false'>").appendTo(audio_block);
audio_block.addClass("block_border");
$("<div class='play'>").appendTo(audio_block);
@ -589,7 +618,7 @@ function onDropTarget(obj, event) {
audio.append(source);
} else {
var img_block = $("<div class='img_block' style='text-align: center;'></div>").appendTo($(obj));
img_block.css("top",event.clientY).css("left",event.clientX);
img_block.css("top",event.clientY - 54).css("left",event.clientX - 54);
$("<div class='move_block' contenteditable='false'>").appendTo(img_block);
$("<div class='close_img' contenteditable='false'>").appendTo(img_block);
$("<div class='resize_block' contenteditable='false'>").appendTo(img_block);

@ -5,7 +5,9 @@ QWidget#UBLibNavigatorWidget,
QWidget#UBLibItemProperties,
QWidget#UBDownloadWidget,
QWidget#UBTeacherGuideWidget,
QWidget#UBFeatureProperties
QWidget#UBFeatureProperties,
QWidget#UBFeaturesNavigatorWidget,
QWidget#PathList
{
background: #EEEEEE;
border-radius: 10px;
@ -26,14 +28,13 @@ QWidget#UBLibWebView
border: 2px solid #999999;
}
QWidget#UBFeaturesWebView
QListView
{
background: #EEEEEE;
border-radius : 10px;
border: 2px solid #999999;
border: 0px;
}
QListView
QWidget#UBFeaturesWebView
{
background: #EEEEEE;
border-radius : 10px;

@ -80,7 +80,7 @@ bool UBImportPDF::addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFi
for(int pdfPageNumber = 1; pdfPageNumber <= pdfPageCount; pdfPageNumber++)
{
int pageIndex = documentPageCount + (pdfPageNumber - 1);
int pageIndex = documentPageCount + pdfPageNumber;
UBApplication::showMessage(tr("Importing page %1 of %2").arg(pdfPageNumber).arg(pdfPageCount), true);
UBGraphicsScene* scene = 0;

@ -45,6 +45,7 @@
#include "board/UBBoardView.h"
#include "board/UBBoardController.h"
#include "board/UBDrawingController.h"
#include "board/UBBoardPaletteManager.h"
#include "frameworks/UBFileSystemUtils.h"
#include "frameworks/UBStringUtils.h"
@ -54,6 +55,9 @@
#include "core/UBPersistenceManager.h"
#include "core/UBApplication.h"
#include "gui/UBTeacherGuideWidget.h"
#include "gui/UBDockTeacherGuideWidget.h"
#include "interfaces/IDataStorage.h"
#include "document/UBDocumentContainer.h"
@ -1142,7 +1146,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::writeSvgElement()
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

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

@ -83,9 +83,9 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll
, mPendingPanButtonPressed(false)
, mPendingEraseButtonPressed(false)
, mpPageNavigWidget(NULL)
#ifdef USE_WEB_WIDGET
//#ifdef USE_WEB_WIDGET
, mpLibWidget(NULL)
#endif
//#endif
, mpCachePropWidget(NULL)
, mpDownloadWidget(NULL)
, mpDesktopLibWidget(NULL)
@ -134,6 +134,8 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
//------------------------------------------------//
// Create the widgets for the dock palettes
mpPageNavigWidget = new UBPageNavigationWidget();
#ifdef USE_WEB_WIDGET
mpLibWidget = new UBLibWidget();
#endif

@ -69,6 +69,8 @@ class UBBoardPaletteManager : public QObject
void setCurrentWebToolsPalette(UBWebToolsPalette *palette) {mWebToolsCurrentPalette = palette;}
UBWebToolsPalette* mWebToolsCurrentPalette;
UBDockTeacherGuideWidget* teacherGuideDockWidget() { return mpTeacherGuideWidget;}
void processPalettersWidget(UBDockPalette *paletter, eUBDockPaletteWidgetMode mode);
void changeMode(eUBDockPaletteWidgetMode newMode, bool isInit = false);
void startDownloads();
@ -135,10 +137,10 @@ class UBBoardPaletteManager : public QObject
/** The page navigator widget */
UBPageNavigationWidget* mpPageNavigWidget;
#ifdef USE_WEB_WIDGET
//#ifdef USE_WEB_WIDGET
/** The library widget */
UBLibWidget* mpLibWidget;
#endif
//#endif
/** The cache properties widget */
UBCachePropertiesWidget* mpCachePropWidget;

@ -28,7 +28,7 @@ class UBRubberBand;
class UBBoardView : public QGraphicsView
{
Q_OBJECT;
Q_OBJECT
public:

@ -65,6 +65,10 @@ class UBDrawingController : public QObject
mIsDesktopMode = mode;
}
bool isInDesktopMode(){
return mIsDesktopMode;
}
public slots:
void setStylusTool(int tool);

@ -18,24 +18,37 @@
#include "domain/UBGraphicsVideoItem.h"
#include "domain/UBGraphicsWidgetItem.h"
#include "gui/UBFeaturesWidget.h"
const QString UBFeaturesController::virtualRootName = "root";
UBFeature::UBFeature(const QString &url, const QPixmap &icon, const QString &name, const QUrl &realPath, UBFeatureElementType type)
: virtualPath(url), mThumbnail(icon), mName(name), mPath(realPath), elementType(type)
: virtualDir(url), mThumbnail(icon), mName(name), mPath(realPath), elementType(type)
{
}
UBFeature::~UBFeature()
{
for (int i = 0; i < mChildren.count(); i++) {
delete mChildren[i];
}
for (int i = 0; i < mParents.count(); i++) {
mParents[i]->mChildren.removeAll(this);
}
}
QString UBFeature::getUrl() const
{
if ( elementType == FEATURE_INTERNAL )
return getFullPath().toString();
/*if ( UBApplication::isFromWeb( getFullPath() ) )
return QUrl( getFullPath() );*/
return getFullPath().toLocalFile();
}
bool UBFeature::operator ==( const UBFeature &f )const
{
return virtualPath == f.getVirtualPath() && mName == f.getName() && mPath == f.getFullPath() && elementType == f.getType();
return virtualDir == f.getVirtualPath() && mName == f.getName() && mPath == f.getFullPath() && elementType == f.getType();
}
bool UBFeature::operator !=( const UBFeature &f )const
@ -51,19 +64,34 @@ bool UBFeature::isFolder() const
bool UBFeature::isDeletable()const
{
return elementType == FEATURE_ITEM;
return elementType == FEATURE_ITEM
|| elementType == FEATURE_FOLDER;
}
UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) :
QObject(pParentWidget),
mLastItemOffsetIndex(0)
bool UBFeature::inTrash() const
{
rootPath = "/root";
initDirectoryTree();
return getFullPath().toLocalFile().startsWith(QUrl::fromLocalFile(UBSettings::userTrashDirPath()).toLocalFile() );
}
void UBFeaturesController::initDirectoryTree()
UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) :
QObject(pParentWidget)
,featuresList(0)
,mLastItemOffsetIndex(0)
{
//Initializing virtual structure of the list
rootPath = "/" + virtualRootName;
appPath = rootPath + "/Applications";
audiosPath = rootPath + "/Audios";
moviesPath = rootPath + "/Movies";
picturesPath = rootPath + "/Pictures";
flashPath = rootPath + "/Animations";
interactPath = rootPath + "/Interactivities";
shapesPath = rootPath + "/Shapes";
trashPath = rootPath + "/Trash";
favoritePath = rootPath + "/Favorites";
//Initializing physical directories from UBSettings
mUserAudioDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->userAudioDirectory());
mUserVideoDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->userVideoDirectory());
mUserPicturesDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->userImageDirectory());
@ -71,53 +99,69 @@ void UBFeaturesController::initDirectoryTree()
mUserAnimationDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->userAnimationDirectory());
mLibPicturesDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->applicationImageLibraryDirectory());
qDebug() << mLibPicturesDirectoryPath;
mLibInteractiveDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->applicationInteractivesDirectory());
mLibApplicationsDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->applicationApplicationsLibraryDirectory());
mLibShapesDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->applicationShapeLibraryDirectory());
mLibSearchDirectoryPath =QUrl::fromLocalFile(UBSettings::settings()->userSearchDirectory());
trashDirectoryPath = QUrl::fromLocalFile(UBSettings::userTrashDirPath());
mLibAudiosDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->applicationAudiosLibraryDirectory());
mLibVideosDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->applicationVideosLibraryDirectory());
mLibAnimationsDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->applicationAnimationsLibraryDirectory());
rootElement = UBFeature(QString(), QPixmap( ":images/libpalette/home.png" ), "root", QUrl());
audiosElement = UBFeature( rootPath, QPixmap(":images/libpalette/AudiosCategory.svg"), "Audios" , mUserAudioDirectoryPath, FEATURE_CATEGORY);
moviesElement = UBFeature( rootPath, QPixmap(":images/libpalette/MoviesCategory.svg"), "Movies" , mUserVideoDirectoryPath, FEATURE_CATEGORY);
picturesElement = UBFeature( rootPath, QPixmap(":images/libpalette/PicturesCategory.svg"), "Pictures" , mUserPicturesDirectoryPath, FEATURE_CATEGORY);
flashElement = UBFeature( rootPath, QPixmap(":images/libpalette/FlashCategory.svg"), "Animations" , mUserAnimationDirectoryPath, FEATURE_CATEGORY);
interactElement = UBFeature( rootPath, QPixmap(":images/libpalette/InteractivesCategory.svg"), "Interactivities" , mLibInteractiveDirectoryPath, FEATURE_CATEGORY);
applicationsElement = UBFeature( rootPath, QPixmap(":images/libpalette/ApplicationsCategory.svg"), "Applications" , mUserInteractiveDirectoryPath, FEATURE_CATEGORY);
shapesElement = UBFeature( rootPath, QPixmap(":images/libpalette/ShapesCategory.svg"), "Shapes" , mLibShapesDirectoryPath, FEATURE_CATEGORY );
favoriteElement = UBFeature( rootPath, QPixmap(":images/libpalette/FavoritesCategory.svg"), "Favorites", QUrl("favorites"), FEATURE_FAVORITE );
webSearchElement = UBFeature( rootPath, QPixmap(":images/libpalette/WebSearchCategory.svg"), "Web search", mLibSearchDirectoryPath, FEATURE_CATEGORY);
trashElement = UBFeature( rootPath, QPixmap(":images/libpalette/TrashCategory.svg"), "Trash", trashDirectoryPath, FEATURE_TRASH );
featuresList = new QList <UBFeature>();
QList <UBToolsManager::UBToolDescriptor> tools = UBToolsManager::manager()->allTools();
scanFS();
featuresList->append( UBFeature( QString(), QPixmap( ":images/libpalette/home.png" ), "root", QUrl() ) );
currentElement = featuresList->at(0);
featuresModel = new UBFeaturesModel(featuresList, this);
featuresModel->setSupportedDragActions(Qt::CopyAction | Qt::MoveAction);
appPath = rootPath + "/Applications";
audiosPath = rootPath + "/Audios";
moviesPath = rootPath + "/Movies";
picturesPath = rootPath + "/Pictures";
flashPath = rootPath + "/Animations";
interactPath = rootPath + "/Interactivities";
shapesPath = rootPath + "/Shapes";
trashPath = rootPath + "/Trash";
favoritePath = rootPath + "/Favorites";
featuresProxyModel = new UBFeaturesProxyModel(this);
featuresProxyModel->setFilterFixedString(rootPath);
featuresProxyModel->setSourceModel(featuresModel);
featuresProxyModel->setFilterCaseSensitivity( Qt::CaseInsensitive );
featuresSearchModel = new UBFeaturesSearchProxyModel(this);
featuresSearchModel->setSourceModel(featuresModel);
featuresSearchModel->setFilterCaseSensitivity( Qt::CaseInsensitive );
featuresPathModel = new UBFeaturesPathProxyModel(this);
featuresPathModel->setPath(rootPath);
featuresPathModel->setSourceModel(featuresModel);
connect(featuresModel, SIGNAL(dataRestructured()), featuresProxyModel, SLOT(invalidate()));
}
void UBFeaturesController::scanFS()
{
featuresList->clear();
featuresList->append(rootElement);
*featuresList << audiosElement
<< moviesElement
<< picturesElement
<< flashElement
<< interactElement
<< applicationsElement
<< shapesElement
<< favoriteElement
<< webSearchElement
<< trashElement;
audiosElement = UBFeature( rootPath, QPixmap(":images/libpalette/AudiosCategory.svg"), "Audios" , mUserAudioDirectoryPath );
featuresList->append( audiosElement );
moviesElement = UBFeature( rootPath, QPixmap(":images/libpalette/MoviesCategory.svg"), "Movies" , mUserVideoDirectoryPath );
featuresList->append( moviesElement );
picturesElement = UBFeature( rootPath, QPixmap(":images/libpalette/PicturesCategory.svg"), "Pictures" , mUserPicturesDirectoryPath );
featuresList->append( picturesElement );
featuresList->append( UBFeature( rootPath, QPixmap(":images/libpalette/ApplicationsCategory.svg"), "Applications" , mUserInteractiveDirectoryPath ) );
flashElement = UBFeature( rootPath, QPixmap(":images/libpalette/FlashCategory.svg"), "Animations" , mUserAnimationDirectoryPath );
featuresList->append( flashElement );
interactElement = UBFeature( rootPath, QPixmap(":images/libpalette/InteractivesCategory.svg"), "Interactivities" , mLibInteractiveDirectoryPath );
featuresList->append( interactElement );
featuresList->append( UBFeature( rootPath, QPixmap(":images/libpalette/ShapesCategory.svg"), "Shapes" , mLibShapesDirectoryPath ) );
trashElement = UBFeature( rootPath, QPixmap(":images/libpalette/TrashCategory.svg"), "Trash", trashDirectoryPath, FEATURE_TRASH );
featuresList->append( trashElement );
favoriteElement = UBFeature( rootPath, QPixmap(":images/libpalette/FavoritesCategory.svg"), "Favorites", QUrl("favorites"), FEATURE_FAVORITE );
featuresList->append( favoriteElement );
webSearchElement = UBFeature( rootPath, QPixmap(":images/libpalette/WebSearchCategory.svg"), "Web search", mLibSearchDirectoryPath );
featuresList->append( webSearchElement );
loadFavoriteList();
QList <UBToolsManager::UBToolDescriptor> tools = UBToolsManager::manager()->allTools();
foreach (UBToolsManager::UBToolDescriptor tool, tools)
{
featuresList->append( UBFeature( appPath, tool.icon, tool.label, QUrl( tool.id ), FEATURE_INTERNAL ) );
@ -126,6 +170,7 @@ void UBFeaturesController::initDirectoryTree()
featuresList->append( UBFeature( favoritePath, tool.icon, tool.label, QUrl( tool.id ), FEATURE_INTERNAL ) );
}
}
//Claudio:
// don't change the order of the scans
fileSystemScan( mLibAudiosDirectoryPath, audiosPath);
@ -145,7 +190,6 @@ void UBFeaturesController::initDirectoryTree()
fileSystemScan( trashDirectoryPath, trashPath );
fileSystemScan( mLibSearchDirectoryPath, rootPath + "/" + "Web search" );
}
void UBFeaturesController::fileSystemScan(const QUrl & currentPath, const QString & currVirtualPath)
@ -191,7 +235,14 @@ void UBFeaturesController::fileSystemScan(const QUrl & currentPath, const QStrin
icon = QPixmap( thumbnailPath );
else icon = createThumbnail( fullFileName );*/
}
featuresList->append( UBFeature( currVirtualPath, icon, fileName, QUrl::fromLocalFile( fullFileName ), fileType ) );
UBFeature testFeature(currVirtualPath, icon, fileName, QUrl::fromLocalFile(fullFileName), fileType);
if (featuresList->contains(testFeature)) {
qDebug() << "the same feature found";
}
featuresList->append(testFeature);
if ( favoriteSet->find( QUrl::fromLocalFile( fullFileName ) ) != favoriteSet->end() )
{
featuresList->append( UBFeature( favoritePath, icon, fileName, QUrl::fromLocalFile( fullFileName ), fileType ) );
@ -219,11 +270,6 @@ void UBFeaturesController::loadFavoriteList()
{
QUrl path;
in >> path;
/*QFileInfo fileInfo( path );
QString fileName = fileInfo.fileName();
UBFeature elem( favoritePath, thumbnailForFile( path ), fileName, path, fileTypeFromUrl(path) );
featuresList->append( elem );*/
favoriteSet->insert( path );
}
}
@ -243,7 +289,7 @@ void UBFeaturesController::saveFavoriteList()
file.close();
}
UBFeature UBFeaturesController::addToFavorite( const QUrl &path )
void UBFeaturesController::addToFavorite( const QUrl &path )
{
QString filePath = fileNameFromUrl( path );
if ( favoriteSet->find( path ) == favoriteSet->end() )
@ -253,19 +299,24 @@ UBFeature UBFeaturesController::addToFavorite( const QUrl &path )
UBFeature elem( favoritePath, thumbnailForFile( filePath ), fileName, path, fileTypeFromUrl(filePath) );
favoriteSet->insert( path );
saveFavoriteList();
return elem;
if ( !elem.getVirtualPath().isEmpty() && !elem.getVirtualPath().isNull())
featuresModel->addItem( elem );
}
return UBFeature();
}
void UBFeaturesController::removeFromFavorite( const QUrl &path )
void UBFeaturesController::removeFromFavorite( const QUrl &path, bool deleteManualy)
{
QString filePath = fileNameFromUrl( path );
// QString filePath = fileNameFromUrl( path );
if ( favoriteSet->find( path ) != favoriteSet->end() )
{
favoriteSet->erase( favoriteSet->find( path ) );
saveFavoriteList();
}
if (deleteManualy) {
featuresModel->deleteFavoriteItem(path.toString());
}
}
QString UBFeaturesController::fileNameFromUrl( const QUrl &url )
@ -376,15 +427,18 @@ UBFeature UBFeaturesController::importImage( const QImage &image, const UBFeatur
}
UBFeature UBFeaturesController::newFolder( const QString &name )
void UBFeaturesController::addNewFolder(const QString &name)
{
QString path = currentElement.getFullPath().toLocalFile() + "/" + name;
if(!QFileInfo(path).exists())
{
if(!QFileInfo(path).exists()) {
QDir().mkpath(path);
}
return UBFeature( currentElement.getFullVirtualPath(), QPixmap(":images/libpalette/folder.svg"),
UBFeature newFeatureFolder = UBFeature( currentElement.getFullVirtualPath(), QPixmap(":images/libpalette/folder.svg"),
name, QUrl::fromLocalFile( path ), FEATURE_FOLDER );
featuresModel->addItem( newFeatureFolder );
featuresProxyModel->invalidate();
}
void UBFeaturesController::addItemToPage(const UBFeature &item)
@ -397,8 +451,7 @@ void UBFeaturesController::addItemAsBackground(const UBFeature &item)
UBApplication::boardController->downloadURL( item.getFullPath(), QPointF(), QSize(), true );
}
UBFeature UBFeaturesController::getDestinationForItem( const QUrl &url )
UBFeature UBFeaturesController::getParentFeatureForUrl( const QUrl &url )
{
QString mimetype = UBFileSystemUtils::mimeTypeFromFileName( url.toString() );
@ -418,11 +471,13 @@ UBFeature UBFeaturesController::getDestinationForItem( const QUrl &url )
return UBFeature();
}
UBFeature UBFeaturesController::addDownloadedFile( const QUrl &sourceUrl, const QByteArray &pData )
void UBFeaturesController::addDownloadedFile(const QUrl &sourceUrl, const QByteArray &pData)
{
UBFeature dest = getDestinationForItem( sourceUrl );
UBFeature dest = getParentFeatureForUrl( sourceUrl );
if ( dest == UBFeature() )
return UBFeature();
return;
QString fileName = QFileInfo( sourceUrl.toString() ).fileName();
QString filePath = dest.getFullPath().toLocalFile() + "/" + fileName;
@ -431,10 +486,14 @@ UBFeature UBFeaturesController::addDownloadedFile( const QUrl &sourceUrl, const
{
file.write(pData);
file.close();
return UBFeature( dest.getFullVirtualPath(), thumbnailForFile( filePath ),
UBFeature downloadedFeature = UBFeature( dest.getFullVirtualPath(), thumbnailForFile( filePath ),
fileName, QUrl::fromLocalFile(filePath), FEATURE_ITEM);
if (downloadedFeature != UBFeature()) {
featuresModel->addItem(downloadedFeature);
}
return UBFeature();
}
}
UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeature &destination )
@ -446,7 +505,7 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu
Q_ASSERT( QFileInfo( sourcePath ).exists() );
UBFeature possibleDest = getDestinationForItem( url );
UBFeature possibleDest = getParentFeatureForUrl( url );
UBFeature dest = destination;
@ -475,13 +534,57 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu
return newElement;
}
void UBFeaturesController::rescanModel()
{
featuresModel->removeRows(0, featuresList->count());
//Could implement infolder scanning for better perfomance
scanFS();
refreshModels();
}
void UBFeaturesController::siftElements(const QString &pSiftValue)
{
featuresProxyModel->setFilterFixedString(pSiftValue);
featuresProxyModel->invalidate();
featuresPathModel->setPath(pSiftValue);
featuresPathModel->invalidate();
}
UBFeature UBFeaturesController::getFeature(const QModelIndex &index, QListView *pOnView)
{
return qobject_cast<QSortFilterProxyModel *>(pOnView->model())->data(index, Qt::UserRole + 1).value<UBFeature>();
}
void UBFeaturesController::searchStarted(const QString &pattern, QListView *pOnView)
{
if (pattern.isEmpty()) {
pOnView->setModel(featuresProxyModel);
featuresProxyModel->invalidate();
} else if ( pattern.size() > 2 ) {
featuresSearchModel->setFilterWildcard( "*" + pattern + "*" );
pOnView->setModel(featuresSearchModel );
featuresSearchModel->invalidate();
}
}
void UBFeaturesController::refreshModels()
{
featuresProxyModel->invalidate();
featuresSearchModel->invalidate();
featuresPathModel->invalidate();
}
UBFeature UBFeaturesController::copyItemToFolder( const QUrl &url, const UBFeature &destination )
{
QString sourcePath = url.toLocalFile();
Q_ASSERT( QFileInfo( sourcePath ).exists() );
UBFeature possibleDest = getDestinationForItem( url );
UBFeature possibleDest = getParentFeatureForUrl( url );
UBFeature dest = destination;
@ -513,18 +616,82 @@ void UBFeaturesController::deleteItem( const QUrl &url )
Q_ASSERT( QFileInfo( path ).exists() );
QString thumbnailPath = UBFileSystemUtils::thumbnailPath( path );
if ( thumbnailPath.length() && QFileInfo( thumbnailPath ).exists() )
{
if ( thumbnailPath.length() && QFileInfo( thumbnailPath ).exists()) {
if (QFileInfo(thumbnailPath).isFile()) {
QFile::remove(thumbnailPath);
} else if (QFileInfo(thumbnailPath).isDir()){
if (!UBFileSystemUtils::deleteDir(thumbnailPath)) {
qDebug() << "Not able to delete directory";
}
}
}
if (QFileInfo(path).isFile()) {
QFile::remove( path );
} else if (QFileInfo(path).isDir()) {
UBFileSystemUtils::deleteDir(path);
}
}
void UBFeaturesController::deleteItem(const UBFeature &pFeature)
{
QUrl sourceUrl = pFeature.getFullPath();
featuresModel->deleteItem(pFeature);
deleteItem(sourceUrl);
}
bool UBFeaturesController::isTrash( const QUrl &url )
{
return url.toLocalFile().startsWith( trashDirectoryPath.toLocalFile() );
}
void UBFeaturesController::moveToTrash(UBFeature feature, bool deleteManualy)
{
featuresModel->moveData(feature, trashElement, Qt::MoveAction, deleteManualy);
removeFromFavorite(feature.getFullPath());
featuresModel->deleteFavoriteItem(UBFeaturesController::fileNameFromUrl(feature.getFullPath()));
}
UBFeaturesController::~UBFeaturesController()
{
if (featuresList) {
delete featuresList;
}
}
void UBFeaturesController::assignFeaturesListVeiw(UBFeaturesListView *pList)
{
pList->setDragDropMode( QAbstractItemView::DragDrop );
pList->setSelectionMode( QAbstractItemView::ContiguousSelection );
pList->setResizeMode( QListView::Adjust );
pList->setViewMode( QListView::IconMode );
pList->setIconSize(QSize(UBFeaturesWidget::defaultThumbnailSize, UBFeaturesWidget::defaultThumbnailSize));
pList->setGridSize(QSize(UBFeaturesWidget::defaultThumbnailSize + 20, UBFeaturesWidget::defaultThumbnailSize + 20));
itemDelegate = new UBFeaturesItemDelegate(this, pList);
pList->setItemDelegate(itemDelegate);
pList->setModel(featuresProxyModel);
}
void UBFeaturesController::assignPathListView(UBFeaturesListView *pList)
{
pList->setViewMode(QListView::IconMode );
pList->setIconSize(QSize(UBFeaturesWidget::defaultThumbnailSize - 10, UBFeaturesWidget::defaultThumbnailSize - 10));
pList->setGridSize(QSize(UBFeaturesWidget::defaultThumbnailSize + 10, UBFeaturesWidget::defaultThumbnailSize - 10));
pList->setFixedHeight(60);
pList->setSelectionMode(QAbstractItemView::NoSelection);
pList->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
pList->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
pList->setFlow(QListView::LeftToRight);
pList->setWrapping(false);
pList->setDragDropMode(QAbstractItemView::DropOnly);
pList->setModel( featuresPathModel);
pathItemDelegate = new UBFeaturesPathItemDelegate(this);
pList->setItemDelegate(pathItemDelegate);
}

@ -11,6 +11,15 @@
#include <QMap>
#include <QUrl>
#include <QByteArray>
#include <QtGui>
class UBFeaturesModel;
class UBFeaturesItemDelegate;
class UBFeaturesPathItemDelegate;
class UBFeaturesProxyModel;
class UBFeaturesSearchProxyModel;
class UBFeaturesPathProxyModel;
class UBFeaturesListView;
//#include "UBDockPaletteWidget.h"
@ -33,36 +42,50 @@ public:
UBFeature() {;}
//UBFeature(const UBFeature &f);
UBFeature(const QString &url, const QPixmap &icon, const QString &name, const QUrl &realPath, UBFeatureElementType type = FEATURE_CATEGORY);
virtual ~UBFeature() {;}
// UBFeature();
virtual ~UBFeature();
QString getName() const { return mName; }
QPixmap getThumbnail() const {return mThumbnail;}
QString getVirtualPath() const { return virtualPath; }
QString getVirtualPath() const { return virtualDir; }
//QString getPath() const { return mPath; };
QUrl getFullPath() const { return mPath; }
QString getFullVirtualPath() const { return virtualPath + "/" + mName; }
QString getFullVirtualPath() const { return virtualDir + "/" + mName; }
QString getUrl() const;
void setFullPath(const QUrl &newPath) {mPath = newPath;}
void setFullVirtualPath(const QString &newVirtualPath) {virtualDir = newVirtualPath;}
UBFeatureElementType getType() const { return elementType; }
bool isFolder() const;
bool isDeletable() const;
bool inTrash() const;
bool operator ==( const UBFeature &f )const;
bool operator !=( const UBFeature &f )const;
const QMap<QString,QString> & getMetadata() const { return metadata; }
void setMetadata( const QMap<QString,QString> &data ) { metadata = data; }
bool hasChildren() const {return mChildren.count();}
bool hasParents() const {return mParents.count();}
bool hasRelationships() const {return mChildren.count() && mParents.count();}
private:
QString virtualPath;
QString virtualDir;
QPixmap mThumbnail;
QString mName;
QUrl mPath;
UBFeatureElementType elementType;
QMap<QString,QString> metadata;
QList<UBFeature*> mChildren;
QList<UBFeature*> mParents;
};
Q_DECLARE_METATYPE( UBFeature )
class UBFeaturesController : public QObject
{
friend class UBFeaturesWidget;
Q_OBJECT
public:
UBFeaturesController(QWidget *parentWidget);
virtual ~UBFeaturesController();
@ -70,6 +93,7 @@ public:
QList <UBFeature>* getFeatures() const {return featuresList;}
const QString& getRootPath()const {return rootPath;}
void scanFS();
void addItemToPage(const UBFeature &item);
void addItemAsBackground(const UBFeature &item);
@ -77,33 +101,61 @@ public:
void setCurrentElement( const UBFeature &elem ) {currentElement = elem;}
const UBFeature & getTrashElement () const { return trashElement; }
UBFeature addDownloadedFile( const QUrl &sourceUrl, const QByteArray &pData );
void addDownloadedFile( const QUrl &sourceUrl, const QByteArray &pData );
UBFeature moveItemToFolder( const QUrl &url, const UBFeature &destination );
UBFeature copyItemToFolder( const QUrl &url, const UBFeature &destination );
void rescanModel();
void siftElements(const QString &pSiftValue);
//TODO make less complicated for betteer maintainence
UBFeature getFeature(const QModelIndex &index, QListView *pOnView);
void searchStarted(const QString &pattern, QListView *pOnView);
void refreshModels();
void deleteItem( const QUrl &url );
void deleteItem(const UBFeature &pFeature);
bool isTrash( const QUrl &url );
UBFeature newFolder( const QString &name );
UBFeature addToFavorite( const QUrl &path );
void removeFromFavorite( const QUrl &path );
void moveToTrash(UBFeature feature, bool deleteManualy = false);
void addNewFolder(const QString &name);
void addToFavorite( const QUrl &path );
void removeFromFavorite(const QUrl &path, bool deleteManualy = false);
UBFeature importImage( const QImage &image, const UBFeature &destination );
void fileSystemScan(const QUrl &currPath, const QString & currVirtualPath);
static QString fileNameFromUrl( const QUrl &url );
static QPixmap thumbnailForFile( const QString &path );
static bool isDeletable( const QUrl &url );
static char featureTypeSplitter() {return ':';}
static const QString virtualRootName;
void assignFeaturesListVeiw(UBFeaturesListView *pList);
void assignPathListView(UBFeaturesListView *pList);
private:
void initDirectoryTree();
void fileSystemScan(const QUrl &currPath, const QString & currVirtualPath);
UBFeaturesItemDelegate *itemDelegate;
UBFeaturesPathItemDelegate *pathItemDelegate;
UBFeaturesModel *featuresModel;
UBFeaturesProxyModel *featuresProxyModel;
UBFeaturesSearchProxyModel *featuresSearchModel;
UBFeaturesPathProxyModel *featuresPathModel;
private:
static QPixmap createThumbnail(const QString &path);
//void addImageToCurrentPage( const QString &path );
void loadFavoriteList();
void saveFavoriteList();
UBFeature getDestinationForItem( const QUrl &url );
static UBFeatureElementType fileTypeFromUrl( const QString &path );
QList <UBFeature> *featuresList;
UBFeature *rootElement;
QUrl mUserAudioDirectoryPath;
QUrl mUserVideoDirectoryPath;
@ -136,19 +188,24 @@ private:
int mLastItemOffsetIndex;
UBFeature currentElement;
UBFeature trashElement;
UBFeature rootElement;
UBFeature favoriteElement;
UBFeature audiosElement;
UBFeature moviesElement;
UBFeature picturesElement;
UBFeature interactElement;
UBFeature applicationsElement;
UBFeature flashElement;
UBFeature shapesElement;
UBFeature webSearchElement;
QSet <QUrl> *favoriteSet;
};
public:
UBFeature trashElement;
UBFeature getParentFeatureForUrl( const QUrl &url );
};
#endif

@ -40,6 +40,8 @@
#include "gui/UBScreenMirror.h"
#include "gui/UBMainWindow.h"
#include "gui/UBDockTeacherGuideWidget.h"
#include "gui/UBTeacherGuideWidget.h"
#include "domain/UBGraphicsPixmapItem.h"
#include "domain/UBW3CWidget.h"
@ -418,7 +420,7 @@ void UBApplicationController::showDocument()
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->hide();
}
@ -471,9 +473,13 @@ void UBApplicationController::showTutorial()
UBApplication::boardController->hide();
}
// it's needed not to duplicate webbrowser search in web mode. If I've breaked smbd's code let Ivan know
if (UBSettings::settings()->webUseExternalBrowser->get().toBool())
{
showDesktop(true);
UBApplication::webController->show(UBWebController::Tutorial);
}
else{
mMainWindow->webToolBar->hide();
mMainWindow->boardToolBar->hide();
mMainWindow->documentToolBar->hide();
@ -486,9 +492,12 @@ void UBApplicationController::showTutorial()
mUninoteController->hideWindow();
UBApplication::webController->show(UBWebController::Tutorial);
mirroringEnabled(false);
emit mainModeChanged(mMainMode);
}
}
void UBApplicationController::showSankoreEditor()
@ -537,7 +546,6 @@ void UBApplicationController::updateRequestFinished(int id, bool error)
}
else{
QString responseString = QString(mHttp->readAll());
qDebug() << responseString;
if (!responseString.isEmpty() && responseString.contains("version") && responseString.contains("url")){
mHttp->close();
downloadJsonFinished(responseString);
@ -586,7 +594,10 @@ void UBApplicationController::checkUpdateRequest()
void UBApplicationController::hideDesktop()
{
mDisplayManager->adjustScreens(-1);
if(UBStylusTool::Eraser != UBDrawingController::drawingController()->stylusTool()){
UBDrawingController::drawingController()->setDrawingMode(eDrawingMode_Vector);
}
if (mMainMode == Board)
{

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

@ -74,6 +74,10 @@ void UBSetting::setString(const QString& pValue)
{
set(pValue);
}
void UBSetting::setInt(int pValue)
{
set(pValue);
}
UBColorListSetting::UBColorListSetting(UBSettings* parent)

@ -54,6 +54,7 @@ class UBSetting : public QObject
void setBool(bool pValue);
void setString(const QString& pValue);
void setInt(int pValue);
signals:

@ -225,6 +225,8 @@ void UBSettings::init()
appStartMode = new UBSetting(this, "App", "StartMode", "");
featureSliderPosition = new UBSetting(this, "Board", "FeatureSliderPosition", 40);
boardPenFineWidth = new UBSetting(this, "Board", "PenFineWidth", 1.5);
boardPenMediumWidth = new UBSetting(this, "Board", "PenMediumWidth", 3.0);
boardPenStrongWidth = new UBSetting(this, "Board", "PenStrongWidth", 8.0);

@ -249,6 +249,8 @@ class UBSettings : public QObject
UBSetting* appStartMode;
UBSetting* featureSliderPosition;
UBColorListSetting* boardPenLightBackgroundColors;
UBColorListSetting* boardPenLightBackgroundSelectedColors;

@ -386,7 +386,10 @@ void UBDesktopAnnotationController::goToUniboard()
UBPlatformUtils::setDesktopMode(false);
UBDrawingController::drawingController()->setInDestopMode(false);
if(UBStylusTool::Eraser != UBDrawingController::drawingController()->stylusTool()){
UBDrawingController::drawingController()->setDrawingMode(eDrawingMode_Vector);
}
emit restoreUniboard();
}

@ -1624,7 +1624,11 @@ void UBDocumentController::refreshDocumentThumbnailsView(UBDocumentContainer*)
}
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))));
}

@ -359,7 +359,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
}
}
}
else if (mOperationMode == Resizing)
else if (mOperationMode == Resizing || mOperationMode == ResizingHorizontally)
{
mTranslateX = moveX;
UBResizableGraphicsItem* resizableItem = dynamic_cast<UBResizableGraphicsItem*>(delegated());
@ -675,19 +675,22 @@ void UBGraphicsDelegateFrame::positionHandles()
QVariant vLocked = delegated()->data(UBGraphicsItemData::ItemLocked);
bool isLocked = (vLocked.isValid() && vLocked.toBool());
mBottomRightResizeGripSvgItem->setVisible(!isLocked);
mBottomResizeGripSvgItem->setVisible(!isLocked);
mLeftResizeGripSvgItem->setVisible(!isLocked);
mRightResizeGripSvgItem->setVisible(!isLocked);
mTopResizeGripSvgItem->setVisible(!isLocked);
bool bShowHorizontalResizers = ResizingHorizontally == mOperationMode;
bool bShowVerticalResizers = ResizingHorizontally != mOperationMode;
bool bShowAllResizers = Resizing == mOperationMode || Scaling == mOperationMode ;
mBottomRightResizeGripSvgItem->setVisible(!isLocked && bShowAllResizers);
mBottomResizeGripSvgItem->setVisible(!isLocked && (bShowVerticalResizers || bShowAllResizers));
mLeftResizeGripSvgItem->setVisible(!isLocked && (bShowHorizontalResizers || bShowAllResizers));
mRightResizeGripSvgItem->setVisible(!isLocked && (bShowHorizontalResizers || bShowAllResizers));
mTopResizeGripSvgItem->setVisible(!isLocked && (bShowVerticalResizers || bShowAllResizers));
mRotateButton->setVisible(mDelegate->canRotate() && !isLocked);
mBottomRightResizeGrip->setVisible(!isLocked);
mBottomResizeGrip->setVisible(!isLocked);
mLeftResizeGrip->setVisible(!isLocked);
mRightResizeGrip->setVisible(!isLocked);
mTopResizeGrip->setVisible(!isLocked);
mBottomRightResizeGrip->setVisible(!isLocked && bShowAllResizers);
mBottomResizeGrip->setVisible(!isLocked && (bShowVerticalResizers || bShowAllResizers));
mLeftResizeGrip->setVisible(!isLocked && (bShowHorizontalResizers || bShowAllResizers));
mRightResizeGrip->setVisible(!isLocked && (bShowHorizontalResizers || bShowAllResizers));
mTopResizeGrip->setVisible(!isLocked && (bShowVerticalResizers || bShowAllResizers));
if (isLocked)
{
@ -714,9 +717,9 @@ UBGraphicsDelegateFrame::FrameTool UBGraphicsDelegateFrame::toolFromPos(QPointF
{
if(mDelegate->isLocked())
return None;
else if (bottomRightResizeGripRect().contains(pos))
else if (bottomRightResizeGripRect().contains(pos) && ResizingHorizontally != mOperationMode)
return ResizeBottomRight;
else if (bottomResizeGripRect().contains(pos)){
else if (bottomResizeGripRect().contains(pos) && ResizingHorizontally != mOperationMode){
if(mMirrorY){
return ResizeTop;
}else{
@ -738,7 +741,7 @@ UBGraphicsDelegateFrame::FrameTool UBGraphicsDelegateFrame::toolFromPos(QPointF
return ResizeRight;
}
}
else if (topResizeGripRect().contains(pos)){
else if (topResizeGripRect().contains(pos) && ResizingHorizontally != mOperationMode){
if(mMirrorY){
return ResizeBottom;
}else{

@ -46,7 +46,7 @@ class UBGraphicsDelegateFrame: public QGraphicsRectItem, public QObject
virtual void setAntiScale(qreal pAntiScale);
enum OperationMode {Scaling, Resizing};
enum OperationMode {Scaling, Resizing, ResizingHorizontally};
void setOperationMode(OperationMode pMode) {mOperationMode = pMode;}
bool isResizing(){return mResizing;}

@ -677,7 +677,8 @@ UBGraphicsToolBarItem::UBGraphicsToolBarItem(QGraphicsItem * parent) :
mShifting(true),
mVisible(false),
mMinWidth(200),
mInitialHeight(26)
mInitialHeight(26),
mElementsPadding(2)
{
QRectF rect = this->rect();
rect.setHeight(mInitialHeight);
@ -698,7 +699,7 @@ void UBGraphicsToolBarItem::positionHandles()
foreach (QGraphicsItem* item, mItemsOnToolBar)
{
item->setPos(itemXOffset, 0);
itemXOffset += (item->boundingRect().width());
itemXOffset += (item->boundingRect().width()+mElementsPadding);
item->show();
}
}
@ -1155,7 +1156,7 @@ void DelegateMediaControl::paint(QPainter *painter,
mLCDTimerArea.setWidth(rect().height());
mSeecArea = rect();
mSeecArea.setWidth(rect().width()-mLCDTimerArea.width());
mSeecArea.setWidth(rect().width()-mLCDTimerArea.width()-2);
path.addRoundedRect(mSeecArea, mSeecArea.height()/2, mSeecArea.height()/2);
painter->fillPath(path, brush());

@ -128,6 +128,7 @@ class DelegateMediaControl: public QObject, public QGraphicsRectItem
void positionHandles();
void updateTicker(qint64 time);
void totalTimeChanged(qint64 newTotalTime);
QSizeF lcdAreaSize(){return mLCDTimerArea.size();}
signals:
void used();
@ -165,6 +166,7 @@ class UBGraphicsToolBarItem : public QGraphicsRectItem, public QObject
int minWidth() { return mMinWidth; }
void positionHandles();
void update();
int getElementsPadding(){return mElementsPadding;}
private:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
@ -175,6 +177,7 @@ class UBGraphicsToolBarItem : public QGraphicsRectItem, public QObject
bool mVisible;
int mMinWidth;
int mInitialHeight;
int mElementsPadding;
QList<QGraphicsItem*> mItemsOnToolBar;
};

@ -21,7 +21,6 @@
#include "document/UBDocumentProxy.h"
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "frameworks/UBFileSystemUtils.h"
#include "core/memcheck.h"
bool UBGraphicsMediaItem::sIsMutedByDefault = false;
@ -56,6 +55,7 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
if(mVideoWidget->sizeHint() == QSize(1,1)){
mVideoWidget->resize(320,240);
mVideoWidget->setMinimumSize(140,26);
}
setWidget(mVideoWidget);
haveLinkedImage = true;
@ -67,8 +67,16 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
mAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
mMediaObject->setTickInterval(1000);
mAudioWidget = new QWidget();
mAudioWidget->resize(320,26);
mAudioWidget = new UBGraphicsMediaItem::UBAudioPresentationWidget();
int borderSize = 0;
UBGraphicsMediaItem::UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBGraphicsMediaItem::UBAudioPresentationWidget*>(mAudioWidget);
if (pAudioWidget)
{
borderSize = pAudioWidget->borderSize();
}
mAudioWidget->resize(320,26+3*borderSize);
mAudioWidget->setMinimumSize(150,26+borderSize);
setWidget(mAudioWidget);
haveLinkedImage = false;
}
@ -82,6 +90,9 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
itemDelegate->init();
setDelegate(itemDelegate);
if (mediaType_Audio == mMediaType)
mDelegate->frame()->setOperationMode(UBGraphicsDelegateFrame::ResizingHorizontally);
else
mDelegate->frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing);
setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly

@ -21,12 +21,54 @@
#include <phonon/VideoWidget>
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "frameworks/UBFileSystemUtils.h"
class UBGraphicsMediaItem : public UBGraphicsProxyWidget
{
Q_OBJECT
public:
class UBAudioPresentationWidget : public QWidget
{
public:
UBAudioPresentationWidget(QWidget *parent = NULL)
:QWidget(parent)
, mBorderSize(10)
, mTitleSize(10)
{}
int borderSize()
{
return mBorderSize;
}
void setTitle(QString title = QString()){mTitle = title;}
QString getTitle(){return mTitle;}
private:
virtual void paintEvent(QPaintEvent *event)
{
QPainter painter(this);
painter.fillRect(rect(), QBrush(Qt::black));
if (QString() != mTitle)
{
painter.setPen(QPen(Qt::white));
QRect titleRect = rect();
titleRect.setX(mBorderSize);
titleRect.setY(2);
titleRect.setHeight(15);
painter.drawText(titleRect, mTitle);
}
QWidget::paintEvent(event);
}
int mBorderSize;
int mTitleSize;
QString mTitle;
};
public:
typedef enum{
mediaType_Video,
@ -81,6 +123,17 @@ public:
virtual UBItem* deepCopy() const;
virtual void setSourceUrl(const QUrl &pSourceUrl)
{
UBGraphicsMediaItem::UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBGraphicsMediaItem::UBAudioPresentationWidget*>(mAudioWidget);
if (pAudioWidget)
{
pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toLocalFile()));
}
UBItem::setSourceUrl(pSourceUrl);
}
public slots:
void toggleMute();
@ -120,13 +173,4 @@ private:
bool haveLinkedImage;
QGraphicsPixmapItem *mLinkedImage;
};
class UBGraphicsUnitedMediaItem : public UBGraphicsMediaItem
{
public:
UBGraphicsUnitedMediaItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent = 0);
};
#endif // UBGRAPHICSMEDIAITEM_H

@ -18,6 +18,7 @@
#include "UBGraphicsMediaItem.h"
#include "UBGraphicsMediaItemDelegate.h"
#include "UBGraphicsDelegateFrame.h"
#include "UBGraphicsScene.h"
@ -120,31 +121,48 @@ void UBGraphicsMediaItemDelegate::positionHandles()
{
UBGraphicsItemDelegate::positionHandles();
qreal AntiScaleRatio = 1 / (UBApplication::boardController->systemScaleFactor() * UBApplication::boardController->currentZoom());
UBGraphicsMediaItem *mediaItem = dynamic_cast<UBGraphicsMediaItem*>(mDelegated);
if (mediaItem)
{
if (mediaItem->getMediaType() != UBGraphicsMediaItem::mediaType_Audio)
{
mToolBarItem->setPos(0, delegated()->boundingRect().height()-mToolBarItem->rect().height()*AntiScaleRatio);
mToolBarItem->setScale(AntiScaleRatio);
QRectF toolBarRect = mToolBarItem->rect();
toolBarRect.setWidth(delegated()->boundingRect().width()/AntiScaleRatio);
mToolBarItem->setRect(toolBarRect);
if (mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Video)
{
mToolBarItem->setPos(0, delegated()->boundingRect().height()-mToolBarItem->rect().height());
// mToolBarItem->setScale(AntiScaleRatio);
toolBarRect.setWidth(delegated()->boundingRect().width());
}
else
else if (mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Audio)
{
mToolBarItem->setPos(0, 0);
int borderSize = 0;
UBGraphicsMediaItem::UBAudioPresentationWidget *audioWidget = dynamic_cast<UBGraphicsMediaItem::UBAudioPresentationWidget*>(delegated()->widget());
if (audioWidget)
borderSize = audioWidget->borderSize();
mToolBarItem->setPos(borderSize,delegated()->boundingRect().height()-(mToolBarItem->rect().height() + borderSize));
toolBarRect.setWidth((delegated()->boundingRect().width()-2*borderSize));
mToolBarItem->show();
}
mToolBarItem->setRect(toolBarRect);
}
int toolBarMinimumWidth = 0;
int mediaItemWidth = mToolBarItem->boundingRect().width();
foreach (DelegateButton* button, mButtons)
{
if (button->getSection() == Qt::TitleBarArea)
mediaItemWidth -= button->boundingRect().width();
{
mediaItemWidth -= button->boundingRect().width() + mToolBarItem->getElementsPadding();
toolBarMinimumWidth += button->boundingRect().width() + mToolBarItem->getElementsPadding();
}
}
toolBarMinimumWidth += mToolBarItem->boundingRect().height();
UBGraphicsMediaItem::UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBGraphicsMediaItem::UBAudioPresentationWidget*>(delegated()->widget());
if (pAudioWidget)
{
pAudioWidget->setMinimumSize(toolBarMinimumWidth + (int)mMediaControl->lcdAreaSize().width() + (int)mMediaControl->rect().height(),26+pAudioWidget->borderSize());
}
QRectF mediaItemRect = mMediaControl->rect();

@ -153,10 +153,30 @@ void UBGraphicsProxyWidget::resize(const QSizeF & pSize)
{
if (pSize != size())
{
QGraphicsProxyWidget::setMaximumSize(pSize.width(), pSize.height());
QGraphicsProxyWidget::resize(pSize.width(), pSize.height());
qreal sizeX = 0;
qreal sizeY = 0;
if (widget())
{
QSizeF minimumItemSize(widget()->minimumSize());
if (minimumItemSize.width() > pSize.width())
sizeX = minimumItemSize.width();
else
sizeX = pSize.width();
if (minimumItemSize.height() > pSize.height())
sizeY = minimumItemSize.height();
else
sizeY = pSize.height();
}
QSizeF size(sizeX, sizeY);
QGraphicsProxyWidget::setMaximumSize(size.width(), size.height());
QGraphicsProxyWidget::resize(size.width(), size.height());
if (widget())
widget()->resize(pSize.width(), pSize.height());
widget()->resize(size.width(), size.height());
if (mDelegate)
mDelegate->positionHandles();
if (scene())

@ -779,7 +779,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
if (mShouldUseOMP)
{
//#pragma omp parallel for
#pragma omp parallel for
for (int i = 0; i < collidItemsSize; i++)
{
UBGraphicsPolygonItem *collidingPolygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*>(collidItems.at(i));
@ -789,7 +789,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
if(eraserInnerRect.contains(collidingPolygonItem->boundingRect()))
{
//#pragma omp critical
#pragma omp critical
// Put the entire polygon into the remove list
toBeRemovedItems << collidingPolygonItem;
}
@ -826,7 +826,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
}
else */if (croppedPathSimplified.isEmpty())
{
//#pragma omp critical
#pragma omp critical
// Put the entire polygon into the remove list if the eraser removes all its visible content
toBeRemovedItems << collidingPolygonItem;
}
@ -837,7 +837,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
foreach(const QPolygonF &pol, croppedPathSimplified.toFillPolygons())
{
UBGraphicsPolygonItem* croppedPolygonItem = collidingPolygonItem->deepCopy(pol);
//#pragma omp critical
#pragma omp critical
if(NULL != pGroup){
croppedPolygonItem->setStrokesGroup(pGroup);
//pGroup->addToGroup(croppedPolygonItem);
@ -845,7 +845,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
// Add this new polygon to the 'added' list
toBeAddedItems << croppedPolygonItem;
}
//#pragma omp critical
#pragma omp critical
// Remove the original polygonitem because it has been replaced by many smaller polygons
toBeRemovedItems << collidingPolygonItem;
}
@ -902,7 +902,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
}
}
if(eDrawingMode_Vector == UBDrawingController::drawingController()->drawingMode()){
if(eDrawingMode_Vector == DRAWING_MODE && !UBDrawingController::drawingController()->isInDesktopMode()){
foreach(QGraphicsItem* item, toBeRemovedItems){
UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item);
if(NULL != poly){
@ -920,7 +920,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
mRemovedItems += toBeRemovedItems;
}
if(eDrawingMode_Vector == UBDrawingController::drawingController()->drawingMode()){
if(eDrawingMode_Vector == DRAWING_MODE && !UBDrawingController::drawingController()->isInDesktopMode()){
foreach(QGraphicsItem* item, toBeAddedItems){
UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item);
if(NULL != poly && NULL != poly->strokesGroup()){

@ -78,14 +78,14 @@ bool UBFileSystemUtils::isAZipFile(QString &filePath)
return result;
}
bool UBFileSystemUtils::copyFile(const QString &source, const QString &Destination, bool overwrite)
bool UBFileSystemUtils::copyFile(const QString &source, const QString &destination, bool overwrite)
{
if (!QFile::exists(source)) {
qDebug() << "file" << source << "does not present in fs";
return false;
}
QString normalizedDestination = Destination;
QString normalizedDestination = destination;
if (QFile::exists(normalizedDestination)) {
if (QFileInfo(normalizedDestination).isFile() && overwrite) {
QFile::remove(normalizedDestination);
@ -103,6 +103,15 @@ bool UBFileSystemUtils::copyFile(const QString &source, const QString &Destinati
return QFile::copy(source, normalizedDestination);
}
bool UBFileSystemUtils::copy(const QString &source, const QString &destination, bool overwrite)
{
if (QFileInfo(source).isDir()) {
return copyDir(source, destination);
} else {
return copyFile(source, destination, overwrite);
}
}
bool UBFileSystemUtils::deleteFile(const QString &path)
{
QFile f(path);

@ -49,6 +49,10 @@ class UBFileSystemUtils
static bool moveDir(const QString& pSourceDirPath, const QString& pTargetDirPath);
static bool copyFile(const QString &source, const QString &destination, bool overwrite = false);
static bool copy(const QString &source, const QString &Destination, bool overwrite = false);
static QString cleanName(const QString& name);
static QString digitFileFormat(const QString& s, int digit);
@ -73,8 +77,6 @@ class UBFileSystemUtils
static bool isAZipFile(QString &filePath);
static bool copyFile(const QString &source, const QString &Destination, bool overwrite = false);
static bool deleteFile(const QString &path);
/**
* Compress a source directory in a zip file.

@ -231,7 +231,6 @@ void UBActionPalette::mouseReleaseEvent(QMouseEvent * event)
void UBActionPalette::actionChanged()
{
emit itemOnActionPaletteChanged();
for(int i = 0; i < mActions.length() && i < mButtons.length(); i++)
{
mButtons.at(i)->setVisible(mActions.at(i)->isVisible());

@ -61,7 +61,6 @@ class UBActionPalette : public UBFloatingPalette
void closed();
void buttonGroupClicked(int id);
void customMouseReleased();
void itemOnActionPaletteChanged();
protected:
virtual void paintEvent(QPaintEvent *event);

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

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

@ -86,7 +86,9 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
{
const QPixmap* pix = source->pageAt(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);
thumbWithText.setBorder(border());

@ -1,5 +1,6 @@
#include "UBFeaturesActionBar.h"
#include "core/memcheck.h"
#include "gui/UBFeaturesWidget.h"
UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWidget* parent, const char* name ) : QWidget (parent)
, featuresController(controller)
@ -8,6 +9,7 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
, mLayout(NULL)
, mpFavoriteAction(NULL)
, mpSocialAction(NULL)
, mpRescanModelAction(NULL)
, mpDeleteAction(NULL)
, mpSearchAction(NULL)
, mpCloseAction(NULL)
@ -15,6 +17,7 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
, mpNewFolderAction(NULL)
, mpFavoriteBtn(NULL)
, mpSocialBtn(NULL)
, mpRescanModelBtn(NULL)
, mpDeleteBtn(NULL)
, mpCloseBtn(NULL)
, mpRemoveFavoriteBtn(NULL)
@ -38,6 +41,7 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
mpFavoriteAction = new QAction(QIcon(":/images/libpalette/miniFavorite.png"), tr("Add to favorites"), this);
mpSocialAction = new QAction(QIcon(":/images/libpalette/social.png"), tr("Share"), this);
mpSearchAction = new QAction(QIcon(":/images/libpalette/miniSearch.png"), tr("Search"), this);
mpRescanModelAction = new QAction(QIcon(":/images/cursors/rotate.png"), tr("Rescan file system"), this);
mpDeleteAction = new QAction(QIcon(":/images/libpalette/miniTrash.png"), tr("Delete"), this);
mpCloseAction = new QAction(QIcon(":/images/close.svg"), tr("Back to folder"), this);
mpRemoveFavorite = new QAction(QIcon(":/images/libpalette/trash_favorite.svg"), tr("Remove from favorites"), this);
@ -46,6 +50,10 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
// Create the buttons
mpFavoriteBtn = new UBActionButton(this, mpFavoriteAction);
mpSocialBtn = new UBActionButton(this, mpSocialAction);
//mpSearchBtn = new UBActionButton(this, mpSearchAction);
mpRescanModelBtn = new UBActionButton(this, mpRescanModelAction);
mpDeleteBtn = new UBActionButton(this, mpDeleteAction);
mpCloseBtn = new UBActionButton(this, mpCloseAction);
mpRemoveFavoriteBtn = new UBActionButton(this, mpRemoveFavorite);
@ -77,14 +85,17 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
connect(mSearchBar, SIGNAL(textChanged(QString)), this, SLOT(onSearchTextChanged(QString)));
connect(mpNewFolderAction, SIGNAL(triggered()), this, SLOT(onActionNewFolder()));
connect(mpRemoveFavorite, SIGNAL(triggered()), this, SLOT(onActionRemoveFavorite()));
connect(mpRescanModelAction, SIGNAL(triggered()), this , SLOT(onActionRescanModel()));
connect(mpDeleteAction,SIGNAL(triggered()), this, SLOT(onActionTrash()));
// Build the default toolbar
mLayout->addWidget(mpFavoriteBtn);
mLayout->addWidget(mpSocialBtn);
mLayout->addWidget(mpNewFolderBtn);
mLayout->addWidget(mSearchBar);
//mLayout->addWidget(mpSearchBtn);
mLayout->addWidget(mpRescanModelBtn);
mLayout->addWidget(mpDeleteBtn);
mLayout->addWidget(mpCloseBtn);
mLayout->addWidget(mpRemoveFavoriteBtn);
@ -113,6 +124,7 @@ void UBFeaturesActionBar::setButtons()
mpNewFolderBtn->show();
mpNewFolderBtn->setEnabled(true);
mpDeleteBtn->setEnabled(true);
mpRescanModelBtn->show();
break;
case IN_ROOT:
mpFavoriteBtn->show();
@ -124,6 +136,7 @@ void UBFeaturesActionBar::setButtons()
mpNewFolderBtn->show();
mpNewFolderBtn->setEnabled(false);
mpDeleteBtn->setEnabled(false);
mpRescanModelBtn->show();
break;
case IN_PROPERTIES:
mpFavoriteBtn->show();
@ -134,6 +147,7 @@ void UBFeaturesActionBar::setButtons()
mpCloseBtn->hide();
mpRemoveFavoriteBtn->hide();
mpNewFolderBtn->hide();
mpRescanModelBtn->hide();
break;
case IN_FAVORITE:
mpFavoriteBtn->hide();
@ -144,6 +158,7 @@ void UBFeaturesActionBar::setButtons()
mpCloseBtn->hide();
mpRemoveFavoriteBtn->show();
mpNewFolderBtn->hide();
mpRescanModelBtn->hide();
break;
case IN_TRASH:
mpFavoriteBtn->hide();
@ -156,6 +171,7 @@ void UBFeaturesActionBar::setButtons()
mpCloseBtn->hide();
//mpRemoveFavoriteBtn->show();
mpNewFolderBtn->hide();
mpRescanModelBtn->hide();
break;
default:
break;
@ -187,48 +203,57 @@ void UBFeaturesActionBar::onActionTrash()
{
emit deleteSelectedElements();
}
/*
void UBFeaturesActionBar::dragMoveEvent(QDragMoveEvent *event)
void UBFeaturesActionBar::onActionRescanModel()
{
event->acceptProposedAction();
emit rescanModel();
}
*/
void UBFeaturesActionBar::dragEnterEvent( QDragEnterEvent *event )
{
if (event->mimeData()->hasFormat("text/uri-list"))
{
const UBFeaturesMimeData *fMimeData = qobject_cast<const UBFeaturesMimeData*>(event->mimeData());
if (fMimeData) {
event->acceptProposedAction();
} else {
event->ignore();
}
}
void UBFeaturesActionBar::dropEvent(QDropEvent *event)
{
const UBFeaturesMimeData *fMimeData = qobject_cast<const UBFeaturesMimeData*>(event->mimeData());
if (!fMimeData) {
qWarning() << "data came from not supported widget";
event->ignore();
return;
}
QWidget *dest = childAt(event->pos());
if ( dest == mpDeleteBtn )
{
QList <QUrl> urls = event->mimeData()->urls();
foreach ( QUrl url, urls )
{
if ( !UBFeaturesController::isDeletable( url ) )
if (dest == mpDeleteBtn) {
QList<UBFeature> featuresList = fMimeData->features();
foreach (UBFeature curFeature, featuresList) {
if (!curFeature.isDeletable()) {
qWarning() << "Undeletable feature found, stopping deleting process";
event->ignore();
return;
}
}
event->setDropAction(Qt::MoveAction);
event->accept();
emit deleteElements( *event->mimeData() );
}
else if ( dest == mpFavoriteBtn )
{
emit deleteElements(fMimeData);
} else if (dest == mpFavoriteBtn) {
event->setDropAction( Qt::CopyAction);
event->accept();
emit addToFavorite( *event->mimeData() );
}
else if ( dest == mpRemoveFavoriteBtn )
{
emit addToFavorite(fMimeData);
} else if (dest == mpRemoveFavoriteBtn) {
event->setDropAction( Qt::MoveAction );
event->accept();
emit removeFromFavorite( *event->mimeData() );
emit removeFromFavorite(fMimeData);
}
}

@ -7,6 +7,8 @@
#include "UBLibActionBar.h"
#include "board/UBFeaturesController.h"
class UBFeaturesMimeData;
enum UBFeaturesActionBarState
{
IN_ROOT,
@ -24,25 +26,30 @@ public:
~UBFeaturesActionBar();
void setCurrentState( UBFeaturesActionBarState state );
signals:
void searchElement(const QString &text);
void newFolderToCreate();
void deleteElements( const QMimeData &data );
void addToFavorite( const QMimeData &data );
void removeFromFavorite( const QMimeData &data );
void deleteElements(const UBFeaturesMimeData *data);
void addToFavorite(const UBFeaturesMimeData *data);
void removeFromFavorite(const UBFeaturesMimeData *data);
void addElementsToFavorite();
void removeElementsFromFavorite();
void deleteSelectedElements();
void rescanModel();
private slots:
void onSearchTextChanged(QString txt);
void onActionNewFolder();
void onActionFavorite();
void onActionRemoveFavorite();
void onActionTrash();
void onActionRescanModel();
protected:
//void dragMoveEvent(QDragMoveEvent *event);
void dragEnterEvent( QDragEnterEvent *event );
void dropEvent( QDropEvent *event );
private:
void setButtons();
UBFeaturesController *featuresController;
@ -56,6 +63,7 @@ private:
QHBoxLayout* mLayout;
QAction* mpFavoriteAction;
QAction* mpSocialAction;
QAction* mpRescanModelAction;
QAction* mpDeleteAction;
QAction* mpSearchAction;
QAction* mpCloseAction;
@ -63,13 +71,11 @@ private:
QAction* mpNewFolderAction;
UBActionButton* mpFavoriteBtn;
UBActionButton* mpSocialBtn;
UBActionButton* mpRescanModelBtn;
UBActionButton* mpDeleteBtn;
//UBActionButton* mpSearchBtn;
UBActionButton* mpCloseBtn;
UBActionButton* mpRemoveFavoriteBtn;
UBActionButton* mpNewFolderBtn;
};
#endif

File diff suppressed because it is too large Load Diff

@ -16,13 +16,12 @@
#include <QDropEvent>
#include "UBDockPaletteWidget.h"
//#include "UBLibActionBar.h"
#include "core/UBSettings.h"
#include "board/UBFeaturesController.h"
#include "api/UBWidgetUniboardAPI.h"
#include "UBFeaturesActionBar.h"
#include "UBRubberBand.h"
#define THUMBNAIL_WIDTH 400
#define ID_LISTVIEW 0
#define ID_PROPERTIES 1
@ -41,6 +40,8 @@ class UBFeatureProperties;
class UBFeatureItemButton;
class UBFeaturesListView;
class UBFeaturesWebView;
class UBFeaturesNavigatorWidget;
class UBFeaturesMimeData;
class UBFeaturesWidget : public UBDockPaletteWidget
{
@ -54,82 +55,100 @@ public:
return mode == eUBDockPaletteWidget_BOARD
|| mode == eUBDockPaletteWidget_DESKTOP;
}
UBFeaturesController * getFeaturesController()const { return controller; };
UBFeaturesController * getFeaturesController() const { return controller; }
static const int minThumbnailSize = 20;
static const int maxThumbnailSize = 100;
static const int defaultThumbnailSize = 40;
public:
int scrollbarHorisontalPadding() const { return 10;}
int scrollbarVerticalIndent() const { return 0;}
private slots:
void onPreviewLoaded(int id, bool pSuccess, QUrl sourceUrl, QString pContentTypeHeader, QByteArray pData, QPointF pPos, QSize pSize, bool isBackground);
void currentSelected( const QModelIndex & );
void searchStarted( const QString & );
void createNewFolder();
void deleteElements( const UBFeaturesMimeData * );
void addToFavorite( const UBFeaturesMimeData *);
void removeFromFavorite( const UBFeaturesMimeData * );
void onDisplayMetadata( QMap<QString,QString> );
void onAddDownloadedFileToLibrary(bool, QUrl, QString, QByteArray);
void addElementsToFavorite();
void removeElementsFromFavorite();
void deleteSelectedElements();
void rescanModel();
private:
void switchToListView();
void switchToProperties();
void switchToWebView();
private:
UBFeaturesController *controller;
UBFeaturesItemDelegate *itemDelegate;
UBFeaturesPathItemDelegate *pathItemDelegate;
UBFeaturesModel *featuresModel;
UBFeaturesProxyModel *featuresProxyModel;
UBFeaturesSearchProxyModel *featuresSearchModel;
UBFeaturesPathProxyModel *featuresPathModel;
UBFeaturesListView *featuresListView;
UBFeaturesNavigatorWidget *mNavigator;
UBFeaturesListView *pathListView;
QSlider *thumbSlider;
QVBoxLayout *layout;
//UBFeaturesPathViewer *pathViewer;
//QGraphicsScene *pathScene;
UBFeaturesActionBar *mActionBar;
UBFeatureProperties *featureProperties;
UBFeaturesWebView *webView;
QStackedWidget *stackedWidget;
int currentStackedWidget;
UBDownloadHttpFile* imageGatherer;
};
int currentStackedWidget;
UBDownloadHttpFile* imageGatherer;
class UBFeaturesMimeData : public QMimeData
{
Q_OBJECT
private slots:
void onPreviewLoaded(int id, bool pSuccess, QUrl sourceUrl, QString pContentTypeHeader, QByteArray pData, QPointF pPos, QSize pSize, bool isBackground);
void currentSelected( const QModelIndex & );
//void currentPathChanged(const QString &);
void currentPathChanged( const QModelIndex & );
void searchStarted( const QString & );
void createNewFolder();
void deleteElements( const QMimeData & );
void addToFavorite( const QMimeData & );
void removeFromFavorite( const QMimeData & );
void thumbnailSizeChanged( int );
void onDisplayMetadata( QMap<QString,QString> );
void onAddDownloadedFileToLibrary(bool, QUrl, QString, QByteArray);
void addElementsToFavorite();
void removeElementsFromFavorite();
void deleteSelectedElements();
public:
virtual QStringList formats() const;
QList<UBFeature> features() const {return mFeatures;}
void setFeatures(const QList<UBFeature> &fList) {mFeatures = fList;}
protected:
bool eventFilter(QObject *target, QEvent *event);
private:
QList<UBFeature> mFeatures;
};
class UBFeaturesListView : public QListView
{
Q_OBJECT
public:
UBFeaturesListView( QWidget* parent=0, const char* name="UBFeaturesListView" );
virtual ~UBFeaturesListView() {;}
protected:
virtual void dragEnterEvent( QDragEnterEvent *event );
virtual void dropEvent( QDropEvent *event );
virtual void dragMoveEvent( QDragMoveEvent *event );
/*virtual void mousePressEvent( QMouseEvent *event );
virtual void mouseMoveEvent( QMouseEvent *event );
virtual void mouseReleaseEvent( QMouseEvent *event );*/
private slots:
void thumbnailSizeChanged(int);
};
// class created to have the same style for slider and QListView itself
class UBFeaturesNavigatorWidget: public QWidget
{
Q_OBJECT
public:
UBFeaturesNavigatorWidget(QWidget *parent, const char* name = "");
UBFeaturesListView *listView() {return mListView;}
void setSliderPosition(int pValue);
private:
//UBRubberBand *rubberBand;
//QPoint rubberOrigin;
UBFeaturesListView *mListView;
QSlider *mListSlder;
};
class UBFeaturesWebView : public QWidget
{
Q_OBJECT
@ -189,9 +208,6 @@ private:
QTreeWidgetItem* mpItem;
};
class UBFeatureItemButton : public QPushButton
{
public:
@ -202,13 +218,18 @@ public:
class UBFeaturesModel : public QAbstractListModel
{
Q_OBJECT
signals:
void dataRestructured();
public:
UBFeaturesModel( QObject *parent = 0 ) : QAbstractListModel(parent) {;}
UBFeaturesModel(QList<UBFeature> *pFeaturesList, QObject *parent = 0) : QAbstractListModel(parent), featuresList(pFeaturesList) {;}
virtual ~UBFeaturesModel(){;}
void addItem( const UBFeature &item );
void deleteFavoriteItem( const QString &path );
void deleteItem( const QString &path );
void deleteItem(const UBFeature &feature);
QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
QMimeData *mimeData( const QModelIndexList &indexes ) const;
@ -221,9 +242,10 @@ public:
//bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
//bool insertRow(int row, const QModelIndex &parent = QModelIndex());
void moveData(const UBFeature &source, const UBFeature &destination, Qt::DropAction action, bool deleteManualy = false);
Qt::DropActions supportedDropActions() const { return Qt::MoveAction | Qt::CopyAction; }
// void setFeaturesList(QList <UBFeature> *flist ) { featuresList = flist; }
void setFeaturesList(QList <UBFeature> *flist ) { featuresList = flist; }
private:
QList <UBFeature> *featuresList;
};
@ -265,7 +287,7 @@ class UBFeaturesItemDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
UBFeaturesItemDelegate(QWidget *parent = 0, const QListView *lw = 0) : QStyledItemDelegate(parent) { listView = lw; }
UBFeaturesItemDelegate(QObject *parent = 0, const QListView *lw = 0) : QStyledItemDelegate(parent) { listView = lw; }
~UBFeaturesItemDelegate() {}
//UBFeaturesItemDelegate(const QListView *lw = 0) { listView = lw; };
//void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
@ -279,7 +301,7 @@ class UBFeaturesPathItemDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
UBFeaturesPathItemDelegate(QWidget *parent = 0);
UBFeaturesPathItemDelegate(QObject *parent = 0);
~UBFeaturesPathItemDelegate();
virtual QString displayText ( const QVariant & value, const QLocale & locale ) const;
void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;

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

@ -43,7 +43,7 @@ UBRubberBand::UBRubberBand(Shape s, QWidget * p)
#elif defined(Q_WS_MAC)
customStyle = new QMacStyle();
#elif defined(Q_WS_X11)
// customStyle = QStyleFactory::create("oxygen");
customStyle = QStyleFactory::create("oxygen");
#endif
if (customStyle)

@ -49,16 +49,13 @@
#define UBTG_SEPARATOR_FIXED_HEIGHT 3
typedef enum
{
typedef enum {
eUBTGAddSubItemWidgetType_None,
eUBTGAddSubItemWidgetType_Action,
eUBTGAddSubItemWidgetType_Media,
eUBTGAddSubItemWidgetType_Url
} eUBTGAddSubItemWidgetType;
/***************************************************************************
* class UBTeacherGuideEditionWidget *
***************************************************************************/
@ -108,6 +105,7 @@ UBTeacherGuideEditionWidget::UBTeacherGuideEditionWidget(QWidget *parent, const
mpLayout->addWidget(mpSeparator);
mpTreeWidget = new QTreeWidget(this);
mpTreeWidget->setStyleSheet("selection-background-color:transparent; padding-bottom:5px; padding-top:5px;");
mpLayout->addWidget(mpTreeWidget);
mpRootWidgetItem = mpTreeWidget->invisibleRootItem();
@ -121,6 +119,7 @@ UBTeacherGuideEditionWidget::UBTeacherGuideEditionWidget(QWidget *parent, const
mpTreeWidget->header()->setResizeMode(0, QHeaderView::Stretch);
mpTreeWidget->header()->setResizeMode(1, QHeaderView::Fixed);
mpTreeWidget->header()->setDefaultSectionSize(18);
mpTreeWidget->setSelectionMode(QAbstractItemView::NoSelection);
connect(mpTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onAddItemClicked(QTreeWidgetItem*,int)));
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged()));
@ -135,7 +134,6 @@ UBTeacherGuideEditionWidget::UBTeacherGuideEditionWidget(QWidget *parent, const
if (UBSettings::settings()->teacherGuideLessonPagesActivated->get().toBool()) {
UBSvgSubsetAdaptor::addElementToBeStored(QString("teacherGuide"), this);
//connect(UBApplication::boardController,SIGNAL(activeDocumentChanged()),this,SLOT(onActiveDocumentChanged()));
connect(UBApplication::boardController, SIGNAL(documentSet(UBDocumentProxy*)), this, SLOT(onActiveDocumentChanged()));
}
}
@ -150,7 +148,7 @@ UBTeacherGuideEditionWidget::~UBTeacherGuideEditionWidget()
DELETEPTR(mpAddAnActionItem);
DELETEPTR(mpAddAMediaItem);
DELETEPTR(mpAddALinkItem);
DELETEPTR(mpTreeWidget)
DELETEPTR(mpTreeWidget);
DELETEPTR(mpLayout);
}
@ -173,7 +171,8 @@ void UBTeacherGuideEditionWidget::load(QString element)
QDomDocument doc("TeacherGuide");
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();
if (tagName == "title")
mpPageTitle->setInitialText(element.attribute("value"));
@ -188,8 +187,6 @@ void UBTeacherGuideEditionWidget::load(QString element)
}
}
QVector<tIDataStorage*> UBTeacherGuideEditionWidget::save(int pageIndex)
{
QVector<tIDataStorage*> result;
@ -198,16 +195,15 @@ QVector<tIDataStorage*> UBTeacherGuideEditionWidget::save(int pageIndex)
tIDataStorage* data = new tIDataStorage();
data->name = "teacherGuide";
data->type = eElementType_START;
data->attributes.insert("version","1.50");
data->attributes.insert("version", "2.00");
result << data;
data = new tIDataStorage();
data->name = "title";
data->type = eElementType_UNIQUE;
data->attributes.insert("value", mpPageTitle->text());
if(mpPageTitle->text().length()){
if (mpPageTitle->text().length())
result << data;
}
data = new tIDataStorage();
data->name = "comment";
@ -312,23 +308,25 @@ void UBTeacherGuideEditionWidget::onAddItemClicked(QTreeWidgetItem* widget, int
newWidgetItem->setData(1, Qt::UserRole, eUBTGAddSubItemWidgetType_None);
newWidgetItem->setIcon(1, QIcon(":images/close.svg"));
switch(addSubItemWidgetType)
{
switch (addSubItemWidgetType) {
case eUBTGAddSubItemWidgetType_Action: {
UBTGActionWidget* actionWidget = new UBTGActionWidget(widget);
if(element) actionWidget->initializeWithDom(*element);
if (element)
actionWidget->initializeWithDom(*element);
mpTreeWidget->setItemWidget(newWidgetItem, 0, actionWidget);
break;
}
case eUBTGAddSubItemWidgetType_Media: {
UBTGMediaWidget* mediaWidget = new UBTGMediaWidget(widget);
if(element) mediaWidget->initializeWithDom(*element);
if (element)
mediaWidget->initializeWithDom(*element);
mpTreeWidget->setItemWidget(newWidgetItem, 0, mediaWidget);
break;
}
case eUBTGAddSubItemWidgetType_Url: {
UBTGUrlWidget* urlWidget = new UBTGUrlWidget();
if(element) urlWidget->initializeWithDom(*element);
if (element)
urlWidget->initializeWithDom(*element);
mpTreeWidget->setItemWidget(newWidgetItem, 0, urlWidget);
break;
}
@ -348,32 +346,42 @@ void UBTeacherGuideEditionWidget::onAddItemClicked(QTreeWidgetItem* widget, int
}
else if (column == 1 && addSubItemWidgetType == eUBTGAddSubItemWidgetType_None) {
UBTGMediaWidget* media = dynamic_cast<UBTGMediaWidget*>(mpTreeWidget->itemWidget(widget, 0));
if(media) media->removeSource();
if (media)
media->removeSource();
int index = mpTreeWidget->currentIndex().row();
QTreeWidgetItem* toBeDeletedWidgetItem = widget->parent()->takeChild(index);
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 *
***************************************************************************/
typedef enum
{
typedef enum {
tUBTGActionAssociateOnClickItem_NONE,
tUBTGActionAssociateOnClickItem_URL,
tUBTGActionAssociateOnClickItem_MEDIA,
tUBTGActionAssociateOnClickItem_EXPAND
} tUBTGActionAssociateOnClickItem;
typedef enum
{
typedef enum {
tUBTGTreeWidgetItemRole_HasAnAction = Qt::UserRole,
tUBTGTreeWidgetItemRole_HasAnUrl
} tUBTGTreeWidgetItemRole;
UBTeacherGuidePresentationWidget::UBTeacherGuidePresentationWidget(QWidget *parent, const char *name) : QWidget(parent)
UBTeacherGuidePresentationWidget::UBTeacherGuidePresentationWidget(QWidget *parent, const char *name) :
QWidget(parent)
, mpPageTitle(NULL)
, mpComment(NULL)
, mpLayout(NULL)
@ -435,12 +443,14 @@ UBTeacherGuidePresentationWidget::UBTeacherGuidePresentationWidget(QWidget *pare
mpLayout->addWidget(mpTreeWidget);
mpRootWidgetItem = mpTreeWidget->invisibleRootItem();
mpTreeWidget->setSelectionMode(QAbstractItemView::NoSelection);
mpTreeWidget->setDragEnabled(true);
mpTreeWidget->setRootIsDecorated(false);
mpTreeWidget->setIndentation(0);
mpTreeWidget->setDropIndicatorShown(false);
mpTreeWidget->header()->close();
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(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged()));
}
@ -503,7 +513,6 @@ void UBTeacherGuidePresentationWidget::createMediaButtonItem()
}
}
void UBTeacherGuidePresentationWidget::showData( QVector<tUBGEElementNode*> data)
{
cleanData();
@ -566,10 +575,10 @@ void UBTeacherGuidePresentationWidget::showData(QVector<tUBGEElementNode*> data)
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) {
switch(associateAction)
{
switch (associateAction) {
case tUBTGActionAssociateOnClickItem_EXPAND:
widget->setExpanded(!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)
, mpButtonTitleLayout(NULL)
, mpModePushButton(NULL)
@ -635,7 +644,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpPageNumberLabel = new QLabel(this);
mpPageNumberLabel->setAlignment(Qt::AlignRight);
mpPageNumberLabel->setObjectName("UBTGPageNumberLabel");
mpPageNumberLabel->setText(tr("Page 0"));
mpPageNumberLabel->setText(tr("Title page"));
mpLayout->addWidget(mpPageNumberLabel);
mpButtonTitleLayout = new QHBoxLayout(0);
@ -772,7 +781,6 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpLayout->addLayout(mpLicenceLayout);
mpLayout->addStretch(1);
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged()));
fillComboBoxes();
}
@ -850,7 +858,6 @@ void UBTeacherGuidePageZeroWidget::fillComboBoxes()
mpSchoolLevelBox->addItem( gradeLevels.at(i).toElement().attribute("label"));
}
QDomNodeList types = rootElement.elementsByTagName("types").at(0).childNodes();
for (int i = 0; i < types.count(); i += 1)
mpSchoolTypeBox->addItem(types.at(i).toElement().attribute("label"));
@ -858,10 +865,18 @@ void UBTeacherGuidePageZeroWidget::fillComboBoxes()
parametersFile.close();
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);
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)
mpLicenceBox->setItemData(i, licenceIconList.at(i));
}
@ -874,8 +889,7 @@ void UBTeacherGuidePageZeroWidget::onSchoolLevelChanged(QString schoolLevel)
mpSchoolSubjectsItemLabel->setEnabled(true);
mpSchoolSubjectsBox->setEnabled(true);
mpSchoolSubjectsBox->addItems(subjects);
}
else{
} else {
mpSchoolSubjectsItemLabel->setDisabled(true);
mpSchoolSubjectsBox->setDisabled(true);
}
@ -1064,13 +1078,29 @@ QVector<tUBGEElementNode*> UBTeacherGuidePageZeroWidget::getData()
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 *
***************************************************************************/
UBTeacherGuideWidget::UBTeacherGuideWidget(QWidget* parent, const char* name): QStackedWidget(parent)
UBTeacherGuideWidget::UBTeacherGuideWidget(QWidget* parent, const char* name) :
QStackedWidget(parent)
, mpPageZeroWidget(NULL)
, mpEditionWidget(NULL)
, mpPresentationWidget(NULL)
, mKeyboardActionFired(false)
{
setObjectName(name);
if (UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool()) {
@ -1089,7 +1119,6 @@ UBTeacherGuideWidget::UBTeacherGuideWidget(QWidget* parent, const char* name): Q
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged()));
}
UBTeacherGuideWidget::~UBTeacherGuideWidget()
{
DELETEPTR(mpPageZeroWidget);
@ -1097,23 +1126,49 @@ UBTeacherGuideWidget::~UBTeacherGuideWidget()
DELETEPTR(mpPresentationWidget);
}
void UBTeacherGuideWidget::onActiveSceneChanged()
{
if (UBApplication::boardController->currentPage() == 0) {
setCurrentWidget(mpPageZeroWidget);
mpPageZeroWidget->switchToMode(tUBTGZeroPageMode_EDITION);
}else
}
else
setCurrentWidget(mpEditionWidget);
}
#include "core/UBApplication.h"
#include "gui/UBMainWindow.h"
void UBTeacherGuideWidget::onTriggeredAction(bool checked)
{
Q_UNUSED(checked);
if(!mKeyboardActionFired)
showPresentationMode();
mKeyboardActionFired=false;
}
void UBTeacherGuideWidget::onTriggeredKeyboardAction(bool checked)
{
Q_UNUSED(checked);
mKeyboardActionFired = true;
}
void UBTeacherGuideWidget::connectToStylusPalette()
{
if(UBApplication::boardController->paletteManager())
connect(UBApplication::boardController->paletteManager()->stylusPalette(),SIGNAL(itemOnActionPaletteChanged()),this,SLOT(showPresentationMode()));
else
QTimer::singleShot(100,this,SLOT(connectToStylusPalette()));
connect(UBApplication::mainWindow->actionPen, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionEraser, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionMarker, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionPointer, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionPlay, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionZoomIn, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionZoomOut, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionCapture, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionHand, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionLine, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionText, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionSelector, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(onTriggeredKeyboardAction(bool)));
}
void UBTeacherGuideWidget::showPresentationMode()
@ -1137,3 +1192,11 @@ void UBTeacherGuideWidget::changeMode()
setCurrentWidget(mpEditionWidget);
}
bool UBTeacherGuideWidget::isModified()
{
if (currentWidget() == mpPageZeroWidget)
return mpPageZeroWidget->isModified();
else
return mpEditionWidget->isModified();
}

@ -50,6 +50,8 @@ public:
void load(QString element);
QVector<tIDataStorage*> save(int pageIndex);
bool isModified();
public slots:
void onAddItemClicked(QTreeWidgetItem* widget, int column, QDomElement* element = 0);
void onActiveSceneChanged();
@ -124,6 +126,7 @@ public:
~UBTeacherGuidePageZeroWidget();
QVector<tUBGEElementNode*> getData();
bool isModified();
public slots:
@ -198,6 +201,8 @@ public:
explicit UBTeacherGuideWidget(QWidget* parent = 0, const char* name="UBTeacherGuideWidget");
~UBTeacherGuideWidget();
bool isModified();
public slots:
void changeMode();
void showPresentationMode();
@ -209,6 +214,11 @@ private:
UBTeacherGuideEditionWidget* mpEditionWidget;
UBTeacherGuidePresentationWidget* mpPresentationWidget;
QVector<tUBGEElementNode*>mCurrentData;
bool mKeyboardActionFired;
private slots:
void onTriggeredAction(bool checked);
void onTriggeredKeyboardAction(bool checked);
};
#endif // UBTEACHERGUIDEWIDGET_H

@ -177,8 +177,6 @@ void UBWebController::tutorialWebInstance()
QString tutorialPath = "/etc/Tutorial/tutorial" + language + "/index.html";
#if defined(Q_WS_MAC)
tutorialHtmlIndexFile = QApplication::applicationDirPath()+ "/../Resources" + tutorialPath;
#elif defined(Q_WS_WIN)
tutorialHtmlIndexFile = QApplication::applicationDirPath()+ tutorialPath;
#else
tutorialHtmlIndexFile = QApplication::applicationDirPath() + tutorialPath;
#endif

Loading…
Cancel
Save