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
241ddb92
Commit
241ddb92
authored
Dec 04, 2013
by
Ilia Ryabokon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Duplicated group button functionality on the frame
parent
ab828a18
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
79 additions
and
7 deletions
+79
-7
UBMetadataDcSubsetAdaptor.cpp
src/adaptors/UBMetadataDcSubsetAdaptor.cpp
+1
-1
UBBoardController.cpp
src/board/UBBoardController.cpp
+1
-2
UBApplication.cpp
src/core/UBApplication.cpp
+3
-1
UBSettings.cpp
src/core/UBSettings.cpp
+12
-2
UBSettings.h
src/core/UBSettings.h
+1
-0
UBGraphicsGroupContainerItemDelegate.cpp
src/domain/UBGraphicsGroupContainerItemDelegate.cpp
+20
-0
UBGraphicsGroupContainerItemDelegate.h
src/domain/UBGraphicsGroupContainerItemDelegate.h
+5
-0
UBSelectionFrame.cpp
src/domain/UBSelectionFrame.cpp
+32
-1
UBSelectionFrame.h
src/domain/UBSelectionFrame.h
+4
-0
No files found.
src/adaptors/UBMetadataDcSubsetAdaptor.cpp
View file @
241ddb92
...
@@ -85,7 +85,7 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy)
...
@@ -85,7 +85,7 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy)
return
;
return
;
}
}
QString
fileName
=
proxy
->
persistencePath
()
+
"/"
+
metadataFilename
;
QString
fileName
=
proxy
->
persistencePath
()
+
"/"
+
metadataFilename
;
qWarning
()
<<
fileName
;
qWarning
()
<<
"Persisting document path is"
<<
fileName
;
QFile
file
(
fileName
);
QFile
file
(
fileName
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Truncate
))
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Truncate
))
{
{
...
...
src/board/UBBoardController.cpp
View file @
241ddb92
...
@@ -1804,8 +1804,7 @@ void UBBoardController::autosaveTimeout()
...
@@ -1804,8 +1804,7 @@ void UBBoardController::autosaveTimeout()
void
UBBoardController
::
appMainModeChanged
(
UBApplicationController
::
MainMode
md
)
void
UBBoardController
::
appMainModeChanged
(
UBApplicationController
::
MainMode
md
)
{
{
// int timerInterval = autosaveTimeoutFromSettings();
int
timerInterval
=
autosaveTimeoutFromSettings
();
int
timerInterval
=
50000
;
if
(
!
timerInterval
)
{
if
(
!
timerInterval
)
{
return
;
return
;
}
}
...
...
src/core/UBApplication.cpp
View file @
241ddb92
...
@@ -120,7 +120,9 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
...
@@ -120,7 +120,9 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
staticMemoryCleaner
=
new
QObject
(
0
);
// deleted in UBApplication destructor
staticMemoryCleaner
=
new
QObject
(
0
);
// deleted in UBApplication destructor
setOrganizationName
(
"Open Education Foundation"
);
setOrganizationName
(
UBSettings
::
organizationName
());
qDebug
()
<<
"organization name"
<<
organizationName
();
qDebug
()
<<
"application"
<<
this
;
setOrganizationDomain
(
"oe-f.org"
);
setOrganizationDomain
(
"oe-f.org"
);
setApplicationName
(
"OpenBoard"
);
setApplicationName
(
"OpenBoard"
);
...
...
src/core/UBSettings.cpp
View file @
241ddb92
...
@@ -148,6 +148,7 @@ QSettings* UBSettings::getAppSettings()
...
@@ -148,6 +148,7 @@ QSettings* UBSettings::getAppSettings()
UBSettings
::
sAppSettings
->
setIniCodec
(
"utf-8"
);
UBSettings
::
sAppSettings
->
setIniCodec
(
"utf-8"
);
}
}
qDebug
()
<<
"sAppSettings"
<<
sAppSettings
;
return
UBSettings
::
sAppSettings
;
return
UBSettings
::
sAppSettings
;
}
}
...
@@ -774,7 +775,8 @@ QString UBSettings::userDataDirectory()
...
@@ -774,7 +775,8 @@ QString UBSettings::userDataDirectory()
{
{
static
QString
dataDirPath
=
""
;
static
QString
dataDirPath
=
""
;
if
(
dataDirPath
.
isEmpty
()){
if
(
dataDirPath
.
isEmpty
()){
if
(
sAppSettings
&&
getAppSettings
()
->
contains
(
"App/DataDirectory"
))
{
if
(
getAppSettings
()
&&
getAppSettings
()
->
contains
(
"App/DataDirectory"
))
{
qDebug
()
<<
"getAppSettings()->contains(App/DataDirectory):"
<<
getAppSettings
()
->
contains
(
"App/DataDirectory"
);
dataDirPath
=
getAppSettings
()
->
value
(
"App/DataDirectory"
).
toString
();
dataDirPath
=
getAppSettings
()
->
value
(
"App/DataDirectory"
).
toString
();
dataDirPath
=
replaceWildcard
(
dataDirPath
);
dataDirPath
=
replaceWildcard
(
dataDirPath
);
...
@@ -785,7 +787,9 @@ QString UBSettings::userDataDirectory()
...
@@ -785,7 +787,9 @@ QString UBSettings::userDataDirectory()
}
}
dataDirPath
=
UBFileSystemUtils
::
normalizeFilePath
(
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DataLocation
));
dataDirPath
=
UBFileSystemUtils
::
normalizeFilePath
(
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DataLocation
));
dataDirPath
.
replace
(
qApp
->
organizationName
()
+
"/"
,
""
);
qDebug
()
<<
"organization name"
<<
UBSettings
::
organizationName
();
qDebug
()
<<
"application"
<<
qApp
;
dataDirPath
.
replace
(
UBSettings
::
organizationName
()
+
"/"
,
""
);
}
}
return
dataDirPath
;
return
dataDirPath
;
}
}
...
@@ -879,6 +883,11 @@ QString UBSettings::userPodcastRecordingDirectory()
...
@@ -879,6 +883,11 @@ QString UBSettings::userPodcastRecordingDirectory()
return
dirPath
;
return
dirPath
;
}
}
QString
UBSettings
::
organizationName
()
{
return
"Open Education Foundation"
;
}
QString
UBSettings
::
userDocumentDirectory
()
QString
UBSettings
::
userDocumentDirectory
()
{
{
...
@@ -887,6 +896,7 @@ QString UBSettings::userDocumentDirectory()
...
@@ -887,6 +896,7 @@ QString UBSettings::userDocumentDirectory()
documentDirectory
=
userDataDirectory
()
+
"/document"
;
documentDirectory
=
userDataDirectory
()
+
"/document"
;
checkDirectory
(
documentDirectory
);
checkDirectory
(
documentDirectory
);
}
}
qDebug
()
<<
"userDocumentDirectory()"
<<
documentDirectory
;
return
documentDirectory
;
return
documentDirectory
;
}
}
...
...
src/core/UBSettings.h
View file @
241ddb92
...
@@ -137,6 +137,7 @@ class UBSettings : public QObject
...
@@ -137,6 +137,7 @@ class UBSettings : public QObject
static
QString
userInteractiveDirectory
();
static
QString
userInteractiveDirectory
();
static
QString
userInteractiveFavoritesDirectory
();
static
QString
userInteractiveFavoritesDirectory
();
static
QString
userPodcastRecordingDirectory
();
static
QString
userPodcastRecordingDirectory
();
static
QString
organizationName
();
QString
userGipLibraryDirectory
();
QString
userGipLibraryDirectory
();
...
...
src/domain/UBGraphicsGroupContainerItemDelegate.cpp
View file @
241ddb92
...
@@ -70,9 +70,23 @@ void UBGraphicsGroupContainerItemDelegate::decorateMenu(QMenu *menu)
...
@@ -70,9 +70,23 @@ void UBGraphicsGroupContainerItemDelegate::decorateMenu(QMenu *menu)
void
UBGraphicsGroupContainerItemDelegate
::
buildButtons
()
void
UBGraphicsGroupContainerItemDelegate
::
buildButtons
()
{
{
if
(
!
mDestroyGroupButton
)
{
mDestroyGroupButton
=
new
DelegateButton
(
":/images/minus.svg"
,
mDelegated
,
mFrame
,
Qt
::
TopLeftSection
);
mDestroyGroupButton
->
setShowProgressIndicator
(
false
);
connect
(
mDestroyGroupButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
destroyGroup
()));
mButtons
<<
mDestroyGroupButton
;
}
UBGraphicsItemDelegate
::
buildButtons
();
UBGraphicsItemDelegate
::
buildButtons
();
}
}
void
UBGraphicsGroupContainerItemDelegate
::
freeButtons
()
{
UBGraphicsItemDelegate
::
freeButtons
();
mDestroyGroupButton
=
0
;
mButtons
.
clear
();
}
bool
UBGraphicsGroupContainerItemDelegate
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
bool
UBGraphicsGroupContainerItemDelegate
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
{
Q_UNUSED
(
event
)
Q_UNUSED
(
event
)
...
@@ -93,3 +107,9 @@ bool UBGraphicsGroupContainerItemDelegate::mouseReleaseEvent(QGraphicsSceneMouse
...
@@ -93,3 +107,9 @@ bool UBGraphicsGroupContainerItemDelegate::mouseReleaseEvent(QGraphicsSceneMouse
return
false
;
return
false
;
}
}
void
UBGraphicsGroupContainerItemDelegate
::
destroyGroup
()
{
qDebug
()
<<
"Destroying group"
;
delegated
()
->
destroy
();
}
src/domain/UBGraphicsGroupContainerItemDelegate.h
View file @
241ddb92
...
@@ -43,11 +43,16 @@ public:
...
@@ -43,11 +43,16 @@ public:
protected
:
protected
:
virtual
void
decorateMenu
(
QMenu
*
menu
);
virtual
void
decorateMenu
(
QMenu
*
menu
);
virtual
void
buildButtons
();
virtual
void
buildButtons
();
virtual
void
freeButtons
();
virtual
bool
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
bool
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
bool
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
bool
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
bool
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
bool
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
private
slots
:
void
destroyGroup
();
private
:
private
:
DelegateButton
*
mDestroyGroupButton
;
DelegateButton
*
mDestroyGroupButton
;
};
};
...
...
src/domain/UBSelectionFrame.cpp
View file @
241ddb92
...
@@ -29,12 +29,15 @@
...
@@ -29,12 +29,15 @@
#include "domain/UBItem.h"
#include "domain/UBItem.h"
#include "domain/UBGraphicsItemZLevelUndoCommand.h"
#include "domain/UBGraphicsItemZLevelUndoCommand.h"
#include "domain/UBGraphicsGroupContainerItem.h"
#include "board/UBBoardController.h"
#include "board/UBBoardController.h"
#include "core/UBSettings.h"
#include "core/UBSettings.h"
#include "core/UBApplication.h"
#include "core/UBApplication.h"
#include "gui/UBResources.h"
#include "gui/UBResources.h"
#include "gui/UBMainWindow.h"
#include "core/UBApplication.h"
#include "core/UBApplication.h"
#include "board/UBBoardView.h"
#include "board/UBBoardView.h"
#include "board/UBDrawingController.h"
UBSelectionFrame
::
UBSelectionFrame
()
UBSelectionFrame
::
UBSelectionFrame
()
:
mThickness
(
UBSettings
::
settings
()
->
objectFrameWidth
)
:
mThickness
(
UBSettings
::
settings
()
->
objectFrameWidth
)
...
@@ -44,6 +47,7 @@ UBSelectionFrame::UBSelectionFrame()
...
@@ -44,6 +47,7 @@ UBSelectionFrame::UBSelectionFrame()
,
mDuplicateButton
(
0
)
,
mDuplicateButton
(
0
)
,
mZOrderUpButton
(
0
)
,
mZOrderUpButton
(
0
)
,
mZOrderDownButton
(
0
)
,
mZOrderDownButton
(
0
)
,
mGroupButton
(
0
)
,
mRotateButton
(
0
)
,
mRotateButton
(
0
)
{
{
setLocalBrush
(
QBrush
(
UBSettings
::
paletteColor
));
setLocalBrush
(
QBrush
(
UBSettings
::
paletteColor
));
...
@@ -314,6 +318,15 @@ void UBSelectionFrame::increaseZlevelBottom()
...
@@ -314,6 +318,15 @@ void UBSelectionFrame::increaseZlevelBottom()
// }
// }
}
}
void
UBSelectionFrame
::
groupItems
()
{
UBGraphicsGroupContainerItem
*
groupItem
=
ubscene
()
->
createGroup
(
enclosedGraphicsItems
());
groupItem
->
setSelected
(
true
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
qDebug
()
<<
"Grouping items"
;
}
void
UBSelectionFrame
::
addSelectionUndo
(
QList
<
QGraphicsItem
*>
items
,
UBZLayerController
::
moveDestination
dest
){
void
UBSelectionFrame
::
addSelectionUndo
(
QList
<
QGraphicsItem
*>
items
,
UBZLayerController
::
moveDestination
dest
){
if
(
!
items
.
empty
()){
if
(
!
items
.
empty
()){
qreal
topItemLevel
=
items
.
at
(
0
)
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
();
qreal
topItemLevel
=
items
.
at
(
0
)
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
();
...
@@ -453,7 +466,6 @@ QList<DelegateButton*> UBSelectionFrame::buttonsForFlags(UBGraphicsFlags fls) {
...
@@ -453,7 +466,6 @@ QList<DelegateButton*> UBSelectionFrame::buttonsForFlags(UBGraphicsFlags fls) {
if
(
!
mDeleteButton
)
{
if
(
!
mDeleteButton
)
{
mDeleteButton
=
new
DelegateButton
(
":/images/close.svg"
,
this
,
0
,
Qt
::
TopLeftSection
);
mDeleteButton
=
new
DelegateButton
(
":/images/close.svg"
,
this
,
0
,
Qt
::
TopLeftSection
);
mButtons
<<
mDeleteButton
;
connect
(
mDeleteButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
remove
()));
connect
(
mDeleteButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
remove
()));
}
}
result
<<
mDeleteButton
;
result
<<
mDeleteButton
;
...
@@ -466,6 +478,15 @@ QList<DelegateButton*> UBSelectionFrame::buttonsForFlags(UBGraphicsFlags fls) {
...
@@ -466,6 +478,15 @@ QList<DelegateButton*> UBSelectionFrame::buttonsForFlags(UBGraphicsFlags fls) {
result
<<
mDuplicateButton
;
result
<<
mDuplicateButton
;
}
}
if
(
mEnclosedtems
.
count
()
>=
1
)
{
if
(
!
mGroupButton
)
{
mGroupButton
=
new
DelegateButton
(
":/images/plus.svg"
,
this
,
0
,
Qt
::
TopLeftSection
);
mGroupButton
->
setShowProgressIndicator
(
false
);
connect
(
mGroupButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
groupItems
()));
}
result
<<
mGroupButton
;
}
if
(
fls
|
GF_ZORDER_MANIPULATIONS_ALLOWED
)
{
if
(
fls
|
GF_ZORDER_MANIPULATIONS_ALLOWED
)
{
if
(
!
mZOrderUpButton
)
{
if
(
!
mZOrderUpButton
)
{
mZOrderUpButton
=
new
DelegateButton
(
":/images/z_layer_up.svg"
,
this
,
0
,
Qt
::
BottomLeftSection
);
mZOrderUpButton
=
new
DelegateButton
(
":/images/z_layer_up.svg"
,
this
,
0
,
Qt
::
BottomLeftSection
);
...
@@ -498,4 +519,14 @@ QList<DelegateButton*> UBSelectionFrame::buttonsForFlags(UBGraphicsFlags fls) {
...
@@ -498,4 +519,14 @@ QList<DelegateButton*> UBSelectionFrame::buttonsForFlags(UBGraphicsFlags fls) {
return
result
;
return
result
;
}
}
QList
<
QGraphicsItem
*>
UBSelectionFrame
::
enclosedGraphicsItems
()
{
QList
<
QGraphicsItem
*>
result
;
foreach
(
UBGraphicsItemDelegate
*
d
,
mEnclosedtems
)
{
result
<<
d
->
delegated
();
}
return
result
;
}
src/domain/UBSelectionFrame.h
View file @
241ddb92
...
@@ -72,6 +72,7 @@ private slots:
...
@@ -72,6 +72,7 @@ private slots:
void
increaseZlevelTop
();
void
increaseZlevelTop
();
void
increaseZlevelDown
();
void
increaseZlevelDown
();
void
increaseZlevelBottom
();
void
increaseZlevelBottom
();
void
groupItems
();
private
:
private
:
void
addSelectionUndo
(
QList
<
QGraphicsItem
*>
items
,
UBZLayerController
::
moveDestination
dest
);
void
addSelectionUndo
(
QList
<
QGraphicsItem
*>
items
,
UBZLayerController
::
moveDestination
dest
);
...
@@ -86,6 +87,8 @@ private:
...
@@ -86,6 +87,8 @@ private:
QList
<
QGraphicsItem
*>
sortedByZ
(
const
QList
<
QGraphicsItem
*>
&
pItems
);
QList
<
QGraphicsItem
*>
sortedByZ
(
const
QList
<
QGraphicsItem
*>
&
pItems
);
QList
<
DelegateButton
*>
buttonsForFlags
(
UBGraphicsFlags
fls
);
QList
<
DelegateButton
*>
buttonsForFlags
(
UBGraphicsFlags
fls
);
QList
<
QGraphicsItem
*>
enclosedGraphicsItems
();
private
:
private
:
int
mThickness
;
int
mThickness
;
...
@@ -104,6 +107,7 @@ private:
...
@@ -104,6 +107,7 @@ private:
DelegateButton
*
mDuplicateButton
;
DelegateButton
*
mDuplicateButton
;
DelegateButton
*
mZOrderUpButton
;
DelegateButton
*
mZOrderUpButton
;
DelegateButton
*
mZOrderDownButton
;
DelegateButton
*
mZOrderDownButton
;
DelegateButton
*
mGroupButton
;
DelegateButton
*
mRotateButton
;
DelegateButton
*
mRotateButton
;
...
...
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