Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Claudio Valerio 14 years ago
commit d6762e92fc
  1. 45
      .gitignore
  2. 20
      resources/library/interactive/Notes.wgt/js/ubw-main.js
  3. 15
      src/board/UBLibraryController.cpp
  4. 3
      src/board/UBLibraryController.h
  5. 3
      src/core/UBSettings.cpp
  6. 8
      src/core/UBSettings.h
  7. 9
      src/gui/UBLibPalette.cpp
  8. 2
      src/gui/UBLibPalette.h
  9. 6
      src/gui/UBLibraryWidget.cpp
  10. 5
      src/gui/UBNavigatorPalette.cpp
  11. 5
      src/gui/UBThumbnailWidget.cpp
  12. 1
      src/gui/UBThumbnailWidget.h

45
.gitignore vendored

@ -0,0 +1,45 @@
# Compiled source #
###################
*.com
*.class
#*.dll
#*.exe
#*.o
#*.so
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db
# IDE #
#######
*.kdev4
*.cproject
*.xcodeproj
*.pdb
*.sln
*.suo
*.vcproj
*.ncb

@ -19,10 +19,8 @@ function init(){
var maximize = $('<img src="images/stick-but-maximize.png">'); var maximize = $('<img src="images/stick-but-maximize.png">');
var title = $('<div id="menu"></div>'); var title = $('<div id="menu"></div>');
var textField = $('<div id="txt"></div>'); var textField = $('<div id="txt"></div>');
var shadow = $("<table width='100%' height='18' border='0' cellspacing='0' cellpadding='0'><tr><td id='sl' width='139'></td><td id='sc' style='background-image:url(images/shadowcenter.png)'>&nbsp;</td><td id='sr' width='139'></td></tr></table>") var shadow = $("<table width='100%' height='18' border='0' cellspacing='0' cellpadding='0'><tr><td id='sl' width='139'></td><td id='sc' style='background-image:url(images/shadowcenter.png)'>&nbsp;</td><td id='sr' width='139'></td></tr></table>")
.appendTo("body"); .appendTo("body");
var shadowleft = $("<img src='images/shadowleft.png'>") var shadowleft = $("<img src='images/shadowleft.png'>")
.appendTo($("#sl")); .appendTo($("#sl"));
var shadowright = $("<img src='images/shadowright.png'>") var shadowright = $("<img src='images/shadowright.png'>")
@ -32,18 +30,13 @@ function init(){
.append(header) .append(header)
.append(textField); .append(textField);
fontUp fontUp.addClass('menuElement');
.addClass('menuElement'); fontDown.addClass('menuElement');
fontDown minimize.addClass('menuElement');
.addClass('menuElement'); maximize.addClass('menuElement')
minimize
.addClass('menuElement');
maximize
.addClass('menuElement')
.hide(); .hide();
header header.append(maximize)
.append(maximize)
.append(minimize) .append(minimize)
.append(fontUp) .append(fontUp)
.append(fontDown); .append(fontDown);
@ -71,6 +64,7 @@ function init(){
window.uniboard.setPreference("fontSize", newFontSize); window.uniboard.setPreference("fontSize", newFontSize);
}; };
textField.focus();
}); });
fontUp.click( fontUp.click(
@ -87,6 +81,8 @@ function init(){
if(window.uniboard){ if(window.uniboard){
window.uniboard.setPreference("fontSize", newFontSize); window.uniboard.setPreference("fontSize", newFontSize);
}; };
textField.focus();
}); });
minimize.click( minimize.click(

@ -221,40 +221,47 @@ QList<UBLibElement*> UBLibraryController::rootCategoriesList()
UBLibElement* element = new UBLibElement(eUBLibElementType_Folder, mAudioStandardDirectoryPath, tr("Audios", "Audio category element")); UBLibElement* element = new UBLibElement(eUBLibElementType_Folder, mAudioStandardDirectoryPath, tr("Audios", "Audio category element"));
QImage* categoryImage = new QImage(":images/libpalette/AudiosCategory.svg"); QImage* categoryImage = new QImage(":images/libpalette/AudiosCategory.svg");
element->setThumbnail(categoryImage); element->setThumbnail(categoryImage);
element->setMoveable(false);
categories << element; categories << element;
element = new UBLibElement(eUBLibElementType_Folder, mVideoStandardDirectoryPath, tr("Movies", "Movies category element")); element = new UBLibElement(eUBLibElementType_Folder, mVideoStandardDirectoryPath, tr("Movies", "Movies category element"));
categoryImage = new QImage(":images/libpalette/MoviesCategory.svg"); categoryImage = new QImage(":images/libpalette/MoviesCategory.svg");
element->setThumbnail(categoryImage); element->setThumbnail(categoryImage);
element->setMoveable(false);
categories << element; categories << element;
element = new UBLibElement(eUBLibElementType_VirtualFolder, picturesVirtualPath, tr("Pictures", "Pictures category element")); element = new UBLibElement(eUBLibElementType_VirtualFolder, picturesVirtualPath, tr("Pictures", "Pictures category element"));
categoryImage = new QImage(":images/libpalette/PicturesCategory.svg"); categoryImage = new QImage(":images/libpalette/PicturesCategory.svg");
element->setThumbnail(categoryImage); element->setThumbnail(categoryImage);
element->setMoveable(false);
categories << element; categories << element;
QString path = UBSettings::settings()->uniboardShapeLibraryDirectory(); QString path = UBSettings::settings()->uniboardShapeLibraryDirectory();
categoryImage = new QImage(":images/libpalette/ShapesCategory.svg"); categoryImage = new QImage(":images/libpalette/ShapesCategory.svg");
element = new UBLibElement(eUBLibElementType_Folder, QUrl::fromLocalFile(path), tr("Shapes", "Shapes category element")); element = new UBLibElement(eUBLibElementType_Folder, QUrl::fromLocalFile(path), tr("Shapes", "Shapes category element"));
element->setThumbnail(categoryImage); element->setThumbnail(categoryImage);
element->setMoveable(false);
categories << element; categories << element;
categoryImage = new QImage(":images/libpalette/ApplicationsCategory.svg"); categoryImage = new QImage(":images/libpalette/ApplicationsCategory.svg");
element = new UBLibElement(eUBLibElementType_VirtualFolder, applicationsVirtualPath, tr("Applications", "Applications category element")); element = new UBLibElement(eUBLibElementType_VirtualFolder, applicationsVirtualPath, tr("Applications", "Applications category element"));
element->setThumbnail(categoryImage); element->setThumbnail(categoryImage);
element->setMoveable(false);
categories << element; categories << element;
categoryImage = new QImage(":images/libpalette/FavoritesCategory.svg"); categoryImage = new QImage(":images/libpalette/FavoritesCategory.svg");
element = new UBLibElement(eUBLibElementType_VirtualFolder, favoriteVirtualPath, tr("Favorite", "Favorite category element")); element = new UBLibElement(eUBLibElementType_VirtualFolder, favoriteVirtualPath, tr("Favorite", "Favorite category element"));
element->setThumbnail(categoryImage); element->setThumbnail(categoryImage);
element->setMoveable(false);
categories << element; categories << element;
categoryImage = new QImage(":images/libpalette/InteractivesCategory.svg"); categoryImage = new QImage(":images/libpalette/InteractivesCategory.svg");
interactivesCategoryPath = UBSettings::settings()->uniboardGipLibraryDirectory(); interactivesCategoryPath = UBSettings::settings()->uniboardGipLibraryDirectory();
element = new UBLibElement(eUBLibElementType_Folder, QUrl::fromLocalFile(interactivesCategoryPath), tr("Interactives", "Interactives category element")); element = new UBLibElement(eUBLibElementType_Folder, QUrl::fromLocalFile(interactivesCategoryPath), tr("Interactives", "Interactives category element"));
element->setThumbnail(categoryImage); element->setThumbnail(categoryImage);
element->setMoveable(false);
categories << element; categories << element;
@ -2429,7 +2436,8 @@ QString UBLibraryController::favoritePath()
UBLibElement::UBLibElement() { UBLibElement::UBLibElement() {
mType = eUBLibElementType_Category; mType = eUBLibElementType_Category;
mName = QObject::tr("/Home", "Category list label on nagigation tool bar"); mName = QObject::tr("/Home", "Category list label on navigation tool bar");
mbMoveable = false;
} }
@ -2439,6 +2447,7 @@ UBLibElement::UBLibElement(eUBLibElementType type, const QUrl &path, const QStri
mPath = path; mPath = path;
mName = name; mName = name;
mInfo = ""; mInfo = "";
mbMoveable = true;
if (type == eUBLibElementType_Folder) if (type == eUBLibElementType_Folder)
mThumbnail = QImage(":images/libpalette/folder.svg"); mThumbnail = QImage(":images/libpalette/folder.svg");
@ -2448,6 +2457,9 @@ UBLibElement::UBLibElement(eUBLibElementType type, const QUrl &path, const QStri
if (type == eUBLibElementType_Item) if (type == eUBLibElementType_Item)
mExtension = QFileInfo(path.toLocalFile()).completeSuffix(); mExtension = QFileInfo(path.toLocalFile()).completeSuffix();
if(type == eUBLibElementType_VirtualFolder || type == eUBLibElementType_Category)
mbMoveable = false;
} }
UBLibElement::~UBLibElement() UBLibElement::~UBLibElement()
@ -2483,6 +2495,7 @@ UBLibElement* UBLibElement::trashElement()
trashElement = new UBLibElement(eUBLibElementType_Folder, UBSettings::trashLibraryPaletteDirPath(), QObject::tr("Trash", "Pictures category element")); trashElement = new UBLibElement(eUBLibElementType_Folder, UBSettings::trashLibraryPaletteDirPath(), QObject::tr("Trash", "Pictures category element"));
QImage *categoryImage = new QImage(":images/libpalette/TrashCategory.svg"); QImage *categoryImage = new QImage(":images/libpalette/TrashCategory.svg");
trashElement->setThumbnail(categoryImage); trashElement->setThumbnail(categoryImage);
trashElement->setMoveable(false);
return trashElement; return trashElement;
} }

