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
d4072aae
Commit
d4072aae
authored
Jul 31, 2012
by
Ilia Ryabokon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search widget in right palette resolved
parent
58bc81c0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
253 deletions
+43
-253
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+32
-19
UBFeaturesController.h
src/board/UBFeaturesController.h
+1
-1
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+10
-157
UBFeaturesWidget.h
src/gui/UBFeaturesWidget.h
+0
-76
No files found.
src/board/UBFeaturesController.cpp
View file @
d4072aae
...
@@ -114,7 +114,7 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) :
...
@@ -114,7 +114,7 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) :
applicationsElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/ApplicationsCategory.svg"
),
"Applications"
,
mUserInteractiveDirectoryPath
,
FEATURE_CATEGORY
);
applicationsElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/ApplicationsCategory.svg"
),
"Applications"
,
mUserInteractiveDirectoryPath
,
FEATURE_CATEGORY
);
shapesElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/ShapesCategory.svg"
),
"Shapes"
,
mLibShapesDirectoryPath
,
FEATURE_CATEGORY
);
shapesElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/ShapesCategory.svg"
),
"Shapes"
,
mLibShapesDirectoryPath
,
FEATURE_CATEGORY
);
favoriteElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/FavoritesCategory.svg"
),
"Favorites"
,
QUrl
(
"favorites"
),
FEATURE_FAVORITE
);
favoriteElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/FavoritesCategory.svg"
),
"Favorites"
,
QUrl
(
"favorites"
),
FEATURE_FAVORITE
);
webSearchElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/WebSearchCategory.svg"
),
"Web search"
,
mLibSearchDirectoryPath
,
FEATURE_
SEARCH
);
webSearchElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/WebSearchCategory.svg"
),
"Web search"
,
mLibSearchDirectoryPath
,
FEATURE_
CATEGORY
);
trashElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/TrashCategory.svg"
),
"Trash"
,
trashDirectoryPath
,
FEATURE_TRASH
);
trashElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/TrashCategory.svg"
),
"Trash"
,
trashDirectoryPath
,
FEATURE_TRASH
);
...
@@ -171,18 +171,25 @@ void UBFeaturesController::scanFS()
...
@@ -171,18 +171,25 @@ void UBFeaturesController::scanFS()
}
}
}
}
fileSystemScan
(
mUserInteractiveDirectoryPath
,
appPath
);
//Claudio:
fileSystemScan
(
mUserAudioDirectoryPath
,
audiosPath
);
// don't change the order of the scans
fileSystemScan
(
mUserPicturesDirectoryPath
,
picturesPath
);
fileSystemScan
(
mLibAudiosDirectoryPath
,
audiosPath
);
fileSystemScan
(
mUserVideoDirectoryPath
,
moviesPath
);
fileSystemScan
(
mLibVideosDirectoryPath
,
moviesPath
);
fileSystemScan
(
mUserAnimationDirectoryPath
,
flashPath
);
fileSystemScan
(
mLibAnimationsDirectoryPath
,
flashPath
);
fileSystemScan
(
mLibPicturesDirectoryPath
,
picturesPath
);
fileSystemScan
(
mUserInteractiveDirectoryPath
,
appPath
);
fileSystemScan
(
mUserAudioDirectoryPath
,
audiosPath
);
fileSystemScan
(
mUserPicturesDirectoryPath
,
picturesPath
);
fileSystemScan
(
mUserVideoDirectoryPath
,
moviesPath
);
fileSystemScan
(
mUserAnimationDirectoryPath
,
flashPath
);
fileSystemScan
(
mLibApplicationsDirectoryPath
,
appPath
);
fileSystemScan
(
mLibShapesDirectoryPath
,
shapesPath
);
fileSystemScan
(
mLibInteractiveDirectoryPath
,
interactPath
);
fileSystemScan
(
trashDirectoryPath
,
trashPath
);
fileSystemScan
(
mLibSearchDirectoryPath
,
rootPath
+
"/"
+
"Web search"
);
fileSystemScan
(
mLibApplicationsDirectoryPath
,
appPath
);
fileSystemScan
(
mLibPicturesDirectoryPath
,
picturesPath
);
fileSystemScan
(
mLibShapesDirectoryPath
,
shapesPath
);
fileSystemScan
(
mLibInteractiveDirectoryPath
,
interactPath
);
fileSystemScan
(
trashDirectoryPath
,
trashPath
);
fileSystemScan
(
mLibSearchDirectoryPath
,
rootPath
+
"/"
+
"Web search"
);
}
}
void
UBFeaturesController
::
fileSystemScan
(
const
QUrl
&
currentPath
,
const
QString
&
currVirtualPath
)
void
UBFeaturesController
::
fileSystemScan
(
const
QUrl
&
currentPath
,
const
QString
&
currVirtualPath
)
...
@@ -464,23 +471,29 @@ UBFeature UBFeaturesController::getParentFeatureForUrl( const QUrl &url )
...
@@ -464,23 +471,29 @@ UBFeature UBFeaturesController::getParentFeatureForUrl( const QUrl &url )
return
UBFeature
();
return
UBFeature
();
}
}
UBFeature
UBFeaturesController
::
addDownloadedFile
(
const
QUrl
&
sourceUrl
,
const
QByteArray
&
pData
)
void
UBFeaturesController
::
addDownloadedFile
(
const
QUrl
&
sourceUrl
,
const
QByteArray
&
pData
)
{
{
UBFeature
dest
=
getParentFeatureForUrl
(
sourceUrl
);
UBFeature
dest
=
getParentFeatureForUrl
(
sourceUrl
);
if
(
dest
==
UBFeature
()
)
if
(
dest
==
UBFeature
()
)
return
UBFeature
();
return
;
QString
fileName
=
QFileInfo
(
sourceUrl
.
toString
()
).
fileName
();
QString
fileName
=
QFileInfo
(
sourceUrl
.
toString
()
).
fileName
();
QString
filePath
=
dest
.
getFullPath
().
toLocalFile
()
+
"/"
+
fileName
;
QString
filePath
=
dest
.
getFullPath
().
toLocalFile
()
+
"/"
+
fileName
;
QFile
file
(
filePath
);
QFile
file
(
filePath
);
if
(
file
.
open
(
QIODevice
::
WriteOnly
))
if
(
file
.
open
(
QIODevice
::
WriteOnly
))
{
{
file
.
write
(
pData
);
file
.
write
(
pData
);
file
.
close
();
file
.
close
();
return
UBFeature
(
dest
.
getFullVirtualPath
(),
thumbnailForFile
(
filePath
),
fileName
,
QUrl
::
fromLocalFile
(
filePath
),
FEATURE_ITEM
);
UBFeature
downloadedFeature
=
UBFeature
(
dest
.
getFullVirtualPath
(),
thumbnailForFile
(
filePath
),
fileName
,
QUrl
::
fromLocalFile
(
filePath
),
FEATURE_ITEM
);
if
(
downloadedFeature
!=
UBFeature
())
{
featuresModel
->
addItem
(
downloadedFeature
);
}
}
}
return
UBFeature
();
}
}
UBFeature
UBFeaturesController
::
moveItemToFolder
(
const
QUrl
&
url
,
const
UBFeature
&
destination
)
UBFeature
UBFeaturesController
::
moveItemToFolder
(
const
QUrl
&
url
,
const
UBFeature
&
destination
)
...
@@ -523,7 +536,7 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu
...
@@ -523,7 +536,7 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu
void
UBFeaturesController
::
rescanModel
()
void
UBFeaturesController
::
rescanModel
()
{
{
featuresModel
->
removeRows
(
0
,
featuresList
->
count
()
-
1
);
featuresModel
->
removeRows
(
0
,
featuresList
->
count
());
//Could implement infolder scanning for better perfomance
//Could implement infolder scanning for better perfomance
scanFS
();
scanFS
();
...
...
src/board/UBFeaturesController.h
View file @
d4072aae
...
@@ -101,7 +101,7 @@ public:
...
@@ -101,7 +101,7 @@ public:
void
setCurrentElement
(
const
UBFeature
&
elem
)
{
currentElement
=
elem
;}
void
setCurrentElement
(
const
UBFeature
&
elem
)
{
currentElement
=
elem
;}
const
UBFeature
&
getTrashElement
()
const
{
return
trashElement
;
}
const
UBFeature
&
getTrashElement
()
const
{
return
trashElement
;
}
UBFeature
addDownloadedFile
(
const
QUrl
&
sourceUrl
,
const
QByteArray
&
pData
);
void
addDownloadedFile
(
const
QUrl
&
sourceUrl
,
const
QByteArray
&
pData
);
UBFeature
moveItemToFolder
(
const
QUrl
&
url
,
const
UBFeature
&
destination
);
UBFeature
moveItemToFolder
(
const
QUrl
&
url
,
const
UBFeature
&
destination
);
UBFeature
copyItemToFolder
(
const
QUrl
&
url
,
const
UBFeature
&
destination
);
UBFeature
copyItemToFolder
(
const
QUrl
&
url
,
const
UBFeature
&
destination
);
...
...
src/gui/UBFeaturesWidget.cpp
View file @
d4072aae
...
@@ -69,8 +69,8 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name):UBDockPale
...
@@ -69,8 +69,8 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name):UBDockPale
mActionBar
=
new
UBFeaturesActionBar
(
controller
,
this
);
mActionBar
=
new
UBFeaturesActionBar
(
controller
,
this
);
//Filling main layout
//Filling main layout
layout
->
addWidget
(
pathListView
);
layout
->
addWidget
(
pathListView
);
layout
->
addWidget
(
stackedWidget
);
layout
->
addWidget
(
stackedWidget
);
layout
->
addWidget
(
mActionBar
);
layout
->
addWidget
(
mActionBar
);
connect
(
mNavigator
->
listView
(),
SIGNAL
(
clicked
(
const
QModelIndex
&
)),
this
,
SLOT
(
currentSelected
(
const
QModelIndex
&
)));
connect
(
mNavigator
->
listView
(),
SIGNAL
(
clicked
(
const
QModelIndex
&
)),
this
,
SLOT
(
currentSelected
(
const
QModelIndex
&
)));
...
@@ -83,120 +83,11 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name):UBDockPale
...
@@ -83,120 +83,11 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name):UBDockPale
connect
(
mActionBar
,
SIGNAL
(
addElementsToFavorite
()
),
this
,
SLOT
(
addElementsToFavorite
())
);
connect
(
mActionBar
,
SIGNAL
(
addElementsToFavorite
()
),
this
,
SLOT
(
addElementsToFavorite
())
);
connect
(
mActionBar
,
SIGNAL
(
removeElementsFromFavorite
()),
this
,
SLOT
(
removeElementsFromFavorite
()));
connect
(
mActionBar
,
SIGNAL
(
removeElementsFromFavorite
()),
this
,
SLOT
(
removeElementsFromFavorite
()));
connect
(
mActionBar
,
SIGNAL
(
rescanModel
()),
this
,
SLOT
(
rescanModel
()));
connect
(
mActionBar
,
SIGNAL
(
rescanModel
()),
this
,
SLOT
(
rescanModel
()));
connect
(
pathListView
,
SIGNAL
(
clicked
(
const
QModelIndex
&
)),
this
,
SLOT
(
currentSelected
(
const
QModelIndex
&
)));
connect
(
pathListView
,
SIGNAL
(
clicked
(
const
QModelIndex
&
)),
this
,
SLOT
(
currentSelected
(
const
QModelIndex
&
)));
connect
(
UBApplication
::
boardController
,
SIGNAL
(
displayMetadata
(
QMap
<
QString
,
QString
>
)),
this
,
SLOT
(
onDisplayMetadata
(
QMap
<
QString
,
QString
>
)));
connect
(
UBApplication
::
boardController
,
SIGNAL
(
displayMetadata
(
QMap
<
QString
,
QString
>
)),
this
,
SLOT
(
onDisplayMetadata
(
QMap
<
QString
,
QString
>
)));
connect
(
UBDownloadManager
::
downloadManager
(),
SIGNAL
(
addDownloadedFileToLibrary
(
bool
,
QUrl
,
QString
,
QByteArray
)),
this
,
SLOT
(
onAddDownloadedFileToLibrary
(
bool
,
QUrl
,
QString
,
QByteArray
)));
connect
(
UBDownloadManager
::
downloadManager
(),
SIGNAL
(
addDownloadedFileToLibrary
(
bool
,
QUrl
,
QString
,
QByteArray
))
//=======
,
this
,
SLOT
(
onAddDownloadedFileToLibrary
(
bool
,
QUrl
,
QString
,
QByteArray
)));
// stackedWidget = new QStackedWidget(this);
// layout = new QVBoxLayout(this);
// controller = new UBFeaturesController(this);
// featuresModel = new UBFeaturesModel(this);
// featuresModel->setFeaturesList( controller->getFeatures() );
// featuresModel->setSupportedDragActions( Qt::CopyAction | Qt::MoveAction );
// featuresListView = new UBFeaturesListView(this);
// pathListView = new UBFeaturesListView(this);
// featuresProxyModel = new UBFeaturesProxyModel(this);
// featuresProxyModel->setFilterFixedString( controller->getRootPath() );
// featuresProxyModel->setSourceModel( featuresModel );
// featuresProxyModel->setFilterCaseSensitivity( Qt::CaseInsensitive );
// featuresSearchModel = new UBFeaturesSearchProxyModel(this);
// featuresSearchModel->setSourceModel( featuresModel );
// featuresSearchModel->setFilterCaseSensitivity( Qt::CaseInsensitive );
// featuresPathModel = new UBFeaturesPathProxyModel(this);
// featuresPathModel->setPath( controller->getRootPath() );
// featuresPathModel->setSourceModel( featuresModel );
// //featuresListView->setStyleSheet( QString("background: #EEEEEE;border-radius: 10px;border: 2px solid #999999;") );
// featuresListView->setDragDropMode( QAbstractItemView::DragDrop );
// featuresListView->setSelectionMode( QAbstractItemView::ContiguousSelection );
// featuresListView->setModel( featuresProxyModel );
// featuresListView->setResizeMode( QListView::Adjust );
// featuresListView->setViewMode( QListView::IconMode );
// itemDelegate = new UBFeaturesItemDelegate( this, featuresListView );
// featuresListView->setItemDelegate( itemDelegate );
// //featuresListView->setSelectionRectVisible(false);
// featuresListView->setIconSize( QSize(currentIconSize, currentIconSize) );
// featuresListView->setGridSize( QSize(currentIconSize * 1.75, currentIconSize * 1.75) );
// //pathListView->setStyleSheet( QString("background: #EEEEEE; border-radius : 10px; border : 2px solid #999999;") );
// pathListView->setModel( featuresPathModel );
// pathListView->setViewMode( QListView::IconMode );
// pathListView->setIconSize( QSize(defaultThumbnailSize - 10, defaultThumbnailSize - 10) );
// pathListView->setGridSize( QSize(defaultThumbnailSize + 10, defaultThumbnailSize - 10) );
// pathListView->setFixedHeight( 60 );
// pathItemDelegate = new UBFeaturesPathItemDelegate( this );
// pathListView->setItemDelegate( pathItemDelegate );
// pathListView->setSelectionMode( QAbstractItemView::NoSelection );
// pathListView->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
// pathListView->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
// pathListView->setFlow( QListView::LeftToRight );
// pathListView->setWrapping(false);
// //pathListView->setResizeMode( QListView::Adjust );
// //pathListView->setMovement( QListView::Static );
// pathListView->setDragDropMode( QAbstractItemView::DropOnly );
// //pathViewer = new UBFeaturesPathViewer( QPixmap(":images/libpalette/home.png"), controller->getRootPath(), pathScene, this );
// featureProperties = new UBFeatureProperties(this);
// webView = new UBFeaturesWebView(this);
// //layout->addWidget( pathViewer );
// //pathViewer->show();
// //layout->addWidget( featuresListView );
// layout->addWidget( pathListView );
// layout->addWidget( stackedWidget );
// stackedWidget->addWidget( featuresListView );
// stackedWidget->addWidget( featureProperties );
// stackedWidget->addWidget( webView );
// stackedWidget->setCurrentIndex(ID_LISTVIEW);
// currentStackedWidget = ID_LISTVIEW;
// mActionBar = new UBFeaturesActionBar(controller, this);
// thumbSlider = new QSlider( Qt::Horizontal, featuresListView );
// thumbSlider->setMinimum( minThumbnailSize );
// thumbSlider->setMaximum( maxThumbnailSize );
// thumbSlider->setValue(currentIconSize);
// //qDebug() << "init" << featuresListView->height();
// thumbSlider->move( 0, featuresListView->height() );
// thumbSlider->resize( thumbSlider->width(), thumbSlider->height() + 4 );
// thumbSlider->show();
// featuresListView->installEventFilter(this);
// //layout->addWidget( thumbSlider );
// layout->addWidget( mActionBar );
// /*connect(featuresListView->selectionModel(), SIGNAL(currentChanged ( const QModelIndex &, const QModelIndex & )),
// this, SLOT(currentSelected(const QModelIndex &)));*/
// connect( featuresListView, SIGNAL(clicked ( const QModelIndex & ) ),
// this, SLOT( currentSelected(const QModelIndex &) ) );
// connect( mActionBar, SIGNAL( searchElement(const QString &) ), this, SLOT( searchStarted(const QString &) ) );
// connect( mActionBar, SIGNAL( newFolderToCreate() ), this, SLOT( createNewFolder() ) );
// 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( mActionBar, SIGNAL( removeElementsFromFavorite() ), this, SLOT ( removeElementsFromFavorite() ) );
// connect( mActionBar, SIGNAL( deleteSelectedElements() ), this, SLOT( deleteSelectedElements() ) );
// connect( pathListView, SIGNAL(clicked( const QModelIndex & ) ),
// this, SLOT( currentPathChanged( const QModelIndex & ) ) );
// //connect( thumbSlider, SIGNAL( sliderMoved(int) ), this, SLOT(thumbnailSizeChanged( int ) ) );
// connect(thumbSlider, SIGNAL(valueChanged(int)), this, SLOT(thumbnailSizeChanged(int)));
// connect( UBApplication::boardController, SIGNAL( displayMetadata( QMap<QString,QString> ) ),
// this, SLOT( onDisplayMetadata( QMap<QString,QString> ) ) );
// connect( UBDownloadManager::downloadManager(), SIGNAL( addDownloadedFileToLibrary( bool, QUrl, QString, QByteArray ) ),
// this, SLOT( onAddDownloadedFileToLibrary( bool, QUrl, QString,QByteArray ) ) );
//>>>>>>> e38b24544e8b8b1d5bd41dabdeaf588df7d45185
}
}
UBFeaturesWidget
::~
UBFeaturesWidget
()
UBFeaturesWidget
::~
UBFeaturesWidget
()
...
@@ -402,15 +293,9 @@ void UBFeaturesWidget::onAddDownloadedFileToLibrary(bool pSuccess, QUrl sourceUr
...
@@ -402,15 +293,9 @@ void UBFeaturesWidget::onAddDownloadedFileToLibrary(bool pSuccess, QUrl sourceUr
{
{
Q_UNUSED
(
pContentHeader
)
Q_UNUSED
(
pContentHeader
)
if
(
pSuccess
)
if
(
pSuccess
)
{
{
controller
->
addDownloadedFile
(
sourceUrl
,
pData
);
UBFeature
newFeature
=
controller
->
addDownloadedFile
(
sourceUrl
,
pData
);
controller
->
refreshModels
();
if
(
newFeature
!=
UBFeature
()
)
{
featuresModel
->
addItem
(
newFeature
);
QSortFilterProxyModel
*
model
=
dynamic_cast
<
QSortFilterProxyModel
*>
(
mNavigator
->
listView
()
->
model
()
);
model
->
invalidate
();
}
}
}
}
}
...
@@ -467,34 +352,6 @@ void UBFeaturesWidget::switchToWebView()
...
@@ -467,34 +352,6 @@ void UBFeaturesWidget::switchToWebView()
currentStackedWidget
=
ID_WEBVIEW
;
currentStackedWidget
=
ID_WEBVIEW
;
}
}
void
UBFeaturesWidget
::
updateSliderPosition
()
{
// //Calculating the topleft position of the slider
// int scrollBarVOffset = featuresListView->horizontalScrollBar()->isVisible() ? featuresListView->horizontalScrollBar()->height() : 0;
// int xSlider = scrollbarHorisontalPadding();
// int ySlider = featuresListView->height() - (thumbSlider->height() + scrollbarVerticalIndent() + scrollBarVOffset);
// thumbSlider->move( xSlider, ySlider);
// //Calculating new slider's size
// int scrollBarHOffset = featuresListView->verticalScrollBar()->isVisible() ? featuresListView->verticalScrollBar()->width() : 0;
// int wSlider = featuresListView->width() - 2 * scrollbarHorisontalPadding() - scrollBarHOffset;
// int hSlider = thumbSlider->height();
// thumbSlider->resize(wSlider, hSlider);
}
/*
void UBFeaturesWidget::currentPathChanged(const QString &path)
{
int newDepth = path.count("/");
pathViewer->truncatePath(newDepth);
featuresListView->setModel( featuresProxyModel );
featuresProxyModel->setFilterFixedString(path);
featuresProxyModel->invalidate();
switchToListView();
}
*/
QStringList
UBFeaturesMimeData
::
formats
()
const
QStringList
UBFeaturesMimeData
::
formats
()
const
{
{
return
QMimeData
::
formats
();
return
QMimeData
::
formats
();
...
@@ -945,7 +802,6 @@ UBFeatureItemButton::UBFeatureItemButton(QWidget *parent, const char *name):QPus
...
@@ -945,7 +802,6 @@ UBFeatureItemButton::UBFeatureItemButton(QWidget *parent, const char *name):QPus
UBFeatureItemButton
::~
UBFeatureItemButton
()
UBFeatureItemButton
::~
UBFeatureItemButton
()
{
{
}
}
QVariant
UBFeaturesModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
QVariant
UBFeaturesModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
...
@@ -1248,10 +1104,7 @@ bool UBFeaturesSearchProxyModel::filterAcceptsRow( int sourceRow, const QModelIn
...
@@ -1248,10 +1104,7 @@ bool UBFeaturesSearchProxyModel::filterAcceptsRow( int sourceRow, const QModelIn
bool
UBFeaturesPathProxyModel
::
filterAcceptsRow
(
int
sourceRow
,
const
QModelIndex
&
sourceParent
)
const
bool
UBFeaturesPathProxyModel
::
filterAcceptsRow
(
int
sourceRow
,
const
QModelIndex
&
sourceParent
)
const
{
{
QModelIndex
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
QModelIndex
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
/*QString name = sourceModel()->data(index, Qt::DisplayRole).toString();
UBFeature
feature
=
sourceModel
()
->
data
(
index
,
Qt
::
UserRole
+
1
).
value
<
UBFeature
>
();
eUBLibElementType type = (eUBLibElementType)sourceModel()->data(index, Qt::UserRole + 1).toInt();*/
UBFeature
feature
=
sourceModel
()
->
data
(
index
,
Qt
::
UserRole
+
1
).
value
<
UBFeature
>
();
return
feature
.
isFolder
()
&&
path
.
startsWith
(
feature
.
getFullVirtualPath
()
);
return
feature
.
isFolder
()
&&
path
.
startsWith
(
feature
.
getFullVirtualPath
()
);
}
}
...
...
src/gui/UBFeaturesWidget.h
View file @
d4072aae
...
@@ -60,7 +60,6 @@ public:
...
@@ -60,7 +60,6 @@ public:
static
const
int
minThumbnailSize
=
20
;
static
const
int
minThumbnailSize
=
20
;
static
const
int
maxThumbnailSize
=
100
;
static
const
int
maxThumbnailSize
=
100
;
static
const
int
defaultThumbnailSize
=
40
;
static
const
int
defaultThumbnailSize
=
40
;
//<<<<<<< HEAD
public
:
public
:
int
scrollbarHorisontalPadding
()
const
{
return
10
;}
int
scrollbarHorisontalPadding
()
const
{
return
10
;}
...
@@ -75,90 +74,27 @@ private slots:
...
@@ -75,90 +74,27 @@ private slots:
void
addToFavorite
(
const
UBFeaturesMimeData
*
);
void
addToFavorite
(
const
UBFeaturesMimeData
*
);
void
removeFromFavorite
(
const
UBFeaturesMimeData
*
);
void
removeFromFavorite
(
const
UBFeaturesMimeData
*
);
void
onDisplayMetadata
(
QMap
<
QString
,
QString
>
);
void
onDisplayMetadata
(
QMap
<
QString
,
QString
>
);
//=======
//private:
// void switchToListView();
// void switchToProperties();
// void switchToWebView();
// UBFeaturesController *controller;
// UBFeaturesItemDelegate *itemDelegate;
// UBFeaturesPathItemDelegate *pathItemDelegate;
// UBFeaturesModel *featuresModel;
// UBFeaturesProxyModel *featuresProxyModel;
// UBFeaturesSearchProxyModel *featuresSearchModel;
// UBFeaturesPathProxyModel *featuresPathModel;
// UBFeaturesListView *featuresListView;
// UBFeaturesListView *pathListView;
// QSlider *thumbSlider;
// QVBoxLayout *layout;
// //UBFeaturesPathViewer *pathViewer;
// //QGraphicsScene *pathScene;
// UBFeaturesActionBar *mActionBar;
// UBFeatureProperties *featureProperties;
// UBFeaturesWebView *webView;
// QStackedWidget *stackedWidget;
// int currentStackedWidget;
// UBDownloadHttpFile* imageGatherer;
//private slots:
//
// void currentSelected( const QModelIndex & );
// //void currentPathChanged(const QString &);
// void currentPathChanged( const QModelIndex & );
// void searchStarted( const QString & );
// void createNewFolder();
// void deleteElements( const QMimeData & );
// void addToFavorite( const QMimeData & );
// void removeFromFavorite( const QMimeData & );
// void thumbnailSizeChanged( int );
// void onDisplayMetadata( QMap<QString,QString> );
//>>>>>>> e38b24544e8b8b1d5bd41dabdeaf588df7d45185
void
onAddDownloadedFileToLibrary
(
bool
,
QUrl
,
QString
,
QByteArray
);
void
onAddDownloadedFileToLibrary
(
bool
,
QUrl
,
QString
,
QByteArray
);
void
addElementsToFavorite
();
void
addElementsToFavorite
();
void
removeElementsFromFavorite
();
void
removeElementsFromFavorite
();
void
deleteSelectedElements
();
void
deleteSelectedElements
();
//<<<<<<< HEAD
void
rescanModel
();
void
rescanModel
();
private
:
private
:
void
switchToListView
();
void
switchToListView
();
void
switchToProperties
();
void
switchToProperties
();
void
switchToWebView
();
void
switchToWebView
();
void
updateSliderPosition
();
private
:
private
:
UBFeaturesController
*
controller
;
UBFeaturesController
*
controller
;
UBFeaturesItemDelegate
*
itemDelegate
;
UBFeaturesPathItemDelegate
*
pathItemDelegate
;
UBFeaturesModel
*
featuresModel
;
UBFeaturesProxyModel
*
featuresProxyModel
;
UBFeaturesSearchProxyModel
*
featuresSearchModel
;
UBFeaturesPathProxyModel
*
featuresPathModel
;
UBFeaturesNavigatorWidget
*
mNavigator
;
UBFeaturesNavigatorWidget
*
mNavigator
;
UBFeaturesListView
*
pathListView
;
UBFeaturesListView
*
pathListView
;
QVBoxLayout
*
layout
;
QVBoxLayout
*
layout
;
UBFeaturesActionBar
*
mActionBar
;
UBFeaturesActionBar
*
mActionBar
;
UBFeatureProperties
*
featureProperties
;
UBFeatureProperties
*
featureProperties
;
UBFeaturesWebView
*
webView
;
UBFeaturesWebView
*
webView
;
QStackedWidget
*
stackedWidget
;
QStackedWidget
*
stackedWidget
;
int
currentStackedWidget
;
int
currentStackedWidget
;
UBDownloadHttpFile
*
imageGatherer
;
UBDownloadHttpFile
*
imageGatherer
;
};
};
...
@@ -175,11 +111,6 @@ public:
...
@@ -175,11 +111,6 @@ public:
private
:
private
:
QList
<
UBFeature
>
mFeatures
;
QList
<
UBFeature
>
mFeatures
;
//=======
//protected:
// bool eventFilter(QObject *target, QEvent *event);
//>>>>>>> e38b24544e8b8b1d5bd41dabdeaf588df7d45185
};
};
...
@@ -195,16 +126,9 @@ protected:
...
@@ -195,16 +126,9 @@ protected:
virtual
void
dragEnterEvent
(
QDragEnterEvent
*
event
);
virtual
void
dragEnterEvent
(
QDragEnterEvent
*
event
);
virtual
void
dropEvent
(
QDropEvent
*
event
);
virtual
void
dropEvent
(
QDropEvent
*
event
);
virtual
void
dragMoveEvent
(
QDragMoveEvent
*
event
);
virtual
void
dragMoveEvent
(
QDragMoveEvent
*
event
);
/*virtual void mousePressEvent( QMouseEvent *event );
virtual void mouseMoveEvent( QMouseEvent *event );
virtual void mouseReleaseEvent( QMouseEvent *event );*/
private
slots
:
private
slots
:
void
thumbnailSizeChanged
(
int
);
void
thumbnailSizeChanged
(
int
);
private
:
//UBRubberBand *rubberBand;
//QPoint rubberOrigin;
};
};
...
...
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