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
5a7c3501
Commit
5a7c3501
authored
Aug 08, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
c9252aca
48a43154
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
776 additions
and
208 deletions
+776
-208
style.qss
resources/style.qss
+11
-8
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+316
-68
UBFeaturesController.h
src/board/UBFeaturesController.h
+62
-19
UBFeaturesActionBar.cpp
src/gui/UBFeaturesActionBar.cpp
+6
-5
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+279
-98
UBFeaturesWidget.h
src/gui/UBFeaturesWidget.h
+102
-10
No files found.
resources/style.qss
View file @
5a7c3501
...
...
@@ -5,15 +5,21 @@ QWidget#UBLibNavigatorWidget,
QWidget#UBLibItemProperties,
QWidget#UBDownloadWidget,
QWidget#UBTeacherGuideWidget,
QWidget#UBFeatureProperties,
QWidget#UBFeaturesNavigatorWidget,
QWidget#PathList
QWidget#PathList,
QWidget#UBFeaturesCentralWidget
{
background: #EEEEEE;
border-radius: 10px;
border: 2px solid #999999;
}
QWidget#mAdditionalDataContainer
{
border-radius: 10px;
border: 2px solid #999999;
}
QWidget#UBMediaVideoContainer
{
background: #000000;
...
...
@@ -30,15 +36,12 @@ QWidget#UBLibWebView
QListView
{
border: 0px;
border: 0px;
}
QWidget#UBFeaturesWebView
QWidget#UBFeatureProperties
{
background: #EEEEEE;
border-radius : 10px;
border: 2px solid #999999;
border: 2px;
}
QWebView#SearchEngineView
...
...
src/board/UBFeaturesController.cpp
View file @
5a7c3501
This diff is collapsed.
Click to expand it.
src/board/UBFeaturesController.h
View file @
5a7c3501
...
...
@@ -12,6 +12,10 @@
#include <QUrl>
#include <QByteArray>
#include <QtGui>
#include <QImage>
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
class
UBFeaturesModel
;
class
UBFeaturesItemDelegate
;
...
...
@@ -20,8 +24,45 @@ class UBFeaturesProxyModel;
class
UBFeaturesSearchProxyModel
;
class
UBFeaturesPathProxyModel
;
class
UBFeaturesListView
;
class
UBFeature
;
class
UBFeaturesComputingThread
:
public
QThread
{
Q_OBJECT
public
:
explicit
UBFeaturesComputingThread
(
QObject
*
parent
=
0
);
virtual
~
UBFeaturesComputingThread
();
void
compute
(
const
QList
<
QPair
<
QUrl
,
QString
>
>
&
pScanningData
);
protected
:
void
run
();
signals
:
void
sendFeature
(
UBFeature
pFeature
);
void
featureSent
();
void
scanStarted
();
void
scanFinished
();
void
maxFilesCountEvaluated
(
int
max
);
public
slots
:
private
:
void
scanFS
(
const
QUrl
&
currentPath
,
const
QString
&
currVirtualPath
);
void
scanAll
(
QList
<
QPair
<
QUrl
,
QString
>
>
pScanningData
);
int
featuresCount
(
const
QUrl
&
pPath
);
int
featuresCountAll
(
QList
<
QPair
<
QUrl
,
QString
>
>
pScanningData
);
private
:
QMutex
mMutex
;
QWaitCondition
mWaitCondition
;
QUrl
mScanningPath
;
QString
mScanningVirtualPath
;
QList
<
QPair
<
QUrl
,
QString
>
>
mScanningData
;
bool
restart
;
bool
abort
;
};
//#include "UBDockPaletteWidget.h"
enum
UBFeatureElementType
{
...
...
@@ -41,12 +82,12 @@ class UBFeature
{
public
:
UBFeature
()
{;}
//
UBFeature(const UBFeature &f);
UBFeature
(
const
QString
&
url
,
const
Q
Pixmap
&
icon
,
const
QString
&
name
,
const
QUrl
&
realPath
,
UBFeatureElementType
type
=
FEATURE_CATEGORY
);
//
UBFeature(const UBFeature &f);
UBFeature
(
const
QString
&
url
,
const
Q
Image
&
icon
,
const
QString
&
name
,
const
QUrl
&
realPath
,
UBFeatureElementType
type
=
FEATURE_CATEGORY
);
// UBFeature();
virtual
~
UBFeature
();
QString
getName
()
const
{
return
mName
;
}
Q
Pixmap
getThumbnail
()
const
{
return
mThumbnail
;}
Q
Image
getThumbnail
()
const
{
return
mThumbnail
;}
QString
getVirtualPath
()
const
{
return
virtualDir
;
}
//QString getPath() const { return mPath; };
QUrl
getFullPath
()
const
{
return
mPath
;
}
...
...
@@ -64,20 +105,13 @@ public:
const
QMap
<
QString
,
QString
>
&
getMetadata
()
const
{
return
metadata
;
}
void
setMetadata
(
const
QMap
<
QString
,
QString
>
&
data
)
{
metadata
=
data
;
}
bool
hasChildren
()
const
{
return
mChildren
.
count
();}
bool
hasParents
()
const
{
return
mParents
.
count
();}
bool
hasRelationships
()
const
{
return
mChildren
.
count
()
&&
mParents
.
count
();}
private
:
QString
virtualDir
;
Q
Pixmap
mThumbnail
;
Q
Image
mThumbnail
;
QString
mName
;
QUrl
mPath
;
UBFeatureElementType
elementType
;
QMap
<
QString
,
QString
>
metadata
;
QList
<
UBFeature
*>
mChildren
;
QList
<
UBFeature
*>
mParents
;
};
Q_DECLARE_METATYPE
(
UBFeature
)
...
...
@@ -111,7 +145,7 @@ public:
void
rescanModel
();
void
siftElements
(
const
QString
&
pSiftValue
);
//TODO make less complicated for betteer maintainence
UBFeature
getFeature
(
const
QModelIndex
&
index
,
QListView
*
pOnView
);
UBFeature
getFeature
(
const
QModelIndex
&
index
,
const
QString
&
listName
);
void
searchStarted
(
const
QString
&
pattern
,
QListView
*
pOnView
);
void
refreshModels
();
...
...
@@ -119,18 +153,17 @@ public:
void
deleteItem
(
const
UBFeature
&
pFeature
);
bool
isTrash
(
const
QUrl
&
url
);
void
moveToTrash
(
UBFeature
feature
,
bool
deleteManualy
=
false
);
void
addNewFolder
(
const
QString
&
name
);
void
addToFavorite
(
const
QUrl
&
path
);
void
removeFromFavorite
(
const
QUrl
&
path
,
bool
deleteManualy
=
false
);
void
importImage
(
const
QImage
&
image
,
const
QString
&
fileName
=
QString
());
void
importImage
(
const
QImage
&
image
,
const
UBFeature
&
destination
,
const
QString
&
fileName
=
QString
()
);
void
fileSystemScan
(
const
QUrl
&
currPath
,
const
QString
&
currVirtualPath
);
int
featuresCount
(
const
QUrl
&
currPath
);
static
UBFeatureElementType
fileTypeFromUrl
(
const
QString
&
path
);
static
QString
fileNameFromUrl
(
const
QUrl
&
url
);
static
Q
Pixmap
getIcon
(
const
QString
&
path
,
UBFeatureElementType
pFType
);
static
Q
Image
getIcon
(
const
QString
&
path
,
UBFeatureElementType
pFType
);
static
bool
isDeletable
(
const
QUrl
&
url
);
static
char
featureTypeSplitter
()
{
return
':'
;}
...
...
@@ -139,6 +172,16 @@ public:
void
assignFeaturesListVeiw
(
UBFeaturesListView
*
pList
);
void
assignPathListView
(
UBFeaturesListView
*
pList
);
signals
:
void
maxFilesCountEvaluated
(
int
pLimit
);
void
scanStarted
();
void
scanFinished
();
void
featureAddedFromThread
();
private
slots
:
void
addNewFolder
(
QString
name
);
void
startThread
();
private
:
UBFeaturesItemDelegate
*
itemDelegate
;
...
...
@@ -149,16 +192,16 @@ private:
UBFeaturesSearchProxyModel
*
featuresSearchModel
;
UBFeaturesPathProxyModel
*
featuresPathModel
;
QAbstractItemModel
*
curListModel
;
UBFeaturesComputingThread
mCThread
;
private
:
static
Q
Pixmap
createThumbnail
(
const
QString
&
path
);
static
Q
Image
createThumbnail
(
const
QString
&
path
);
//void addImageToCurrentPage( const QString &path );
void
loadFavoriteList
();
void
saveFavoriteList
();
QList
<
UBFeature
>
*
featuresList
;
QUrl
mUserAudioDirectoryPath
;
...
...
src/gui/UBFeaturesActionBar.cpp
View file @
5a7c3501
...
...
@@ -53,6 +53,7 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
//mpSearchBtn = new UBActionButton(this, mpSearchAction);
mpRescanModelBtn
=
new
UBActionButton
(
this
,
mpRescanModelAction
);
mpRescanModelBtn
->
hide
();
mpDeleteBtn
=
new
UBActionButton
(
this
,
mpDeleteAction
);
mpCloseBtn
=
new
UBActionButton
(
this
,
mpCloseAction
);
...
...
@@ -124,7 +125,7 @@ void UBFeaturesActionBar::setButtons()
mpNewFolderBtn
->
show
();
mpNewFolderBtn
->
setEnabled
(
true
);
mpDeleteBtn
->
setEnabled
(
true
);
mpRescanModelBtn
->
show
();
//
mpRescanModelBtn->show();
break
;
case
IN_ROOT
:
mpFavoriteBtn
->
show
();
...
...
@@ -136,7 +137,7 @@ void UBFeaturesActionBar::setButtons()
mpNewFolderBtn
->
show
();
mpNewFolderBtn
->
setEnabled
(
false
);
mpDeleteBtn
->
setEnabled
(
false
);
mpRescanModelBtn
->
show
();
//
mpRescanModelBtn->show();
break
;
case
IN_PROPERTIES
:
mpFavoriteBtn
->
show
();
...
...
@@ -147,7 +148,7 @@ void UBFeaturesActionBar::setButtons()
mpCloseBtn
->
hide
();
mpRemoveFavoriteBtn
->
hide
();
mpNewFolderBtn
->
hide
();
mpRescanModelBtn
->
hide
();
//
mpRescanModelBtn->hide();
break
;
case
IN_FAVORITE
:
mpFavoriteBtn
->
hide
();
...
...
@@ -158,7 +159,7 @@ void UBFeaturesActionBar::setButtons()
mpCloseBtn
->
hide
();
mpRemoveFavoriteBtn
->
show
();
mpNewFolderBtn
->
hide
();
mpRescanModelBtn
->
hide
();
//
mpRescanModelBtn->hide();
break
;
case
IN_TRASH
:
mpFavoriteBtn
->
hide
();
...
...
@@ -171,7 +172,7 @@ void UBFeaturesActionBar::setButtons()
mpCloseBtn
->
hide
();
//mpRemoveFavoriteBtn->show();
mpNewFolderBtn
->
hide
();
mpRescanModelBtn
->
hide
();
//
mpRescanModelBtn->hide();
break
;
default
:
break
;
...
...
src/gui/UBFeaturesWidget.cpp
View file @
5a7c3501
This diff is collapsed.
Click to expand it.
src/gui/UBFeaturesWidget.h
View file @
5a7c3501
...
...
@@ -43,6 +43,8 @@ class UBFeaturesListView;
class
UBFeaturesWebView
;
class
UBFeaturesNavigatorWidget
;
class
UBFeaturesMimeData
;
class
UBFeaturesCentralWidget
;
class
UBFeaturesNewFolderDialog
;
class
UBFeaturesWidget
:
public
UBDockPaletteWidget
{
...
...
@@ -63,6 +65,9 @@ public:
static
const
int
maxThumbnailSize
=
100
;
static
const
int
defaultThumbnailSize
=
40
;
static
const
char
*
objNamePathList
;
static
const
char
*
objNameFeatureList
;
public
:
int
scrollbarHorisontalPadding
()
const
{
return
10
;}
int
scrollbarVerticalIndent
()
const
{
return
0
;}
...
...
@@ -82,6 +87,7 @@ private slots:
void
removeElementsFromFavorite
();
void
deleteSelectedElements
();
void
rescanModel
();
void
lockIt
(
bool
pLock
);
private
:
void
resizeEvent
(
QResizeEvent
*
event
);
...
...
@@ -91,17 +97,12 @@ private:
private
:
UBFeaturesController
*
controller
;
UBFeaturesNavigatorWidget
*
mNavigator
;
UBFeaturesListView
*
pathListView
;
QVBoxLayout
*
layout
;
UBFeaturesActionBar
*
mActionBar
;
UBFeatureProperties
*
featureProperties
;
UBFeaturesWebView
*
webView
;
QStackedWidget
*
stackedWidget
;
int
currentStackedWidget
;
UBDownloadHttpFile
*
imageGatherer
;
UBNewFolderDlg
*
mkFolderDlg
;
UBFeaturesCentralWidget
*
centralWidget
;
};
...
...
@@ -128,12 +129,13 @@ public:
virtual
~
UBFeaturesListView
()
{;}
protected
:
virtual
void
dragEnterEvent
(
QDragEnterEvent
*
event
);
virtual
void
dragEnterEvent
(
QDragEnterEvent
*
event
);
virtual
void
dropEvent
(
QDropEvent
*
event
);
virtual
void
dragMoveEvent
(
QDragMoveEvent
*
event
);
private
slots
:
void
thumbnailSizeChanged
(
int
);
};
...
...
@@ -153,6 +155,93 @@ private:
};
class
UBFeaturesCentralWidget
:
public
QWidget
{
Q_OBJECT
public
:
enum
StackElement
{
MainList
=
0
,
FeaturePropertiesList
,
FeaturesWebView
};
enum
AddWidget
{
NewFolderDialog
=
0
,
ProgressBarWidget
};
enum
AddWidgetState
{
NonModal
=
0
,
Modal
};
UBFeaturesCentralWidget
(
QWidget
*
parent
=
0
);
void
setSliderPosition
(
int
pValue
)
{
mNavigator
->
setSliderPosition
(
pValue
);}
UBFeaturesListView
*
listView
()
{
return
mNavigator
->
listView
();}
void
showElement
(
const
UBFeature
&
feature
,
StackElement
pView
);
void
switchTo
(
StackElement
pView
);
void
setPropertiesPixmap
(
const
QPixmap
&
pix
);
void
setPropertiesThumbnail
(
const
QPixmap
&
pix
);
StackElement
currentView
()
const
{
return
static_cast
<
StackElement
>
(
mStackedWidget
->
currentIndex
());}
UBFeature
getCurElementFromProperties
();
void
showAdditionalData
(
AddWidget
pWidgetType
,
AddWidgetState
pState
=
NonModal
);
void
setLockedExcludingAdditional
(
bool
pLock
);
QStackedWidget
*
mStackedWidget
;
UBFeaturesNavigatorWidget
*
mNavigator
;
UBFeatureProperties
*
mFeatureProperties
;
UBFeaturesWebView
*
webView
;
QStackedWidget
*
mAdditionalDataContainer
;
signals
:
void
lockMainWidget
(
bool
pLock
);
void
createNewFolderSignal
(
QString
pStr
);
// progressbar widget related signals
void
maxFilesCountEvaluated
(
int
pValue
);
private
slots
:
void
createNewFolderSlot
(
QString
pStr
);
void
hideAdditionalData
();
void
scanStarted
();
void
scanFinished
();
void
increaseStatusBarValue
();
private
:
};
class
UBFeaturesNewFolderDialog
:
public
QWidget
{
Q_OBJECT
public
:
static
const
QString
acceptText
;
static
const
QString
cancelText
;
static
const
QString
labelText
;
UBFeaturesNewFolderDialog
(
QWidget
*
parent
=
0
);
void
setRegexp
(
const
QRegExp
pRegExp
);
signals
:
void
createNewFolder
(
QString
str
);
void
closeDialog
();
private
slots
:
void
accept
();
void
reject
();
private
:
QLineEdit
*
mLineEdit
;
QRegExpValidator
*
mValidator
;
};
class
UBFeaturesWebView
:
public
QWidget
{
...
...
@@ -182,8 +271,8 @@ public:
void
showElement
(
const
UBFeature
&
elem
);
UBFeature
getCurrentElement
()
const
;
void
setOrigPixmap
(
QPixmap
&
pix
);
void
setThumbnail
(
QPixmap
&
pix
);
void
setOrigPixmap
(
const
QPixmap
&
pix
);
void
setThumbnail
(
const
QPixmap
&
pix
);
protected
:
void
resizeEvent
(
QResizeEvent
*
event
);
...
...
@@ -231,7 +320,6 @@ public:
UBFeaturesModel
(
QList
<
UBFeature
>
*
pFeaturesList
,
QObject
*
parent
=
0
)
:
QAbstractListModel
(
parent
),
featuresList
(
pFeaturesList
)
{;}
virtual
~
UBFeaturesModel
(){;}
void
addItem
(
const
UBFeature
&
item
);
void
deleteFavoriteItem
(
const
QString
&
path
);
void
deleteItem
(
const
QString
&
path
);
void
deleteItem
(
const
UBFeature
&
feature
);
...
...
@@ -251,6 +339,9 @@ public:
Qt
::
DropActions
supportedDropActions
()
const
{
return
Qt
::
MoveAction
|
Qt
::
CopyAction
;
}
// void setFeaturesList(QList <UBFeature> *flist ) { featuresList = flist; }
public
slots
:
void
addItem
(
const
UBFeature
&
item
);
private
:
QList
<
UBFeature
>
*
featuresList
;
};
...
...
@@ -314,4 +405,5 @@ private:
QPixmap
*
arrowPixmap
;
};
#endif // UBFEATURESWIDGET_H
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