From 01bb806677c5d4e48ba29e9e8976f9a7721e5167 Mon Sep 17 00:00:00 2001 From: Ilia Ryabokon Date: Wed, 4 Dec 2013 18:57:42 +0300 Subject: [PATCH] Openboard crosslinux hack detecting storage location --- src/core/UBSettings.cpp | 2 ++ src/domain/UBGraphicsTextItemDelegate.cpp | 12 +++++++++++- src/domain/UBGraphicsTextItemDelegate.h | 5 +++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index d34ad285..fbf1bfe2 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -790,6 +790,8 @@ QString UBSettings::userDataDirectory() qDebug() << "organization name" << UBSettings::organizationName(); qDebug() << "application" << qApp; dataDirPath.replace(UBSettings::organizationName() + "/", ""); + dataDirPath.truncate(dataDirPath.count() - 1); + dataDirPath.append("OpenBoard"); } return dataDirPath; } diff --git a/src/domain/UBGraphicsTextItemDelegate.cpp b/src/domain/UBGraphicsTextItemDelegate.cpp index da253638..d3b6e5b0 100644 --- a/src/domain/UBGraphicsTextItemDelegate.cpp +++ b/src/domain/UBGraphicsTextItemDelegate.cpp @@ -48,6 +48,10 @@ const int UBGraphicsTextItemDelegate::sMinPointSize = 8; UBGraphicsTextItemDelegate::UBGraphicsTextItemDelegate(UBGraphicsTextItem* pDelegated, QObject *) : UBGraphicsItemDelegate(pDelegated,0, GF_COMMON | GF_REVOLVABLE | GF_TOOLBAR_USED) , mLastFontPixelSize(-1) + , mAlignLeftButton(0) + , mAlignCenterButton(0) + , mAlignRightButton(0) + , mAlighMixed(0) , delta(5) { delegated()->setData(UBGraphicsItemData::ItemEditable, QVariant(true)); @@ -108,13 +112,19 @@ void UBGraphicsTextItemDelegate::buildButtons() mDecreaseSizeButton = new DelegateButton(":/images/minus.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); mIncreaseSizeButton = new DelegateButton(":/images/plus.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); + //Alignment buttons family + mAlignLeftButton = new DelegateButton(":/images/plus.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); + mAlignCenterButton = new DelegateButton(":/images/pause.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); + mAlignRightButton = new DelegateButton(":/images/minus.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); + mAlighMixed = new DelegateButton(":/images/reload.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); + connect(mFontButton, SIGNAL(clicked(bool)), this, SLOT(pickFont())); connect(mColorButton, SIGNAL(clicked(bool)), this, SLOT(pickColor())); connect(mDecreaseSizeButton, SIGNAL(clicked(bool)), this, SLOT(decreaseSize())); connect(mIncreaseSizeButton, SIGNAL(clicked(bool)), this, SLOT(increaseSize())); QList itemsOnToolBar; - itemsOnToolBar << mFontButton << mColorButton << mDecreaseSizeButton << mIncreaseSizeButton; + itemsOnToolBar << mFontButton << mColorButton << mDecreaseSizeButton << mIncreaseSizeButton << mFontButton; mToolBarItem->setItemsOnToolBar(itemsOnToolBar); mToolBarItem->setShifting(true); mToolBarItem->setVisibleOnBoard(true); diff --git a/src/domain/UBGraphicsTextItemDelegate.h b/src/domain/UBGraphicsTextItemDelegate.h index 87f4817a..7143f7eb 100644 --- a/src/domain/UBGraphicsTextItemDelegate.h +++ b/src/domain/UBGraphicsTextItemDelegate.h @@ -76,6 +76,11 @@ class UBGraphicsTextItemDelegate : public UBGraphicsItemDelegate DelegateButton* mDecreaseSizeButton; DelegateButton* mIncreaseSizeButton; + DelegateButton* mAlignLeftButton; + DelegateButton* mAlignCenterButton; + DelegateButton* mAlignRightButton; + DelegateButton* mAlighMixed; + int mLastFontPixelSize; static const int sMinPixelSize;