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
de0ea916
Commit
de0ea916
authored
May 07, 2012
by
Anna Udovichenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented adding selected group of elements to favorite
parent
604ea2fa
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
12 deletions
+35
-12
UBFeaturesActionBar.cpp
src/gui/UBFeaturesActionBar.cpp
+7
-2
UBFeaturesActionBar.h
src/gui/UBFeaturesActionBar.h
+2
-0
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+25
-10
UBFeaturesWidget.h
src/gui/UBFeaturesWidget.h
+1
-0
No files found.
src/gui/UBFeaturesActionBar.cpp
View file @
de0ea916
...
...
@@ -66,8 +66,8 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
mButtonGroup
->
addButton
(
mpRemoveFavoriteBtn
);
mButtonGroup
->
addButton
(
mpNewFolderBtn
);
// Connect signals & slots
/*
connect(mpFavoriteAction,SIGNAL(triggered()), this, SLOT(onActionFavorite()));
connect(mpSocialAction,SIGNAL(triggered()), this, SLOT(onActionSocial()));
connect
(
mpFavoriteAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
onActionFavorite
()));
/*
connect(mpSocialAction,SIGNAL(triggered()), this, SLOT(onActionSocial()));
connect(mpSearchAction,SIGNAL(triggered()), this, SLOT(onActionSearch()));
connect(mpDeleteAction,SIGNAL(triggered()), this, SLOT(onActionTrash()));
connect(mpCloseAction, SIGNAL(triggered()), this, SLOT(onActionClose()));
...
...
@@ -170,6 +170,11 @@ void UBFeaturesActionBar::onActionNewFolder()
emit
newFolderToCreate
();
}
void
UBFeaturesActionBar
::
onActionFavorite
()
{
emit
addElementsToFavorite
();
}
/*
void UBFeaturesActionBar::dragMoveEvent(QDragMoveEvent *event)
{
...
...
src/gui/UBFeaturesActionBar.h
View file @
de0ea916
...
...
@@ -30,9 +30,11 @@ signals:
void
deleteElements
(
const
QMimeData
&
data
);
void
addToFavorite
(
const
QMimeData
&
data
);
void
removeFromFavorite
(
const
QMimeData
&
data
);
void
addElementsToFavorite
();
private
slots
:
void
onSearchTextChanged
(
QString
txt
);
void
onActionNewFolder
();
void
onActionFavorite
();
protected
:
//void dragMoveEvent(QDragMoveEvent *event);
void
dragEnterEvent
(
QDragEnterEvent
*
event
);
...
...
src/gui/UBFeaturesWidget.cpp
View file @
de0ea916
...
...
@@ -121,6 +121,7 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name):UBDockPale
connect
(
mActionBar
,
SIGNAL
(
deleteElements
(
const
QMimeData
&
)
),
this
,
SLOT
(
deleteElements
(
const
QMimeData
&
)
)
);
connect
(
mActionBar
,
SIGNAL
(
addToFavorite
(
const
QMimeData
&
)
),
this
,
SLOT
(
addToFavorite
(
const
QMimeData
&
)
)
);
connect
(
mActionBar
,
SIGNAL
(
removeFromFavorite
(
const
QMimeData
&
)
),
this
,
SLOT
(
removeFromFavorite
(
const
QMimeData
&
)
)
);
connect
(
mActionBar
,
SIGNAL
(
addElementsToFavorite
()
),
this
,
SLOT
(
addElementsToFavorite
()
)
);
connect
(
pathListView
,
SIGNAL
(
clicked
(
const
QModelIndex
&
)
),
this
,
SLOT
(
currentPathChanged
(
const
QModelIndex
&
)
)
);
connect
(
thumbSlider
,
SIGNAL
(
sliderMoved
(
int
)
),
this
,
SLOT
(
thumbnailSizeChanged
(
int
)
)
);
...
...
@@ -333,6 +334,20 @@ void UBFeaturesWidget::onAddDownloadedFileToLibrary(bool pSuccess, QUrl sourceUr
}
}
void
UBFeaturesWidget
::
addElementsToFavorite
()
{
QModelIndexList
selected
=
featuresListView
->
selectionModel
()
->
selectedIndexes
();
for
(
int
i
=
0
;
i
<
selected
.
size
();
++
i
)
{
UBFeature
feature
=
selected
.
at
(
i
).
data
(
Qt
::
UserRole
+
1
).
value
<
UBFeature
>
();
UBFeature
elem
=
controller
->
addToFavorite
(
feature
.
getFullPath
()
);
if
(
!
elem
.
getVirtualPath
().
isEmpty
()
&&
!
elem
.
getVirtualPath
().
isNull
()
)
featuresModel
->
addItem
(
elem
);
}
QSortFilterProxyModel
*
model
=
dynamic_cast
<
QSortFilterProxyModel
*>
(
featuresListView
->
model
()
);
model
->
invalidate
();
}
void
UBFeaturesWidget
::
switchToListView
()
{
stackedWidget
->
setCurrentIndex
(
ID_LISTVIEW
);
...
...
src/gui/UBFeaturesWidget.h
View file @
de0ea916
...
...
@@ -101,6 +101,7 @@ private slots:
void
thumbnailSizeChanged
(
int
);
void
onDisplayMetadata
(
QMap
<
QString
,
QString
>
);
void
onAddDownloadedFileToLibrary
(
bool
,
QUrl
,
QString
,
QByteArray
);
void
addElementsToFavorite
();
protected
:
bool
eventFilter
(
QObject
*
target
,
QEvent
*
event
);
};
...
...
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