Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
d6762e92
Commit
d6762e92
authored
Apr 26, 2011
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
14d424bc
51b2330b
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
130 additions
and
40 deletions
+130
-40
.gitignore
.gitignore
+45
-0
ubw-main.js
resources/library/interactive/Notes.wgt/js/ubw-main.js
+16
-20
UBLibraryController.cpp
src/board/UBLibraryController.cpp
+14
-1
UBLibraryController.h
src/board/UBLibraryController.h
+3
-0
UBSettings.cpp
src/core/UBSettings.cpp
+3
-0
UBSettings.h
src/core/UBSettings.h
+8
-0
UBLibPalette.cpp
src/gui/UBLibPalette.cpp
+8
-1
UBLibPalette.h
src/gui/UBLibPalette.h
+2
-0
UBLibraryWidget.cpp
src/gui/UBLibraryWidget.cpp
+6
-0
UBNavigatorPalette.cpp
src/gui/UBNavigatorPalette.cpp
+3
-2
UBThumbnailWidget.cpp
src/gui/UBThumbnailWidget.cpp
+21
-16
UBThumbnailWidget.h
src/gui/UBThumbnailWidget.h
+1
-0
No files found.
.gitignore
0 → 100644
View file @
d6762e92
# Compiled source #
###################
*.com
*.class
#*.dll
#*.exe
#*.o
#*.so
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db
# IDE #
#######
*.kdev4
*.cproject
*.xcodeproj
*.pdb
*.sln
*.suo
*.vcproj
*.ncb
resources/library/interactive/Notes.wgt/js/ubw-main.js
View file @
d6762e92
...
...
@@ -19,41 +19,34 @@ function init(){
var
maximize
=
$
(
'<img src="images/stick-but-maximize.png">'
);
var
title
=
$
(
'<div id="menu"></div>'
);
var
textField
=
$
(
'<div id="txt"></div>'
);
var
shadow
=
$
(
"<table width='100%' height='18' border='0' cellspacing='0' cellpadding='0'><tr><td id='sl' width='139'></td><td id='sc' style='background-image:url(images/shadowcenter.png)'> </td><td id='sr' width='139'></td></tr></table>"
)
.
appendTo
(
"body"
);
var
shadowleft
=
$
(
"<img src='images/shadowleft.png'>"
)
.
appendTo
(
$
(
"#sl"
));
var
shadowright
=
$
(
"<img src='images/shadowright.png'>"
)
.
appendTo
(
$
(
"#sr"
));
var
shadow
=
$
(
"<table width='100%' height='18' border='0' cellspacing='0' cellpadding='0'><tr><td id='sl' width='139'></td><td id='sc' style='background-image:url(images/shadowcenter.png)'> </td><td id='sr' width='139'></td></tr></table>"
)
.
appendTo
(
"body"
);
var
shadowleft
=
$
(
"<img src='images/shadowleft.png'>"
)
.
appendTo
(
$
(
"#sl"
));
var
shadowright
=
$
(
"<img src='images/shadowright.png'>"
)
.
appendTo
(
$
(
"#sr"
));
$
(
"#ubwidget"
)
.
append
(
header
)
.
append
(
textField
);
fontUp
.
addClass
(
'menuElement'
);
fontDown
.
addClass
(
'menuElement'
);
minimize
.
addClass
(
'menuElement'
);
maximize
.
addClass
(
'menuElement'
)
fontUp
.
addClass
(
'menuElement'
);
fontDown
.
addClass
(
'menuElement'
);
minimize
.
addClass
(
'menuElement'
);
maximize
.
addClass
(
'menuElement'
)
.
hide
();
header
.
append
(
maximize
)
header
.
append
(
maximize
)
.
append
(
minimize
)
.
append
(
fontUp
)
.
append
(
fontDown
);
var
titletext
=
header
.
find
(
'textarea'
);
var
titletext
=
header
.
find
(
'textarea'
);
titletext
.
click
(
function
(){
titletext
.
focus
();
});
fontDown
.
click
(
...
...
@@ -71,6 +64,7 @@ function init(){
window
.
uniboard
.
setPreference
(
"fontSize"
,
newFontSize
);
};
textField
.
focus
();
});
fontUp
.
click
(
...
...
@@ -87,6 +81,8 @@ function init(){
if
(
window
.
uniboard
){
window
.
uniboard
.
setPreference
(
"fontSize"
,
newFontSize
);
};
textField
.
focus
();
});
minimize
.
click
(
...
...
src/board/UBLibraryController.cpp
View file @
d6762e92
...
...
@@ -221,40 +221,47 @@ QList<UBLibElement*> UBLibraryController::rootCategoriesList()
UBLibElement
*
element
=
new
UBLibElement
(
eUBLibElementType_Folder
,
mAudioStandardDirectoryPath
,
tr
(
"Audios"
,
"Audio category element"
));
QImage
*
categoryImage
=
new
QImage
(
":images/libpalette/AudiosCategory.svg"
);
element
->
setThumbnail
(
categoryImage
);
element
->
setMoveable
(
false
);
categories
<<
element
;
element
=
new
UBLibElement
(
eUBLibElementType_Folder
,
mVideoStandardDirectoryPath
,
tr
(
"Movies"
,
"Movies category element"
));
categoryImage
=
new
QImage
(
":images/libpalette/MoviesCategory.svg"
);
element
->
setThumbnail
(
categoryImage
);
element
->
setMoveable
(
false
);
categories
<<
element
;
element
=
new
UBLibElement
(
eUBLibElementType_VirtualFolder
,
picturesVirtualPath
,
tr
(
"Pictures"
,
"Pictures category element"
));
categoryImage
=
new
QImage
(
":images/libpalette/PicturesCategory.svg"
);
element
->
setThumbnail
(
categoryImage
);
element
->
setMoveable
(
false
);
categories
<<
element
;
QString
path
=
UBSettings
::
settings
()
->
uniboardShapeLibraryDirectory
();
categoryImage
=
new
QImage
(
":images/libpalette/ShapesCategory.svg"
);
element
=
new
UBLibElement
(
eUBLibElementType_Folder
,
QUrl
::
fromLocalFile
(
path
),
tr
(
"Shapes"
,
"Shapes category element"
));
element
->
setThumbnail
(
categoryImage
);
element
->
setMoveable
(
false
);
categories
<<
element
;
categoryImage
=
new
QImage
(
":images/libpalette/ApplicationsCategory.svg"
);
element
=
new
UBLibElement
(
eUBLibElementType_VirtualFolder
,
applicationsVirtualPath
,
tr
(
"Applications"
,
"Applications category element"
));
element
->
setThumbnail
(
categoryImage
);
element
->
setMoveable
(
false
);
categories
<<
element
;
categoryImage
=
new
QImage
(
":images/libpalette/FavoritesCategory.svg"
);
element
=
new
UBLibElement
(
eUBLibElementType_VirtualFolder
,
favoriteVirtualPath
,
tr
(
"Favorite"
,
"Favorite category element"
));
element
->
setThumbnail
(
categoryImage
);
element
->
setMoveable
(
false
);
categories
<<
element
;
categoryImage
=
new
QImage
(
":images/libpalette/InteractivesCategory.svg"
);
interactivesCategoryPath
=
UBSettings
::
settings
()
->
uniboardGipLibraryDirectory
();
element
=
new
UBLibElement
(
eUBLibElementType_Folder
,
QUrl
::
fromLocalFile
(
interactivesCategoryPath
),
tr
(
"Interactives"
,
"Interactives category element"
));
element
->
setThumbnail
(
categoryImage
);
element
->
setMoveable
(
false
);
categories
<<
element
;
...
...
@@ -2429,7 +2436,8 @@ QString UBLibraryController::favoritePath()
UBLibElement
::
UBLibElement
()
{
mType
=
eUBLibElementType_Category
;
mName
=
QObject
::
tr
(
"/Home"
,
"Category list label on nagigation tool bar"
);
mName
=
QObject
::
tr
(
"/Home"
,
"Category list label on navigation tool bar"
);
mbMoveable
=
false
;
}
...
...
@@ -2439,6 +2447,7 @@ UBLibElement::UBLibElement(eUBLibElementType type, const QUrl &path, const QStri
mPath
=
path
;
mName
=
name
;
mInfo
=
""
;
mbMoveable
=
true
;
if
(
type
==
eUBLibElementType_Folder
)
mThumbnail
=
QImage
(
":images/libpalette/folder.svg"
);
...
...
@@ -2448,6 +2457,9 @@ UBLibElement::UBLibElement(eUBLibElementType type, const QUrl &path, const QStri
if
(
type
==
eUBLibElementType_Item
)
mExtension
=
QFileInfo
(
path
.
toLocalFile
()).
completeSuffix
();
if
(
type
==
eUBLibElementType_VirtualFolder
||
type
==
eUBLibElementType_Category
)
mbMoveable
=
false
;
}
UBLibElement
::~
UBLibElement
()
...
...
@@ -2483,6 +2495,7 @@ UBLibElement* UBLibElement::trashElement()
trashElement
=
new
UBLibElement
(
eUBLibElementType_Folder
,
UBSettings
::
trashLibraryPaletteDirPath
(),
QObject
::
tr
(
"Trash"
,
"Pictures category element"
));
QImage
*
categoryImage
=
new
QImage
(
":images/libpalette/TrashCategory.svg"
);
trashElement
->
setThumbnail
(
categoryImage
);
trashElement
->
setMoveable
(
false
);
return
trashElement
;
}
...
...
src/board/UBLibraryController.h
View file @
d6762e92
...
...
@@ -46,6 +46,8 @@ public:
void
setName
(
QString
name
){
mName
=
name
;}
QString
extension
(){
return
mExtension
;}
void
setExtension
(
QString
&
extension
){
mExtension
=
extension
;}
bool
isMoveable
(){
return
mbMoveable
;}
void
setMoveable
(
bool
bState
){
mbMoveable
=
bState
;}
private
:
eUBLibElementType
mType
;
...
...
@@ -54,6 +56,7 @@ private:
QString
mInfo
;
QString
mName
;
QString
mExtension
;
bool
mbMoveable
;
};
class
UBChainedLibElement
...
...
src/core/UBSettings.cpp
View file @
d6762e92
...
...
@@ -168,6 +168,9 @@ void UBSettings::init()
appEnableAutomaticSoftwareUpdates
=
new
UBSetting
(
this
,
"App"
,
"EnableAutomaticSoftwareUpdates"
,
true
);
appEnableSoftwareUpdates
=
new
UBSetting
(
this
,
"App"
,
"EnableSoftwareUpdates"
,
true
);
appToolBarOrientationVertical
=
new
UBSetting
(
this
,
"App"
,
"ToolBarOrientationVertical"
,
true
);
navigPaletteWidth
=
new
UBSetting
(
this
,
"Board"
,
"NavigPaletteWidth"
,
300
);
libPaletteWidth
=
new
UBSetting
(
this
,
"Board"
,
"LibPaletteWidth"
,
300
);
appIsInSoftwareUpdateProcess
=
new
UBSetting
(
this
,
"App"
,
"IsInSoftwareUpdateProcess"
,
false
);
appLastSessionDocumentUUID
=
new
UBSetting
(
this
,
"App"
,
"LastSessionDocumentUUID"
,
""
);
...
...
src/core/UBSettings.h
View file @
d6762e92
...
...
@@ -310,6 +310,14 @@ class UBSettings : public QObject
UBSetting
*
gipThumbnailWidth
;
UBSetting
*
soundThumbnailWidth
;
UBSetting
*
navigPaletteWidth
;
UBSetting
*
libPaletteWidth
;
/*
static int navigPaletteWidth;
static int libPaletteWidth;
*/
public
slots
:
void
setPenWidthIndex
(
int
index
);
...
...
src/gui/UBLibPalette.cpp
View file @
d6762e92
...
...
@@ -17,9 +17,10 @@ UBLibPalette::UBLibPalette(QWidget *parent, const char *name):UBDockPalette(pare
mIcon
=
QPixmap
(
":images/paletteLibrary.png"
);
setAcceptDrops
(
true
);
resize
(
300
,
height
());
resize
(
UBSettings
::
settings
()
->
libPaletteWidth
->
get
().
toInt
()
,
height
());
setContentsMargins
(
border
(),
0
,
0
,
0
);
mCollapseWidth
=
180
;
mLastWidth
=
300
;
mLayout
=
new
QVBoxLayout
(
this
);
mLayout
->
setMargin
(
3
);
...
...
@@ -158,3 +159,9 @@ void UBLibPalette::showFolder()
mActionBar
->
setButtons
(
mActionBar
->
previousButtonSet
());
mStackedWidget
->
setCurrentIndex
(
ID_NAVIGATOR
);
}
void
UBLibPalette
::
resizeEvent
(
QResizeEvent
*
event
)
{
UBDockPalette
::
resizeEvent
(
event
);
UBSettings
::
settings
()
->
libPaletteWidth
->
set
(
width
());
}
src/gui/UBLibPalette.h
View file @
d6762e92
...
...
@@ -9,6 +9,7 @@
#include <QDragMoveEvent>
#include <QMimeData>
#include <QMouseEvent>
#include <QResizeEvent>
#include "UBDockPalette.h"
#include "UBLibNavigatorWidget.h"
...
...
@@ -33,6 +34,7 @@ protected:
void
dropEvent
(
QDropEvent
*
pEvent
);
void
dragMoveEvent
(
QDragMoveEvent
*
pEvent
);
void
mouseMoveEvent
(
QMouseEvent
*
event
);
void
resizeEvent
(
QResizeEvent
*
event
);
private
slots
:
void
showProperties
(
UBLibElement
*
elem
);
...
...
src/gui/UBLibraryWidget.cpp
View file @
d6762e92
...
...
@@ -209,6 +209,7 @@ void UBLibraryWidget::onSelectionChanged()
QList
<
UBLibElement
*>
qlSelectedItems
;
QList
<
QGraphicsItem
*>
qlGI
=
selectedItems
();
bCanDrag
=
true
;
foreach
(
QGraphicsItem
*
it
,
qlGI
)
{
int
itIndex
=
mGraphicItems
.
indexOf
(
it
);
...
...
@@ -222,6 +223,11 @@ void UBLibraryWidget::onSelectionChanged()
{
qlSelectedItems
<<
pElem
;
}
if
(
!
pElem
->
isMoveable
())
{
bCanDrag
=
false
;
}
}
}
}
...
...
src/gui/UBNavigatorPalette.cpp
View file @
d6762e92
...
...
@@ -17,8 +17,8 @@ UBNavigatorPalette::UBNavigatorPalette(QWidget *parent, const char *name):UBDock
setOrientation
(
eUBDockOrientation_Left
);
setMaximumWidth
(
300
);
mIcon
=
QPixmap
(
":images/paletteNavigator.png"
);
resize
(
maximumWidth
(),
height
());
resize
(
UBSettings
::
settings
()
->
navigPaletteWidth
->
get
().
toInt
(),
height
());
mLastWidth
=
300
;
setContentsMargins
(
0
,
0
,
border
(),
0
);
// Build the gui
...
...
@@ -135,6 +135,7 @@ void UBNavigatorPalette::resizeEvent(QResizeEvent *event)
{
mNavigator
->
setMinimumHeight
(
height
()
-
2
*
border
());
}
UBSettings
::
settings
()
->
navigPaletteWidth
->
set
(
width
());
}
void
UBNavigatorPalette
::
timerEvent
(
QTimerEvent
*
event
)
...
...
src/gui/UBThumbnailWidget.cpp
View file @
d6762e92
...
...
@@ -19,6 +19,8 @@ UBThumbnailWidget::UBThumbnailWidget(QWidget* parent)
,
mSelectionSpan
(
0
)
,
mLassoRectItem
(
0
)
{
// By default, the drag is possible
bCanDrag
=
true
;
setHorizontalScrollBarPolicy
(
Qt
::
ScrollBarAlwaysOff
);
setRenderHints
(
QPainter
::
Antialiasing
|
QPainter
::
SmoothPixmapTransform
|
QPainter
::
TextAntialiasing
);
setFrameShape
(
QFrame
::
NoFrame
);
...
...
@@ -326,30 +328,33 @@ void UBThumbnailWidget::mouseMoveEvent(QMouseEvent *event)
if
(
0
==
selectedItems
().
size
())
return
;
QDrag
*
drag
=
new
QDrag
(
this
);
QMimeData
*
mime
=
new
QMimeData
();
if
(
bCanDrag
)
{
QDrag
*
drag
=
new
QDrag
(
this
);
QMimeData
*
mime
=
new
QMimeData
();
if
(
mMimeType
.
length
()
>
0
)
mime
->
setData
(
mMimeType
,
QByteArray
());
// trick the d&d system to register our own mime type
if
(
mMimeType
.
length
()
>
0
)
mime
->
setData
(
mMimeType
,
QByteArray
());
// trick the d&d system to register our own mime type
drag
->
setMimeData
(
mime
);
drag
->
setMimeData
(
mime
);
QList
<
QUrl
>
qlElements
;
QList
<
QUrl
>
qlElements
;
foreach
(
QGraphicsItem
*
item
,
selectedItems
())
{
if
(
mGraphicItems
.
contains
(
item
))
foreach
(
QGraphicsItem
*
item
,
selectedItems
())
{
if
(
mGraphicItems
.
indexOf
(
item
)
<=
mItemsPaths
.
size
()){
qlElements
<<
mItemsPaths
.
at
(
mGraphicItems
.
indexOf
(
item
));
if
(
mGraphicItems
.
contains
(
item
))
{
if
(
mGraphicItems
.
indexOf
(
item
)
<=
mItemsPaths
.
size
()){
qlElements
<<
mItemsPaths
.
at
(
mGraphicItems
.
indexOf
(
item
));
}
}
}
}
if
(
qlElements
.
size
()
>
0
){
mime
->
setUrls
(
qlElements
);
drag
->
setMimeData
(
mime
);
drag
->
exec
();
if
(
qlElements
.
size
()
>
0
){
mime
->
setUrls
(
qlElements
);
drag
->
setMimeData
(
mime
);
drag
->
exec
();
}
}
}
...
...
src/gui/UBThumbnailWidget.h
View file @
d6762e92
...
...
@@ -77,6 +77,7 @@ class UBThumbnailWidget : public QGraphicsView
QList
<
QUrl
>
mItemsPaths
;
QStringList
mLabels
;
bool
bSelectionInProgress
;
bool
bCanDrag
;
private
:
void
selectAll
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment