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
04672119
Commit
04672119
authored
Aug 01, 2012
by
Ilia Ryabokon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AddToPalette Sankore-621 External DnD for UBFeaturesWidget resolved
parent
f4ac3c88
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
159 additions
and
108 deletions
+159
-108
UBBoardPaletteManager.cpp
src/board/UBBoardPaletteManager.cpp
+4
-0
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+123
-96
UBFeaturesController.h
src/board/UBFeaturesController.h
+9
-5
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+21
-6
UBFeaturesWidget.h
src/gui/UBFeaturesWidget.h
+1
-0
UBTeacherGuideWidget.cpp
src/gui/UBTeacherGuideWidget.cpp
+1
-1
No files found.
src/board/UBBoardPaletteManager.cpp
View file @
04672119
...
...
@@ -884,6 +884,10 @@ void UBBoardPaletteManager::addItemToLibrary()
#ifdef USE_WEB_WIDGET
mpLibWidget
->
libNavigator
()
->
libraryWidget
()
->
libraryController
()
->
importImageOnLibrary
(
image
);
#else
QDateTime
now
=
QDateTime
::
currentDateTime
();
QString
capturedName
=
tr
(
"CapturedImage"
)
+
"-"
+
now
.
toString
(
"dd-MM-yyyy hh-mm-ss"
)
+
".png"
;
mpFeaturesWidget
->
importImage
(
image
,
capturedName
);
#endif
}
...
...
src/board/UBFeaturesController.cpp
View file @
04672119
This diff is collapsed.
Click to expand it.
src/board/UBFeaturesController.h
View file @
04672119
...
...
@@ -33,7 +33,8 @@ enum UBFeatureElementType
FEATURE_ITEM
,
FEATURE_TRASH
,
FEATURE_FAVORITE
,
FEATURE_SEARCH
FEATURE_SEARCH
,
FEATURE_INVALID
};
class
UBFeature
...
...
@@ -105,6 +106,7 @@ public:
UBFeature
moveItemToFolder
(
const
QUrl
&
url
,
const
UBFeature
&
destination
);
UBFeature
copyItemToFolder
(
const
QUrl
&
url
,
const
UBFeature
&
destination
);
void
moveExternalData
(
const
QUrl
&
url
,
const
UBFeature
&
destination
);
void
rescanModel
();
void
siftElements
(
const
QString
&
pSiftValue
);
...
...
@@ -120,13 +122,15 @@ public:
void
addNewFolder
(
const
QString
&
name
);
void
addToFavorite
(
const
QUrl
&
path
);
void
removeFromFavorite
(
const
QUrl
&
path
,
bool
deleteManualy
=
false
);
UBFeature
importImage
(
const
QImage
&
image
,
const
UBFeature
&
destination
);
void
importImage
(
const
QImage
&
image
,
const
QString
&
fileName
=
QString
());
void
importImage
(
const
QImage
&
image
,
const
UBFeature
&
destination
,
const
QString
&
fileName
=
QString
()
);
void
fileSystemScan
(
const
QUrl
&
currPath
,
const
QString
&
currVirtualPath
);
static
UBFeatureElementType
fileTypeFromUrl
(
const
QString
&
path
);
static
QString
fileNameFromUrl
(
const
QUrl
&
url
);
static
QPixmap
thumbnailForFile
(
const
QString
&
path
);
static
QPixmap
getIcon
(
const
QString
&
path
,
UBFeatureElementType
pFType
);
static
bool
isDeletable
(
const
QUrl
&
url
);
static
char
featureTypeSplitter
()
{
return
':'
;}
...
...
@@ -153,7 +157,7 @@ private:
void
loadFavoriteList
();
void
saveFavoriteList
();
static
UBFeatureElementType
fileTypeFromUrl
(
const
QString
&
path
);
QList
<
UBFeature
>
*
featuresList
;
...
...
@@ -204,7 +208,7 @@ private:
public
:
UBFeature
trashElement
;
UBFeature
get
Parent
FeatureForUrl
(
const
QUrl
&
url
);
UBFeature
get
Destination
FeatureForUrl
(
const
QUrl
&
url
);
};
...
...
src/gui/UBFeaturesWidget.cpp
View file @
04672119
...
...
@@ -108,6 +108,9 @@ void UBFeaturesWidget::currentSelected(const QModelIndex ¤t)
return
;
}
//Calling to reset the model for listView. Maybe separate function needed
controller
->
searchStarted
(
""
,
mNavigator
->
listView
());
QString
objName
=
sender
()
->
objectName
();
if
(
objName
.
isEmpty
())
{
...
...
@@ -357,6 +360,10 @@ QStringList UBFeaturesMimeData::formats() const
return
QMimeData
::
formats
();
}
void
UBFeaturesWidget
::
importImage
(
const
QImage
&
image
,
const
QString
&
fileName
)
{
controller
->
importImage
(
image
,
fileName
);
}
UBFeaturesListView
::
UBFeaturesListView
(
QWidget
*
parent
,
const
char
*
name
)
:
QListView
(
parent
)
...
...
@@ -862,6 +869,8 @@ bool UBFeaturesModel::dropMimeData(const QMimeData *mimeData, Qt::DropAction act
Q_UNUSED
(
row
)
const
UBFeaturesMimeData
*
fMimeData
=
qobject_cast
<
const
UBFeaturesMimeData
*>
(
mimeData
);
UBFeaturesController
*
curController
=
qobject_cast
<
UBFeaturesController
*>
(
QObject
::
parent
());
bool
dataFromSameModel
=
false
;
if
(
fMimeData
)
...
...
@@ -876,12 +885,12 @@ bool UBFeaturesModel::dropMimeData(const QMimeData *mimeData, Qt::DropAction act
UBFeature
parentFeature
;
if
(
!
parent
.
isValid
())
{
parentFeature
=
dynamic_cast
<
UBFeaturesWidget
*>
(
QObject
::
parent
())
->
getFeaturesController
()
->
getCurrentElement
();
parentFeature
=
curController
->
getCurrentElement
();
}
else
{
parentFeature
=
parent
.
data
(
Qt
::
UserRole
+
1
).
value
<
UBFeature
>
();
}
if
(
mimeData
->
hasUrls
()
)
{
if
(
dataFromSameModel
)
{
QList
<
UBFeature
>
featList
=
fMimeData
->
features
();
for
(
int
i
=
0
;
i
<
featList
.
count
();
i
++
)
{
UBFeature
sourceElement
;
...
...
@@ -890,10 +899,16 @@ bool UBFeaturesModel::dropMimeData(const QMimeData *mimeData, Qt::DropAction act
moveData
(
sourceElement
,
parentFeature
,
Qt
::
MoveAction
);
}
}
}
else
if
(
mimeData
->
hasImage
()
)
{
}
else
if
(
mimeData
->
hasUrls
())
{
QList
<
QUrl
>
urlList
=
mimeData
->
urls
();
foreach
(
QUrl
curUrl
,
urlList
)
{
qDebug
()
<<
"URl catched is "
<<
curUrl
.
toLocalFile
();
curController
->
moveExternalData
(
curUrl
,
parentFeature
);
}
}
else
if
(
mimeData
->
hasImage
())
{
QImage
image
=
qvariant_cast
<
QImage
>
(
mimeData
->
imageData
()
);
UBFeature
element
=
dynamic_cast
<
UBFeaturesWidget
*>
(
QObject
::
parent
())
->
getFeaturesController
()
->
importImage
(
image
,
parentFeature
);
addItem
(
element
);
curController
->
importImage
(
image
,
parentFeature
);
}
return
true
;
...
...
@@ -1019,7 +1034,7 @@ void UBFeaturesModel::moveData(const UBFeature &source, const UBFeature &destina
curFeature
.
setFullPath
(
newPath
);
}
}
// processing copy or move action for
re
al FS
// processing copy or move action for
virtu
al FS
if
(
action
==
Qt
::
CopyAction
)
{
copyFeature
.
setFullVirtualPath
(
newVirtualPath
);
}
else
{
...
...
src/gui/UBFeaturesWidget.h
View file @
04672119
...
...
@@ -56,6 +56,7 @@ public:
||
mode
==
eUBDockPaletteWidget_DESKTOP
;
}
UBFeaturesController
*
getFeaturesController
()
const
{
return
controller
;
}
void
importImage
(
const
QImage
&
image
,
const
QString
&
fileName
=
QString
());
static
const
int
minThumbnailSize
=
20
;
static
const
int
maxThumbnailSize
=
100
;
...
...
src/gui/UBTeacherGuideWidget.cpp
View file @
04672119
...
...
@@ -1163,7 +1163,7 @@ void UBTeacherGuideWidget::connectToStylusPalette()
connect
(
UBApplication
::
mainWindow
->
actionPlay
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
onTriggeredAction
(
bool
)));
connect
(
UBApplication
::
mainWindow
->
actionZoomIn
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
onTriggeredAction
(
bool
)));
connect
(
UBApplication
::
mainWindow
->
actionZoomOut
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
onTriggeredAction
(
bool
)));
connect
(
UBApplication
::
mainWindow
->
actionCapture
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
onTriggeredAction
(
bool
)));
connect
(
UBApplication
::
mainWindow
->
actionCapture
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
onTriggeredAction
(
bool
)));
connect
(
UBApplication
::
mainWindow
->
actionHand
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
onTriggeredAction
(
bool
)));
connect
(
UBApplication
::
mainWindow
->
actionLine
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
onTriggeredAction
(
bool
)));
connect
(
UBApplication
::
mainWindow
->
actionText
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
onTriggeredAction
(
bool
)));
...
...
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