Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Ivan Ilin 13 years ago
commit 96d942c8cc
  1. 2
      Sankore_3.1.pro
  2. 2
      release.linux.sh
  3. BIN
      resources/i18n/sankore_es.qm
  4. 2860
      resources/i18n/sankore_es.ts
  5. 240
      resources/images/libpalette/WebSearchCategory.svg
  6. 39
      resources/library/sankoreInteractivities/ord-phrases.wgt/template/scripts/template2.js
  7. 37
      resources/library/sankoreInteractivities/ord-words.wgt/template/scripts/template2.js
  8. 20
      resources/library/sankoreInteractivities/spl-phrase.wgt/scripts/app.js
  9. 22
      resources/library/sankoreInteractivities/spl-text.wgt/scripts/app2.js
  10. 18
      resources/library/sankoreInteractivities/spl-word.wgt/scripts/spl-word.js
  11. 3
      resources/sankore.qrc
  12. 21
      resources/style.qss
  13. 128
      src/board/UBBoardPaletteManager.cpp
  14. 1
      src/board/UBBoardPaletteManager.h
  15. 35
      src/board/UBLibraryController.cpp
  16. 3
      src/board/UBLibraryController.h
  17. 11
      src/core/UBApplicationController.cpp
  18. 7
      src/core/UBPersistenceManager.cpp
  19. 2
      src/core/UBPersistenceManager.h
  20. 9
      src/core/UBSettings.cpp
  21. 1
      src/core/UBSettings.h
  22. 86
      src/desktop/UBDesktopAnnotationController.cpp
  23. 8
      src/desktop/UBDesktopAnnotationController.h
  24. 18
      src/document/UBDocumentController.cpp
  25. 6
      src/document/UBDocumentController.h
  26. 1
      src/domain/UBGraphicsItemDelegate.cpp
  27. 1
      src/frameworks/UBFileSystemUtils.cpp
  28. 11
      src/gui/UBCachePropertiesWidget.cpp
  29. 5
      src/gui/UBDocumentNavigator.cpp
  30. 57
      src/gui/UBKeyboardPalette.cpp
  31. 7
      src/gui/UBKeyboardPalette.h
  32. 63
      src/gui/UBLibItemProperties.cpp
  33. 6
      src/gui/UBLibItemProperties.h
  34. 61
      src/gui/UBLibNavigatorWidget.cpp
  35. 8
      src/gui/UBLibNavigatorWidget.h
  36. 45
      src/gui/UBLibPathViewer.cpp
  37. 8
      src/gui/UBLibPathViewer.h
  38. 86
      src/gui/UBLibWebView.cpp
  39. 27
      src/gui/UBLibWebView.h
  40. 66
      src/gui/UBLibWidget.cpp
  41. 14
      src/gui/UBLibWidget.h
  42. 16
      src/gui/UBLibraryWidget.cpp
  43. 3
      src/gui/UBLibraryWidget.h
  44. 24
      src/gui/UBMainWindow.cpp
  45. 5
      src/gui/UBMainWindow.h
  46. 11
      src/gui/UBUpdateDlg.cpp
  47. 6
      src/gui/gui.pri
  48. 20
      src/network/UBNetworkAccessManager.cpp
  49. 2
      src/tools/UBGraphicsCache.cpp
  50. 31
      src/web/UBWebController.cpp
  51. 14
      src/web/UBWebController.h
  52. 3
      src/web/browser/WBWebView.cpp

@ -7,7 +7,7 @@ CONFIG += debug_and_release \
no_include_pwd
VERSION_MAJ = 1
VERSION_MIN = 28
VERSION_MIN = 35
VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error
VERSION_PATCH = 00

@ -19,7 +19,7 @@ make clean
rm -rf build/linux/release/
rm -rf install
QT_PATH="/usr/local/Trolltech/Qt-4.7.3"
QT_PATH="../Qt-sankore3.1"
PLUGINS_PATH="$QT_PATH/plugins"
QMAKE_PATH="$QT_PATH/bin/qmake"

Binary file not shown.

File diff suppressed because it is too large Load Diff

@ -0,0 +1,240 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.2"
x="0px"
y="0px"
width="96px"
height="96px"
viewBox="0 -8.898 96 96"
overflow="visible"
xml:space="preserve"
id="svg2"
inkscape:version="0.48.1 r9760"
sodipodi:docname="folder.svg"><metadata
id="metadata70"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1280"
inkscape:window-height="776"
id="namedview68"
showgrid="false"
inkscape:zoom="3"
inkscape:cx="-12.833333"
inkscape:cy="48"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
<defs
id="defs4"><linearGradient
id="linearGradient3819"><stop
style="stop-color:#bcd8dc;stop-opacity:1;"
offset="0"
id="stop3821" /><stop
style="stop-color:#7ecbdc;stop-opacity:0;"
offset="1"
id="stop3823" /></linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3819"
id="radialGradient3825"
cx="71.333336"
cy="70.5"
fx="71.333336"
fy="70.5"
r="7.6666665"
gradientTransform="matrix(1,0,0,0.97826089,0,1.5326073)"
gradientUnits="userSpaceOnUse" /></defs>
<g
id="g6">
<path
fill="none"
stroke="#000000"
stroke-miterlimit="10"
d="M0.75,63.903"
id="path8" />
<linearGradient
id="SVGID_1_"
gradientUnits="userSpaceOnUse"
x1="38.2183"
y1="69.7495"
x2="38.2183"
y2="0.7495">
<stop
offset="0"
style="stop-color:#B8B6B7"
id="stop11" />
<stop
offset="1"
style="stop-color:#D9D9DE"
id="stop13" />
</linearGradient>
<path
fill="url(#SVGID_1_)"
d="M75.687,17.069v-5.114c0-1.247-1.021-2.268-2.268-2.268h-42.67V3.75c0-1.657-1.343-3-3-3H3.75 c-1.657,0-3,1.343-3,3v60c0,3.313,1.116,6,2.772,6c1.657,0,2.657-2.682,3.228-6l5.71-44.432c0.159-1.237,1.31-2.249,2.557-2.249 H75.687"
id="path15" />
<path
fill="none"
stroke="#000000"
stroke-miterlimit="10"
d="M0.75,63.903"
id="path17" />
<linearGradient
id="SVGID_2_"
gradientUnits="userSpaceOnUse"
x1="45.7817"
y1="69.7837"
x2="45.7817"
y2="17.0342">
<stop
offset="0"
style="stop-color:#EBEBED"
id="stop20" />
<stop
offset="1"
style="stop-color:#FFFFFF"
id="stop22" />
</linearGradient>
<path
fill="url(#SVGID_2_)"
d="M3.493,69.703c1.657,0.001,2.66-2.679,3.235-5.997l5.76-44.425c0.161-1.237,1.312-2.248,2.559-2.246 l71.136,0.08c1.246,0.001,2.079,1.006,1.851,2.232l-7.891,42.213c-0.229,1.226-0.789,3.18-1.244,4.341c0,0-1.522,3.886-3.18,3.884 l-71.45-0.08L3.493,69.703z"
id="path24" />
<linearGradient
id="SVGID_3_"
gradientUnits="userSpaceOnUse"
x1="47.1133"
y1="69.7495"
x2="47.1133"
y2="19.7071">
<stop
offset="0"
style="stop-color:#C8C8CC"
id="stop27" />
<stop
offset="0.0241"
style="stop-color:#CBCBCF"
id="stop29" />
<stop
offset="0.1455"
style="stop-color:#D6D6DB"
id="stop31" />
<stop
offset="0.2577"
style="stop-color:#D9D9DE"
id="stop33" />
<stop
offset="1"
style="stop-color:#E5E5E9"
id="stop35" />
</linearGradient>
<path
fill="url(#SVGID_3_)"
d="M6.184,69.75c1.605,0,2.574-2.547,3.126-5.699l5.53-42.207c0.154-1.175,1.268-2.136,2.476-2.136 h68.896c1.208,0,2.016,0.953,1.795,2.118l-7.596,40.108c-0.22,1.164-0.761,3.021-1.2,4.124c0,0-1.47,3.692-3.075,3.692H6.935H6.184 z"
id="path37" />
<g
id="g39">
<linearGradient
id="SVGID_4_"
gradientUnits="userSpaceOnUse"
x1="3.6626"
y1="43.4028"
x2="75.8658"
y2="43.4028">
<stop
offset="0"
style="stop-color:#848685"
id="stop42" />
<stop
offset="0.0053"
style="stop-color:#888A89"
id="stop44" />
<stop
offset="0.0344"
style="stop-color:#9A9C9B"
id="stop46" />
<stop
offset="0.0687"
style="stop-color:#A7A9A9"
id="stop48" />
<stop
offset="0.113"
style="stop-color:#AFB0B1"
id="stop50" />
<stop
offset="0.2025"
style="stop-color:#B1B3B4"
id="stop52" />
<stop
offset="0.4988"
style="stop-color:#AFB0B1"
id="stop54" />
<stop
offset="0.6946"
style="stop-color:#A6A7A7"
id="stop56" />
<stop
offset="0.8607"
style="stop-color:#979898"
id="stop58" />
<stop
offset="1"
style="stop-color:#848685"
id="stop60" />
</linearGradient>
<path
fill="url(#SVGID_4_)"
d="M3.663,69.047c0.725-0.279,1.739-1.881,2.349-5.424l5.705-44.401 c0.209-1.628,1.659-2.903,3.3-2.903h60.849v1.5H15.017c-0.871,0-1.701,0.73-1.813,1.594l-5.71,44.433 c-0.735,4.274-1.954,6.455-3.722,6.642L3.663,69.047z"
id="path62" />
</g>
<path
fill="none"
stroke="#848685"
stroke-width="1.5"
stroke-miterlimit="10"
d="M75.687,17.069v-5.114 c0-1.247-1.021-2.268-2.268-2.268h-42.67V3.75c0-1.657-1.343-3-3-3H3.75c-1.657,0-3,1.343-3,3v60c0,3.313,1.116,6,2.772,6"
id="path64" />
<path
fill="none"
stroke="#848685"
stroke-width="1.5"
stroke-miterlimit="10"
d="M75.819,17.069h10.333 c1.247,0,2.081,1.003,1.853,2.229l-7.842,42.223c-0.228,1.226-0.785,3.18-1.239,4.342c0,0-1.519,3.887-3.175,3.887H3.522"
id="path66" />
</g>
<path
sodipodi:type="arc"
style="opacity:1;fill:#00a9dc;fill-opacity:1;stroke:#0078c5;stroke-opacity:1;stroke-width:1.60000000000000009;stroke-miterlimit:4;stroke-dasharray:none"
id="path3047"
sodipodi:cx="70.833336"
sodipodi:cy="71.5"
sodipodi:rx="15.166667"
sodipodi:ry="15.166667"
d="m 86.000003,71.5 a 15.166667,15.166667 0 1 1 -30.333334,0 15.166667,15.166667 0 1 1 30.333334,0 z"
transform="translate(2.3333333,-7.2313333)" /><path
sodipodi:type="arc"
style="fill:url(#radialGradient3825);fill-opacity:1.0;stroke:none"
id="path3817"
sodipodi:cx="71.333336"
sodipodi:cy="70.5"
sodipodi:rx="7.6666665"
sodipodi:ry="7.5"
d="m 79.000002,70.5 a 7.6666665,7.5 0 1 1 -15.333333,0 7.6666665,7.5 0 1 1 15.333333,0 z"
transform="matrix(1.8043479,0,0,1.7111112,-55.876816,-57.031334)" /></svg>

After

Width:  |  Height:  |  Size: 6.7 KiB

@ -28,7 +28,16 @@ function checkResponse()
var sentence = "this is\nan example\nsentence";
var sentence = "";
var curSentence = "";
if(window.sankore){
sentence = (sankore.preference("rightOrdPhrases", ""))?sankore.preference("rightOrdPhrases", ""):"this is\nan example\nsentence";
curSentence = (sankore.preference("currentOrdPhrases", ""))?sankore.preference("currentOrdPhrases", ""):"";
} else {
sentence = "this is\nan example\nsentence";
}
var doCheck = true;
// array of dom elements
@ -143,8 +152,13 @@ function modeView()
// clean the previous word
$( "#mp_word" ).empty();
var phrases;
// create new set of elements
var phrases = shuffle( createElements( sentence ) );
if(window.sankore && curSentence && !editMode)
phrases = createElements( curSentence );
else
phrases = shuffle( createElements( sentence ) );
for( i in phrases ){
$("#mp_word").append( phrases[i] );
}
@ -153,7 +167,9 @@ function modeView()
// the answer, so no update parameter would be needed
$( "#mp_word" ).sortable();
if( !isSankore ){
$( "#mp_word" ).sortable( { update: checkSentence } );
$( "#mp_word" ).sortable( {
update: checkSentence
} );
} else
$( "#mp_word" ).sortable();
@ -172,7 +188,9 @@ adjust width or height
*/
function adjust( height )
{
$( "#mp_word" ).animate( {height: height } );
$( "#mp_word" ).animate( {
height: height
} );
// if viewed as a widget, resize the window
if( !isBrowser ){
window.resizeTo( widget.width, height + widget_padding );
@ -200,6 +218,19 @@ function modeEdit()
adjust( $( "#mp_word textarea" ).outerHeight() );
}
$(window).mouseout(function(){
if(window.sankore){
var ph = [];
$( "#mp_word .phrase" ).each( function()
{
ph.push( $( this ).text() );
});
sankore.setPreference("currentOrdPhrases", ph.join( "\n" ));
sankore.setPreference("rightOrdPhrases", sentence);
}
});
$(document).ready(function()
{

@ -28,7 +28,16 @@ function checkResponse()
var word = "a*long*,*long*time*ago*...";
var word = "";
var curWord = "";
if(window.sankore){
word = (sankore.preference("rightOrdWords", ""))?sankore.preference("rightOrdWords", ""):"a*long*,*long*time*ago*...";
curWord = (sankore.preference("currentOrdWords", ""))?sankore.preference("currentOrdWords", ""):"";
} else {
word = "a*long*,*long*time*ago*...";
}
var img = "template/images/horse.png";
var doCheckWord = true;
@ -156,7 +165,12 @@ function modeView()
$( "#mp_word" ).empty();
// create new set of letters
var letters = shuffle( createWordLetters( word ) );
var letters;
if(window.sankore && curWord && !editMode)
letters = createWordLetters( curWord );
else
letters = shuffle( createWordLetters( word ) );
for( i in letters ){
$("#mp_word").append( letters[i] );
}
@ -164,7 +178,9 @@ function modeView()
// in sankore api there would be a function to check
// the answer, so no update parameter would be needed
if( !isSankore ){
$( "#mp_word" ).sortable( { update: checkWord } );
$( "#mp_word" ).sortable( {
update: checkWord
} );
} else $( "#mp_word" ).sortable();
// adjustWidth
@ -200,7 +216,9 @@ adjustWidth
*/
function adjustWidth( width )
{
$( "#ub-widget" ).animate( {width: width } );
$( "#ub-widget" ).animate( {
width: width
} );
// if viewed as a widget, resize the window
if( !isBrowser ){
window.resizeTo( width + widget_padding, widget.height );
@ -227,6 +245,17 @@ function modeEdit()
adjustWidth( input_width );
}
$(window).mouseout(function(){
if(window.sankore){
var str = "";
$( "#mp_word .letter" ).each( function(){
str += $(this).text();
});
sankore.setPreference("currentOrdWords", str);
sankore.setPreference("rightOrdWords", word);
}
});
$(document).ready(function()
{

@ -21,10 +21,17 @@ function createElements( phrase )
$(document).ready(function()
{
var w = new wcontainer( "#ub-widget" );
var sentence = "";
if(window.sankore)
sentence = (sankore.preference("ordSplPhrases", ""))?sankore.preference("ordSplPhrases", ""):"this is a bunch of words which should be split apart";
else
sentence = "this is a bunch of words which should be split apart";
w.maxWidth = 600;
w.setEditContent( '<div class="inputwrap"><textarea class="percent">this is a bunch of words which should be split apart</textarea></div>' );
w.setEditContent( '<div class="inputwrap"><textarea class="percent">' + sentence + '</textarea></div>' );
w.setViewContent( '<div class="upper"><div class="dash fixed">. </div></div>' );
w.setData( "dashWidth", w.elements.container.find( ".dash" ).outerWidth() );
w.setViewContent( '<div class="upper"><div class="dash fixed">M</div></div>' );
@ -116,7 +123,10 @@ $(document).ready(function()
h = parseInt( square / w );
}
return { w: w, h: h+dh };
return {
w: w,
h: h+dh
};
};
// editSize
@ -161,4 +171,10 @@ $(document).ready(function()
w.modeView();
$(window).mouseout(function(){
if(window.sankore){
sankore.setPreference("ordSplPhrases", w.getData("phrase"));
}
});
});

@ -24,9 +24,16 @@ $(document).ready(function()
{
var w = new wcontainer( "#ub-widget" );
var sentences = "";
if(window.sankore)
sentences = (sankore.preference("ordSplText", ""))?sankore.preference("ordSplText", ""):"hello, this is the first sentence. hi, this is the second sentence. hello again, this is the third sentence. good morning, this is the fifth sentence. hi, sorry, i\'m late, i\'m the fourth sentence.";
else
sentences = "hello, this is the first sentence. hi, this is the second sentence. hello again, this is the third sentence. good morning, this is the fifth sentence. hi, sorry, i\'m late, i\'m the fourth sentence.";
w.maxWidth = 600;
w.setEditContent( '<div class="inputwrap"><textarea class="percent">hello, this is the first sentence. hi, this is the second sentence. hello again, this is the third sentence. good morning, this is the fifth sentence. hi, sorry, i\'m late, i\'m the fourth sentence.</textarea></div>' );
w.setEditContent( '<div class="inputwrap"><textarea class="percent">' + sentences + '</textarea></div>' );
w.setViewContent( '<div class="upper"><div class="dash fixed">. </div></div>' );
w.setData( "dashWidth", w.elements.container.find( ".dash" ).outerWidth() );
w.setViewContent( '<div class="upper"><div class="dash fixed">M</div></div>' );
@ -117,7 +124,10 @@ $(document).ready(function()
h = parseInt( square / w );
}
return { w: w, h: h+dh };
return {
w: w,
h: h+dh
};
};
// editSize
@ -151,8 +161,6 @@ $(document).ready(function()
}
});
console.log( text );
if( text == this.getData( "text" ) ){
this.elements.containerView.addClass( "answerRight" );
}
@ -167,4 +175,10 @@ $(document).ready(function()
w.modeView();
$(window).mouseout(function(){
if(window.sankore){
sankore.setPreference("ordSplText", w.getData( "text" ));
}
});
});

@ -18,8 +18,13 @@ function createWord( word )
$(document).ready(function()
{
var w = new wcontainer( "#ub-widget" );
var words = "";
w.setEditContent( '<div class="inputwrap"><input class="percent" value="so*phis*ti*ca*ted"></div>' );
if(window.sankore)
words = (sankore.preference("ordSplWords", ""))?sankore.preference("ordSplWords", ""):"so*phis*ti*ca*ted";
else
words = "so*phis*ti*ca*ted";
w.setEditContent( '<div class="inputwrap"><input class="percent" value="' + words + '"></div>' );
w.setViewContent( '<span class="upper"><span class="dash fixed">&mdash;</span></span>' );
w.setData( "dashWidth", w.elements.container.find( "span.dash" ).outerWidth() );
w.setViewContent( "" );
@ -53,7 +58,10 @@ $(document).ready(function()
});
var dw = winstance.getData( "dashWidth" );
return { w: w+dw, h: h };
return {
w: w+dw,
h: h
};
};
// editSize
@ -96,4 +104,10 @@ $(document).ready(function()
w.modeView();
$(window).mouseout(function(){
if(window.sankore){
sankore.setPreference("ordSplWords", w.getData("word"));
}
});
});

@ -319,7 +319,6 @@
<file>images/pages_open.png</file>
<file>images/cache_close.png</file>
<file>images/cache_open.png</file>
<file>style.qss</file>
<file>images/cache_circle.png</file>
<file>images/cache_square.png</file>
<file>images/down_arrow.png</file>
@ -333,6 +332,8 @@
<file>images/teacher_close.png</file>
<file>images/teacher_open.png</file>
<file>images/teacher_close_disabled.png</file>
<file>style.qss</file>
<file>images/teacher_open_disabled.png</file>
<file>images/libpalette/WebSearchCategory.svg</file>
</qresource>
</RCC>

@ -1,13 +1,25 @@
QWidget#DockPaletteWidgetBox,
QWidget#documentNavigator,
QWidget#UBLibraryWidget,
QWidget#UBLibPathViewer,
QWidget#UBTeacherStudentAction
QWidget#UBTeacherStudentAction,
QWidget#UBLibNavigatorWidget,
QWidget#UBLibItemProperties
{
background: #EEEEEE;
border-radius: 10px;
border: 2px solid #999999;
/* padding-bottom: -2px; */
}
QWidget#UBLibWebView
{
background: #EEEEEE;
border-radius : 10px;
border: 2px solid #999999;
}
QWebView#SearchEngineView
{
background:#EEEEEE;
}
QColorDialog
@ -121,8 +133,6 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical
background:transparent;
}
QScrollBar::horizontal
{
background:transparent;
@ -166,7 +176,6 @@ QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal
background:transparent;
}
QSlider::handle::horizontal
{
background-color:#EEEEEE;

@ -106,6 +106,11 @@ UBBoardPaletteManager::~UBBoardPaletteManager()
delete mpLibWidget;
mpLibWidget = NULL;
}
if(NULL != mpTeacherBarWidget)
{
delete mpTeacherBarWidget;
mpTeacherBarWidget = NULL;
}
if(NULL != mpCachePropWidget)
{
delete mpCachePropWidget;
@ -220,15 +225,38 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
void UBBoardPaletteManager::slot_changeMainMode(UBApplicationController::MainMode mainMode)
{
// Board = 0, Internet, Document, Tutorial, ParaschoolEditor, WebDocument
switch( mainMode )
{
case UBApplicationController::Board:
{
// call changeMode only when switch NOT from desktop mode
if(!UBApplication::applicationController->isShowingDesktop())
changeMode(eUBDockPaletteWidget_BOARD);
}
break;
case UBApplicationController::Tutorial:
{
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
mKeyboardPalette->hide();
}
break;
case UBApplicationController::Internet:
changeMode(eUBDockPaletteWidget_WEB);
break;
case UBApplicationController::Document:
changeMode(eUBDockPaletteWidget_DOCUMENT);
break;
default:
{
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
mKeyboardPalette->hide();
}
break;
}
}
@ -255,25 +283,25 @@ void UBBoardPaletteManager::slot_changeDesktopMode(bool isDesktop)
void UBBoardPaletteManager::setupPalettes()
{
setupDockPaletteWidgets();
// Add the other palettes
mStylusPalette = new UBStylusPalette(mContainer, UBSettings::settings()->appToolBarOrientationVertical->get().toBool() ? Qt::Vertical : Qt::Horizontal);
connect(mStylusPalette, SIGNAL(stylusToolDoubleClicked(int)), UBApplication::boardController, SLOT(stylusToolDoubleClicked(int)));
mStylusPalette->show(); // always show stylus palette at startup
if (UBPlatformUtils::hasVirtualKeyboard())
{
mKeyboardPalette = UBKeyboardPalette::create(0);
mKeyboardPalette = new UBKeyboardPalette(0);
#ifndef Q_WS_WIN
connect(mKeyboardPalette, SIGNAL(closed()), mKeyboardPalette, SLOT(onDeactivated()));
#endif
#ifndef Q_WS_MAC
mKeyboardPalette->setParent(mContainer);
// mKeyboardPalette->setParent(mContainer);
#endif
}
setupDockPaletteWidgets();
// Add the other palettes
mStylusPalette = new UBStylusPalette(mContainer, UBSettings::settings()->appToolBarOrientationVertical->get().toBool() ? Qt::Vertical : Qt::Horizontal);
connect(mStylusPalette, SIGNAL(stylusToolDoubleClicked(int)), UBApplication::boardController, SLOT(stylusToolDoubleClicked(int)));
mStylusPalette->show(); // always show stylus palette at startup
mZoomPalette = new UBZoomPalette(mContainer);
QList<QAction*> backgroundsActions;
@ -483,7 +511,7 @@ void UBBoardPaletteManager::connectPalettes()
}
bool isFirstResized = true;
void UBBoardPaletteManager::containerResized()
{
int innerMargin = UBSettings::boardMargin;
@ -493,25 +521,39 @@ void UBBoardPaletteManager::containerResized()
int userTop = innerMargin;
int userHeight = mContainer->height() - (2 * innerMargin);
if(mStylusPalette)
{
mStylusPalette->move(userLeft, userTop);
mStylusPalette->adjustSizeAndPosition();
mStylusPalette->initPosition();
}
if(mZoomPalette)
{
mZoomPalette->move(userLeft + userWidth - mZoomPalette->width()
, userTop + userHeight /*- mPageNumberPalette->height()*/ - innerMargin - mZoomPalette->height());
mZoomPalette->adjustSizeAndPosition();
}
if (mKeyboardPalette)
if (isFirstResized && mKeyboardPalette && mKeyboardPalette->parent() == UBApplication::boardController->controlContainer())
{
isFirstResized = false;
mKeyboardPalette->move(userLeft + (userWidth - mKeyboardPalette->width())/2,
userTop + userHeight - mKeyboardPalette->height());
userTop + (userHeight - mKeyboardPalette->height())/2);
mKeyboardPalette->adjustSizeAndPosition();
}
if(mLeftPalette)
{
mLeftPalette->resize(mLeftPalette->width()-1, mContainer->height());
mRightPalette->resize(mRightPalette->width()-1, mContainer->height());
mLeftPalette->resize(mLeftPalette->width(), mContainer->height());
}
if(mRightPalette)
{
mRightPalette->resize(mRightPalette->width()-1, mContainer->height());
mRightPalette->resize(mRightPalette->width(), mContainer->height());
}
}
@ -683,6 +725,18 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
{
mLeftPalette->setParent(UBApplication::boardController->controlContainer());
mRightPalette->setParent(UBApplication::boardController->controlContainer());
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{
if(mKeyboardPalette->m_isVisible)
{
mKeyboardPalette->hide();
mKeyboardPalette->setParent(UBApplication::boardController->controlContainer());
mKeyboardPalette->show();
}
else
mKeyboardPalette->setParent(UBApplication::boardController->controlContainer());
}
mLeftPalette->setVisible(true);
mRightPalette->setVisible(true);
@ -696,6 +750,18 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
{
mLeftPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
mRightPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{
if(mKeyboardPalette->m_isVisible)
{
mKeyboardPalette->hide();
mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
mKeyboardPalette->show();
}
else
mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
}
mLeftPalette->setVisible(false);
mRightPalette->setVisible(true);
@ -705,12 +771,46 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
}
break;
case eUBDockPaletteWidget_WEB:
{
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{
WBBrowserWindow* brWnd = UBApplication::webController->GetCurrentWebBrowser();
if(mKeyboardPalette->m_isVisible)
{
mKeyboardPalette->hide();
mKeyboardPalette->setParent(brWnd);
mKeyboardPalette->show();
}
else
mKeyboardPalette->setParent(brWnd);
}
}
break;
default:
{
mLeftPalette->setVisible(false);
mRightPalette->setVisible(false);
mLeftPalette->setParent(0);
mRightPalette->setParent(0);
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{
if(mKeyboardPalette->m_isVisible)
{
mKeyboardPalette->hide();
mKeyboardPalette->setParent(0);
mKeyboardPalette->show();
}
else
mKeyboardPalette->setParent(0);
// mKeyboardPalette->update();
}
}
break;
}

@ -26,7 +26,6 @@
#include "gui/UBLibWidget.h"
#include "gui/UBCachePropertiesWidget.h"
#include "gui/UBTeacherBarWidget.h"
#include "core/UBApplicationController.h"

@ -222,7 +222,6 @@ QList<UBLibElement*> UBLibraryController::rootCategoriesList()
element->setMoveable(false);
categories << element;
element = new UBLibElement(eUBLibElementType_Folder, mInteractiveUserDirectoryPath, tr("Applications", "Applications category element"));
element->setThumbnail(QImage(":images/libpalette/ApplicationsCategory.svg"));
element->setMoveable(false);
@ -239,11 +238,20 @@ QList<UBLibElement*> UBLibraryController::rootCategoriesList()
element->setMoveable(false);
categories << element;
// Note : FEATURE IN DEVELOPMENT, DO NOT ERASE (or you will get problems) !!!!
// mSearchCategoryPath = QUrl::fromLocalFile(UBSettings::settings()->uniboardSearchDirectory());
// element = new UBLibElement(eUBLibElementType_Folder, mSearchCategoryPath, tr("Web Search", "Web search category element"));
// element->setThumbnail(QImage(":images/libpalette/WebSearchCategory.svg"));
// element->setMoveable(false);
// categories << element;
element = new UBLibElement(eUBLibElementType_Folder, mAnimationUserDirectoryPath, tr("Animations", "Animations category element"));
element->setThumbnail(QImage(":images/libpalette/FlashCategory.svg"));
element->setMoveable(false);
categories << element;
categories << UBLibElement::trashElement();
return categories;
@ -759,6 +767,31 @@ void UBChainedLibElement::setNextElement(UBChainedLibElement *nextElem)
mpNextElem = nextElem;
}
UBChainedLibElement* UBChainedLibElement::lastElement()
{
UBChainedLibElement* pElem = NULL;
if(NULL != mpNextElem)
{
UBChainedLibElement* pLast = mpNextElem->lastElement();
if(NULL != pLast)
{
pElem = pLast;
}
else
{
pElem = mpNextElem;
}
}
return pElem;
}
QUrl UBChainedLibElement::lastItemPath()
{
return lastElement()->element()->path();
}
UBLibElement* UBLibElement::trashElement()
{
UBLibElement *trashElement;

@ -82,8 +82,10 @@ public:
~UBChainedLibElement();
UBChainedLibElement* nextElement(){return mpNextElem;}
UBChainedLibElement* lastElement();
void setNextElement(UBChainedLibElement* nextElem);
UBLibElement* element(){return mpElem;}
QUrl lastItemPath();
private:
UBLibElement* mpElem;
@ -160,6 +162,7 @@ class UBLibraryController : public QObject
QUrl mInteractiveUserDirectoryPath;
QUrl mInteractiveCategoryPath;
QUrl mAnimationUserDirectoryPath;
QUrl mSearchCategoryPath;
QStringList addItemsToCurrentLibrary(const QDir& pSelectedFolder, const QStringList& pExtensions);

@ -368,6 +368,8 @@ void UBApplicationController::showInternet()
if (UBSettings::settings()->webUseExternalBrowser->get().toBool())
{
showDesktop(true);
UBApplication::webController->show(UBWebController::WebBrowser);
// really no have emit mainModeChanged here ? potential problem with virtual keyboard ?
}
else
{
@ -382,10 +384,11 @@ void UBApplicationController::showInternet()
mMainWindow->show();
mUninoteController->hideWindow();
emit mainModeChanged(Internet);
}
UBApplication::webController->show(UBWebController::WebBrowser);
emit mainModeChanged(Internet);
}
}
@ -563,9 +566,7 @@ void UBApplicationController::downloadJsonFinished(QString currentJson)
}
else {
if (isNoUpdateDisplayed) {
QMessageBox msgBox;
msgBox.setText (tr ("No update available"));
msgBox.exec();
mMainWindow->information(tr("Update"), tr("No update available"));
}
}
}

@ -14,6 +14,7 @@
*/
#include "UBPersistenceManager.h"
#include "gui/UBMainWindow.h"
#include <QtXml>
@ -1005,11 +1006,7 @@ void UBPersistenceManager::checkIfDocumentRepositoryExists()
QString humanPath = QDir::cleanPath(mDocumentRepositoryPath);
humanPath = QDir::toNativeSeparators(humanPath);
QMessageBox::question(
QApplication::activeWindow(),
tr("Document Repository Loss"),
tr("Sankore has lost access to the document repository '%1'. Unfortunately the application must shut down to avoid data corruption. Latest changes may be lost as well.").arg(humanPath),
QMessageBox::Yes);
UBApplication::mainWindow->warning(tr("Document Repository Loss"),tr("Sankore has lost access to the document repository '%1'. Unfortunately the application must shut down to avoid data corruption. Latest changes may be lost as well.").arg(humanPath));
UBApplication::quit();
}

@ -74,8 +74,8 @@ class UBPersistenceManager : public QObject
virtual void persistDocumentScene(UBDocumentProxy* pDocumentProxy,
UBGraphicsScene* pScene, const int pSceneIndex);
virtual void persistTeacherBar(UBDocumentProxy* pDocumentProxy, int page, sTeacherBarInfos infos);
sTeacherBarInfos getTeacherBarInfos(UBDocumentProxy* pDocumentProxy, int page);
virtual UBGraphicsScene* createDocumentSceneAt(UBDocumentProxy* pDocumentProxy, int index);

