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; int index = 0;
foreach(const QUrl url, urls) foreach(const QUrl url, urls){
{
qWarning() << url;
QPointF pos(pPos + QPointF(index * 15, index * 15)); QPointF pos(pPos + QPointF(index * 15, index * 15));
downloadURL(url, pos); downloadURL(url, pos);
index++; index++;

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

@ -49,6 +49,7 @@ static quint32 magicNumber = 0xACDCAFE0;
static QString applicationsVirtualPath = "$applications$"; static QString applicationsVirtualPath = "$applications$";
static QString picturesVirtualPath = "$pictures$"; static QString picturesVirtualPath = "$pictures$";
static QString favoriteVirtualPath = "$favorite$"; static QString favoriteVirtualPath = "$favorite$";
static QString interactivesCategoryPath;
UBLibraryController::UBLibraryController(QWidget *pParentWidget, UBBoardController *pBoardController) : UBLibraryController::UBLibraryController(QWidget *pParentWidget, UBBoardController *pBoardController) :
QObject(pParentWidget), QObject(pParentWidget),
@ -78,6 +79,26 @@ UBLibraryController::UBLibraryController(QWidget *pParentWidget, UBBoardControll
mPicturesStandardDirectoryPath = QUrl::fromLocalFile(UBDesktopServices::storageLocation(QDesktopServices::PicturesLocation)); mPicturesStandardDirectoryPath = QUrl::fromLocalFile(UBDesktopServices::storageLocation(QDesktopServices::PicturesLocation));
userPath(mPicturesStandardDirectoryPath); 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) void UBLibraryController::createNewFolder(QString name, UBLibElement *parentElem)
@ -231,7 +252,8 @@ QList<UBLibElement*> UBLibraryController::rootCategoriesList()
categories << element; categories << element;
categoryImage = new QImage(":images/libpalette/InteractivesCategory.svg"); 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); element->setThumbnail(categoryImage);
categories << element; categories << element;
@ -317,6 +339,8 @@ QList<UBLibElement*> UBLibraryController::listElementsInPath(const QString& pPat
content << element; content << element;
} }
if (pPath == interactivesCategoryPath)
content << mInternalLibElements;
return content; return content;
} }

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

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

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

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

Loading…
Cancel
Save