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
Show 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)
return
;
}
QString
fileName
=
proxy
->
persistencePath
()
+
"/"
+
metadataFilename
;
qWarning
()
<<
fileName
;
qWarning
()
<<
"Persisting document path is"
<<
fileName
;
QFile
file
(
fileName
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Truncate
))
{
...
...
src/board/UBBoardController.cpp
View file @
241ddb92
...
...
@@ -1804,8 +1804,7 @@ void UBBoardController::autosaveTimeout()
void
UBBoardController
::
appMainModeChanged
(
UBApplicationController
::
MainMode
md
)
{
// int timerInterval = autosaveTimeoutFromSettings();
int
timerInterval
=
50000
;
int
timerInterval
=
autosaveTimeoutFromSettings
();
if
(
!
timerInterval
)
{
return
;
}
...
...
src/core/UBApplication.cpp
View file @
241ddb92
...
...
@@ -120,7 +120,9 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
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"
);
setApplicationName
(
"OpenBoard"
);
...
...
src/core/UBSettings.cpp
View file @
241ddb92
...
...
@@ -148,6 +148,7 @@ QSettings* UBSettings::getAppSettings()
UBSettings
::
sAppSettings
->
setIniCodec
(
"utf-8"
);
}
qDebug
()
<<
"sAppSettings"
<<
sAppSettings
;
return
UBSettings
::
sAppSettings
;
}
...
...
@@ -774,7 +775,8 @@ QString UBSettings::userDataDirectory()
{
static
QString
dataDirPath
=
""
;
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
=
replaceWildcard
(
dataDirPath
);
...
...
@@ -785,7 +787,9 @@ QString UBSettings::userDataDirectory()
}
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
;
}
...
...
@@ -879,6 +883,11 @@ QString UBSettings::userPodcastRecordingDirectory()
return
dirPath
;
}
QString
UBSettings
::
organizationName
()
{
return
"Open Education Foundation"
;
}
QString
UBSettings
::
userDocumentDirectory
()
{
...
...
@@ -887,6 +896,7 @@ QString UBSettings::userDocumentDirectory()
documentDirectory
=
userDataDirectory
()
+
"/document"
;
checkDirectory
(
documentDirectory
);
}
qDebug
()
<<
"userDocumentDirectory()"
<<
documentDirectory
;
return
documentDirectory
;
}
...
...
src/core/UBSettings.h
View file @
241ddb92
...
...
@@ -137,6 +137,7 @@ class UBSettings : public QObject
static
QString
userInteractiveDirectory
();
static
QString
userInteractiveFavoritesDirectory
();
static
QString
userPodcastRecordingDirectory
();
static
QString
organizationName
();
QString
userGipLibraryDirectory
();
...
...
src/domain/UBGraphicsGroupContainerItemDelegate.cpp
View file @
241ddb92
...
...
@@ -70,9 +70,23 @@ void UBGraphicsGroupContainerItemDelegate::decorateMenu(QMenu *menu)
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
();
}
void
UBGraphicsGroupContainerItemDelegate
::
freeButtons
()
{
UBGraphicsItemDelegate
::
freeButtons
();
mDestroyGroupButton
=
0
;
mButtons
.
clear
();
}
bool
UBGraphicsGroupContainerItemDelegate
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
Q_UNUSED
(
event
)
...
...
@@ -93,3 +107,9 @@ bool UBGraphicsGroupContainerItemDelegate::mouseReleaseEvent(QGraphicsSceneMouse
return
false
;
}
void
UBGraphicsGroupContainerItemDelegate
::
destroyGroup
()
{
qDebug
()
<<
"Destroying group"
;
delegated
()
->
destroy
();
}
src/domain/UBGraphicsGroupContainerItemDelegate.h
View file @
241ddb92
...
...
@@ -43,11 +43,16 @@ public:
protected
:
virtual
void
decorateMenu
(
QMenu
*
menu
);
virtual
void
buildButtons
();
virtual
void
freeButtons
();
virtual
bool
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
bool
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
bool
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
private
slots
:
void
destroyGroup
();
private
:
DelegateButton
*
mDestroyGroupButton
;
};
...
...
src/domain/UBSelectionFrame.cpp
View file @
241ddb92
...
...
@@ -29,12 +29,15 @@
#include "domain/UBItem.h"
#include "domain/UBGraphicsItemZLevelUndoCommand.h"
#include "domain/UBGraphicsGroupContainerItem.h"
#include "board/UBBoardController.h"
#include "core/UBSettings.h"
#include "core/UBApplication.h"
#include "gui/UBResources.h"
#include "gui/UBMainWindow.h"
#include "core/UBApplication.h"
#include "board/UBBoardView.h"
#include "board/UBDrawingController.h"
UBSelectionFrame
::
UBSelectionFrame
()
:
mThickness
(
UBSettings
::
settings
()
->
objectFrameWidth
)
...
...
@@ -44,6 +47,7 @@ UBSelectionFrame::UBSelectionFrame()
,
mDuplicateButton
(
0
)
,
mZOrderUpButton
(
0
)
,
mZOrderDownButton
(
0
)
,
mGroupButton
(
0
)
,
mRotateButton
(
0
)
{
setLocalBrush
(
QBrush
(
UBSettings
::
paletteColor
));
...
...
@@ -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
){
if
(
!
items
.
empty
()){
qreal
topItemLevel
=
items
.
at
(
0
)
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
();
...
...
@@ -453,7 +466,6 @@ QList<DelegateButton*> UBSelectionFrame::buttonsForFlags(UBGraphicsFlags fls) {
if
(
!
mDeleteButton
)
{
mDeleteButton
=
new
DelegateButton
(
":/images/close.svg"
,
this
,
0
,
Qt
::
TopLeftSection
);
mButtons
<<
mDeleteButton
;
connect
(
mDeleteButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
remove
()));
}
result
<<
mDeleteButton
;
...
...
@@ -466,6 +478,15 @@ QList<DelegateButton*> UBSelectionFrame::buttonsForFlags(UBGraphicsFlags fls) {
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
(
!
mZOrderUpButton
)
{
mZOrderUpButton
=
new
DelegateButton
(
":/images/z_layer_up.svg"
,
this
,
0
,
Qt
::
BottomLeftSection
);
...
...
@@ -498,4 +519,14 @@ QList<DelegateButton*> UBSelectionFrame::buttonsForFlags(UBGraphicsFlags fls) {
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:
void
increaseZlevelTop
();
void
increaseZlevelDown
();
void
increaseZlevelBottom
();
void
groupItems
();
private
:
void
addSelectionUndo
(
QList
<
QGraphicsItem
*>
items
,
UBZLayerController
::
moveDestination
dest
);
...
...
@@ -86,6 +87,8 @@ private:
QList
<
QGraphicsItem
*>
sortedByZ
(
const
QList
<
QGraphicsItem
*>
&
pItems
);
QList
<
DelegateButton
*>
buttonsForFlags
(
UBGraphicsFlags
fls
);
QList
<
QGraphicsItem
*>
enclosedGraphicsItems
();
private
:
int
mThickness
;
...
...
@@ -104,6 +107,7 @@ private:
DelegateButton
*
mDuplicateButton
;
DelegateButton
*
mZOrderUpButton
;
DelegateButton
*
mZOrderDownButton
;
DelegateButton
*
mGroupButton
;
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