Anatoly Mihalchenko 13 years ago
parent 21e57fbc83
commit ce8c7bee2f
  1. 2
      src/adaptors/UBMetadataDcSubsetAdaptor.cpp
  2. 2
      src/board/UBBoardController.cpp
  3. 8
      src/core/UBSetting.cpp
  4. 10
      src/core/UBSettings.cpp
  5. 4
      src/core/UBSettings.h
  6. 4
      src/document/UBDocumentProxy.cpp

@ -185,7 +185,7 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath)
if (width == 1024 && height == 768) // move from 1024/768 to 1280/960 if (width == 1024 && height == 768) // move from 1024/768 to 1280/960
{ {
docSize = UBSettings::settings()->defaultDocumentSize; docSize = UBSettings::settings()->pageSize->get().toSize();
} }
metadata.insert(UBSettings::documentSize, QVariant(docSize)); metadata.insert(UBSettings::documentSize, QVariant(docSize));

@ -1591,6 +1591,8 @@ void UBBoardController::setPageSize(QSize newSize)
updatePageSizeState(); updatePageSizeState();
adjustDisplayViews(); adjustDisplayViews();
mActiveDocument->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); mActiveDocument->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
UBSettings::settings()->pageSize->set(newSize);
} }
} }

@ -29,8 +29,12 @@ UBSetting::UBSetting(UBSettings* parent) :
UBSetting::UBSetting(UBSettings* owner, const QString& pDomain, const QString& pKey, UBSetting::UBSetting(UBSettings* owner, const QString& pDomain, const QString& pKey,
const QVariant& pDefaultValue) : const QVariant& pDefaultValue) :
QObject(owner), mOwner(owner), mDomain(pDomain), mKey(pKey), mPath( QObject(owner),
pDomain + "/" + pKey), mDefaultValue(pDefaultValue) mOwner(owner),
mDomain(pDomain),
mKey(pKey),
mPath(pDomain + "/" + pKey),
mDefaultValue(pDefaultValue)
{ {
//NOOP //NOOP
} }

@ -188,6 +188,9 @@ void UBSettings::init()
softwareHomeUrl = productWebUrl->get().toString(); softwareHomeUrl = productWebUrl->get().toString();
documentSizes.insert(DocumentSizeRatio::Ratio4_3, QSize(1280, 960)); // 1.33
documentSizes.insert(DocumentSizeRatio::Ratio16_9, QSize((960 / 9 * 16), 960)); // 1.77
appToolBarPositionedAtTop = new UBSetting(this, "App", "ToolBarPositionedAtTop", true); appToolBarPositionedAtTop = new UBSetting(this, "App", "ToolBarPositionedAtTop", true);
appToolBarDisplayText = new UBSetting(this, "App", "ToolBarDisplayText", true); appToolBarDisplayText = new UBSetting(this, "App", "ToolBarDisplayText", true);
appEnableAutomaticSoftwareUpdates = new UBSetting(this, "App", "EnableAutomaticSoftwareUpdates", true); appEnableAutomaticSoftwareUpdates = new UBSetting(this, "App", "EnableAutomaticSoftwareUpdates", true);
@ -216,6 +219,8 @@ void UBSettings::init()
boardKeyboardPaletteKeyBtnSize = new UBSetting(this, "Board", "KeyboardPaletteKeyBtnSize", "16x16"); boardKeyboardPaletteKeyBtnSize = new UBSetting(this, "Board", "KeyboardPaletteKeyBtnSize", "16x16");
ValidateKeyboardPaletteKeyBtnSize(); ValidateKeyboardPaletteKeyBtnSize();
pageSize = new UBSetting(this, "Board", "DefaultPageSize", documentSizes.value(DocumentSizeRatio::Ratio4_3));
QStringList penLightBackgroundColors; QStringList penLightBackgroundColors;
penLightBackgroundColors << "#000000" << "#FF0000" <<"#004080" << "#008000" << "#C87400" << "#800040" << "#008080" << "#5F2D0A"; penLightBackgroundColors << "#000000" << "#FF0000" <<"#004080" << "#008000" << "#C87400" << "#800040" << "#008080" << "#5F2D0A";
boardPenLightBackgroundColors = new UBColorListSetting(this, "Board", "PenLightBackgroundColors", penLightBackgroundColors, 1.0); boardPenLightBackgroundColors = new UBColorListSetting(this, "Board", "PenLightBackgroundColors", penLightBackgroundColors, 1.0);
@ -310,11 +315,6 @@ void UBSettings::init()
boardShowToolsPalette = new UBSetting(this, "Board", "ShowToolsPalette", "false"); boardShowToolsPalette = new UBSetting(this, "Board", "ShowToolsPalette", "false");
documentSizes.insert(DocumentSizeRatio::Ratio4_3, QSize(1280, 960)); // 1.33
documentSizes.insert(DocumentSizeRatio::Ratio16_9, QSize((960 / 9 * 16), 960)); // 1.77
defaultDocumentSize = documentSizes.value(DocumentSizeRatio::Ratio4_3);
svgViewBoxMargin = new UBSetting(this, "SVG", "ViewBoxMargin", "50"); svgViewBoxMargin = new UBSetting(this, "SVG", "ViewBoxMargin", "50");
pdfMargin = new UBSetting(this, "PDF", "Margin", "20"); pdfMargin = new UBSetting(this, "PDF", "Margin", "20");

@ -266,7 +266,7 @@ class UBSettings : public QObject
QMap<DocumentSizeRatio::Enum, QSize> documentSizes; QMap<DocumentSizeRatio::Enum, QSize> documentSizes;
QSize defaultDocumentSize; //QSize defaultDocumentSize;
UBSetting* svgViewBoxMargin; UBSetting* svgViewBoxMargin;
UBSetting* pdfMargin; UBSetting* pdfMargin;
@ -311,6 +311,8 @@ class UBSettings : public QObject
UBSetting* communityUser; UBSetting* communityUser;
UBSetting* communityPsw; UBSetting* communityPsw;
UBSetting* pageSize;
/* /*
static int navigPaletteWidth; static int navigPaletteWidth;
static int libPaletteWidth; static int libPaletteWidth;

@ -48,7 +48,7 @@ void UBDocumentProxy::init()
setUuid(QUuid::createUuid()); setUuid(QUuid::createUuid());
setDefaultDocumentSize(UBSettings::settings()->defaultDocumentSize); setDefaultDocumentSize(UBSettings::settings()->pageSize->get().toSize());
} }
@ -162,7 +162,7 @@ QSize UBDocumentProxy::defaultDocumentSize() const
if (mMetaDatas.contains(UBSettings::documentSize)) if (mMetaDatas.contains(UBSettings::documentSize))
return metaData(UBSettings::documentSize).toSize(); return metaData(UBSettings::documentSize).toSize();
else else
return UBSettings::settings()->defaultDocumentSize; return UBSettings::settings()->pageSize->get().toSize();
} }
void UBDocumentProxy::setDefaultDocumentSize(QSize pSize) void UBDocumentProxy::setDefaultDocumentSize(QSize pSize)

Loading…
Cancel
Save