Displayed on the interactivities directory the 4 internal widget. Those widget hasn't a corresponding real file on interactivities directory.

preferencesAboutTextFull
Claudio Valerio 14 years ago
parent ea5772a772
commit 666b67b164
  1. 4
      src/board/UBBoardController.cpp
  2. 18
      src/board/UBBoardView.cpp
  3. 26
      src/board/UBLibraryController.cpp
  4. 2
      src/board/UBLibraryController.h
  5. 2
      src/gui/UBLibraryWidget.cpp
  6. 3
      src/gui/UBThumbnailWidget.cpp
  7. 4
      src/gui/UBThumbnailWidget.h

@ -1786,9 +1786,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
int index = 0;
foreach(const QUrl url, urls)
{
qWarning() << url;
foreach(const QUrl url, urls){
QPointF pos(pPos + QPointF(index * 15, index * 15));
downloadURL(url, pos);
index++;

@ -683,10 +683,6 @@ UBBoardView::dragMoveEvent (QDragMoveEvent *event)
void
UBBoardView::dropEvent (QDropEvent *event)
{
qDebug () << event;
qDebug() << event->source();
if(!event->source() || dynamic_cast<UBThumbnailWidget *>(event->source()))
{
mController->processMimeData (event->mimeData (), mapToScene (event->pos ()));
@ -801,9 +797,9 @@ UBBoardView::settingChanged (QVariant newValue)
void UBBoardView::virtualKeyboardActivated(bool b)
{
UBPlatformUtils::setWindowNonActivableFlag(this, b);
mVirtualKeyboardActive = b;
setInteractive(!b);
UBPlatformUtils::setWindowNonActivableFlag(this, b);
mVirtualKeyboardActive = b;
setInteractive(!b);
}
@ -812,16 +808,16 @@ void UBBoardView::virtualKeyboardActivated(bool b)
bool
UBBoardView::isAbsurdPoint (QPoint point)
{
QDesktopWidget *desktop = qApp->desktop ();
bool isValidPoint = false;
QDesktopWidget *desktop = qApp->desktop ();
bool isValidPoint = false;
for (int i = 0; i < desktop->numScreens (); i++)
for (int i = 0; i < desktop->numScreens (); i++)
{
QRect screenRect = desktop->screenGeometry (i);
isValidPoint = isValidPoint || screenRect.contains (point);
}
return !isValidPoint;
return !isValidPoint;
}
void

@ -49,6 +49,7 @@ static quint32 magicNumber = 0xACDCAFE0;
static QString applicationsVirtualPath = "$applications$";
static QString picturesVirtualPath = "$pictures$";
static QString favoriteVirtualPath = "$favorite$";
static QString interactivesCategoryPath;
UBLibraryController::UBLibraryController(QWidget *pParentWidget, UBBoardController *pBoardController) :
QObject(pParentWidget),
@ -78,6 +79,26 @@ UBLibraryController::UBLibraryController(QWidget *pParentWidget, UBBoardControll
mPicturesStandardDirectoryPath = QUrl::fromLocalFile(UBDesktopServices::storageLocation(QDesktopServices::PicturesLocation));
userPath(mPicturesStandardDirectoryPath);
createInternalWidgetItems();
}
void UBLibraryController::createInternalWidgetItems()
{
QStringList toolUris = UBToolsManager::manager()->allToolIDs();
foreach(QString toolUri, toolUris)
{
UBToolsManager::UBToolDescriptor tool = UBToolsManager::manager()->toolByID(toolUri);
UBLibElement *newTool = new UBLibElement(eUBLibElementType_InteractiveItem, QUrl(tool.id), tool.label);
QImage toolImage = tool.icon.toImage();
newTool->setThumbnail(&toolImage);
newTool->setInformation(tool.label + " " + tool.version);
mInternalLibElements << newTool;
}
}
void UBLibraryController::createNewFolder(QString name, UBLibElement *parentElem)
@ -231,7 +252,8 @@ QList<UBLibElement*> UBLibraryController::rootCategoriesList()
categories << element;
categoryImage = new QImage(":images/libpalette/InteractivesCategory.svg");
element = new UBLibElement(eUBLibElementType_Folder, QUrl::fromLocalFile(UBSettings::settings()->uniboardGipLibraryDirectory()), tr("Interactives", "Interactives category element"));
interactivesCategoryPath = UBSettings::settings()->uniboardGipLibraryDirectory();
element = new UBLibElement(eUBLibElementType_Folder, QUrl::fromLocalFile(interactivesCategoryPath), tr("Interactives", "Interactives category element"));
element->setThumbnail(categoryImage);
categories << element;
@ -317,6 +339,8 @@ QList<UBLibElement*> UBLibraryController::listElementsInPath(const QString& pPat
content << element;
}
if (pPath == interactivesCategoryPath)
content << mInternalLibElements;
return content;
}

@ -157,6 +157,7 @@ class UBLibraryController : public QObject
QList<UBLibElement*> mFavoriteList;
void persistFavoriteList();
void readFavoriteList();
QList<UBLibElement*> mInternalLibElements;
private:
QList<UBLibElement*> rootCategoriesList();
@ -168,6 +169,7 @@ class UBLibraryController : public QObject
QList<UBLibElement*> elementsInPicturesVirtualForlder();
QList<UBLibElement*> elementsInApplicationsVirtualForlder();
void createInternalWidgetItems();
void routeItem(QString& pItem, QString pMiddleDirectory = QString());
void createDirectory(QUrl& pDirPath);

@ -104,7 +104,7 @@ void UBLibraryWidget::generateItems()
{
UBLibElement* pElem = mCurrentElems.at(i);
mLabels << pElem->name();
mItemsPaths << pElem->path().toLocalFile();
mItemsPaths << pElem->path();
QGraphicsPixmapItem *pixmapItem = new UBThumbnailPixmap(QPixmap::fromImage(*pElem->thumbnail()));
mGraphicItems << pixmapItem;
}

@ -341,8 +341,7 @@ void UBThumbnailWidget::mouseMoveEvent(QMouseEvent *event)
if (mGraphicItems.contains(item))
{
if (mGraphicItems.indexOf(item) <= mItemsPaths.size()){
QString localFilePath = mItemsPaths.at(mGraphicItems.indexOf(item)).toString();
qlElements << QUrl::fromLocalFile(localFilePath);
qlElements << mItemsPaths.at(mGraphicItems.indexOf(item));
}
}
}

@ -46,9 +46,7 @@ class UBThumbnailWidget : public QGraphicsView
public slots:
void setThumbnailWidth(qreal pThumbnailWidth);
void setSpacing(qreal pSpacing);
virtual void setGraphicsItems(const QList<QGraphicsItem*>& pGraphicsItems,
const QList<QUrl>& pItemPaths, const QStringList pLabels = QStringList(),
const QString& pMimeType = QString(""));
virtual void setGraphicsItems(const QList<QGraphicsItem*>& pGraphicsItems, const QList<QUrl>& pItemPaths, const QStringList pLabels = QStringList(), const QString& pMimeType = QString(""));
void refreshScene();
void sceneSelectionChanged();

Loading…
Cancel
Save