@ -46,6 +46,8 @@ public:
void setName(QString name){mName = name;} void setName(QString name){mName = name;}
QString extension(){return mExtension;} QString extension(){return mExtension;}
void setExtension(QString &extension){ mExtension = extension;} void setExtension(QString &extension){ mExtension = extension;}
bool isMoveable(){return mbMoveable;}
void setMoveable(bool bState){mbMoveable = bState;}
private: private:
eUBLibElementType mType; eUBLibElementType mType;
@ -54,6 +56,7 @@ private:
QString mInfo; QString mInfo;
QString mName; QString mName;
QString mExtension; QString mExtension;
bool mbMoveable;
}; };
class UBChainedLibElement class UBChainedLibElement

@ -168,6 +168,9 @@ void UBSettings::init()
appEnableAutomaticSoftwareUpdates = new UBSetting(this, "App", "EnableAutomaticSoftwareUpdates", true); appEnableAutomaticSoftwareUpdates = new UBSetting(this, "App", "EnableAutomaticSoftwareUpdates", true);
appEnableSoftwareUpdates = new UBSetting(this, "App", "EnableSoftwareUpdates", true); appEnableSoftwareUpdates = new UBSetting(this, "App", "EnableSoftwareUpdates", true);
appToolBarOrientationVertical = new UBSetting(this, "App", "ToolBarOrientationVertical", true); appToolBarOrientationVertical = new UBSetting(this, "App", "ToolBarOrientationVertical", true);
navigPaletteWidth = new UBSetting(this, "Board", "NavigPaletteWidth", 300);
libPaletteWidth = new UBSetting(this, "Board", "LibPaletteWidth", 300);
appIsInSoftwareUpdateProcess = new UBSetting(this, "App", "IsInSoftwareUpdateProcess", false); appIsInSoftwareUpdateProcess = new UBSetting(this, "App", "IsInSoftwareUpdateProcess", false);
appLastSessionDocumentUUID = new UBSetting(this, "App", "LastSessionDocumentUUID", ""); appLastSessionDocumentUUID = new UBSetting(this, "App", "LastSessionDocumentUUID", "");

@ -310,6 +310,14 @@ class UBSettings : public QObject
UBSetting* gipThumbnailWidth; UBSetting* gipThumbnailWidth;
UBSetting* soundThumbnailWidth; UBSetting* soundThumbnailWidth;
UBSetting* navigPaletteWidth;
UBSetting* libPaletteWidth;
/*
static int navigPaletteWidth;
static int libPaletteWidth;
*/
public slots: public slots:
void setPenWidthIndex(int index); void setPenWidthIndex(int index);

@ -17,9 +17,10 @@ UBLibPalette::UBLibPalette(QWidget *parent, const char *name):UBDockPalette(pare
mIcon = QPixmap(":images/paletteLibrary.png"); mIcon = QPixmap(":images/paletteLibrary.png");
setAcceptDrops(true); setAcceptDrops(true);
resize(300, height()); resize(UBSettings::settings()->libPaletteWidth->get().toInt(), height());
setContentsMargins(border(), 0, 0, 0); setContentsMargins(border(), 0, 0, 0);
mCollapseWidth = 180; mCollapseWidth = 180;
mLastWidth = 300;
mLayout = new QVBoxLayout(this); mLayout = new QVBoxLayout(this);
mLayout->setMargin(3); mLayout->setMargin(3);
@ -158,3 +159,9 @@ void UBLibPalette::showFolder()
mActionBar->setButtons(mActionBar->previousButtonSet()); mActionBar->setButtons(mActionBar->previousButtonSet());
mStackedWidget->setCurrentIndex(ID_NAVIGATOR); mStackedWidget->setCurrentIndex(ID_NAVIGATOR);
} }
void UBLibPalette::resizeEvent(QResizeEvent *event)
{
UBDockPalette::resizeEvent(event);
UBSettings::settings()->libPaletteWidth->set(width());
}

@ -9,6 +9,7 @@
#include <QDragMoveEvent> #include <QDragMoveEvent>
#include <QMimeData> #include <QMimeData>
#include <QMouseEvent> #include <QMouseEvent>
#include <QResizeEvent>
#include "UBDockPalette.h" #include "UBDockPalette.h"
#include "UBLibNavigatorWidget.h" #include "UBLibNavigatorWidget.h"
@ -33,6 +34,7 @@ protected:
void dropEvent(QDropEvent *pEvent); void dropEvent(QDropEvent *pEvent);
void dragMoveEvent(QDragMoveEvent* pEvent); void dragMoveEvent(QDragMoveEvent* pEvent);
void mouseMoveEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event);
void resizeEvent(QResizeEvent *event);
private slots: private slots:
void showProperties(UBLibElement* elem); void showProperties(UBLibElement* elem);

@ -209,6 +209,7 @@ void UBLibraryWidget::onSelectionChanged()
QList<UBLibElement*> qlSelectedItems; QList<UBLibElement*> qlSelectedItems;
QList<QGraphicsItem*> qlGI = selectedItems(); QList<QGraphicsItem*> qlGI = selectedItems();
bCanDrag = true;
foreach(QGraphicsItem* it, qlGI) foreach(QGraphicsItem* it, qlGI)
{ {
int itIndex = mGraphicItems.indexOf(it); int itIndex = mGraphicItems.indexOf(it);
@ -222,6 +223,11 @@ void UBLibraryWidget::onSelectionChanged()
{ {
qlSelectedItems << pElem; qlSelectedItems << pElem;
} }
if(!pElem->isMoveable())
{
bCanDrag = false;
}
} }
} }
} }

@ -17,8 +17,8 @@ UBNavigatorPalette::UBNavigatorPalette(QWidget *parent, const char *name):UBDock
setOrientation(eUBDockOrientation_Left); setOrientation(eUBDockOrientation_Left);
setMaximumWidth(300); setMaximumWidth(300);
mIcon = QPixmap(":images/paletteNavigator.png"); mIcon = QPixmap(":images/paletteNavigator.png");
resize(maximumWidth(), height()); resize(UBSettings::settings()->navigPaletteWidth->get().toInt(), height());
mLastWidth = 300;
setContentsMargins(0, 0, border(), 0); setContentsMargins(0, 0, border(), 0);
// Build the gui // Build the gui
@ -135,6 +135,7 @@ void UBNavigatorPalette::resizeEvent(QResizeEvent *event)
{ {
mNavigator->setMinimumHeight(height() - 2*border()); mNavigator->setMinimumHeight(height() - 2*border());
} }
UBSettings::settings()->navigPaletteWidth->set(width());
} }
void UBNavigatorPalette::timerEvent(QTimerEvent *event) void UBNavigatorPalette::timerEvent(QTimerEvent *event)

@ -19,6 +19,8 @@ UBThumbnailWidget::UBThumbnailWidget(QWidget* parent)
, mSelectionSpan(0) , mSelectionSpan(0)
, mLassoRectItem(0) , mLassoRectItem(0)
{ {
// By default, the drag is possible
bCanDrag = true;
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing); setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing);
setFrameShape(QFrame::NoFrame); setFrameShape(QFrame::NoFrame);
@ -326,6 +328,8 @@ void UBThumbnailWidget::mouseMoveEvent(QMouseEvent *event)
if (0 == selectedItems().size()) if (0 == selectedItems().size())
return; return;
if(bCanDrag)
{
QDrag *drag = new QDrag(this); QDrag *drag = new QDrag(this);
QMimeData *mime = new QMimeData(); QMimeData *mime = new QMimeData();
@ -352,6 +356,7 @@ void UBThumbnailWidget::mouseMoveEvent(QMouseEvent *event)
drag->exec(); drag->exec();
} }
} }
}
QGraphicsView::mouseMoveEvent(event); QGraphicsView::mouseMoveEvent(event);
} }

@ -77,6 +77,7 @@ class UBThumbnailWidget : public QGraphicsView
QList<QUrl> mItemsPaths; QList<QUrl> mItemsPaths;
QStringList mLabels; QStringList mLabels;
bool bSelectionInProgress; bool bSelectionInProgress;
bool bCanDrag;
private: private:
void selectAll(); void selectAll();

Loading…
Cancel
Save