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
bfd74d22
Commit
bfd74d22
authored
May 04, 2012
by
Anna Udovichenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added setting element as background
parent
56c8bfc3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
28 deletions
+20
-28
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+6
-8
UBFeaturesController.h
src/board/UBFeaturesController.h
+2
-1
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+11
-18
UBFeaturesWidget.h
src/gui/UBFeaturesWidget.h
+1
-1
No files found.
src/board/UBFeaturesController.cpp
View file @
bfd74d22
...
...
@@ -359,16 +359,14 @@ UBFeature UBFeaturesController::newFolder( const QString &name )
void
UBFeaturesController
::
addItemToPage
(
const
UBFeature
&
item
)
{
UBApplication
::
boardController
->
downloadURL
(
item
.
getFullPath
()
);
/*if ( item.getType() == FEATURE_INTERNAL )
{
UBApplication::boardController->downloadURL( QUrl( item.getFullPath() ) );
}
else
{
UBApplication::boardController->downloadURL( QUrl::fromLocalFile( item.getFullPath() ) );
}*/
}
void
UBFeaturesController
::
addItemAsBackground
(
const
UBFeature
&
item
)
{
UBApplication
::
boardController
->
downloadURL
(
item
.
getFullPath
(),
QPointF
(),
QSize
(),
true
);
}
UBFeature
UBFeaturesController
::
getDestinationForItem
(
const
QUrl
&
url
)
{
QString
mimetype
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
fileNameFromUrl
(
url
)
);
...
...
src/board/UBFeaturesController.h
View file @
bfd74d22
...
...
@@ -70,7 +70,8 @@ public:
const
QString
&
getRootPath
()
const
{
return
rootPath
;
}
void
addItemToPage
(
const
UBFeature
&
item
);
void
addItemToPage
(
const
UBFeature
&
item
);
void
addItemAsBackground
(
const
UBFeature
&
item
);
const
UBFeature
&
getCurrentElement
()
const
{
return
currentElement
;
}
void
setCurrentElement
(
const
UBFeature
&
elem
)
{
currentElement
=
elem
;
}
const
UBFeature
&
getTrashElement
()
const
{
return
trashElement
;
}
...
...
src/gui/UBFeaturesWidget.cpp
View file @
bfd74d22
...
...
@@ -555,7 +555,8 @@ UBFeatureProperties::UBFeatureProperties( QWidget *parent, const char *name ) :
mpObjInfos
->
setStyleSheet
(
"background:white;"
);
mpLayout
->
addWidget
(
mpObjInfos
,
1
);
connect
(
mpAddPageButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onAddToPage
()));
connect
(
mpAddPageButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onAddToPage
())
);
connect
(
mpSetAsBackgroundButton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
onSetAsBackground
()
)
);
}
...
...
@@ -626,22 +627,13 @@ void UBFeatureProperties::onAddToPage()
QWidget
*
w
=
parentWidget
()
->
parentWidget
();
UBFeaturesWidget
*
featuresWidget
=
dynamic_cast
<
UBFeaturesWidget
*>
(
w
);
featuresWidget
->
getFeaturesController
()
->
addItemToPage
(
*
mpElement
);
/*if ( UBApplication::isFromWeb( mpElement->getVirtualPath() ) )
{
sDownloadFileDesc desc;
desc.isBackground = false;
desc.modal = true;
desc.name = QFileInfo( mpElement->getName() ).fileName();
desc.url = mpElement->getVirtualPath();
UBDownloadManager::downloadManager()->addFileToDownload(desc);
}
}
else
{
void
UBFeatureProperties
::
onSetAsBackground
()
{
QWidget
*
w
=
parentWidget
()
->
parentWidget
();
UBFeaturesWidget
*
featuresWidget
=
dynamic_cast
<
UBFeaturesWidget
*>
(
w
);
featuresWidget->getFeaturesController()->addItemToPage( *mpElement );
}*/
featuresWidget
->
getFeaturesController
()
->
addItemAsBackground
(
*
mpElement
);
}
UBFeatureProperties
::~
UBFeatureProperties
()
...
...
@@ -704,14 +696,15 @@ QMimeData* UBFeaturesModel::mimeData(const QModelIndexList &indexes) const
if
(
index
.
isValid
()
)
{
UBFeature
element
=
data
(
index
,
Qt
::
UserRole
+
1
).
value
<
UBFeature
>
();
if
(
element
.
getType
()
==
FEATURE_INTERNAL
)
urlList
.
push_back
(
element
.
getFullPath
()
);
/*if ( element.getType() == FEATURE_INTERNAL )
{
urlList.push_back( QUrl( element.getFullPath() ) );
}
else if ( element.getType() == FEATURE_INTERACTIVE || element.getType() == FEATURE_ITEM )
{
urlList.push_back( element.getFullPath() );
}
}
*/
}
}
mimeData
->
setUrls
(
urlList
);
...
...
src/gui/UBFeaturesWidget.h
View file @
bfd74d22
...
...
@@ -157,7 +157,7 @@ protected:
private
slots
:
void
onAddToPage
();
//void onAddToLib();
//
void onSetAsBackground();
void
onSetAsBackground
();
//void onBack();
private
:
...
...
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