@ -1020,6 +1020,15 @@ QString UBSettings::uniboardGipLibraryDirectory()
return dirPath;
}
QString UBSettings::uniboardSearchDirectory()
{
QString dirPath = UBPlatformUtils::applicationResourcesDirectory() + "/library/search";
if (!QDir(dirPath).exists())
QDir().mkpath(dirPath);
return dirPath;
}
QString UBSettings::uniboardImageLibraryDirectory()
{
QString defaultRelativePath = QString("./library/image");

@ -112,6 +112,7 @@ class UBSettings : public QObject
QString uniboardImageLibraryDirectory();
QString uniboardUserImageDirectory();
QString defaultUserImagesDirectory();
QString uniboardSearchDirectory();
QString uniboardUserVideoDirectory();
QString uniboardDefaultUserImageLibraryDirectory();

@ -52,7 +52,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mTransparentDrawingView(0)
, mTransparentDrawingScene(0)
, mDesktopPalette(NULL)
, mKeyboardPalette(0)
// , mKeyboardPalette(0)
, mDesktopPenPalette(NULL)
, mDesktopMarkerPalette(NULL)
, mDesktopEraserPalette(NULL)
@ -64,7 +64,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mPendingMarkerButtonPressed(false)
, mPendingEraserButtonPressed(false)
, mbArrowClicked(false)
, mBoardStylusTool(UBStylusTool::Pen)
, mBoardStylusTool(UBStylusTool::Selector /*UBStylusTool::Pen*/)
, mDesktopStylusTool(UBStylusTool::Selector)
{
@ -101,10 +101,15 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
connect(mTransparentDrawingView, SIGNAL(hidden()), mKeyboardPalette, SLOT(hide()));
connect(mTransparentDrawingView, SIGNAL(shown()), this, SLOT(showKeyboard()));
#else
mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView);
mKeyboardPalette->setParent(mTransparentDrawingView);
// mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView);
// mKeyboardPalette->setParent(mTransparentDrawingView);
#endif
connect(mKeyboardPalette, SIGNAL(keyboardActivated(bool)), mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
connect( UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(keyboardActivated(bool)),
mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
// connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)),
// mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
#ifdef Q_WS_X11
connect(mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask()));
connect(mDesktopPalette,SIGNAL(refreshMask()), this, SLOT(refreshMask()));
@ -117,7 +122,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture()));
connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized()));
connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(onDesktopPaletteMinimize()));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool)));
// connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool)));
connect(mTransparentDrawingView, SIGNAL(resized(QResizeEvent*)), this, SLOT(onTransparentWidgetResized()));
@ -164,31 +169,32 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
onDesktopPaletteMaximized();
}
void UBDesktopAnnotationController::showKeyboard(bool show)
{
#ifdef Q_WS_X11
if (!mTransparentDrawingView->isVisible())
return;
#endif
if(mKeyboardPalette)
{
if(show)
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
mKeyboardPalette->setVisible(show);
#ifdef Q_WS_X11
updateMask(true);
#endif
}
}
void UBDesktopAnnotationController::showKeyboard()
{
if (UBApplication::mainWindow->actionVirtualKeyboard->isChecked())
mKeyboardPalette->show();
}
// void UBDesktopAnnotationController::showKeyboard(bool show)
// {
// #ifdef Q_WS_X11
// if (!mTransparentDrawingView->isVisible())
// return;
// #endif
//
// if(mKeyboardPalette)
// {
// if(show)
// UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
// mKeyboardPalette->setVisible(show);
//
// #ifdef Q_WS_X11
// updateMask(true);
// #endif
//
// }
//
// }
// void UBDesktopAnnotationController::showKeyboard()
// {
// if (UBApplication::mainWindow->actionVirtualKeyboard->isChecked())
// mKeyboardPalette->show();
// }
UBDesktopAnnotationController::~UBDesktopAnnotationController()
{
@ -366,12 +372,12 @@ void UBDesktopAnnotationController::close()
void UBDesktopAnnotationController::stylusToolChanged(int tool)
{
UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool;
if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text)
{
if(mKeyboardPalette->m_isVisible)
UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger);
}
// UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool;
// if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text)
// {
// if(mKeyboardPalette->m_isVisible)
// UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger);
// }
updateBackground();
}
@ -910,15 +916,15 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent)
{
p.drawRect(mDesktopPalette->geometry().x(), mDesktopPalette->geometry().y(), mDesktopPalette->width(), mDesktopPalette->height());
}
if(mKeyboardPalette->isVisible())
if(UBApplication::boardController->paletteManager()->mKeyboardPalette->isVisible())
{
p.drawRect(mKeyboardPalette->geometry().x(), mKeyboardPalette->geometry().y(), mKeyboardPalette->width(), mKeyboardPalette->height());
p.drawRect(UBApplication::boardController->paletteManager()->mKeyboardPalette->geometry().x(), UBApplication::boardController->paletteManager()->mKeyboardPalette->geometry().y(),
UBApplication::boardController->paletteManager()->mKeyboardPalette->width(), UBApplication::boardController->paletteManager()->mKeyboardPalette->height());
}
// UBApplication::boardController->paletteManager()->mDesktopRightPalette
if(UBApplication::boardController->paletteManager()->rightPalette()->isVisible())
{
qDebug() << ">>>>>> Drawing the mask for the right palette";
p.drawRect(UBApplication::boardController->paletteManager()->rightPalette()->geometry().x(),
UBApplication::boardController->paletteManager()->rightPalette()->geometry().y(),
UBApplication::boardController->paletteManager()->rightPalette()->width(),

@ -29,7 +29,7 @@ class UBDesktopPenPalette;
class UBDesktopMarkerPalette;
class UBDesktopEraserPalette;
class UBActionPalette;
class UBKeyboardPalette;
//class UBKeyboardPalette;
class UBMainWindow;
#define PROPERTY_PALETTE_TIMER 1000
@ -72,8 +72,8 @@ class UBDesktopAnnotationController : public QObject
void stylusToolChanged(int tool);
void updateBackground();
void showKeyboard(bool show);
void showKeyboard(); //X11 virtual keyboard working only needed
// void showKeyboard(bool show);
// void showKeyboard(); //X11 virtual keyboard working only needed
signals:
/**
@ -118,7 +118,7 @@ class UBDesktopAnnotationController : public QObject
void updateMask(bool bTransparent);
UBDesktopPalette *mDesktopPalette;
UBKeyboardPalette *mKeyboardPalette;
//UBKeyboardPalette *mKeyboardPalette;
UBDesktopPenPalette* mDesktopPenPalette;
UBDesktopMarkerPalette* mDesktopMarkerPalette;
UBDesktopEraserPalette* mDesktopEraserPalette;

@ -38,7 +38,7 @@
#include "board/UBBoardPaletteManager.h"
#include "board/UBDrawingController.h"
#include "gui/UBKeyboardPalette.h"
//#include "gui/UBKeyboardPalette.h"
#include "gui/UBThumbnailView.h"
#include "gui/UBDocumentTreeWidget.h"
@ -70,7 +70,7 @@ UBDocumentController::UBDocumentController(UBMainWindow* mainWindow)
, mToolsPalette(0)
, mToolsPalettePositionned(false)
, mTrashTi(0)
, mKeyboardPalette(0)
// , mKeyboardPalette(0)
{
setupViews();
setupToolbar();
@ -444,12 +444,12 @@ void UBDocumentController::setupViews()
mMessageWindow = new UBMessageWindow(mDocumentUI->thumbnailWidget);
mMessageWindow->hide();
if (UBPlatformUtils::hasVirtualKeyboard())
{
mKeyboardPalette = UBKeyboardPalette::create(0);
mKeyboardPalette->setParent(controlView());
connect(mMainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool)));
}
// if (UBPlatformUtils::hasVirtualKeyboard())
// {
// mKeyboardPalette = UBKeyboardPalette::create(0);
// mKeyboardPalette->setParent(controlView());
// connect(mMainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool)));
// }
}
}
@ -467,6 +467,7 @@ void UBDocumentController::setupToolbar()
connect(mMainWindow->actionDocumentTools, SIGNAL(triggered()), this, SLOT(toggleDocumentToolsPalette()));
}
/*
void UBDocumentController::showKeyboard(bool show)
{
if(mKeyboardPalette)
@ -477,6 +478,7 @@ void UBDocumentController::showKeyboard(bool show)
}
}
*/
void UBDocumentController::setupPalettes()
{

@ -34,7 +34,7 @@ class UBDocumentGroupTreeItem;
class UBDocumentProxyTreeItem;
class UBMainWindow;
class UBDocumentToolsPalette;
class UBKeyboardPalette;
//class UBKeyboardPalette;
class UBDocumentController : public QObject
{
@ -76,7 +76,7 @@ class UBDocumentController : public QObject
void paste();
void focusChanged(QWidget *old, QWidget *current);
void showKeyboard(bool show);
// void showKeyboard(bool show);
protected:
virtual void setupViews();
@ -112,7 +112,7 @@ class UBDocumentController : public QObject
UBDocumentGroupTreeItem* mTrashTi;
UBDocumentProxy* mCurrentDocument;
UBKeyboardPalette *mKeyboardPalette;
// UBKeyboardPalette *mKeyboardPalette;
private slots:

@ -193,6 +193,7 @@ bool UBGraphicsItemDelegate::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
bool UBGraphicsItemDelegate::weelEvent(QGraphicsSceneWheelEvent *event)
{
Q_UNUSED(event);
if( mDelegated->isSelected() )
{
// event->accept();

@ -396,6 +396,7 @@ QString UBFileSystemUtils::mimeTypeFromFileName(const QString& fileName)
if (ext == "m4v") return "video/x-m4v";
// W3C widget
if (ext == "wgt") return "application/widget";
if (ext == "wgs") return "application/search";
// Apple widget
if (ext == "wdgt") return "application/vnd.apple-widget"; //mime type invented by us :-(
if (ext == "swf") return "application/x-shockwave-flash";

@ -92,7 +92,7 @@ UBCachePropertiesWidget::UBCachePropertiesWidget(QWidget *parent, const char *na
mpSizeLabel = new QLabel(tr("Size:"), mpProperties);
mpSizeSlider = new QSlider(Qt::Horizontal, mpProperties);
mpSizeSlider->setMinimumHeight(20);
mpSizeSlider->setMinimum(0);
mpSizeSlider->setMinimum(50);
mpSizeSlider->setMaximum(MAX_SHAPE_WIDTH);
mpSizeLayout->addWidget(mpSizeLabel, 0);
mpSizeLayout->addWidget(mpSizeSlider, 1);
@ -205,6 +205,8 @@ UBCachePropertiesWidget::~UBCachePropertiesWidget()
void UBCachePropertiesWidget::onCloseClicked()
{
if(!mCaches.empty())
{
// Remove the current cache from the list
mCaches.remove(mCaches.indexOf(mpCurrentCache));
@ -216,6 +218,9 @@ void UBCachePropertiesWidget::onCloseClicked()
{
emit cacheListEmpty();
}
emit hideTab(name());
}
}
void UBCachePropertiesWidget::updateCacheColor(QColor color)
@ -321,8 +326,8 @@ void UBCachePropertiesWidget::updateCurrentCache()
// If we fall here, that means:
// 1 - that this page has no cache
// 2 - we do not on Board page
// 3 - we in board mode, but show desktop (as really - desktop mode)
// 2 - we are not in Board mode
// 3 - we are in Board mode, but show desktop (as really - Desktop mode)
emit hideTab(name());
mpCurrentCache = NULL;
setDisabled(true);

@ -141,7 +141,10 @@ void UBDocumentNavigator::updateSpecificThumbnail(int iPage)
{
// Save the current state of the scene
pScene->setModified(true);
UBSvgSubsetAdaptor::persistScene(mCrntDoc,pScene, iPage);
if(UBApplication::boardController)
{
UBApplication::boardController->persistCurrentScene();
}
UBThumbnailAdaptor::persistScene(mCrntDoc->persistencePath(), pScene, iPage);

@ -27,6 +27,9 @@
UBKeyboardPalette::UBKeyboardPalette(QWidget *parent)
: UBActionPalette(Qt::TopRightCorner, parent)
{
// setWindowFlags(/*Qt::CustomizeWindowHint|*/Qt::WindowStaysOnTopHint|Qt::FramelessWindowHint);
setCustomCloseProcessing(true);
setCustomPosition(true);
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
@ -56,57 +59,25 @@ UBKeyboardPalette::UBKeyboardPalette(QWidget *parent)
setContentsMargins( 22, 22, 22, 22 );
connect(this, SIGNAL(keyboardActivated(bool)), this, SLOT(onActivated(bool)));
init();
}
QList<UBKeyboardPalette*> UBKeyboardPalette::instances;
UBKeyboardPalette* UBKeyboardPalette::create(QWidget *parent)
//QList<UBKeyboardPalette*> UBKeyboardPalette::instances;
void UBKeyboardPalette::init()
{
//------------------------------//
if (!UBPlatformUtils::hasVirtualKeyboard())
return NULL;
//------------------------------//
UBKeyboardPalette* firstKeyboard = NULL;
// if we already have keyboards inside, get it position and show/hide status, for new keyboard
if(instances.size() > 0)
firstKeyboard = instances.at(0);
//------------------------------//
m_isVisible = false;
setVisible(false);
UBKeyboardPalette* instance = new UBKeyboardPalette(parent);
instance->setKeyButtonSize(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize->get().toString());
setKeyButtonSize(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize->get().toString());
instance->m_isVisible = firstKeyboard ? firstKeyboard->m_isVisible : false;
instance->setVisible(instance->m_isVisible);
if( firstKeyboard )
instance->move(firstKeyboard->m_pos);
connect(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize, SIGNAL(changed(QVariant)), instance, SLOT(keyboardPaletteButtonSizeChanged(QVariant)));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), instance, SLOT(showKeyboard(bool)));
// connect(instance, SIGNAL(moved(const QPoint&)), instance, SLOT(syncPosition(const QPoint&)));
connect(instance, SIGNAL(closed()), instance, SLOT(hideKeyboard()));
//------------------------------//
instances.append(instance);
foreach(UBKeyboardPalette* inst, instances)
{
connect(inst, SIGNAL(moved(const QPoint&)), instance, SLOT(syncPosition(const QPoint&)));
connect(instance, SIGNAL(moved(const QPoint&)), inst, SLOT(syncPosition(const QPoint&)));
connect(inst, SIGNAL(localeChanged(int)), instance, SLOT(syncLocale(int)));
connect(instance, SIGNAL(localeChanged(int)), inst, SLOT(syncLocale(int)));
// connect(instance, SIGNAL(closed()), inst, )
}
connect(this, SIGNAL(keyboardActivated(bool)), this, SLOT(onActivated(bool)));
connect(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize, SIGNAL(changed(QVariant)), this, SLOT(keyboardPaletteButtonSizeChanged(QVariant)));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool)));
connect(this, SIGNAL(closed()), this, SLOT(hideKeyboard()));
//------------------------------//
return instance;
UBPlatformUtils::setWindowNonActivableFlag(this, true);
}
void UBKeyboardPalette::showKeyboard(bool show)

@ -67,6 +67,7 @@ friend class UBCapsLockButton;
friend class UBLocaleButton;
public:
UBKeyboardPalette(QWidget *parent);
~UBKeyboardPalette();
BTNImages *currBtnImages;
@ -77,8 +78,6 @@ public:
QString getKeyButtonSize() const {QString res; res.sprintf("%dx%d", btnWidth, btnHeight); return res;}
void setKeyButtonSize(const QString& strSize);
static UBKeyboardPalette* create(QWidget *parent);
static QList<UBKeyboardPalette*> instances;
bool m_isVisible;
QPoint m_pos;
@ -120,9 +119,9 @@ protected:
const QString* getLocaleName();
private:
void init();
UBKeyboardPalette(QWidget *parent);
private:
QRect originalRect;

@ -38,38 +38,16 @@ UBLibItemProperties::UBLibItemProperties(QWidget *parent, const char *name):QWid
, mpThumbnail(NULL)
, mpOrigPixmap(NULL)
, mpElement(NULL)
, mpNavigBar(NULL)
, mpNavigLayout(NULL)
, mpNavigBack(NULL)
, mpNavigBackAction(NULL)
{
setObjectName(name);
setAttribute(Qt::WA_StyledBackground, true);
setStyleSheet(UBApplication::globalStyleSheet());
// Create the GUI
mpLayout = new QVBoxLayout(this);
setLayout(mpLayout);
mpNavigBar = new QWidget(this);
mpNavigLayout = new QHBoxLayout(mpNavigBar);
mpNavigBar->setLayout(mpNavigLayout);
mpNavigBar->setStyleSheet(QString("background-color : white; border-radius : 10px;"));
mpNavigBar->setMaximumHeight(42);
mpNavigBackAction = new QAction(QIcon(":/images/libpalette/back.png"), tr("Back"), mpNavigBar);
mpNavigBack = new QToolButton(mpNavigBar);
mpNavigBar->addAction(mpNavigBackAction);
mpNavigBack->setDefaultAction(mpNavigBackAction);
mpNavigBack->setIconSize(QSize(32,32));
mpNavigBack->setToolButtonStyle(Qt::ToolButtonIconOnly);
mpNavigBack->setStyleSheet(QString("QToolButton {color: white; font-weight: bold; font-family: Arial; background-color: transparent; border: none}"));
mpNavigBack->setFocusPolicy(Qt::NoFocus);
mpNavigLayout->addWidget(mpNavigBack, 0);
connect(mpNavigBackAction, SIGNAL(triggered()), this, SLOT(onBack()));
mpNavigLayout->addStretch(1);
mpLayout->addWidget(mpNavigBar);
maxThumbHeight = height() / 4;
mpThumbnail = new QLabel();
@ -77,7 +55,8 @@ UBLibItemProperties::UBLibItemProperties(QWidget *parent, const char *name):QWid
icon.scaledToWidth(THUMBNAIL_WIDTH);
mpThumbnail->setPixmap(icon);
mpThumbnail->setStyleSheet(QString("background-color : white; padding : 10 px; border-radius : 10px;"));
mpThumbnail->setObjectName("DockPaletteWidgetBox");
mpThumbnail->setStyleSheet("background:white;");
mpThumbnail->setAlignment(Qt::AlignHCenter);
mpLayout->addWidget(mpThumbnail, 0);
@ -104,7 +83,8 @@ UBLibItemProperties::UBLibItemProperties(QWidget *parent, const char *name):QWid
mpObjInfos = new QTextEdit(this);
mpObjInfos->setReadOnly(true);
mpObjInfos->setStyleSheet(QString("background-color: white; border-radius : 10px;"));
mpObjInfos->setObjectName("DockPaletteWidgetBox");
mpObjInfos->setStyleSheet("background:white;");
mpLayout->addWidget(mpObjInfos, 1);
connect(mpAddPageButton, SIGNAL(clicked()), this, SLOT(onAddToPage()));
@ -118,26 +98,6 @@ UBLibItemProperties::UBLibItemProperties(QWidget *parent, const char *name):QWid
*/
UBLibItemProperties::~UBLibItemProperties()
{
if(NULL != mpNavigBackAction)
{
delete mpNavigBackAction;
mpNavigBackAction = NULL;
}
if(NULL != mpNavigBack)
{
delete mpNavigBack;
mpNavigBack = NULL;
}
if(NULL != mpNavigLayout)
{
delete mpNavigLayout;
mpNavigLayout = NULL;
}
if(NULL != mpNavigBar)
{
delete mpNavigLayout;
mpNavigLayout = NULL;
}
if(NULL != mpOrigPixmap)
{
delete mpOrigPixmap;
@ -148,11 +108,6 @@ UBLibItemProperties::~UBLibItemProperties()
delete mpLayout;
mpLayout = NULL;
}
//if(NULL != mpButtonLayout)
//{
// delete mpButtonLayout;
// mpButtonLayout = NULL;
//}
if(NULL != mpSetAsBackgroundButton)
{
delete mpSetAsBackgroundButton;
@ -211,10 +166,6 @@ void UBLibItemProperties::adaptSize()
mpThumbnail->setPixmap(mpOrigPixmap->scaledToWidth(THUMBNAIL_WIDTH));
}
}
if(NULL != mpNavigBar)
{
mpNavigBar->resize(width(), mpNavigBar->height());
}
}
/**

@ -73,12 +73,6 @@ private:
QPixmap* mpOrigPixmap;
int maxThumbHeight;
UBLibElement* mpElement;
// Navigation bar
QWidget* mpNavigBar;
QHBoxLayout* mpNavigLayout;
QToolButton* mpNavigBack;
QAction* mpNavigBackAction;
};

@ -15,6 +15,7 @@
#include "UBLibNavigatorWidget.h"
#include "UBLibWidget.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
static int lowBoundForSlider = 40;
@ -29,22 +30,20 @@ static int tickIntervalForSlider = 10;
UBLibNavigatorWidget::UBLibNavigatorWidget(QWidget *parent, const char *name):QWidget(parent)
, mLayout(NULL)
, mLibWidget(NULL)
, mPathViewer(NULL)
, mSlider(NULL)
, mSliderWidthSetting(NULL)
{
setObjectName(name);
setAttribute(Qt::WA_StyledBackground, true);
setStyleSheet(UBApplication::globalStyleSheet());
setAcceptDrops(true);
UBLibWidget* libWidget = dynamic_cast<UBLibWidget*>(parentWidget());
mLayout = new QVBoxLayout(this);
setLayout(mLayout);
mPathViewer = new UBLibPathViewer(this);
mPathViewer->setMaximumHeight(62);
mLayout->addWidget(mPathViewer, 0);
mLibWidget = new UBLibraryWidget(this);
mLayout->addWidget(mLibWidget, 1);
@ -56,27 +55,25 @@ UBLibNavigatorWidget::UBLibNavigatorWidget(QWidget *parent, const char *name):QW
mSlider->setValue(defaultWidth);
mSlider->setTickInterval(tickIntervalForSlider);
mLayout->addWidget(mSlider, 0);
mLibWidget->updateThumbnailsSize(defaultWidth);
connect(mLibWidget, SIGNAL(navigBarUpdate(UBLibElement*)), this, SLOT(onNavigbarUpate(UBLibElement*)));
connect(mLibWidget, SIGNAL(propertiesRequested(UBLibElement*)), this, SLOT(onPropertiesRequested(UBLibElement*)));
connect(mPathViewer, SIGNAL(mouseClick(UBChainedLibElement*)), this, SLOT(onPathItemClicked(UBChainedLibElement*)));
connect(mSlider,SIGNAL(valueChanged(int)),this,SLOT(updateThumbnailsSize(int)));
connect(mPathViewer, SIGNAL(elementsDropped(QList<QString>,UBLibElement*)), mLibWidget, SLOT(onElementsDropped(QList<QString>,UBLibElement*)));
connect(this, SIGNAL(updateNavigBar(UBChainedLibElement*)), libWidget, SLOT(onUpdateNavigBar(UBChainedLibElement*)));
mLibWidget->updateThumbnailsSize(defaultWidth);
connect(mLibWidget, SIGNAL(propertiesRequested(UBLibElement*)), this, SLOT(onPropertiesRequested(UBLibElement*)));
connect(mLibWidget, SIGNAL(displaySearchEngine(UBLibElement*)), this, SLOT(onDisplaySearchEngine(UBLibElement*)));
connect(mSlider,SIGNAL(valueChanged(int)),this,SLOT(updateThumbnailsSize(int)));
connect(libWidget->pathViewer(), SIGNAL(mouseClick(UBChainedLibElement*)), this, SLOT(onPathItemClicked(UBChainedLibElement*)));
connect(libWidget->pathViewer(), SIGNAL(elementsDropped(QList<QString>,UBLibElement*)), mLibWidget, SLOT(onElementsDropped(QList<QString>,UBLibElement*)));
connect(mLibWidget, SIGNAL(navigBarUpdate(UBLibElement*)), libWidget->actionBar(), SLOT(onNavigbarUpdate(UBLibElement*)));
connect(mLibWidget, SIGNAL(itemsSelected(QList<UBLibElement*>, bool)), libWidget->actionBar(), SLOT(onSelectionChanged(QList<UBLibElement*>, bool)));
connect(libWidget->actionBar(), SIGNAL(deleteDone()), mLibWidget, SLOT(onRefreshCurrentFolder()));
connect(mLibWidget, SIGNAL(favoritesEntered(bool)), libWidget->actionBar(), SLOT(onFavoritesEntered(bool)));
connect(libWidget->actionBar(), SIGNAL(searchElement(QString)), mLibWidget, SLOT(onSearchElement(QString)));
connect(libWidget->actionBar(), SIGNAL(newFolderToCreate()), mLibWidget, SLOT(onNewFolderToCreate()));
/*** to update the search bar **/
connect(mLibWidget, SIGNAL(itemClicked()),libWidget->actionBar(), SLOT(onItemChanged()));
connect(mPathViewer, SIGNAL(mouseClick(UBChainedLibElement*)),libWidget->actionBar(), SLOT(onItemChanged()));
connect(libWidget->pathViewer(), SIGNAL(mouseClick(UBChainedLibElement*)),libWidget->actionBar(), SLOT(onItemChanged()));
mLibWidget->init();
}
@ -85,10 +82,10 @@ UBLibNavigatorWidget::UBLibNavigatorWidget(QWidget *parent, const char *name):QW
*/
UBLibNavigatorWidget::~UBLibNavigatorWidget()
{
if(NULL != mPathViewer)
if(NULL != mLibWidget)
{
delete mPathViewer;
mPathViewer = NULL;
delete mLibWidget;
mLibWidget = NULL;
}
if(NULL != mSlider)
{
@ -100,6 +97,11 @@ UBLibNavigatorWidget::~UBLibNavigatorWidget()
delete mSliderWidthSetting;
mSliderWidthSetting = NULL;
}
if(NULL != mLayout)
{
delete mLayout;
mLayout = NULL;
}
}
void UBLibNavigatorWidget::dropMe(const QMimeData *_data)
@ -114,14 +116,8 @@ void UBLibNavigatorWidget::dropMe(const QMimeData *_data)
*/
void UBLibNavigatorWidget::onNavigbarUpate(UBLibElement *pElem)
{
if(NULL != pElem)
{
// Refresh the path navigator
mPathViewer->displayPath(mLibWidget->chainedElements);
// Show the path navigator
mPathViewer->show();
}
Q_UNUSED(pElem);
emit updateNavigBar(mLibWidget->chainedElements);
}
/**
@ -157,13 +153,22 @@ void UBLibNavigatorWidget::removeNextChainedElements(UBChainedLibElement *fromEl
/**
* \brief Handles the properties requested event
* @param elem as tje related element
* @param elem as the related element
*/
void UBLibNavigatorWidget::onPropertiesRequested(UBLibElement *elem)
{
emit propertiesRequested(elem);
}
/**
* \brief Handles the display search engine requested event
* @param elem as the related element
*/
void UBLibNavigatorWidget::onDisplaySearchEngine(UBLibElement *elem)
{
emit displaySearchEngine(elem);
}
/**
* \brief Update the thumbnails size
* @param newSize as the given thumbnails size

@ -21,7 +21,6 @@
#include <QDropEvent>
#include "UBLibraryWidget.h"
#include "UBLibPathViewer.h"
#include "core/UBSetting.h"
class UBLibNavigatorWidget : public QWidget
@ -32,24 +31,25 @@ public:
~UBLibNavigatorWidget();
void dropMe(const QMimeData* _data);
UBLibraryWidget* libraryWidget(){return mLibWidget;};
UBLibraryWidget* libraryWidget(){return mLibWidget;}
signals:
void propertiesRequested(UBLibElement* elem);
void displaySearchEngine(UBLibElement* elem);
void updateNavigBar(UBChainedLibElement* elem);
private slots:
void onNavigbarUpate(UBLibElement* pElem);
void onPathItemClicked(UBChainedLibElement *elem);
void onPropertiesRequested(UBLibElement* elem);
void updateThumbnailsSize(int newSize);
void onDisplaySearchEngine(UBLibElement* elem);
private:
void removeNextChainedElements(UBChainedLibElement* fromElem);
QVBoxLayout* mLayout;
UBLibraryWidget* mLibWidget;
UBLibPathViewer* mPathViewer;
QSlider* mSlider;
UBSetting* mSliderWidthSetting;
};

@ -29,15 +29,21 @@
*/
UBLibPathViewer::UBLibPathViewer(QWidget *parent, const char *name):QGraphicsView(parent)
, mpElems(NULL)
, mpElemsBackup(NULL)
, mpScene(NULL)
, mpLayout(NULL)
, mpContainer(NULL)
, mpBackElem(NULL)
{
setObjectName(name);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
setAcceptDrops(true);
mpBackElem = new UBLibElement();
mpBackElem->setThumbnail(QPixmap(":images/libpalette/back.png").toImage());
mpBackElem->setDeletable(false);
mpScene = new UBPathScene(this);
setScene(mpScene);
@ -57,21 +63,31 @@ UBLibPathViewer::UBLibPathViewer(QWidget *parent, const char *name):QGraphicsVie
*/
UBLibPathViewer::~UBLibPathViewer()
{
// if(NULL != mpLayout)
// {
// delete mpLayout;
// mpLayout = NULL;
// }
if(NULL != mpContainer)
{
delete mpContainer;
mpContainer = NULL;
}
if(NULL != mpBackElem)
{
delete mpBackElem;
mpBackElem = NULL;
}
if(NULL != mpElems)
{
delete mpElems;
mpElems = NULL;
}
if(NULL != mpElemsBackup)
{
delete mpElemsBackup;
mpElemsBackup = NULL;
}
if(NULL != mpLayout)
{
delete mpLayout;
mpLayout = NULL;
}
if(NULL != mpScene)
{
delete mpScene;
@ -255,6 +271,24 @@ void UBLibPathViewer::onElementsDropped(QList<QString> elements, UBLibElement *t
emit elementsDropped(elements, target);
}
void UBLibPathViewer::showBack()
{
// Backup the current path so we can go back by clicking on the back button
mpElemsBackup = mpElems;
// Set the correct path to the backElem
UBChainedLibElement* pLastElem = mpElemsBackup->lastElement();
if(NULL != pLastElem)
{
mpBackElem->setPath(pLastElem->element()->path());
mpBackElem->setType(eUBLibElementType_Folder);
mpBackElem->setName(pLastElem->element()->name());
}
// Display the 'back' element
displayPath(new UBChainedLibElement(mpBackElem));
}
UBFolderPath::UBFolderPath():QGraphicsProxyWidget()
{
@ -422,7 +456,6 @@ void UBPathScene::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
void UBPathScene::dropEvent(QGraphicsSceneDragDropEvent *event)
{
const QMimeData* pMimeData = event->mimeData();
qDebug() << " Drop source : " << event->source()->metaObject()->className();
if(0 == QString::compare(event->source()->metaObject()->className(), "UBLibraryWidget"))
{

@ -79,6 +79,10 @@ public:
void displayPath(UBChainedLibElement* elementsChain);
int widgetAt(QPointF p);
void updateScrolls();
public slots:
void showBack();
signals:
void mouseClick(UBChainedLibElement* elem);
void elementsDropped(QList<QString> elements, UBLibElement* target);
@ -99,6 +103,8 @@ private:
/** The chained path elements */
UBChainedLibElement* mpElems;
/** The backup chained path elements */
UBChainedLibElement* mpElemsBackup;
/** The scene */
UBPathScene* mpScene;
//QGraphicsScene* mpScene;
@ -110,6 +116,8 @@ private:
QVector<QGraphicsWidget*> mVItems;
/** The total width of the element in the scene */
int mSceneWidth;
/** The back element */
UBLibElement* mpBackElem;
};

@ -0,0 +1,86 @@
#include <QDomDocument>
#include "core/UBApplication.h"
#include "UBLibWebView.h"
UBLibWebView::UBLibWebView(QWidget* parent, const char* name):QWidget(parent)
, mpView(NULL)
, mpWebSettings(NULL)
, mpLayout(NULL)
{
setObjectName(name);
setAttribute(Qt::WA_StyledBackground, true);
setStyleSheet(UBApplication::globalStyleSheet());
mpLayout = new QVBoxLayout();
setLayout(mpLayout);
mpView = new QWebView(this);
mpView->setObjectName("SearchEngineView");
//mpView->setStyleSheet(QString("background-color:white;"));
mpWebSettings = QWebSettings::globalSettings();
mpWebSettings->setAttribute(QWebSettings::JavaEnabled, true);
mpWebSettings->setAttribute(QWebSettings::PluginsEnabled, true);
mpWebSettings->setAttribute(QWebSettings::JavaEnabled, true);
mpWebSettings->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true);
mpWebSettings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true);
mpWebSettings->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
mpWebSettings->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
mpWebSettings->setAttribute(QWebSettings::DnsPrefetchEnabled, true);
mpLayout->addWidget(mpView);
}
UBLibWebView::~UBLibWebView()
{
if(NULL != mpView)
{
delete mpView;
mpView = NULL;
}
if(NULL != mpLayout)
{
delete mpLayout;
mpLayout = NULL;
}
}
void UBLibWebView::setElement(UBLibElement *elem)
{
if(NULL != elem)
{
QString qsWidgetName;
QString path = elem->path().toLocalFile();
QString qsConfigPath = QString("%0/config.xml").arg(path);
if(QFile::exists(qsConfigPath))
{
QFile f(qsConfigPath);
if(f.open(QIODevice::ReadOnly))
{
QDomDocument domDoc;
domDoc.setContent(QString(f.readAll()));
QDomElement root = domDoc.documentElement();
QDomNode node = root.firstChild();
while(!node.isNull())
{
if(node.toElement().tagName() == "content")
{
QDomAttr srcAttr = node.toElement().attributeNode("src");
qsWidgetName = srcAttr.value();
break;
}
node = node.nextSibling();
}
f.close();
}
}
mpView->load(QUrl::fromLocalFile(QString("%0/%1").arg(path).arg(qsWidgetName)));
}
}

@ -0,0 +1,27 @@
#ifndef UBLIBWEBVIEW_H
#define UBLIBWEBVIEW_H
#include <QWidget>
#include <QWebView>
#include <QWebSettings>
#include <QVBoxLayout>
#include "board/UBLibraryController.h"
class UBLibWebView : public QWidget
{
Q_OBJECT
public:
UBLibWebView(QWidget* parent = 0, const char* name = "UBLibWebView");
~UBLibWebView();
void setElement(UBLibElement* elem);
private:
QWebView* mpView;
QWebSettings* mpWebSettings;
QVBoxLayout* mpLayout;
};
#endif // UBLIBWEBVIEW_H

@ -29,6 +29,8 @@ UBLibWidget::UBLibWidget(QWidget *parent, const char *name):UBDockPaletteWidget(
, mNavigator(NULL)
, mProperties(NULL)
, mActionBar(NULL)
, mpWebView(NULL)
, mpPathViewer(NULL)
{
setObjectName(name);
mName = "LibWidget";
@ -43,23 +45,37 @@ UBLibWidget::UBLibWidget(QWidget *parent, const char *name):UBDockPaletteWidget(
mLayout = new QVBoxLayout(this);
setLayout(mLayout);
// -------------
// Build the GUI
// -------------
// The 'global' widgets
mStackedWidget = new QStackedWidget(this);
mActionBar = new UBLibActionBar(this);
mpPathViewer = new UBLibPathViewer(this);
mpPathViewer->setMaximumHeight(62);
// The internal widgets
mNavigator = new UBLibNavigatorWidget(this);
mProperties = new UBLibItemProperties(this);
mpWebView = new UBLibWebView(this);
mLayout->addWidget(mpPathViewer, 0);
mLayout->addWidget(mStackedWidget, 1);
mLayout->addWidget(mActionBar, 0);
mStackedWidget->addWidget(mNavigator);
mStackedWidget->addWidget(mProperties);
mStackedWidget->addWidget(mpWebView);
mStackedWidget->setCurrentIndex(ID_NAVIGATOR);
miCrntStackWidget = ID_NAVIGATOR;
connect(mNavigator, SIGNAL(updateNavigBar(UBChainedLibElement*)), this, SLOT(onUpdateNavigBar(UBChainedLibElement*)));
connect(mNavigator, SIGNAL(propertiesRequested(UBLibElement*)), this, SLOT(showProperties(UBLibElement*)));
connect(mNavigator, SIGNAL(displaySearchEngine(UBLibElement*)), this, SLOT(showSearchEngine(UBLibElement*)));
connect(mProperties, SIGNAL(showFolderContent()), this, SLOT(showFolder()));
connect(this, SIGNAL(showLibElemProperties()), mpPathViewer, SLOT(showBack()));
connect(this, SIGNAL(showLibSearchEngine()), mpPathViewer, SLOT(showBack()));
}
/**
@ -67,16 +83,41 @@ UBLibWidget::UBLibWidget(QWidget *parent, const char *name):UBDockPaletteWidget(
*/
UBLibWidget::~UBLibWidget()
{
if(NULL != mpPathViewer)
{
delete mpPathViewer;
mpPathViewer = NULL;
}
if(NULL != mNavigator)
{
delete mNavigator;
mNavigator = NULL;
}
if(NULL != mpWebView)
{
delete mpWebView;
mpWebView = NULL;
}
if(NULL != mProperties)
{
delete mProperties;
mProperties = NULL;
}
if(NULL != mStackedWidget)
{
delete mStackedWidget;
mStackedWidget = NULL;
}
if(NULL != mActionBar)
{
delete mActionBar;
mActionBar = NULL;
}
if(NULL != mLayout)
{
delete mLayout;
mLayout = NULL;
}
}
/**
@ -133,14 +174,26 @@ void UBLibWidget::showProperties(UBLibElement *elem)
{
if(NULL != elem)
{
emit showLibElemProperties();
mActionBar->setButtons(eButtonSet_Properties);
// Show the properties of this object
mProperties->showElement(elem);
mStackedWidget->setCurrentIndex(ID_PROPERTIES);
miCrntStackWidget = ID_PROPERTIES;
}
}
void UBLibWidget::showSearchEngine(UBLibElement *elem)
{
if(NULL != elem)
{
emit showLibSearchEngine();
mActionBar->hide();
mpWebView->setElement(elem);
mStackedWidget->setCurrentIndex(ID_WEBVIEW);
miCrntStackWidget = ID_WEBVIEW;
}
}
void UBLibWidget::showFolder()
{
mActionBar->setButtons(mActionBar->previousButtonSet());
@ -157,3 +210,14 @@ int UBLibWidget::border()
{
return 15;
}
void UBLibWidget::onUpdateNavigBar(UBChainedLibElement *elem)
{
mpPathViewer->displayPath(elem);
mpPathViewer->show();
if(ID_NAVIGATOR != miCrntStackWidget)
{
showFolder();
}
}

@ -30,9 +30,12 @@
#include "UBLibNavigatorWidget.h"
#include "UBLibItemProperties.h"
#include "UBLibActionBar.h"
#include "UBLibWebView.h"
#include "UBLibPathViewer.h"
#define ID_NAVIGATOR 0
#define ID_PROPERTIES 1
#define ID_WEBVIEW 2
class UBLibWidget : public UBDockPaletteWidget
{
@ -42,10 +45,13 @@ public:
~UBLibWidget();
UBLibActionBar* actionBar(){return mActionBar;}
UBLibNavigatorWidget* libNavigator() {return mNavigator;};
UBLibNavigatorWidget* libNavigator() {return mNavigator;}
UBLibPathViewer* pathViewer() {return mpPathViewer;}
signals:
void resized();
void showLibElemProperties();
void showLibSearchEngine();
protected:
void dragEnterEvent(QDragEnterEvent* pEvent);
@ -55,7 +61,9 @@ protected:
private slots:
void showProperties(UBLibElement* elem);
void showSearchEngine(UBLibElement* elem);
void showFolder();
void onUpdateNavigBar(UBChainedLibElement* elem);
private:
void processMimeData(const QMimeData* pData);
@ -74,6 +82,10 @@ private:
UBLibActionBar* mActionBar;
/** The current stack widget index*/
int miCrntStackWidget;
/** The webview used to display the search engines */
UBLibWebView* mpWebView;
/** The path navigation widget */
UBLibPathViewer* mpPathViewer;
};
#endif // UBLIBWIDGET_H

@ -25,6 +25,8 @@
#include "core/memcheck.h"
#include "frameworks/UBFileSystemUtils.h"
/**
* \brief Constructor
* @param parent as the parent widget
@ -34,6 +36,7 @@ UBLibraryWidget::UBLibraryWidget(QWidget *parent, const char *name):UBThumbnailW
, chainedElements(NULL)
, mpCrntDir(NULL)
, mpCrntElem(NULL)
, mLibraryController(NULL)
{
setObjectName(name);
setSpacing(5);
@ -45,7 +48,8 @@ UBLibraryWidget::UBLibraryWidget(QWidget *parent, const char *name):UBThumbnailW
*/
UBLibraryWidget::~UBLibraryWidget()
{
if(mLibraryController){
if(NULL != mLibraryController)
{
delete mLibraryController;
mLibraryController = NULL;
}
@ -148,7 +152,8 @@ void UBLibraryWidget::onItemClicked(QGraphicsItem *item, int index)
{
delete mpCrntElem;
mpCrntElem = new UBLibElement(pElem);
if(eUBLibElementType_Folder == pElem->type() || eUBLibElementType_VirtualFolder == pElem->type()) {
if(eUBLibElementType_Folder == pElem->type() || eUBLibElementType_VirtualFolder == pElem->type())
{
// Add the clicked element to the end of the elements list
// (at this level, the user can only go down in the path)
UBChainedLibElement* pNextElem = new UBChainedLibElement(pElem);
@ -161,11 +166,18 @@ void UBLibraryWidget::onItemClicked(QGraphicsItem *item, int index)
refreshView();
}
else
{
if ("application/search" == UBFileSystemUtils::mimeTypeFromFileName(pElem->path().toLocalFile()))
{
emit displaySearchEngine(pElem);
}
else
{
// Display the properties view
emit propertiesRequested(pElem);
}
}
}
emit itemClicked();
}
}

@ -47,7 +47,7 @@ public:
void updateThumbnailsSize(int newSize);
void init();
UBLibraryController* libraryController() {return mLibraryController;};
UBLibraryController* libraryController() {return mLibraryController;}
public slots:
void onRefreshCurrentFolder();
@ -59,6 +59,7 @@ signals:
void navigBarUpdate(UBLibElement* pElem);
void itemsSelected(QList<UBLibElement*> elemList, bool inTrash);
void propertiesRequested(UBLibElement* pElem);
void displaySearchEngine(UBLibElement* pElem);
void favoritesEntered(bool bFav);
void itemClicked();

@ -16,7 +16,6 @@
#include <QtGui>
#include "UBMainWindow.h"
#include "core/UBApplication.h"
#include "core/UBApplicationController.h"
#include "board/UBBoardController.h"
@ -160,3 +159,26 @@ bool UBMainWindow::yesNoQuestion(QString windowTitle, QString text)
return messageBox.clickedButton() == yesButton;
}
void UBMainWindow::oneButtonMessageBox(QString windowTitle, QString text, QMessageBox::Icon type)
{
QMessageBox messageBox;
messageBox.setParent(this);
messageBox.setWindowFlags(Qt::Dialog);
messageBox.setWindowTitle(windowTitle);
messageBox.setText(text);
messageBox.addButton(tr("Ok"),QMessageBox::YesRole);
messageBox.setIcon(type);
messageBox.exec();
}
void UBMainWindow::warning(QString windowTitle, QString text)
{
oneButtonMessageBox(windowTitle,text, QMessageBox::Warning);
}
void UBMainWindow::information(QString windowTitle, QString text)
{
oneButtonMessageBox(windowTitle, text, QMessageBox::Information);
}

@ -20,6 +20,7 @@
#include <QMainWindow>
#include <QWidget>
#include <QWebView>
#include <QMessageBox>
class QStackedLayout;
@ -41,7 +42,10 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
void addDocumentsWidget(QWidget *pWidget);
void switchToDocumentsWidget();
bool yesNoQuestion(QString windowTitle, QString text);
void warning(QString windowTitle, QString text);
void information(QString windowTitle, QString text);
signals:
void closeEvent_Signal( QCloseEvent *event );
@ -50,6 +54,7 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
void onExportDone();
protected:
void oneButtonMessageBox(QString windowTitle, QString text, QMessageBox::Icon type);
virtual void keyPressEvent(QKeyEvent *event);
virtual void closeEvent (QCloseEvent *event);

@ -12,10 +12,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QMessageBox>
#include <QFileDialog>
#include "UBUpdateDlg.h"
#include "core/UBApplication.h"
#include "UBMainWindow.h"
#include "core/memcheck.h"
@ -181,15 +182,13 @@ void UBUpdateDlg::onFilesUpdated(bool bResult)
this->hide();
QString qsMsg;
if (bResult)
{
if (bResult) {
qsMsg = tr("Files update successful!\nPlease reboot the application to access the updated documents.");
}
else
{
else {
qsMsg = tr("An error occured during the update. The files have not been affected.");
}
QMessageBox::information(this, tr("Files update results"), qsMsg, QMessageBox::Ok);
UBApplication::mainWindow->information(tr("Files update results"), qsMsg);
}
QString UBUpdateDlg::backupPath()

@ -43,7 +43,8 @@ HEADERS += src/gui/UBThumbnailView.h \
src/gui/UBLibWidget.h \
src/gui/UBMagnifer.h \
src/gui/UBCachePropertiesWidget.h \
src/gui/UBTeacherBarWidget.h
src/gui/UBTeacherBarWidget.h \
src/gui/UBLibWebView.h
SOURCES += src/gui/UBThumbnailView.cpp \
src/gui/UBFloatingPalette.cpp \
@ -89,7 +90,8 @@ SOURCES += src/gui/UBThumbnailView.cpp \
src/gui/UBLibWidget.cpp \
src/gui/UBMagnifer.cpp \
src/gui/UBCachePropertiesWidget.cpp \
src/gui/UBTeacherBarWidget.cpp
src/gui/UBTeacherBarWidget.cpp \
src/gui/UBLibWebView.cpp
win32 {

@ -160,14 +160,18 @@ void UBNetworkAccessManager::sslErrors(QNetworkReply *reply, const QList<QSslErr
QString errors = errorStrings.join(QLatin1String("\n"));
int ret = QMessageBox::warning(mainWindow, QCoreApplication::applicationName(),
tr("SSL Errors:\n\n%1\n\n%2\n\n"
"Do you want to ignore these errors for this host?").arg(reply->url().toString()).arg(errors),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No);
if (ret == QMessageBox::Yes)
{
QMessageBox messageBox;
messageBox.setParent(mainWindow);
messageBox.setWindowFlags(Qt::Dialog);
messageBox.setWindowTitle(QCoreApplication::applicationName());
messageBox.setText(tr("SSL Errors:\n\n%1\n\n%2\n\n"
"Do you want to ignore these errors for this host?").arg(reply->url().toString()).arg(errors));
QPushButton* yesButton = messageBox.addButton(tr("Yes"),QMessageBox::YesRole);
messageBox.addButton(tr("No"),QMessageBox::NoRole);
messageBox.setIcon(QMessageBox::Question);
messageBox.exec();
if(messageBox.clickedButton() == yesButton) {
reply->ignoreSslErrors();
sslTrustedHostList.append(replyHost);
}

@ -105,7 +105,7 @@ void UBGraphicsCache::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
}
else if(eMaskShap_Rectangle == mMaskShape)
{
path.addRect(mShapePos.x() - mShapeWidth / 2, mShapePos.y() - mShapeWidth / 2, mShapeWidth, mShapeWidth);
path.addRect(mShapePos.x() - mShapeWidth, mShapePos.y() - mShapeWidth, 2*mShapeWidth, 2*mShapeWidth);
}
path.setFillRule(Qt::OddEvenFill);
}

@ -32,7 +32,7 @@
#include "gui/UBScreenMirror.h"
#include "gui/UBMainWindow.h"
#include "gui/UBWebToolsPalette.h"
#include "gui/UBKeyboardPalette.h"
//#include "gui/UBKeyboardPalette.h"
#include "core/UBSettings.h"
#include "core/UBSetting.h"
@ -55,7 +55,7 @@ UBWebController::UBWebController(UBMainWindow* mainWindow)
, mBrowserWidget(0)
, mTrapFlashController(0)
, mToolsCurrentPalette(0)
, mKeyboardCurrentPalette(0)
// , mKeyboardCurrentPalette(0)
, mToolsPalettePositionned(false)
, mDownloadViewIsVisible(false)
@ -113,7 +113,7 @@ void UBWebController::webBrowserInstance()
{
mCurrentWebBrowser = &mWebBrowserList[WebBrowser];
mToolsCurrentPalette = &mToolsPaletteList[WebBrowser];
mKeyboardCurrentPalette = &mKeyboardPaletteList[WebBrowser];
// mKeyboardCurrentPalette = &mKeyboardPaletteList[WebBrowser];
mToolsPalettePositionned = mToolsPalettePositionnedList[WebBrowser];
if (!(*mCurrentWebBrowser))
{
@ -191,7 +191,7 @@ void UBWebController::tutorialWebInstance()
{
mCurrentWebBrowser = &mWebBrowserList[Tutorial];
mToolsCurrentPalette = &mToolsPaletteList[Tutorial];
mKeyboardCurrentPalette = &mKeyboardPaletteList[Tutorial];
// mKeyboardCurrentPalette = &mKeyboardPaletteList[Tutorial];
mToolsPalettePositionned = &mToolsPalettePositionnedList[Tutorial];
if (!(*mCurrentWebBrowser))
{
@ -249,7 +249,7 @@ void UBWebController::paraschoolWebInstance()
else {
mCurrentWebBrowser = &mWebBrowserList[Paraschool];
mToolsCurrentPalette = &mToolsPaletteList[Paraschool];
mKeyboardCurrentPalette = &mKeyboardPaletteList[Paraschool];
// mKeyboardCurrentPalette = &mKeyboardPaletteList[Paraschool];
mToolsPalettePositionned = &mToolsPalettePositionnedList[Paraschool];
if (!(*mCurrentWebBrowser)){
(*mCurrentWebBrowser) = new WBBrowserWindow(mMainWindow->centralWidget(), mMainWindow, true);
@ -391,7 +391,7 @@ void UBWebController::setupPalettes()
{
(*mToolsCurrentPalette) = new UBWebToolsPalette((*mCurrentWebBrowser),false);
(*mKeyboardCurrentPalette) = UBKeyboardPalette::create(*mCurrentWebBrowser);
// (*mKeyboardCurrentPalette) = UBKeyboardPalette::create(*mCurrentWebBrowser);
#ifndef Q_WS_WIN
if (*mKeyboardCurrentPalette)
connect(*mKeyboardCurrentPalette, SIGNAL(closed()), *mKeyboardCurrentPalette, SLOT(onDeactivated()));
@ -411,7 +411,7 @@ void UBWebController::setupPalettes()
(*mToolsCurrentPalette)->hide();
(*mToolsCurrentPalette)->adjustSizeAndPosition();
(*mKeyboardCurrentPalette)->adjustSizeAndPosition();
// (*mKeyboardCurrentPalette)->adjustSizeAndPosition();
if (controlView()){
int left = controlView()->width() - 20 - (*mToolsCurrentPalette)->width();
@ -435,15 +435,14 @@ void UBWebController::toggleWebTrap(bool checked)
}
}
void UBWebController::showKeyboard(bool checked)
{
if (mKeyboardCurrentPalette
&& (*mKeyboardCurrentPalette))
{
(*mKeyboardCurrentPalette)->setVisible(checked);
}
}
// void UBWebController::showKeyboard(bool checked)
// {
// if (mKeyboardCurrentPalette
// && (*mKeyboardCurrentPalette))
// {
// (*mKeyboardCurrentPalette)->setVisible(checked);
// }
// }
void UBWebController::toggleWebToolsPalette(bool checked)
{

@ -28,7 +28,7 @@ class UBMainWindow;
class UBWebToolsPalette;
class WBWebView;
class UBServerXMLHttpRequest;
class UBKeyboardPalette;
//class UBKeyboardPalette;
class UBWebController : public QObject
@ -58,6 +58,12 @@ class UBWebController : public QObject
void show(WebInstance type = UBWebController::WebBrowser);
WBBrowserWindow* GetCurrentWebBrowser()
{
if( mCurrentWebBrowser != NULL ) return *mCurrentWebBrowser;
else return NULL;
};
protected:
void setupPalettes();
@ -101,8 +107,8 @@ class UBWebController : public QObject
UBTrapFlashController* mTrapFlashController;
UBWebToolsPalette** mToolsCurrentPalette;
UBWebToolsPalette* mToolsPaletteList[TotalNumberOfWebInstances];
UBKeyboardPalette** mKeyboardCurrentPalette;
UBKeyboardPalette* mKeyboardPaletteList[TotalNumberOfWebInstances];
// UBKeyboardPalette** mKeyboardCurrentPalette;
// UBKeyboardPalette* mKeyboardPaletteList[TotalNumberOfWebInstances];
bool mToolsPalettePositionned;
bool mToolsPalettePositionnedList[TotalNumberOfWebInstances];
@ -124,7 +130,7 @@ class UBWebController : public QObject
void toggleWebTrap(bool checked);
void showKeyboard(bool checked);
// void showKeyboard(bool checked);
signals:
/**

@ -168,8 +168,7 @@ void WBWebPage::handleUnsupportedContent(QNetworkReply *reply)
messageBox.setText(tr("Download PDF Document: would you prefer to download the PDF file or add it to the current Sankore document?"));
messageBox.addButton(tr("Download"), QMessageBox::AcceptRole);
QAbstractButton *addButton =
messageBox.addButton(tr("Add to Current Document"), QMessageBox::AcceptRole);
QAbstractButton *addButton = messageBox.addButton(tr("Add to Current Document"), QMessageBox::AcceptRole);
messageBox.exec();
if (messageBox.clickedButton() == addButton)

Loading…
Cancel
Save