Commit b48ef4f6 authored by Ilia Ryabokon's avatar Ilia Ryabokon

Merge conflicts in UBFeaturesWidget resolved manualy

parents 864800c0 d740a60a
No preview for this file type
......@@ -11,7 +11,7 @@ CONFIG += debug_and_release \
VERSION_MAJ = 2
VERSION_MIN = 00
VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error
VERSION_PATCH = 09
VERSION_PATCH = 10
VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}"
VERSION = $$replace(VERSION, "\\.r", "")
......
This diff is collapsed.
......@@ -123,7 +123,7 @@
</property>
</widget>
</item>
<item row="9" column="1">
<item row="10" column="1">
<widget class="QLabel" name="label_4">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
......@@ -143,13 +143,23 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="10" column="1">
<item row="11" column="1">
<widget class="QDialogButtonBox" name="dialogButtons">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="youtubeCredentialsPersistence">
<property name="text">
<string>Restore credentials on reboot</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
......
......@@ -3,7 +3,7 @@
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://uniboard.mnemis.com/widgets/notes"
version="1.2"
width="302"
width="320"
height="260"
ub:resizable="true">
......
* {
margin: 0;
padding: 0;
margin: 0;
padding: 0;
}
body{
margin:0px;
body, html{
margin:0px;
height: 96%;
}
.ubw-container{
text-overflow: ellipsis;
left:0px;
top:0px;
margin:0px;
/*background-color: #edf7c0;*/
background-image: url(../images/back.png);
overflow: hidden;
border-right: 1px solid rgb(252, 252, 220);
border-left: 1px solid rgb(232, 232, 220);
min-width: 280px;
min-height: 200px;
width: 99%;
height: 100%;
text-overflow: ellipsis;
left:0px;
top:0px;
margin:0px;
background-image: url(../images/back.png);
overflow: hidden;
border-right: 1px solid rgb(252, 252, 220);
border-left: 1px solid rgb(232, 232, 220);
}
.ubw-body{
}
.head{
border-top: 1px solid rgb(252, 252, 220);
position: relative;
background-color: transparent;
font-style: normal;
color: #263141;
font-size: 119%;
width: auto;
height: 20px;
font-family: Arial, Helvetica, sans-serif;
font-weight: normal;
outline: none;
border-bottom: rgb(252, 252, 220);
border-top: 1px solid rgb(252, 252, 220);
position: relative;
background-color: transparent;
font-style: normal;
color: #263141;
font-size: 119%;
width: auto;
height: 20px;
font-family: Arial, Helvetica, sans-serif;
font-weight: normal;
outline: none;
border-bottom: rgb(252, 252, 220);
}
.stickytitle{
background-color: transparent;
min-width: 10px;
max-width: 70%;
width: 100%;
padding-top: 4px;
height: 20px;
float: left;
z-index: 3;
position: relative;
overflow:hidden;
margin-left: 10px;
margin-right: -2px;
font-style: normal;
color: #444444;
font-size: 88%;
border-style: none;
outline: none;
font-family: Arial, Helvetica, sans-serif;
font-weight: normal;
text-align: left;
resize: none;
background-color: transparent;
min-width: 10px;
max-width: 70%;
width: 100%;
padding-top: 4px;
height: 20px;
float: left;
z-index: 3;
position: relative;
overflow:hidden;
margin-left: 10px;
margin-right: -2px;
font-style: normal;
color: #444444;
font-size: 88%;
border-style: none;
outline: none;
font-family: Arial, Helvetica, sans-serif;
font-weight: normal;
text-align: left;
resize: none;
}
.textField{
min-height: 50px;
overflow-y: auto;
overflow-x: hidden;
height: auto;
width: auto;
margin: 5px;
padding-right: 4%;
background-position: 0;
border-left-style: none;
border-bottom-style: none;
border-right-style: none;
border-top-style: none;
text-align: left;
list-style-type: none;
outline: none;
word-wrap: break-word;
font-style: normal;
font-weight: normal;
font-family: Arial, Helvetica, sans-serif;
color:#444444;
min-height: 50px;
overflow-y: auto;
overflow-x: hidden;
height: auto;
width: auto;
margin: 5px;
padding-right: 4%;
background-position: 0;
border-left-style: none;
border-bottom-style: none;
border-right-style: none;
border-top-style: none;
text-align: left;
list-style-type: none;
outline: none;
word-wrap: break-word;
font-style: normal;
font-weight: normal;
font-family: Arial, Helvetica, sans-serif;
color:#444444;
}
.ubw-inspector{
position:absolute;
background-color:rgb(252, 252, 252);
border:1px solid #cccccc;
line-height:20px;
font-family:Arial, Helvetica, sans-serif;
font-weight:normal;
font-size:20px;
color:#333333;
position:absolute;
background-color:rgb(252, 252, 252);
border:1px solid #cccccc;
line-height:20px;
font-family:Arial, Helvetica, sans-serif;
font-weight:normal;
font-size:20px;
color:#333333;
}
.ubw-inpubox{
min-width:28px;
min-height:37px;
color:#333333;
background-image: url(../images/button_out.png);
border-left:1px solid rgb(231, 231, 231);
border-right:1px solid rgb(231, 231, 231);
border-bottom:1px solid rgb(221, 221, 221);
border-top:1px solid rgb(241, 241, 241);
min-width:28px;
min-height:37px;
color:#333333;
background-image: url(../images/button_out.png);
border-left:1px solid rgb(231, 231, 231);
border-right:1px solid rgb(231, 231, 231);
border-bottom:1px solid rgb(221, 221, 221);
border-top:1px solid rgb(241, 241, 241);
}
/*BUTTONS*/
.ubw-button-wrapper{
float:left;
position:relative;
/*border:solid 1px yellow;*/
margin-right:-7px;
z-index:0;
font-family:Arial, Helvetica, sans-serif;
font-weight:normal;
font-size:30px;
overflow:visible;
float:left;
position:relative;
/*border:solid 1px yellow;*/
margin-right:-7px;
z-index:0;
font-family:Arial, Helvetica, sans-serif;
font-weight:normal;
font-size:30px;
overflow:visible;
}
.ubw-button-canvas{
width:auto;
float:left;
position:relative;
overflow:visible;
width:auto;
float:left;
position:relative;
overflow:visible;
}
table{
line-height:90%;
line-height:90%;
}
.ubw-dropdown{
margin: 0;
padding: 0;
font-size: 15px;
width:100px;
list-style: none;
cursor:pointer;
float:none;
margin-left:3px;
}
.ubw-dropdown li.out{
padding-left: 5px;
color:#444444;
border-left:1px solid rgb(231, 231, 233);
border-right:1px solid rgb(231, 231, 233);
background-image: url(../images/button_out.gif);
}
.ubw-dropdown li.over{
padding-left: 5px;
color:#eeeeee;
border-left:1px solid rgb(140, 140, 140);
border-right:1px solid rgb(140, 140, 140);
background-image: url(../images/button_out_dark.png);
}
.ubw-dropdown li.ubw-dropdown-top-corners{
border-top:1px solid rgb(241, 241, 244);
}
.ubw-dropdown li.ubw-dropdown-bottom-corners{
border-bottom:1px solid rgb(221, 221, 223);
}
margin: 0;
padding: 0;
font-size: 15px;
width:100px;
list-style: none;
cursor:pointer;
float:none;
margin-left:3px;
}
.ubw-dropdown li.out{
padding-left: 5px;
color:#444444;
border-left:1px solid rgb(231, 231, 233);
border-right:1px solid rgb(231, 231, 233);
background-image: url(../images/button_out.gif);
}
.ubw-dropdown li.over{
padding-left: 5px;
color:#eeeeee;
border-left:1px solid rgb(140, 140, 140);
border-right:1px solid rgb(140, 140, 140);
background-image: url(../images/button_out_dark.png);
}
.ubw-dropdown li.ubw-dropdown-top-corners{
border-top:1px solid rgb(241, 241, 244);
}
.ubw-dropdown li.ubw-dropdown-bottom-corners{
border-bottom:1px solid rgb(221, 221, 223);
}
.ubw-button-body{
position:relative;
float:left;
width:auto;
height:auto;
overflow:visible
text-align:center;
vertical-align:middle;
cursor:pointer;
position:relative;
float:left;
width:auto;
height:auto;
overflow:visible
text-align:center;
vertical-align:middle;
cursor:pointer;
}
.ubw-button-content{
margin:2px;
height:auto;
width:auto;
text-align:center;
overflow:visible;
margin:2px;
height:auto;
width:auto;
text-align:center;
overflow:visible;
}
.ubw-button-over{
color:#444444;
background-image: url(../images/button_out.gif);
border-left:1px solid rgb(221, 221, 221);
border-right:1px solid rgb(221, 221, 221);
border-bottom:1px solid rgb(211, 211, 211);
border-top:1px solid rgb(231, 231, 231);
color:#444444;
background-image: url(../images/button_out.gif);
border-left:1px solid rgb(221, 221, 221);
border-right:1px solid rgb(221, 221, 221);
border-bottom:1px solid rgb(211, 211, 211);
border-top:1px solid rgb(231, 231, 231);
}
.ubw-button-out{
color:#555555;
background-image: url(../images/button_out.gif);
border-left:2px solid rgb(231, 231, 233);
border-right:2px solid rgb(231, 231, 233);
border-bottom:2px solid rgb(221, 221, 223);
border-top:2px solid rgb(241, 241, 244);
color:#555555;
background-image: url(../images/button_out.gif);
border-left:2px solid rgb(231, 231, 233);
border-right:2px solid rgb(231, 231, 233);
border-bottom:2px solid rgb(221, 221, 223);
border-top:2px solid rgb(241, 241, 244);
}
span.colored{
color: #0080ff;
color: #0080ff;
}
......@@ -217,8 +221,8 @@ span.colored{
.menuElement{
position: relative;
float:right;
position: relative;
float:right;
}
......
......@@ -29,8 +29,6 @@
// Default options
jQuery.fn.ubwidget.defaults = {
width:250,
height:300
};
// Shadows
......
......@@ -16,8 +16,8 @@
function init(){
var ubwidget = $("#ubwidget").ubwidget({
width:360,
height:240
// width:360,
// height:240
});
var checkMinimize = false;
......@@ -108,6 +108,7 @@ function init(){
minimize.click(
function(){
$('.ubw-container').css("min-height", "26px")
$('.ubw-container').animate({
height:"26px"
},500);
......@@ -123,11 +124,11 @@ function init(){
});
maximize.click(
function(){
function(){
var lastHeight = String(minimizedHeight)+'px';
$('.ubw-container').animate({
height: lastHeight
},500);
},500, function(){$('.ubw-container').css("min-height", "200px").css("height","")});
maximize.hide();
minimize.show();
......@@ -190,8 +191,8 @@ function init(){
text = window.sankore.preference('noteText', text);
currentFontSize = window.sankore.preference('fontSize', defaultFontSize);
$('.ubw-container').css({
width:window.innerWidth - 2,
height:window.innerHeight - 20
// width:window.innerWidth - 2,
// height:window.innerHeight - 20
});
if(checkMinimize){
......@@ -212,25 +213,24 @@ function init(){
winwidth = window.innerWidth;
winheight = window.innerHeight;
if(winwidth <= 290)
{
window.resizeTo(290,winheight);
}
if(winheight <= 100)
{
window.resizeTo(winwidth,100);
}
if(winheight > 600)
{
window.resizeTo(winwidth,600);
}
// if(winwidth <= 290)
// {
// window.resizeTo(290,winheight);
// }
// if(winheight <= 100)
// {
// window.resizeTo(winwidth,100);
// }
// if(winheight > 600)
// {
// window.resizeTo(winwidth,600);
// }
$('.ubw-container').width(winwidth-2);
// $('.ubw-container').width(winwidth-2);
//
if(checkMinimize)
minimizedHeight = winheight-40;
else
$('.ubw-container').height(winheight-40);
controlTextField();
}
......
......@@ -4,7 +4,8 @@ html, body{
margin: 0;
padding: 0;
border-radius: 35px;
overflow: hidden;
overflow: hidden;
font-family: sans-serif;
}
.without_radius{
......@@ -280,7 +281,7 @@ body{
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -290,7 +291,7 @@ body{
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -407,7 +408,7 @@ body{
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -5,6 +5,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......@@ -315,7 +316,7 @@ body{
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -325,7 +326,7 @@ body{
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -351,22 +352,6 @@ body{
text-shadow: #FFDCA9 0 1px 0;
}
.style_select{
width: 120px;
/*font-family: "Lobster13Regular";*/
font-size: 24px;
float: right;
margin: 10px 20px 0 0;
border-radius: 10px;
background-image: url(../img/ar_down.png);
background-color: #d4aa79;
color: #8c5730;
background-position: 105px 11px;
background-repeat: no-repeat;
-webkit-appearance: menulist-text;
display: none;
}
.btl_pad{
background-image: url(../img/pad-top-left.png) !important;
}
......@@ -463,7 +448,7 @@ body{
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -5,6 +5,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......@@ -256,7 +257,7 @@ body{
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -266,7 +267,7 @@ body{
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -388,7 +389,7 @@ body{
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -5,6 +5,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......@@ -278,7 +279,7 @@ body{
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -288,7 +289,7 @@ body{
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -410,7 +411,7 @@ body{
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -18,6 +18,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......@@ -30,7 +31,7 @@ body{
border: none;
background-image: url(../images/greySquare.png);
font-weight: bold;
font-family: Verdana;
font-family: sans-serif;
color: #00C6FF;;
cursor: pointer;
}
......@@ -45,7 +46,7 @@ body{
float: left;
padding: 5px;
margin: 2px;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: large;
}
......@@ -68,7 +69,7 @@ body{
margin: 2px auto;
padding: 5px;
float: left;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-family: sans-serif;
}
.qstDivDisplay{
......@@ -76,7 +77,7 @@ body{
margin: 5px 5%;
padding: 5px;
float: left;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-family: sans-serif;
border: 2px solid #cccccc;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
......@@ -146,7 +147,7 @@ body{
width: 95%;
max-height: 100px;
overflow-x: hidden;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: small;
border: 3px solid #ccc;
border-radius: 5px;
......@@ -162,7 +163,7 @@ body{
width: 95%;
max-height: 120px;
overflow-x: hidden;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-family: sans-serif;
color: white;
border: 1px solid #DFDFDE;
border-top-left-radius: 10px;
......@@ -214,7 +215,7 @@ body{
.ansContent{
padding: 1px 3px 3px 3px;
margin-left: 5px;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: small;
width: 80%;
max-height: 60px;
......@@ -230,7 +231,7 @@ body{
.ansContentDisplay{
padding: 1px 3px 3px 3px;
margin-left: 5px;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: small;
font-weight: bold;
width: 80%;
......@@ -299,7 +300,7 @@ body{
color: #666666;
float: left;
font-size: small;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-family: sans-serif;
margin: 3px 5px;
padding: 5px;
}
......@@ -347,7 +348,7 @@ body{
.textType{
width: 160px;
font-size: small;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-family: sans-serif;
color: #666;
padding: 3px;
margin-left: 20px;
......@@ -471,7 +472,7 @@ body{
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -481,7 +482,7 @@ body{
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -603,7 +604,7 @@ body{
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -5,6 +5,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......@@ -17,11 +18,9 @@ body{
border: none;
background-image: url(../images/greySquare.png);
font-weight: bold;
font-family: Verdana;
font-family: sans-serif;
color: yellow;
cursor: pointer;
-webkit-border-top-left-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
......@@ -101,7 +100,7 @@ body{
float: right;
width: 70%;
border: none;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-family: sans-serif;
background-color: #ffc;
-webkit-border-radius: 5px;
-webkit-border-radius: 5px;
......@@ -116,7 +115,7 @@ body{
margin: 4px 5px;
border: none;
background-image: url(../images/greySquare2.png);
font-family: Verdana;
font-family: sans-serif;
color: yellow;
cursor: pointer;
-webkit-border-radius: 5px;
......@@ -137,7 +136,7 @@ body{
padding: 2px;
float: left;
text-align: center;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-weight: bold;
font-size:24px;
word-wrap: break-word;
......@@ -265,7 +264,7 @@ body{
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -275,7 +274,7 @@ body{
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -413,7 +412,7 @@ body{
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -5,6 +5,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......@@ -354,7 +355,7 @@ li>div{
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -364,7 +365,7 @@ li>div{
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -479,7 +480,7 @@ li>div{
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -5,6 +5,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......@@ -237,7 +238,7 @@ body{
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -247,7 +248,7 @@ body{
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -369,7 +370,7 @@ body{
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -5,6 +5,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......@@ -298,7 +299,7 @@ body{
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -308,7 +309,7 @@ body{
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -430,7 +431,7 @@ body{
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -31,8 +31,8 @@ function start(){
$("div.inline label").html(sankoreLang.theme + tmpl)
if(window.sankore){
if(sankore.preference("associer_sound","")){
var data = jQuery.parseJSON(sankore.preference("associer_sound",""));
if(sankore.preference("ord_let","")){
var data = jQuery.parseJSON(sankore.preference("ord_let",""));
importData(data);
}
else
......@@ -263,15 +263,17 @@ function exportData(){
array_to_export.push(cont_obj);
});
}
if(window.sankore)
sankore.setPreference("associer_sound", JSON.stringify(array_to_export));
if(window.sankore){
sankore.setPreference("ord_let", JSON.stringify(array_to_export));
sankore.setPreference("ord_let_locale", "en");
}
if($("#wgt_display").hasClass("selected")){
if(window.sankore)
sankore.setPreference("associer_sound_state", "display");
sankore.setPreference("ord_let_state", "display");
}
else{
if(window.sankore)
sankore.setPreference("associer_sound_state", "edit");
sankore.setPreference("ord_let_state", "edit");
}
}
......@@ -308,8 +310,8 @@ function importData(data){
tmp_array.push(tmp_letter);
}
if(sankore.preference("associer_sound_state","")){
if(sankore.preference("associer_sound_state","") == "edit")
if(sankore.preference("ord_let_state","")){
if(sankore.preference("ord_let_state","") == "edit")
tmp_array = shuffle(tmp_array);
} else
tmp_array = shuffle(tmp_array);
......@@ -365,12 +367,12 @@ function addContainer(){
var sub_container = $("<div class='sub_cont'>").appendTo(container);
$("<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 text = $("<div class='text_cont'>").appendTo(sub_container);
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", "");
......@@ -505,12 +507,11 @@ 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");
$(obj).find("audio").remove();
audio_block.find(":first-child").removeClass("stop").addClass("play");
$(obj).find(":first-child").removeClass("stop").addClass("play");
var source = $("<source/>").attr("src", tmp);
var audio = $("<audio>").appendTo(audio_block);
audio.append(source);
var audio = $("<audio>").appendTo($(obj));
audio.append(source);
}
}
else {
......
......@@ -51,8 +51,8 @@ function start(){
$("div.inline label").html(sankoreLang.theme + tmpl)
if(window.sankore){
if(sankore.preference("associer_sound","")){
var data = jQuery.parseJSON(sankore.preference("associer_sound",""));
if(sankore.preference("ord_let","")){
var data = jQuery.parseJSON(sankore.preference("ord_let",""));
importData(data);
}
else
......@@ -272,7 +272,7 @@ function exportData(){
$(".cont").each(function(){
var cont_obj = new Object();
cont_obj.text = $(this).find(".audio_desc").text();
cont_obj.audio = $(this).find("source").attr("src").replace("../../","");
cont_obj.audio = $(this).find("source").attr("src");
cont_obj.answer = $(this).find(".audio_answer").text();
cont_obj.cur_answer = "";
array_to_export.push(cont_obj);
......@@ -281,22 +281,23 @@ function exportData(){
$(".cont").each(function(){
var cont_obj = new Object();
cont_obj.text = $(this).find(".audio_desc").text();
cont_obj.audio = $(this).find("source").attr("src").replace("../../","");
cont_obj.audio = $(this).find("source").attr("src");
cont_obj.answer = $(this).find("ul").next().val();
cont_obj.cur_answer = getAnswer($(this).find("ul"));
array_to_export.push(cont_obj);
});
}
sankore.setPreference("associer_sound", JSON.stringify(array_to_export));
sankore.setPreference("ord_let", JSON.stringify(array_to_export));
sankore.setPreference("ord_let_locale", sankore.locale().substr(0,2));
if($("#wgt_display").hasClass("selected"))
sankore.setPreference("associer_sound_state", "display");
sankore.setPreference("ord_let_state", "display");
else
sankore.setPreference("associer_sound_state", "edit");
sankore.setPreference("ord_let_state", "edit");
}
//import
function importData(data){
var tmp_loc = sankore.preference("ord_let_locale","")
var tmp = 0;
for(var i in data){
var tmp_array = [];
......@@ -309,7 +310,7 @@ function importData(data){
var audio_block = $("<div class='audio_block'>").appendTo(text);
$("<div class='play'>").appendTo(audio_block);
$("<div class='replay'>").appendTo(audio_block);
var source = $("<source/>").attr("src", data[i].audio);
var source = $("<source/>").attr("src",((tmp_loc != "en")?"":"../../") + data[i].audio);
var audio = $("<audio>").appendTo(audio_block);
audio.append(source);
$("<input type='hidden'/>").appendTo(audio_block);
......@@ -326,8 +327,8 @@ function importData(data){
tmp_array.push(tmp_letter);
}
if(sankore.preference("associer_sound_state","")){
if(sankore.preference("associer_sound_state","") == "edit")
if(sankore.preference("ord_let_state","")){
if(sankore.preference("ord_let_state","") == "edit")
tmp_array = shuffle(tmp_array);
} else
tmp_array = shuffle(tmp_array);
......@@ -390,11 +391,11 @@ function addContainer(){
$("<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", "");
......@@ -527,13 +528,12 @@ function onDropAudio(obj, event) {
textData = stringToXML(textData);
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");
if(tmp_type.substr(0, 5) == "audio"){
$(obj).find("audio").remove();
audio_block.find(":first-child").removeClass("stop").addClass("play");
$(obj).find(":first-child").removeClass("stop").addClass("play");
var source = $("<source/>").attr("src", "../../" + tmp);
var audio = $("<audio>").appendTo(audio_block);
audio.append(source);
var audio = $("<audio>").appendTo($(obj));
audio.append(source);
}
}
else {
......@@ -565,4 +565,4 @@ if (window.widget) {
$(this).parent().find(":first-child").removeClass("stop").addClass("play");
});
}
}
}
\ No newline at end of file
......@@ -31,8 +31,8 @@ function start(){
$("div.inline label").html(sankoreLang.theme + tmpl)
if(window.sankore){
if(sankore.preference("associer_sound","")){
var data = jQuery.parseJSON(sankore.preference("associer_sound",""));
if(sankore.preference("ord_let","")){
var data = jQuery.parseJSON(sankore.preference("ord_let",""));
importData(data);
}
else
......@@ -252,7 +252,7 @@ function exportData(){
$(".cont").each(function(){
var cont_obj = new Object();
cont_obj.text = $(this).find(".audio_desc").text();
cont_obj.audio = $(this).find("source").attr("src").replace("../../","");
cont_obj.audio = $(this).find("source").attr("src");
cont_obj.answer = $(this).find(".audio_answer").text();
cont_obj.cur_answer = "";
array_to_export.push(cont_obj);
......@@ -261,22 +261,23 @@ function exportData(){
$(".cont").each(function(){
var cont_obj = new Object();
cont_obj.text = $(this).find(".audio_desc").text();
cont_obj.audio = $(this).find("source").attr("src").replace("../../","");
cont_obj.audio = $(this).find("source").attr("src");
cont_obj.answer = $(this).find("ul").next().val();
cont_obj.cur_answer = getAnswer($(this).find("ul"));
array_to_export.push(cont_obj);
});
}
sankore.setPreference("associer_sound", JSON.stringify(array_to_export));
sankore.setPreference("ord_let", JSON.stringify(array_to_export));
sankore.setPreference("ord_let_locale", sankore.locale().substr(0,2));
if($("#wgt_display").hasClass("selected"))
sankore.setPreference("associer_sound_state", "display");
sankore.setPreference("ord_let_state", "display");
else
sankore.setPreference("associer_sound_state", "edit");
sankore.setPreference("ord_let_state", "edit");
}
//import
function importData(data){
var tmp_loc = sankore.preference("ord_let_locale","")
var tmp = 0;
for(var i in data){
var tmp_array = [];
......@@ -289,7 +290,7 @@ function importData(data){
var audio_block = $("<div class='audio_block'>").appendTo(text);
$("<div class='play'>").appendTo(audio_block);
$("<div class='replay'>").appendTo(audio_block);
var source = $("<source/>").attr("src", data[i].audio);
var source = $("<source/>").attr("src",((tmp_loc != "en")?"":"../../") + data[i].audio);
var audio = $("<audio>").appendTo(audio_block);
audio.append(source);
$("<input type='hidden'/>").appendTo(audio_block);
......@@ -306,8 +307,8 @@ function importData(data){
tmp_array.push(tmp_letter);
}
if(sankore.preference("associer_sound_state","")){
if(sankore.preference("associer_sound_state","") == "edit")
if(sankore.preference("ord_let_state","")){
if(sankore.preference("ord_let_state","") == "edit")
tmp_array = shuffle(tmp_array);
} else
tmp_array = shuffle(tmp_array);
......@@ -339,7 +340,7 @@ function showExample(){
var audio_block = $("<div class='audio_block'>").appendTo(text);
$("<div class='play'>").appendTo(audio_block);
$("<div class='replay'>").appendTo(audio_block);
var source = $("<source/>").attr("src", "objects/exemple.mp3");
var source = $("<source/>").attr("src", "objects/example.mp3");
var audio = $("<audio>").appendTo(audio_block);
audio.append(source);
$("<input type='hidden'/>").appendTo(audio_block);
......@@ -370,11 +371,11 @@ function addContainer(){
$("<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", "");
......@@ -507,13 +508,12 @@ function onDropAudio(obj, event) {
textData = stringToXML(textData);
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");
if(tmp_type.substr(0, 5) == "audio"){
$(obj).find("audio").remove();
audio_block.find(":first-child").removeClass("stop").addClass("play");
$(obj).find(":first-child").removeClass("stop").addClass("play");
var source = $("<source/>").attr("src", "../../" + tmp);
var audio = $("<audio>").appendTo(audio_block);
audio.append(source);
var audio = $("<audio>").appendTo($(obj));
audio.append(source);
}
}
else {
......
......@@ -5,6 +5,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......@@ -140,7 +141,7 @@ body{
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -150,7 +151,7 @@ body{
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -272,7 +273,7 @@ body{
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -5,6 +5,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......@@ -149,7 +150,7 @@ textarea{
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -159,7 +160,7 @@ textarea{
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -281,7 +282,7 @@ textarea{
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -5,6 +5,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......@@ -314,7 +315,7 @@ body{
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -324,7 +325,7 @@ body{
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -446,7 +447,7 @@ body{
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -109,7 +109,7 @@
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -119,7 +119,7 @@
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -241,7 +241,7 @@
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -5,6 +5,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......
......@@ -110,7 +110,7 @@
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -120,7 +120,7 @@
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -242,7 +242,7 @@
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -5,6 +5,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......
......@@ -5,6 +5,7 @@ html, body{
padding: 0;
border-radius: 35px;
overflow: hidden;
font-family: sans-serif;
}
body{
......
......@@ -111,7 +111,7 @@
margin: 10px 10px 0 10px;
padding: 0;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
......@@ -121,7 +121,7 @@
cursor: pointer;
margin: 10px 10px 0 0;
float: right;
font-family: Arial,Helvetica,sans-serif;
font-family: sans-serif;
font-size: 24px;
line-height: 32px;
}
......@@ -243,7 +243,7 @@
.inline{
display: inline-block;
font-family: "helvetica neue";
font-family: sans-serif;
font-size: 14px;
color: #666;
}
......
......@@ -69,7 +69,7 @@
var iHeight = $("<input type='hidden'/>");
var iWidth = $("<input type='hidden'/>");
var iTitle = $("<input type='hidden'/>");
var iThumbnailUrl = $("<input type='hidden'/>");
// We use titleNoFormatting so that no HTML tags are left in the
// title
//title.innerHTML = result.title;
......@@ -96,12 +96,14 @@
iHeight.attr("value", result.height);
iWidth.attr("value", result.width);
iTitle.attr("value",result.title);
iThumbnailUrl.attr("value",newImg.src);
//imgContainer.append($(title));
imgContainer.append(iUrl);
imgContainer.append(iContent);
imgContainer.append(iHeight);
imgContainer.append(iWidth);
imgContainer.append(iTitle);
imgContainer.append(iThumbnailUrl);
// Put our title + image in the content
imgContainer.appendTo(contentDiv);
......@@ -252,6 +254,8 @@
parent.find("input:hidden").eq(3).val() +
"</value></data><data><key>Title</key><value>" +
parent.find("input:hidden").eq(4).val() +
"</value></data><data><key>thumbnailUrl</key><value>" +
parent.find("input:hidden").eq(5).val() +
"</value></data></metadata>";
return meta;
}
......
......@@ -1002,9 +1002,6 @@ UBGraphicsGroupContainerItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroup()
UBGraphicsGroupContainerItem *group = new UBGraphicsGroupContainerItem();
QMultiMap<QString, UBGraphicsPolygonItem *> strokesGroupsContainer;
QList<QGraphicsItem *> groupContainer;
QString currentStrokeIdentifier;
QUuid groupUuid = QUuid(mXmlReader.attributes().value(aId).toString());
mXmlReader.readNext();
while (!mXmlReader.atEnd())
......
......@@ -62,7 +62,6 @@ UBDocumentPublisher::UBDocumentPublisher(UBDocumentProxy* pDocument, QObject *pa
, mPassword("")
, bLoginCookieSet(false)
{
//NOOP
init();
}
......@@ -109,7 +108,7 @@ void UBDocumentPublisher::buildUbwFile()
if (UBFileSystemUtils::copyDir(mSourceDocument->persistencePath(), tmpDir))
{
QUuid publishingUuid = QUuid::createUuid();
QString documentName = mSourceDocument->name();
mPublishingPath = tmpDir;
mPublishingSize = mSourceDocument->pageCount();
......@@ -120,11 +119,11 @@ void UBDocumentPublisher::buildUbwFile()
UBExportFullPDF pdfExporter;
pdfExporter.setVerbode(false);
pdfExporter.persistsDocument(mSourceDocument, mPublishingPath + "/" + UBStringUtils::toCanonicalUuid(publishingUuid) + ".pdf");
pdfExporter.persistsDocument(mSourceDocument, mPublishingPath + "/" + documentName + ".pdf");
UBExportDocument ubzExporter;
ubzExporter.setVerbode(false);
ubzExporter.persistsDocument(mSourceDocument, mPublishingPath + "/" + UBStringUtils::toCanonicalUuid(publishingUuid) + ".ubz");
ubzExporter.persistsDocument(mSourceDocument, mPublishingPath + "/" + documentName + ".ubz");
// remove all useless files
......
......@@ -108,6 +108,11 @@ UBBoardController::UBBoardController(UBMainWindow* mainWindow)
mPenColorOnLightBackground = UBSettings::settings()->penColors(false).at(penColorIndex);
mMarkerColorOnDarkBackground = UBSettings::settings()->markerColors(true).at(markerColorIndex);
mMarkerColorOnLightBackground = UBSettings::settings()->markerColors(false).at(markerColorIndex);
QDesktopWidget* desktop = UBApplication::desktop();
int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
int sPixelsPerMillimeter = qRound(dpiCommon / UBGeometryUtils::inchSize);
UBSettings::settings()->crossSize = 10*sPixelsPerMillimeter;
}
......@@ -996,30 +1001,30 @@ void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, c
|| contentType.startsWith("application/widget")
|| contentType.startsWith("application/vnd.apple-widget");
if (shouldLoadFileData)
{
if (shouldLoadFileData)
{
QFile file(fileName);
file.open(QIODevice::ReadOnly);
downloadFinished(true, formedUrl, QUrl(), contentType, file.readAll(), pPos, pSize, isBackground, internalData);
file.close();
}
else
{
// media items should be copyed in separate thread
sDownloadFileDesc desc;
desc.modal = false;
desc.srcUrl = sUrl;
desc.originalSrcUrl = contentSourceUrl;
desc.currentSize = 0;
desc.name = QFileInfo(url.toString()).fileName();
desc.totalSize = 0; // The total size will be retrieved during the download
desc.pos = pPos;
desc.size = pSize;
desc.isBackground = isBackground;
UBDownloadManager::downloadManager()->addFileToDownload(desc);
}
}
else
{
// media items should be copyed in separate thread
sDownloadFileDesc desc;
desc.modal = false;
desc.srcUrl = sUrl;
desc.originalSrcUrl = contentSourceUrl;
desc.currentSize = 0;
desc.name = QFileInfo(url.toString()).fileName();
desc.totalSize = 0; // The total size will be retrieved during the download
desc.pos = pPos;
desc.size = pSize;
desc.isBackground = isBackground;
UBDownloadManager::downloadManager()->addFileToDownload(desc);
}
}
else
{
......@@ -2362,10 +2367,17 @@ void UBBoardController::togglePodcast(bool checked)
void UBBoardController::moveGraphicsWidgetToControlView(UBGraphicsWidgetItem* graphicsWidget)
{
mActiveScene->setURStackEnable(false);
UBGraphicsItem *toolW3C = duplicateItem(dynamic_cast<UBItem *>(graphicsWidget));
UBGraphicsWidgetItem *copyedGraphicsWidget = NULL;
if (UBGraphicsWidgetItem::Type == toolW3C->type())
copyedGraphicsWidget = static_cast<UBGraphicsWidgetItem *>(toolW3C);
UBToolWidget *toolWidget = new UBToolWidget(copyedGraphicsWidget, mControlView);
graphicsWidget->remove(false);
mActiveScene->addItemToDeletion(graphicsWidget);
UBToolWidget *toolWidget = new UBToolWidget(graphicsWidget, mControlView);
mActiveScene->setURStackEnable(true);
QPoint controlViewPos = mControlView->mapFromScene(graphicsWidget->sceneBoundingRect().center());
......
......@@ -148,8 +148,8 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
// RIGHT palette widgets
#ifndef USE_WEB_WIDGET
mpFeaturesWidget = new UBFeaturesWidget();
mRightPalette->registerWidget(mpFeaturesWidget);
mRightPalette->addTab(mpFeaturesWidget);
mRightPalette->registerWidget(mpFeaturesWidget);
mRightPalette->addTab(mpFeaturesWidget);
#endif
//Do not show deprecated lib widget to prevent collisions. Uncomment to return lib widget
......@@ -332,15 +332,15 @@ void UBBoardPaletteManager::pagePaletteButtonReleased()
{
if( mPageButtonPressedTime.msecsTo(QTime::currentTime()) > 900)
{
// The palette is reinstanciated because the duplication depends on the current scene
delete(mPagePalette);
mPagePalette = 0;
QList<QAction*>pageActions;
pageActions << UBApplication::mainWindow->actionNewPage;
UBBoardController* boardController = UBApplication::boardController;
if(UBApplication::documentController->pageCanBeDuplicated(UBDocumentContainer::pageFromSceneIndex(boardController->activeSceneIndex()))){
pageActions << UBApplication::mainWindow->actionDuplicatePage;
}
// The palette is reinstanciated because the duplication depends on the current scene
delete(mPagePalette);
mPagePalette = 0;
QList<QAction*>pageActions;
pageActions << UBApplication::mainWindow->actionNewPage;
UBBoardController* boardController = UBApplication::boardController;
if(UBApplication::documentController->pageCanBeDuplicated(UBDocumentContainer::pageFromSceneIndex(boardController->activeSceneIndex()))){
pageActions << UBApplication::mainWindow->actionDuplicatePage;
}
pageActions << UBApplication::mainWindow->actionImportPage;
mPagePalette = new UBActionPalette(pageActions, Qt::Horizontal , mContainer);
......@@ -351,9 +351,9 @@ void UBBoardPaletteManager::pagePaletteButtonReleased()
// As we recreate the pagePalette every time, we must reconnect the slots
connect(UBApplication::mainWindow->actionNewPage, SIGNAL(triggered()), mPagePalette, SLOT(close()));
connect(UBApplication::mainWindow->actionDuplicatePage, SIGNAL(triggered()), mPagePalette, SLOT(close()));
connect(UBApplication::mainWindow->actionImportPage, SIGNAL(triggered()), mPagePalette, SLOT(close()));
connect(mPagePalette, SIGNAL(closed()), this, SLOT(pagePaletteClosed()));
connect(UBApplication::mainWindow->actionDuplicatePage, SIGNAL(triggered()), mPagePalette, SLOT(close()));
connect(UBApplication::mainWindow->actionImportPage, SIGNAL(triggered()), mPagePalette, SLOT(close()));
connect(mPagePalette, SIGNAL(closed()), this, SLOT(pagePaletteClosed()));
togglePagePalette(true);
}
......@@ -955,7 +955,7 @@ void UBBoardPaletteManager::changeStylusPaletteOrientation(QVariant var)
bool bVertical = var.toBool();
bool bVisible = mStylusPalette->isVisible();
// Clean the old palette
// Clean the old palette
if(NULL != mStylusPalette)
{
// TODO : check why this line creates a crash in the application.
......@@ -995,7 +995,6 @@ void UBBoardPaletteManager::startDownloads()
mDownloadInProgress = true;
mpDownloadWidget->setVisibleState(true);
mRightPalette->addTab(mpDownloadWidget);
mpDownloadWidget;
}
}
......
......@@ -866,6 +866,7 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
mMouseDownPos = event->pos ();
movingItem = scene()->itemAt(this->mapToScene(event->posF().toPoint()));
if (!movingItem)
emit clickOnBoard();
......@@ -1099,6 +1100,11 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
if (currentTool == UBStylusTool::Selector)
{
bool bReleaseIsNeed = true;
if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->posF().toPoint()))))
{
movingItem = NULL;
bReleaseIsNeed = false;
}
if (mWidgetMoved)
{
mWidgetMoved = false;
......
......@@ -476,6 +476,8 @@ void UBApplication::closing()
if (webController)
webController->closing();
UBSettings::settings()->closing();
UBSettings::settings()->appToolBarPositionedAtTop->set(mainWindow->toolBarArea(mainWindow->boardToolBar) == Qt::TopToolBarArea);
quit();
......
......@@ -33,19 +33,18 @@ UBAsyncLocalFileDownloader::UBAsyncLocalFileDownloader(sDownloadFileDesc desc, Q
UBAsyncLocalFileDownloader *UBAsyncLocalFileDownloader::download()
{
if (!QFile::exists(QUrl(mDesc.srcUrl).toLocalFile())) {
qDebug() << "file" << mDesc.srcUrl << "does not present in fs";
return this;
}
start();
return this;
}
void UBAsyncLocalFileDownloader::run()
{
if(mDesc.srcUrl.startsWith("file://"))
mDesc.srcUrl = QUrl(mDesc.srcUrl).toLocalFile();
else
mDesc.srcUrl = QUrl::fromLocalFile(mDesc.srcUrl).toLocalFile();
QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(mDesc.srcUrl);
int position=mimeType.indexOf(";");
......@@ -67,7 +66,7 @@ void UBAsyncLocalFileDownloader::run()
QString uuid = QUuid::createUuid();
UBPersistenceManager::persistenceManager()->addFileToDocument(UBApplication::boardController->selectedDocument(),
QUrl(mDesc.srcUrl).toLocalFile(),
mDesc.srcUrl,
destDirectory,
uuid,
mTo,
......
......@@ -67,8 +67,6 @@ UBPreferencesController::UBPreferencesController(QWidget *parent)
mPreferencesWindow = new UBPreferencesDialog(this,parent, Qt::Dialog);
mPreferencesUI = new Ui::preferencesDialog(); // deleted in
mPreferencesUI->setupUi(mPreferencesWindow);
connect(mPreferencesUI->Username_textBox, SIGNAL(editingFinished()), this, SLOT(onCommunityUsernameChanged()));
connect(mPreferencesUI->Password_textEdit, SIGNAL(editingFinished()), this, SLOT(onCommunityPasswordChanged()));
wire();
}
......@@ -76,7 +74,7 @@ UBPreferencesController::UBPreferencesController(QWidget *parent)
UBPreferencesController::~UBPreferencesController()
{
delete mPreferencesWindow;
delete mPreferencesWindow;
delete mPreferencesUI;
......@@ -161,6 +159,12 @@ void UBPreferencesController::wire()
connect(mMarkerProperties->pressureSensitiveCheckBox, SIGNAL(clicked(bool)), settings, SLOT(setMarkerPressureSensitive(bool)));
connect(mMarkerProperties->opacitySlider, SIGNAL(valueChanged(int)), this, SLOT(opacitySliderChanged(int)));
//network
connect(mPreferencesUI->Username_textBox, SIGNAL(editingFinished()), this, SLOT(onCommunityUsernameChanged()));
connect(mPreferencesUI->Password_textEdit, SIGNAL(editingFinished()), this, SLOT(onCommunityPasswordChanged()));
connect(mPreferencesUI->PSCredentialsPersistenceCheckBox,SIGNAL(clicked()),this, SLOT(onCommunityPersistenceChanged()));
// about tab
connect(mPreferencesUI->checkSoftwareUpdateAtLaunchCheckBox, SIGNAL(clicked(bool)), settings->appEnableAutomaticSoftwareUpdates, SLOT(setBool(bool)));
}
......@@ -212,18 +216,36 @@ void UBPreferencesController::init()
mMarkerProperties->opacitySlider->setValue(settings->boardMarkerAlpha->get().toDouble() * 100);
//network
mPreferencesUI->PSCredentialsPersistenceCheckBox->setChecked(settings->getCommunityDataPersistence());
persistanceCheckboxUpdate();
}
void UBPreferencesController::onCommunityUsernameChanged()
{
UBSettings* settings = UBSettings::settings();
settings->setCommunityUsername(mPreferencesUI->Username_textBox->text());
persistanceCheckboxUpdate();
}
void UBPreferencesController::onCommunityPasswordChanged()
{
UBSettings* settings = UBSettings::settings();
settings->setCommunityPassword(mPreferencesUI->Password_textEdit->text());
persistanceCheckboxUpdate();
}
void UBPreferencesController::onCommunityPersistenceChanged()
{
UBSettings::settings()->setCommunityPersistence(mPreferencesUI->PSCredentialsPersistenceCheckBox->isChecked());
}
void UBPreferencesController::persistanceCheckboxUpdate()
{
bool checkBoxEnabled = mPreferencesUI->Username_textBox->text().length() || mPreferencesUI->Password_textEdit->text().length();
mPreferencesUI->PSCredentialsPersistenceCheckBox->setEnabled(checkBoxEnabled);
mPreferencesUI->PSCredentialsPersistenceCheckBox->setStyleSheet(checkBoxEnabled ? "color:black;" : "color:lightgray;");
}
......
......@@ -83,12 +83,14 @@ class UBPreferencesController : public QObject
void toolbarOrientationHorizontal(bool checked);
void onCommunityUsernameChanged();
void onCommunityPasswordChanged();
void onCommunityPersistenceChanged();
private:
static qreal sSliderRatio;
static qreal sMinPenWidth;
static qreal sMaxPenWidth;
void persistanceCheckboxUpdate();
};
......
......@@ -173,7 +173,7 @@ void UBSettings::ValidateKeyboardPaletteKeyBtnSize()
{
// if boardKeyboardPaletteKeyBtnSize is not initialized, or supportedKeyboardSizes not initialized or empty
if( !boardKeyboardPaletteKeyBtnSize ||
!supportedKeyboardSizes ||
!supportedKeyboardSizes ||
supportedKeyboardSizes->size() == 0 ) return;
// get original size value
......@@ -243,7 +243,7 @@ void UBSettings::init()
pageSize = new UBSetting(this, "Board", "DefaultPageSize", documentSizes.value(DocumentSizeRatio::Ratio4_3));
pageDpi = new UBSetting(this, "Board", "pageDpi", 0);
QStringList penLightBackgroundColors;
penLightBackgroundColors << "#000000" << "#FF0000" <<"#004080" << "#008000" << "#C87400" << "#800040" << "#008080" << "#5F2D0A";
boardPenLightBackgroundColors = new UBColorListSetting(this, "Board", "PenLightBackgroundColors", penLightBackgroundColors, 1.0);
......@@ -350,6 +350,7 @@ void UBSettings::init()
podcastPublishToYoutube = new UBSetting(this, "Podcast", "PublishToYouTube", false);
youTubeUserEMail = new UBSetting(this, "YouTube", "UserEMail", "");
youTubeCredentialsPersistence = new UBSetting(this,"YouTube", "CredentialsPersistence",false);
uniboardWebEMail = new UBSetting(this, "UniboardWeb", "EMail", "");
uniboardWebAuthor = new UBSetting(this, "UniboardWeb", "Author", "");
......@@ -357,6 +358,7 @@ void UBSettings::init()
communityUser = new UBSetting(this, "Community", "Username", "");
communityPsw = new UBSetting(this, "Community", "Password", "");
communityCredentialsPersistence = new UBSetting(this,"Community", "CredentialsPersistence",false);
QStringList uris = UBToolsManager::manager()->allToolIDs();
......@@ -383,7 +385,7 @@ void UBSettings::init()
intranetPodcastPublishingUrl = new UBSetting(this, "IntranetPodcast", "PublishingUrl", "");
intranetPodcastAuthor = new UBSetting(this, "IntranetPodcast", "Author", "");
KeyboardLocale = new UBSetting(this, "Board", "StartupKeyboardLocale", 0);
KeyboardLocale = new UBSetting(this, "Board", "StartupKeyboardLocale", 0);
swapControlAndDisplayScreens = new UBSetting(this, "App", "SwapControlAndDisplayScreens", false);
angleTolerance = new UBSetting(this, "App", "AngleTolerance", 4);
......@@ -392,6 +394,8 @@ void UBSettings::init()
teacherGuideLessonPagesActivated = new UBSetting(this,"DockPalette","TeacherGuideActivateLessonPages",true);
libIconSize = new UBSetting(this, "Library", "LibIconSize", defaultLibraryIconSize);
cleanNonPersistentSettings();
}
......@@ -401,7 +405,7 @@ QVariant UBSettings::value ( const QString & key, const QVariant & defaultValue)
{
sAppSettings->setValue(key, defaultValue);
}
return mUserSettings->value(key, sAppSettings->value(key, defaultValue));
}
......@@ -944,7 +948,7 @@ QString UBSettings::applicationImageLibraryDirectory()
{
QString defaultRelativePath = QString("./library/pictures");
QString configPath = value("Library/ImageDirectory", QVariant(defaultRelativePath)).toString();
QString configPath = value("Library/ImageDirectory", QVariant(defaultRelativePath)).toString();
if (configPath.startsWith(".")) {
return UBPlatformUtils::applicationResourcesDirectory() + configPath.right(configPath.size() - 1);
......@@ -1180,12 +1184,17 @@ void UBSettings::setCommunityPassword(const QString &password)
communityPsw->set(QVariant(password));
}
void UBSettings::setCommunityPersistence(const bool persistence)
{
communityCredentialsPersistence->set(QVariant(persistence));
}
int UBSettings::libraryIconSize(){
return libIconSize->get().toInt();
return libIconSize->get().toInt();
}
void UBSettings::setLibraryIconsize(const int& size){
libIconSize->set(QVariant(size));
libIconSize->set(QVariant(size));
}
bool UBSettings::checkDirectory(QString& dirPath)
......@@ -1218,3 +1227,20 @@ QString UBSettings::replaceWildcard(QString& path)
return result;
}
void UBSettings::closing()
{
cleanNonPersistentSettings();
}
void UBSettings::cleanNonPersistentSettings()
{
if(!communityCredentialsPersistence->get().toBool()){
communityPsw->set(QVariant(""));
communityUser->set(QVariant(""));
}
if(!youTubeCredentialsPersistence->get().toBool()){
removePassword(youTubeUserEMail->get().toString());
youTubeUserEMail->set(QVariant(""));
}
}
......@@ -29,13 +29,14 @@ class UBSettings : public QObject
UBSettings(QObject *parent = 0);
virtual ~UBSettings();
void cleanNonPersistentSettings();
public:
QStringList* supportedKeyboardSizes;
void InitKeyboardPaletteKeyBtnSizes();
void ValidateKeyboardPaletteKeyBtnSize();
void closing();
int penWidthIndex();
......@@ -95,12 +96,14 @@ class UBSettings : public QObject
void setCommunityUsername(const QString& username);
QString communityPassword();
void setCommunityPassword(const QString& password);
bool getCommunityDataPersistence(){return communityCredentialsPersistence->get().toBool();}
void setCommunityPersistence(const bool persistence);
int libraryIconSize();
void setLibraryIconsize(const int& size);
void init();
//user directories
static QString userDataDirectory();
static QString userDocumentDirectory();
......@@ -115,9 +118,9 @@ class UBSettings : public QObject
static QString userInteractiveFavoritesDirectory();
static QString userPodcastRecordingDirectory();
QString userGipLibraryDirectory();
//application directory
QString userGipLibraryDirectory();
//application directory
QString applicationShapeLibraryDirectory();
QString applicationImageLibraryDirectory();
QString applicationApplicationsLibraryDirectory();
......@@ -302,6 +305,7 @@ class UBSettings : public QObject
UBSetting* podcastPublishToYoutube;
UBSetting* youTubeUserEMail;
UBSetting* youTubeCredentialsPersistence;
UBSetting* uniboardWebEMail;
UBSetting* uniboardWebAuthor;
......@@ -337,6 +341,7 @@ class UBSettings : public QObject
UBSetting* communityUser;
UBSetting* communityPsw;
UBSetting* communityCredentialsPersistence;
UBSetting* pageSize;
UBSetting* pageDpi;
......
......@@ -243,7 +243,7 @@ void UBGraphicsDelegateFrame::setCursorFromAngle(QString angle)
QSize cursorSize(45,30);
QImage mask_img(cursorSize, QImage::Format_Mono);
mask_img.fill(0xff);
QPainter mask_ptr(&mask_img);
......@@ -252,7 +252,7 @@ void UBGraphicsDelegateFrame::setCursorFromAngle(QString angle)
QBitmap bmpMask = QBitmap::fromImage(mask_img);
QPixmap pixCursor(cursorSize);
QPixmap pixCursor(cursorSize);
pixCursor.fill(QColor(Qt::white));
QPainter painter(&pixCursor);
......@@ -293,12 +293,12 @@ QPointF UBGraphicsDelegateFrame::getFixedPointFromPos()
QPointF fixedPoint;
if (!moving() && !rotating())
{
if (resizingTop())
if (resizingTop())
{
if (mMirrorX && mMirrorY)
{
if ((0 < mAngle) && (mAngle < 90))
fixedPoint = delegated()->sceneBoundingRect().topLeft();
fixedPoint = delegated()->sceneBoundingRect().topLeft();
else
fixedPoint = delegated()->sceneBoundingRect().topRight();
}
......@@ -310,12 +310,12 @@ QPointF UBGraphicsDelegateFrame::getFixedPointFromPos()
fixedPoint = delegated()->sceneBoundingRect().bottomLeft();
}
}
else if (resizingLeft())
else if (resizingLeft())
{
if (mMirrorX && mMirrorY)
{
if ((0 < mAngle) && (mAngle < 90))
fixedPoint = delegated()->sceneBoundingRect().bottomLeft();
fixedPoint = delegated()->sceneBoundingRect().bottomLeft();
else
fixedPoint = delegated()->sceneBoundingRect().topLeft();
}
......@@ -337,14 +337,14 @@ QSizeF UBGraphicsDelegateFrame::getResizeVector(qreal moveX, qreal moveY)
qreal dPosX = 0;
qreal dPosY = 0;
if (resizingTop())
if (resizingTop())
{
if (mMirrorX && mMirrorY)
dPosY = moveY;
else
dPosY = -moveY;
}
else if (resizingLeft())
else if (resizingLeft())
{
if (mMirrorX && mMirrorY)
dPosX = moveX;
......@@ -354,7 +354,7 @@ QSizeF UBGraphicsDelegateFrame::getResizeVector(qreal moveX, qreal moveY)
else if (resizingRight())
dPosX = (mMirrorX) ? -moveX : moveX;
else if (resizingBottom())
else if (resizingBottom())
dPosY = mMirrorY ? -moveY : moveY;
return QSizeF(dPosX, dPosY);
......@@ -363,7 +363,7 @@ QSizeF UBGraphicsDelegateFrame::getResizeVector(qreal moveX, qreal moveY)
QSizeF UBGraphicsDelegateFrame::resizeDelegate(qreal moveX, qreal moveY)
{
QSizeF incVector;
mFixedPoint = getFixedPointFromPos();
mFixedPoint = getFixedPointFromPos();
UBResizableGraphicsItem* resizableItem = dynamic_cast<UBResizableGraphicsItem*>(delegated());
if (resizableItem)
......@@ -382,15 +382,10 @@ QSizeF UBGraphicsDelegateFrame::resizeDelegate(qreal moveX, qreal moveY)
}
void UBGraphicsDelegateFrame::scaleByPos(qreal scaleX, qreal scaleY)
{
}
void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
if (None == mCurrentTool)
return;
return;
QLineF move = QLineF(mStartingPoint, event->scenePos());
qreal moveX = move.length() * cos((move.angle() - mAngle) * PI / 180);
......@@ -399,7 +394,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
qreal height = delegated()->boundingRect().height() * mTotalScaleY;
if (mOperationMode == Scaling)
{
{
if(!rotating())
{
mTranslateX = moveX;
......@@ -504,7 +499,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
}
}
}
if (rotating())
{
mTranslateX = 0;
......@@ -597,7 +592,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
delegated()->setTransform(buildTransform());
}
else // resizing/resizing horizontally
{
{
if (resizingBottomRight())
{
......@@ -609,9 +604,9 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
else
mCurrentTool = ResizeBottom;
incV = resizeDelegate(moveX, moveY);
incV = resizeDelegate(moveX, moveY);
mOriginalSize += incV;
if (mMirrorX && mMirrorY)
mCurrentTool = ResizeLeft;
else
......@@ -623,7 +618,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
mFixedPoint = getFixedPointFromPos();
incH = resizeDelegate(moveX, moveY);
incH = resizeDelegate(moveX, moveY);
mOriginalSize -= incV;
mOriginalSize += incH;
......@@ -631,7 +626,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
mCurrentTool = ResizeBottomRight;
}
else
resizeDelegate(moveX, moveY);
resizeDelegate(moveX, moveY);
}
event->accept();
}
......@@ -660,11 +655,11 @@ void UBGraphicsDelegateFrame::prepareFramesToMove(QList<UBGraphicsDelegateFrame
foreach (UBGraphicsDelegateFrame *frame, mLinkedFrames)
{
frame->prepareLinkedFrameToMove();
}
}
}
void UBGraphicsDelegateFrame::prepareLinkedFrameToMove()
{
{
mDelegate->startUndoStep();
mStartingPoint = QPointF(0,0);
......@@ -685,12 +680,12 @@ void UBGraphicsDelegateFrame::prepareLinkedFrameToMove()
void UBGraphicsDelegateFrame::moveLinkedItems(QLineF movingVector, bool bLinked)
{
if (bLinked)
{
{
mCurrentTool = Move;
mTranslateX = movingVector.dx();
mTranslateY = movingVector.dy();
delegated()->setTransform(buildTransform(), false);
}
else
......@@ -777,7 +772,7 @@ void UBGraphicsDelegateFrame::setVisible(bool visible)
void UBGraphicsDelegateFrame::positionHandles()
{
QRectF itemRect = delegated()->boundingRect();
if (mDelegate->getToolBarItem() && mDelegate->getToolBarItem()->isVisibleOnBoard()
&& mDelegate->getToolBarItem()->isShifting())
{
......
......@@ -40,7 +40,6 @@ class UBGraphicsDelegateFrame: public QGraphicsRectItem, public QObject
QPointF getFixedPointFromPos();
QSizeF getResizeVector(qreal moveX, qreal moveY);
QSizeF resizeDelegate(qreal moveX, qreal moveY);
void scaleByPos(qreal scaleX, qreal scaleY);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
......
......@@ -397,7 +397,6 @@ QString UBFileSystemUtils::lastPathComponent(const QString& path)
QString UBFileSystemUtils::mimeTypeFromFileName(const QString& fileName)
{
Q_ASSERT(fileName.length());
QString ext = extension(fileName);
if (ext == "xls" || ext == "xlsx") return "application/msexcel";
......
......@@ -18,6 +18,12 @@
#include "core/memcheck.h"
const double PI = 4.0 * atan(1.0);
const int UBGeometryUtils::centimeterGraduationHeight = 15;
const int UBGeometryUtils::halfCentimeterGraduationHeight = 10;
const int UBGeometryUtils::millimeterGraduationHeight = 5;
const int UBGeometryUtils::millimetersPerCentimeter = 10;
const int UBGeometryUtils::millimetersPerHalfCentimeter = 5;
const float UBGeometryUtils::inchSize = 25.4f;
UBGeometryUtils::UBGeometryUtils()
{
......
......@@ -37,6 +37,13 @@ class UBGeometryUtils
static QPoint pointConstrainedInRect(QPoint point, QRect rect);
static void crashPointList(QVector<QPointF> &points);
const static int centimeterGraduationHeight;
const static int halfCentimeterGraduationHeight;
const static int millimeterGraduationHeight;
const static int millimetersPerCentimeter;
const static int millimetersPerHalfCentimeter;
const static float inchSize;
};
#endif /* UBGEOMETRYUTILS_H_ */
This diff is collapsed.
......@@ -34,11 +34,12 @@ QPixmap* UBToolWidget::sUnpinPixmap = 0;
UBToolWidget::UBToolWidget(const QUrl& pUrl, QWidget *pParent)
: QWidget(pParent, Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint)
, mWebView(0)
, mToolWidget(0)
, mShouldMoveWidget(false)
, mContentMargin(0)
, mFrameWidth(0)
, mWebView(0)
, mToolWidget(0)
{
int widgetType = UBGraphicsWidgetItem::widgetType(pUrl);
if (widgetType == UBWidgetType::Apple)
......@@ -53,11 +54,12 @@ UBToolWidget::UBToolWidget(const QUrl& pUrl, QWidget *pParent)
UBToolWidget::UBToolWidget(UBGraphicsWidgetItem *pWidget, QWidget *pParent)
: QWidget(pParent, Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint)
, mWebView(0)
, mToolWidget(pWidget)
, mShouldMoveWidget(false)
, mContentMargin(0)
, mFrameWidth(0)
, mWebView(0)
, mToolWidget(pWidget)
{
initialize();
javaScriptWindowObjectCleared();
......@@ -92,7 +94,7 @@ void UBToolWidget::initialize()
mWebView->installEventFilter(this);
mFrameWidth = UBSettings::settings()->objectFrameWidth;
mContentMargin = sClosePixmap->width() / 2 + mFrameWidth;
setLayout(new QVBoxLayout());
......
......@@ -94,16 +94,16 @@ void UBYouTubePublisher::postClientLoginRequest(const QString& userName, const Q
QUrl url("https://www.google.com/youtube/accounts/ClientLogin");
mAuthRequest = new UBServerXMLHttpRequest(UBNetworkAccessManager::defaultAccessManager()
, "application/x-www-form-urlencoded"); // destroyed in postClientLoginResponse
, "application/x-www-form-urlencoded"); // destroyed in postClientLoginResponse
connect(mAuthRequest, SIGNAL(finished(bool, const QByteArray&)), this, SLOT(postClientLoginResponse(bool, const QByteArray&)));
mAuthRequest->addHeader("X-GData-Key", sYouTubeDeveloperKey);
QString payload = QString("Email=%1&Passwd=%2&service=youtube&source=%3")
.arg(userName)
.arg(password)
.arg(tr("OpenSankore"));
.arg(userName)
.arg(password)
.arg(tr("OpenSankore"));
mAuthRequest->post(url, payload.toUtf8());
......@@ -125,8 +125,8 @@ void UBYouTubePublisher::postClientLoginResponse(bool success, const QByteArray&
{
if(line.startsWith("Auth="))
{
mAuthToken = line.replace("Auth=", "");
break;
mAuthToken = line.replace("Auth=", "");
break;
}
}
}
......@@ -137,7 +137,7 @@ void UBYouTubePublisher::postClientLoginResponse(bool success, const QByteArray&
if(mAuthToken.length() == 0)
{
UBApplication::showMessage(tr("YouTube authentication failed."));
// success = false;
// success = false;
deleteLater();
}
else
......@@ -188,7 +188,7 @@ void UBYouTubePublisher::postVideoUploadRequest()
QString contentType = QString("multipart/related; boundary=\"%1\"").arg(boundary);
mUploadRequest = new UBServerXMLHttpRequest(UBNetworkAccessManager::defaultAccessManager()
, contentType); // destroyed in postVideoUploadResponse
, contentType); // destroyed in postVideoUploadResponse
mUploadRequest->setVerbose(true);
connect(mUploadRequest, SIGNAL(progress(qint64, qint64)), this, SLOT(progress(qint64, qint64)));
......@@ -206,15 +206,15 @@ void UBYouTubePublisher::postVideoUploadRequest()
QByteArray payload;
payload.append(QString("\n--" + boundary + "\n").toUtf8())
.append(QString("Content-Type: application/atom+xml; charset=UTF-8\n\n").toUtf8())
.append(youtubeMetadata().toUtf8());
.append(QString("Content-Type: application/atom+xml; charset=UTF-8\n\n").toUtf8())
.append(youtubeMetadata().toUtf8());
payload.append(QString("\n--" + boundary + "\n").toUtf8());
QString videoMimeType = UBFileSystemUtils::mimeTypeFromFileName(mVideoFilePath);
payload.append((QString("Content-Type: %1\n").arg(videoMimeType)).toUtf8())
.append(QString("Content-Transfer-Encoding: binary\n\n").toUtf8());
.append(QString("Content-Transfer-Encoding: binary\n\n").toUtf8());
payload.append(videoFile.readAll());
......@@ -335,23 +335,45 @@ UBYouTubePublishingDialog::UBYouTubePublishingDialog(const QString& videoFilePat
connect(email, SIGNAL(textChanged(const QString&)), this, SLOT(updateUIState(const QString&)));
connect(password, SIGNAL(textChanged(const QString&)), this, SLOT(updateUIState(const QString&)));
connect(youtubeCredentialsPersistence,SIGNAL(clicked()), this, SLOT(updateCredentialPersistenceState()));
dialogButtons->button(QDialogButtonBox::Ok)->setEnabled(false);
dialogButtons->button(QDialogButtonBox::Ok)->setText(tr("Upload"));
UBSettings* settings = UBSettings::settings();
email->setText(settings->youTubeUserEMail->get().toString());
password->setText(settings->password(email->text()));
youtubeCredentialsPersistence->setChecked(UBSettings::settings()->youTubeCredentialsPersistence->get().toBool());
updatePersistanceEnableState();
}
void UBYouTubePublishingDialog::updateCredentialPersistenceState()
{
UBSettings::settings()->youTubeCredentialsPersistence->set(QVariant(youtubeCredentialsPersistence->checkState()));
}
void UBYouTubePublishingDialog::updatePersistanceEnableState()
{
bool enabled = email->text().length() || password->text().length();
youtubeCredentialsPersistence->setEnabled(enabled);
youtubeCredentialsPersistence->setStyleSheet(enabled ? "color:black;" : "color : lightgrey;");
}
void UBYouTubePublishingDialog::updateUIState(const QString& string)
{
Q_UNUSED(string);
bool ok = title->text().length() > 0
&& description->toPlainText().length() > 0
&& keywords->text().length() > 0
&& email->text().length() > 0
&& password->text().length() > 0;
bool ok = title->text().length() > 0
&& description->toPlainText().length() > 0
&& keywords->text().length() > 0
&& email->text().length() > 0
&& password->text().length() > 0;
dialogButtons->button(QDialogButtonBox::Ok)->setEnabled(ok);
updatePersistanceEnableState();
}
......
......@@ -78,9 +78,11 @@ class UBYouTubePublishingDialog : public QDialog, public Ui::YouTubePublishingDi
private:
QMap<QString, QString> categories();
void updatePersistanceEnableState();
private slots:
void updateUIState(const QString& = QString(""));
void updateCredentialPersistenceState();
};
......
......@@ -47,7 +47,7 @@ UBAbstractDrawRuler::UBAbstractDrawRuler()
//we actually need to evaluate pixels per millimeter
QDesktopWidget* desktop = UBApplication::desktop();
int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
sPixelsPerMillimeter = qRound(dpiCommon / 25.4f);//because 1inch = 25.4 mm
sPixelsPerMillimeter = qRound(dpiCommon / UBGeometryUtils::inchSize);
}
......
......@@ -16,6 +16,8 @@
#define UB_ABSTRACTDRAWRULER_H_
#include <QtGui>
#include "frameworks/UBGeometryUtils.h"
class UBGraphicsScene;
class QGraphicsSvgItem;
......@@ -45,7 +47,8 @@ protected:
virtual void rotateAroundCenter(qreal angle) = 0;
virtual QPointF rotationCenter() const = 0;
virtual QRectF closeButtonRect() const = 0;
virtual QRectF closeButtonRect() const = 0;
virtual void paintGraduations(QPainter *painter) = 0;
bool mShowButtons;
QGraphicsSvgItem* mCloseSvgItem;
......
......@@ -51,6 +51,11 @@ UBGraphicsCompass::UBGraphicsCompass()
, mDrewCenterCross(false)
{
setRect(sDefaultRect);
//TODO claudio: remove code duplication
QDesktopWidget* desktop = UBApplication::desktop();
int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
mPixelsPerMillimeter = qRound(dpiCommon / 25.4f);
setFlag(QGraphicsItem::ItemIsMovable, true);
setFlag(QGraphicsItem::ItemIsSelectable, true);
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
......@@ -68,7 +73,7 @@ UBGraphicsCompass::UBGraphicsCompass()
updateResizeCursor();
updateDrawCursor();
unsetCursor();
unsetCursor();
setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::CppTool)); //Necessary to set if we want z value to be assigned correctly
setFlag(QGraphicsItem::ItemIsSelectable, false);
......@@ -179,9 +184,9 @@ QVariant UBGraphicsCompass::itemChange(GraphicsItemChange change, const QVariant
void UBGraphicsCompass::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Selector &&
if (UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Selector &&
UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Play)
return;
return;
if (resizeButtonRect().contains(event->pos()))
{
......@@ -216,9 +221,9 @@ void UBGraphicsCompass::mousePressEvent(QGraphicsSceneMouseEvent *event)
void UBGraphicsCompass::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
if (UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Selector &&
if (UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Selector &&
UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Play)
return;
return;
if (!mResizing && !mRotating && !mDrawing)
{
......@@ -261,9 +266,9 @@ void UBGraphicsCompass::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
void UBGraphicsCompass::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Selector &&
if (UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Selector &&
UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Play)
return;
return;
if (mResizing)
{
......@@ -302,9 +307,9 @@ void UBGraphicsCompass::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void UBGraphicsCompass::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
if (UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Selector &&
if (UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Selector &&
UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Play)
return;
return;
mOuterCursor = cursor();
mShowButtons = shape().contains(event->pos());
......@@ -332,9 +337,9 @@ void UBGraphicsCompass::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
void UBGraphicsCompass::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
if (UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Selector &&
if (UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Selector &&
UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Play)
return;
return;
mShowButtons = false;
mCloseSvgItem->setVisible(mShowButtons);
......@@ -346,9 +351,9 @@ void UBGraphicsCompass::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
void UBGraphicsCompass::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
{
if (UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Selector &&
if (UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Selector &&
UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Play)
return;
return;
mShowButtons = shape().contains(event->pos());
mCloseSvgItem->setVisible(mShowButtons);
......@@ -399,7 +404,7 @@ void UBGraphicsCompass::paintAngleDisplay(QPainter *painter)
void UBGraphicsCompass::paintRadiusDisplay(QPainter *painter)
{
qreal radiusInCentimeters = rect().width() / (sPixelsPerMillimeter * 10);
qreal radiusInCentimeters = rect().width() / (mPixelsPerMillimeter * 10);
QString format = rect().width() >= sDisplayRadiusUnitMinLength ? "%1 cm" : "%1";
QString radiusText = QString(format).arg(radiusInCentimeters, 0, 'f', 1);
......@@ -557,10 +562,10 @@ void UBGraphicsCompass::paintCenterCross()
QPointF needleCrossCenter = mapToScene(needlePosition());
scene()->moveTo(QPointF(needleCrossCenter.x() - 5, needleCrossCenter.y()));
scene()->drawLineTo(QPointF(needleCrossCenter.x() + 5, needleCrossCenter.y()), 1,
UBDrawingController::drawingController()->stylusTool() == UBStylusTool::Line);
UBDrawingController::drawingController()->stylusTool() == UBStylusTool::Line);
scene()->moveTo(QPointF(needleCrossCenter.x(), needleCrossCenter.y() - 5));
scene()->drawLineTo(QPointF(needleCrossCenter.x(), needleCrossCenter.y() + 5), 1,
UBDrawingController::drawingController()->stylusTool() == UBStylusTool::Line);
UBDrawingController::drawingController()->stylusTool() == UBStylusTool::Line);
}
QPointF UBGraphicsCompass::needlePosition() const
......
......@@ -113,6 +113,7 @@ class UBGraphicsCompass: public QObject, public QGraphicsRectItem, public UBItem
QGraphicsSvgItem* mResizeSvgItem;
qreal mAntiScaleRatio;
bool mDrewCenterCross;
int mPixelsPerMillimeter;
// Constants
static const QRect sDefaultRect;
......@@ -130,7 +131,6 @@ class UBGraphicsCompass: public QObject, public QGraphicsRectItem, public UBItem
static const QColor sDarkBackgroundEdgeFillColor;
static const QColor sDarkBackgroundMiddleFillColor;
static const QColor sDarkBackgroundDrawColor;
static const int sPixelsPerMillimeter = 5;
static const int sDisplayRadiusOnPencilArmMinLength = 300;
static const int sDisplayRadiusUnitMinLength = 250;
};
......
......@@ -62,10 +62,10 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event);
virtual QPainterPath shape() const;
QRectF boundingRect() const;
void paintGraduations(QPainter *painter);
private:
// Helpers
void paintGraduations (QPainter *painter);
void paintButtons (QPainter *painter);
void paintAngleMarker (QPainter *painter);
Tool toolFromPos (QPointF pos);
......
This diff is collapsed.
......@@ -59,6 +59,7 @@ class UBGraphicsRuler : public UBAbstractDrawRuler, public QGraphicsRectItem, pu
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
void paintGraduations(QPainter *painter);
private:
......@@ -68,7 +69,6 @@ class UBGraphicsRuler : public UBAbstractDrawRuler, public QGraphicsRectItem, pu
// Helpers
void fillBackground(QPainter *painter);
void paintGraduations(QPainter *painter);
void paintRotationCenter(QPainter *painter);
virtual void rotateAroundCenter(qreal angle);
......
......@@ -297,12 +297,6 @@ QPainterPath UBGraphicsTriangle::shape() const
void UBGraphicsTriangle::paintGraduations(QPainter *painter)
{
const int centimeterGraduationHeight = 15;
const int halfCentimeterGraduationHeight = 10;
const int millimeterGraduationHeight = 5;
const int millimetersPerCentimeter = 10;
const int millimetersPerHalfCentimeter = 5;
qreal kx = (mOrientation == TopLeft || mOrientation == BottomLeft) ? 1 : -1;
qreal ky = (mOrientation == BottomLeft || mOrientation == BottomRight) ? 1 : -1;
......@@ -312,10 +306,10 @@ void UBGraphicsTriangle::paintGraduations(QPainter *painter)
for (int millimeters = 0; millimeters < (rect().width() - sLeftEdgeMargin - sRoundingRadius) / sPixelsPerMillimeter; millimeters++)
{
int graduationX = rotationCenter().x() + kx * sPixelsPerMillimeter * millimeters;
int graduationHeight = (0 == millimeters % millimetersPerCentimeter) ?
centimeterGraduationHeight :
((0 == millimeters % millimetersPerHalfCentimeter) ?
halfCentimeterGraduationHeight : millimeterGraduationHeight);
int graduationHeight = (0 == millimeters % UBGeometryUtils::millimetersPerCentimeter) ?
UBGeometryUtils::centimeterGraduationHeight :
((0 == millimeters % UBGeometryUtils::millimetersPerHalfCentimeter) ?
UBGeometryUtils::halfCentimeterGraduationHeight : UBGeometryUtils::millimeterGraduationHeight);
// Check that grad. line inside triangle
qreal dx = (kx > 0) ? rect().width() - graduationX : graduationX - rect().x();
......@@ -332,15 +326,15 @@ void UBGraphicsTriangle::paintGraduations(QPainter *painter)
}
painter->drawLine(QLine(graduationX, rotationCenter().y(), graduationX, rotationCenter().y() - ky * graduationHeight));
if (0 == millimeters % millimetersPerCentimeter)
if (0 == millimeters % UBGeometryUtils::millimetersPerCentimeter)
{
QString text = QString("%1").arg((int)(millimeters / millimetersPerCentimeter));
QString text = QString("%1").arg((int)(millimeters / UBGeometryUtils::millimetersPerCentimeter));
int textXRight = graduationX + fontMetrics.width(text) / 2;
qreal textWidth = fontMetrics.width(text);
qreal textHeight = fontMetrics.tightBoundingRect(text).height() + 5;
int textY = (ky > 0) ? rotationCenter().y() - 5 - centimeterGraduationHeight - textHeight
: rotationCenter().y() + 5 + centimeterGraduationHeight;
int textY = (ky > 0) ? rotationCenter().y() - 5 - UBGeometryUtils::centimeterGraduationHeight - textHeight
: rotationCenter().y() + 5 + UBGeometryUtils::centimeterGraduationHeight;
bool bText = false;
switch(mOrientation)
......
......@@ -118,6 +118,7 @@ class UBGraphicsTriangle : public UBAbstractDrawRuler, public QGraphicsPolygonIt
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
void paintGraduations(QPainter *painter);
private:
......@@ -143,9 +144,6 @@ class UBGraphicsTriangle : public UBAbstractDrawRuler, public QGraphicsPolygonIt
static const QRect sDefaultRect;
static const UBGraphicsTriangleOrientation sDefaultOrientation;
void paintGraduations(QPainter *painter);
UBGraphicsTriangleOrientation mOrientation;
QPointF A1, B1, C1, A2, B2, C2; // coordinates of points in ext and int triangles
......
......@@ -91,12 +91,12 @@ UBToolsManager::UBToolsManager(QObject *parent)
mDescriptors << cache;
// --------------------------------------------------------------------------------
aristo.id = "uniboardTool://uniboard.mnemis.com/aristo";
aristo.icon = QPixmap(":/images/toolPalette/aristoTool.png");
aristo.label = tr("Aristo");
aristo.version = "1.0";
mToolsIcon.insert(aristo.id, ":/images/toolPalette/aristoTool.png");
mDescriptors << aristo;
// aristo.id = "uniboardTool://uniboard.mnemis.com/aristo";
// aristo.icon = QPixmap(":/images/toolPalette/aristoTool.png");
// aristo.label = tr("Aristo");
// aristo.version = "1.0";
// mToolsIcon.insert(aristo.id, ":/images/toolPalette/aristoTool.png");
// mDescriptors << aristo;
}
UBToolsManager::~UBToolsManager()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment