Commit c0089c9f authored by Ivan Ilin's avatar Ivan Ilin

issue Sankore-165 resolved

parent 3d9cd22b
...@@ -72,7 +72,9 @@ UBLibraryController::UBLibraryController(QWidget *pParentWidget) : ...@@ -72,7 +72,9 @@ UBLibraryController::UBLibraryController(QWidget *pParentWidget) :
bool UBLibraryController::canItemsOnElementBeDeleted(UBLibElement *pElement) bool UBLibraryController::canItemsOnElementBeDeleted(UBLibElement *pElement)
{ {
return !pElement->path().toLocalFile().startsWith(UBSettings::settings()->uniboardShapeLibraryDirectory()); return !pElement->path().toLocalFile().startsWith(UBSettings::settings()->uniboardShapeLibraryDirectory()) &&
!pElement->path().toLocalFile().startsWith(UBSettings::settings()->sankoreDistributedInteractiveDirectory()) &&
pElement->isDeletable();
} }
void UBLibraryController::createInternalWidgetItems() void UBLibraryController::createInternalWidgetItems()
...@@ -696,6 +698,7 @@ UBLibElement::UBLibElement() { ...@@ -696,6 +698,7 @@ UBLibElement::UBLibElement() {
mType = eUBLibElementType_Category; mType = eUBLibElementType_Category;
mName = QObject::tr("/Home", "Category list label on navigation tool bar"); mName = QObject::tr("/Home", "Category list label on navigation tool bar");
mbMoveable = false; mbMoveable = false;
mbDeletable = true;
} }
UBLibElement::UBLibElement(UBLibElement* element) UBLibElement::UBLibElement(UBLibElement* element)
...@@ -707,6 +710,7 @@ UBLibElement::UBLibElement(UBLibElement* element) ...@@ -707,6 +710,7 @@ UBLibElement::UBLibElement(UBLibElement* element)
mName = element->name(); mName = element->name();
mExtension = element->extension(); mExtension = element->extension();
mbMoveable = element->isMoveable(); mbMoveable = element->isMoveable();
mbDeletable = element->isDeletable();
} }
...@@ -717,6 +721,7 @@ UBLibElement::UBLibElement(eUBLibElementType type, const QUrl &path, const QStri ...@@ -717,6 +721,7 @@ UBLibElement::UBLibElement(eUBLibElementType type, const QUrl &path, const QStri
mName = name; mName = name;
mInfo = ""; mInfo = "";
mbMoveable = true; mbMoveable = true;
mbDeletable = true;
if (type == eUBLibElementType_Folder) if (type == eUBLibElementType_Folder)
mThumbnail = QImage(":images/libpalette/folder.svg"); mThumbnail = QImage(":images/libpalette/folder.svg");
......
...@@ -61,6 +61,8 @@ public: ...@@ -61,6 +61,8 @@ public:
void setExtension(QString &extension){ mExtension = extension;} void setExtension(QString &extension){ mExtension = extension;}
bool isMoveable(){return mbMoveable;} bool isMoveable(){return mbMoveable;}
void setMoveable(bool bState){mbMoveable = bState;} void setMoveable(bool bState){mbMoveable = bState;}
bool isDeletable() const {return mbDeletable;}
void setDeletable(bool mState) {mbDeletable = mState;}
private: private:
eUBLibElementType mType; eUBLibElementType mType;
...@@ -70,6 +72,7 @@ private: ...@@ -70,6 +72,7 @@ private:
QString mName; QString mName;
QString mExtension; QString mExtension;
bool mbMoveable; bool mbMoveable;
bool mbDeletable;
}; };
class UBChainedLibElement class UBChainedLibElement
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment