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
b7ceb4d3
Commit
b7ceb4d3
authored
Apr 18, 2012
by
Anna Udovichenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some DnD bugs, added action bar class
parent
4b182e73
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
8 deletions
+46
-8
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+2
-2
UBFeaturesController.h
src/board/UBFeaturesController.h
+1
-0
UBFeaturesActionBar.cpp
src/gui/UBFeaturesActionBar.cpp
+9
-0
UBFeaturesActionBar.h
src/gui/UBFeaturesActionBar.h
+17
-0
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+13
-4
gui.pri
src/gui/gui.pri
+4
-2
No files found.
src/board/UBFeaturesController.cpp
View file @
b7ceb4d3
...
...
@@ -60,7 +60,7 @@ void UBFeaturesController::initDirectoryTree()
QList
<
UBToolsManager
::
UBToolDescriptor
>
tools
=
UBToolsManager
::
manager
()
->
allTools
();
featuresList
->
push_back
(
UBFeature
(
""
,
QPixmap
(
":images/libpalette/home.png"
),
"root"
,
""
)
);
featuresList
->
push_back
(
UBFeature
(
QString
(),
QPixmap
(
":images/libpalette/home.png"
),
"root"
,
QString
()
)
);
appPath
=
rootPath
+
"/Applications"
;
audiosPath
=
rootPath
+
"/Audios"
;
...
...
@@ -80,7 +80,7 @@ void UBFeaturesController::initDirectoryTree()
foreach
(
UBToolsManager
::
UBToolDescriptor
tool
,
tools
)
{
featuresList
->
push_back
(
UBFeature
(
appPath
,
tool
.
icon
,
tool
.
label
,
mUserInteractiveDirectoryPath
,
FEATURE_INTERACTIVE
)
);
featuresList
->
push_back
(
UBFeature
(
appPath
,
tool
.
icon
,
tool
.
label
,
tool
.
id
,
FEATURE_INTERNAL
)
);
}
fileSystemScan
(
mUserInteractiveDirectoryPath
,
appPath
);
fileSystemScan
(
mUserAudioDirectoryPath
,
audiosPath
);
...
...
src/board/UBFeaturesController.h
View file @
b7ceb4d3
...
...
@@ -16,6 +16,7 @@ enum UBFeatureElementType
FEATURE_VIRTUALFOLDER
,
FEATURE_FOLDER
,
FEATURE_INTERACTIVE
,
FEATURE_INTERNAL
,
FEATURE_ITEM
};
...
...
src/gui/UBFeaturesActionBar.cpp
0 → 100644
View file @
b7ceb4d3
#include "UBFeaturesActionBar.h"
UBFeaturesActionBar
::
UBFeaturesActionBar
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
{
}
UBFeaturesActionBar
::~
UBFeaturesActionBar
()
{
}
\ No newline at end of file
src/gui/UBFeaturesActionBar.h
0 → 100644
View file @
b7ceb4d3
#ifndef UBFEATURESACTIONBAR_H
#define UBFEATURESACTIONBAR_H
#include <QWidget>
#include <QToolButton>
#include "UBLibActionBar.h"
class
UBFeaturesActionBar
:
public
QWidget
{
Q_OBJECT
public
:
UBFeaturesActionBar
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBFeaturesActionBar"
);
~
UBFeaturesActionBar
();
};
#endif
\ No newline at end of file
src/gui/UBFeaturesWidget.cpp
View file @
b7ceb4d3
...
...
@@ -106,7 +106,7 @@ void UBFeaturesWidget::searchStarted( QString pattern )
featuresListView
->
setModel
(
featuresProxyModel
);
featuresProxyModel
->
invalidate
();
}
else
else
if
(
pattern
.
size
()
>
2
)
{
featuresSearchModel
->
setFilterWildcard
(
"*"
+
pattern
+
"*"
);
featuresListView
->
setModel
(
featuresSearchModel
);
...
...
@@ -443,7 +443,14 @@ QMimeData* UBFeaturesModel::mimeData(const QModelIndexList &indexes) const
if
(
index
.
isValid
()
)
{
UBFeature
element
=
data
(
index
,
Qt
::
UserRole
+
1
).
value
<
UBFeature
>
();
urlList
.
push_back
(
QUrl
::
fromLocalFile
(
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
(
QUrl
::
fromLocalFile
(
element
.
getFullPath
())
);
}
}
}
mimeData
->
setUrls
(
urlList
);
...
...
@@ -529,10 +536,11 @@ Qt::ItemFlags UBFeaturesModel::flags( const QModelIndex &index ) const
{
UBFeature
item
=
index
.
data
(
Qt
::
UserRole
+
1
).
value
<
UBFeature
>
();
if
(
item
.
getType
()
==
FEATURE_INTERACTIVE
||
item
.
getType
()
==
FEATURE_ITEM
)
item
.
getType
()
==
FEATURE_ITEM
||
item
.
getType
()
==
FEATURE_INTERNAL
)
return
Qt
::
ItemIsDragEnabled
|
defaultFlags
;
if
(
item
.
getType
()
==
FEATURE_FOLDER
||
(
item
.
getType
()
==
FEATURE_CATEGORY
&&
item
.
getFullPath
()
!=
""
))
(
item
.
getType
()
==
FEATURE_CATEGORY
&&
!
item
.
getFullPath
().
isNull
()
))
return
defaultFlags
|
Qt
::
ItemIsDropEnabled
;
else
return
defaultFlags
;
}
...
...
@@ -572,6 +580,7 @@ bool UBFeaturesSearchProxyModel::filterAcceptsRow( int sourceRow, const QModelIn
UBFeature
feature
=
sourceModel
()
->
data
(
index
,
Qt
::
UserRole
+
1
).
value
<
UBFeature
>
();
bool
isFile
=
feature
.
getType
()
==
FEATURE_INTERACTIVE
||
feature
.
getType
()
==
FEATURE_INTERNAL
||
feature
.
getType
()
==
FEATURE_ITEM
;
return
isFile
&&
filterRegExp
().
exactMatch
(
feature
.
getName
()
);
...
...
src/gui/gui.pri
View file @
b7ceb4d3
...
...
@@ -46,7 +46,8 @@ HEADERS += src/gui/UBThumbnailView.h \
src/gui/UBLibWebView.h \
src/gui/UBDownloadWidget.h \
src/gui/UBDockDownloadWidget.h \
src/gui/UBFeaturesWidget.h\
src/gui/UBFeaturesWidget.h \
src/gui/UBFeaturesActionBar.h \
src/gui/UBDockTeacherGuideWidget.h \
src/gui/UBTeacherGuideWidget.h \
src/gui/UBTeacherGuideWidgetsTools.h \
...
...
@@ -100,7 +101,8 @@ SOURCES += src/gui/UBThumbnailView.cpp \
src/gui/UBLibWebView.cpp \
src/gui/UBDownloadWidget.cpp \
src/gui/UBDockDownloadWidget.cpp \
src/gui/UBFeaturesWidget.cpp\
src/gui/UBFeaturesWidget.cpp \
src/gui/UBFeaturesActionBar.cpp \
src/gui/UBDockTeacherGuideWidget.cpp \
src/gui/UBTeacherGuideWidget.cpp \
src/gui/UBTeacherGuideWidgetsTools.cpp \
...
...
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