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

preferencesAboutTextFull
Anatoly Mihalchenko 13 years ago
commit 81ec03feb2
  1. 1
      src/board/UBBoardView.cpp
  2. 13
      src/core/UBSettings.cpp
  3. 13
      src/core/UBSettings.h
  4. 3
      src/domain/UBGraphicsVideoItem.cpp
  5. 3
      src/gui/UBDockPalette.cpp
  6. 5
      src/gui/UBDockPalette.h
  7. 45
      src/gui/UBLeftPalette.cpp
  8. 2
      src/gui/UBLeftPalette.h
  9. 8
      src/gui/UBNavigatorPalette.cpp
  10. 43
      src/gui/UBRightPalette.cpp
  11. 2
      src/gui/UBRightPalette.h

@ -426,6 +426,7 @@ UBBoardView::mousePressEvent (QMouseEvent *event)
if (!movingItem if (!movingItem
|| movingItem->isSelected() || movingItem->isSelected()
|| movingItem->data(UBGraphicsItemData::ItemLocked).toBool()
|| movingItem->type() == UBGraphicsDelegateFrame::Type || movingItem->type() == UBGraphicsDelegateFrame::Type
|| movingItem->type() == DelegateButton::Type || movingItem->type() == DelegateButton::Type
|| movingItem->type() == UBGraphicsCompass::Type || movingItem->type() == UBGraphicsCompass::Type

@ -204,11 +204,14 @@ 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", false); appToolBarOrientationVertical = new UBSetting(this, "App", "ToolBarOrientationVertical", false);
navigPaletteWidth = new UBSetting(this, "Board", "NavigPaletteWidth", 270); rightLibPaletteBoardModeWidth = new UBSetting(this, "Board", "RightLibPaletteBoardModeWidth", 270);
rightLibPaletteWidth = new UBSetting(this, "Board", "RightLibPaletteWidth", 270); rightLibPaletteBoardModeIsCollapsed = new UBSetting(this,"Board", "RightLibPaletteBoardModeIsCollapsed",false);
rightLibPaletteIsCollapsed = new UBSetting(this,"Board", "RightLibPaletteIsCollapsed",false); rightLibPaletteDesktopModeWidth = new UBSetting(this, "Board", "RightLibPaletteDesktopModeWidth", 270);
leftLibPaletteWidth = new UBSetting(this, "Board", "LeftLibPaletteWidth",270); rightLibPaletteDesktopModeIsCollapsed = new UBSetting(this,"Board", "RightLibPaletteDesktopModeIsCollapsed",false);
leftLibPaletteIsCollapsed = new UBSetting(this,"Board","LeftLibPaletteIsCollapsed",false); leftLibPaletteBoardModeWidth = new UBSetting(this, "Board", "LeftLibPaletteBoardModeWidth",270);
leftLibPaletteBoardModeIsCollapsed = new UBSetting(this,"Board","LeftLibPaletteBoardModeIsCollapsed",false);
leftLibPaletteDesktopModeWidth = new UBSetting(this, "Board", "LeftLibPaletteDesktopModeWidth",270);
leftLibPaletteDesktopModeIsCollapsed = new UBSetting(this,"Board","LeftLibPaletteDesktopModeIsCollapsed",false);
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", "");

@ -314,11 +314,14 @@ class UBSettings : public QObject
UBSetting* gipThumbnailWidth; UBSetting* gipThumbnailWidth;
UBSetting* soundThumbnailWidth; UBSetting* soundThumbnailWidth;
UBSetting* navigPaletteWidth; UBSetting* rightLibPaletteBoardModeWidth;
UBSetting* rightLibPaletteWidth; UBSetting* rightLibPaletteBoardModeIsCollapsed;
UBSetting* rightLibPaletteIsCollapsed; UBSetting* rightLibPaletteDesktopModeWidth;
UBSetting* leftLibPaletteWidth; UBSetting* rightLibPaletteDesktopModeIsCollapsed;
UBSetting* leftLibPaletteIsCollapsed; UBSetting* leftLibPaletteBoardModeWidth;
UBSetting* leftLibPaletteBoardModeIsCollapsed;
UBSetting* leftLibPaletteDesktopModeWidth;
UBSetting* leftLibPaletteDesktopModeIsCollapsed;
UBSetting* communityUser; UBSetting* communityUser;
UBSetting* communityPsw; UBSetting* communityPsw;

@ -120,6 +120,9 @@ void UBGraphicsVideoItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
void UBGraphicsVideoItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsVideoItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{ {
if (mDelegate->delegated()->data(UBGraphicsItemData::ItemLocked).toBool())
return;
if(mShouldMove && (event->buttons() & Qt::LeftButton)) if(mShouldMove && (event->buttons() & Qt::LeftButton))
{ {
QPointF offset = event->scenePos() - mMousePressPos; QPointF offset = event->scenePos() - mMousePressPos;

@ -531,9 +531,10 @@ void UBDockPalette::setVisible(bool visible)
bool UBDockPalette::switchMode(eUBDockPaletteWidgetMode mode) bool UBDockPalette::switchMode(eUBDockPaletteWidgetMode mode)
{ {
mCurrentMode = mode;
bool hasVisibleElements = false; bool hasVisibleElements = false;
//-------------------------------// //-------------------------------//
// get full right palette widgets list, parse it, show all widgets for BOARD mode, and hide all other // get full palette widgets list, parse it, show all widgets for BOARD mode, and hide all other
for(int i = 0; i < mRegisteredWidgets.size(); i++) for(int i = 0; i < mRegisteredWidgets.size(); i++)
{ {
UBDockPaletteWidget* pNextWidget = mRegisteredWidgets.at(i); UBDockPaletteWidget* pNextWidget = mRegisteredWidgets.at(i);

@ -79,8 +79,7 @@ private:
typedef enum typedef enum
{ {
eUBDockPaletteType_LEFT, eUBDockPaletteType_LEFT,
eUBDockPaletteType_RIGHT, eUBDockPaletteType_RIGHT
eUBDockPaletteType_NAVIGATOR,
} eUBDockPaletteType; } eUBDockPaletteType;
@ -116,6 +115,8 @@ public:
bool switchMode(eUBDockPaletteWidgetMode mode); bool switchMode(eUBDockPaletteWidgetMode mode);
eUBDockPaletteWidgetMode mCurrentMode;
QVector<UBDockPaletteWidget*> GetWidgetsList() { return mRegisteredWidgets; } QVector<UBDockPaletteWidget*> GetWidgetsList() { return mRegisteredWidgets; }
public: public:

@ -25,11 +25,19 @@ UBLeftPalette::UBLeftPalette(QWidget *parent, const char *name):
{ {
setObjectName(name); setObjectName(name);
setOrientation(eUBDockOrientation_Left); setOrientation(eUBDockOrientation_Left);
mLastWidth = UBSettings::settings()->leftLibPaletteWidth->get().toInt();
mCollapseWidth = 150; mCollapseWidth = 150;
if(UBSettings::settings()->leftLibPaletteIsCollapsed->get().toBool()) bool isCollapsed = false;
if(mCurrentMode == eUBDockPaletteWidget_BOARD){
mLastWidth = UBSettings::settings()->leftLibPaletteBoardModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->get().toBool();
}
else{
mLastWidth = UBSettings::settings()->leftLibPaletteDesktopModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->get().toBool();
}
if(isCollapsed)
resize(0,parentWidget()->height()); resize(0,parentWidget()->height());
else else
resize(mLastWidth, parentWidget()->height()); resize(mLastWidth, parentWidget()->height());
@ -58,8 +66,35 @@ void UBLeftPalette::updateMaxWidth()
void UBLeftPalette::resizeEvent(QResizeEvent *event) void UBLeftPalette::resizeEvent(QResizeEvent *event)
{ {
int newWidth = width(); int newWidth = width();
if(mCurrentMode == eUBDockPaletteWidget_BOARD){
if(newWidth > mCollapseWidth) if(newWidth > mCollapseWidth)
UBSettings::settings()->leftLibPaletteWidth->set(newWidth); UBSettings::settings()->leftLibPaletteBoardModeWidth->set(newWidth);
UBSettings::settings()->leftLibPaletteIsCollapsed->set(newWidth == 0); UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->set(newWidth == 0);
}
else{
if(newWidth > mCollapseWidth)
UBSettings::settings()->leftLibPaletteDesktopModeWidth->set(newWidth);
UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->set(newWidth == 0);
}
UBDockPalette::resizeEvent(event); UBDockPalette::resizeEvent(event);
} }
bool UBLeftPalette::switchMode(eUBDockPaletteWidgetMode mode)
{
int newModeWidth;
if(mode == eUBDockPaletteWidget_BOARD){
mLastWidth = UBSettings::settings()->leftLibPaletteBoardModeWidth->get().toInt();
newModeWidth = mLastWidth;
if(UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->get().toBool())
newModeWidth = 0;
}
else{
mLastWidth = UBSettings::settings()->leftLibPaletteDesktopModeWidth->get().toInt();
newModeWidth = mLastWidth;
if(UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->get().toBool())
newModeWidth = 0;
}
resize(newModeWidth,height());
return UBDockPalette::switchMode(mode);
}

@ -23,6 +23,8 @@ public:
UBLeftPalette(QWidget* parent=0, const char* name="UBLeftPalette"); UBLeftPalette(QWidget* parent=0, const char* name="UBLeftPalette");
~UBLeftPalette(); ~UBLeftPalette();
bool switchMode(eUBDockPaletteWidgetMode mode);
protected: protected:
void updateMaxWidth(); void updateMaxWidth();
void resizeEvent(QResizeEvent *event); void resizeEvent(QResizeEvent *event);

@ -24,18 +24,13 @@
* @param name as the object name * @param name as the object name
*/ */
UBNavigatorPalette::UBNavigatorPalette(QWidget *parent, const char *name): UBNavigatorPalette::UBNavigatorPalette(QWidget *parent, const char *name):
UBDockPalette(eUBDockPaletteType_NAVIGATOR, parent, name) UBDockPalette(eUBDockPaletteType_LEFT, parent, name)
, mNavigator(NULL) , mNavigator(NULL)
, mLayout(NULL) , mLayout(NULL)
, mHLayout(NULL) , mHLayout(NULL)
, mPageNbr(NULL) , mPageNbr(NULL)
, mClock(NULL) , mClock(NULL)
{ {
setOrientation(eUBDockOrientation_Left);
setMaximumWidth(300);
resize(UBSettings::settings()->navigPaletteWidth->get().toInt(), height());
mLastWidth = 300;
// Build the gui // Build the gui
mLayout = new QVBoxLayout(this); mLayout = new QVBoxLayout(this);
mLayout->setContentsMargins(customMargin(), customMargin(), 2*border() + customMargin(), customMargin()); mLayout->setContentsMargins(customMargin(), customMargin(), 2*border() + customMargin(), customMargin());
@ -150,7 +145,6 @@ 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)

@ -28,9 +28,16 @@ UBRightPalette::UBRightPalette(QWidget *parent, const char *name):
setObjectName(name); setObjectName(name);
setOrientation(eUBDockOrientation_Right); setOrientation(eUBDockOrientation_Right);
mCollapseWidth = 150; mCollapseWidth = 150;
bool isCollapsed = false;
mLastWidth = UBSettings::settings()->rightLibPaletteWidth->get().toInt(); if(mCurrentMode == eUBDockPaletteWidget_BOARD){
if(UBSettings::settings()->rightLibPaletteIsCollapsed->get().toBool()) mLastWidth = UBSettings::settings()->rightLibPaletteBoardModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->rightLibPaletteBoardModeIsCollapsed->get().toBool();
}
else{
mLastWidth = UBSettings::settings()->rightLibPaletteDesktopModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->rightLibPaletteDesktopModeIsCollapsed->get().toBool();
}
if(isCollapsed)
resize(0,parentWidget()->height()); resize(0,parentWidget()->height());
else else
resize(mLastWidth, parentWidget()->height()); resize(mLastWidth, parentWidget()->height());
@ -62,9 +69,16 @@ void UBRightPalette::mouseMoveEvent(QMouseEvent *event)
void UBRightPalette::resizeEvent(QResizeEvent *event) void UBRightPalette::resizeEvent(QResizeEvent *event)
{ {
int newWidth = width(); int newWidth = width();
if(mCurrentMode == eUBDockPaletteWidget_BOARD){
if(newWidth > mCollapseWidth) if(newWidth > mCollapseWidth)
UBSettings::settings()->rightLibPaletteWidth->set(newWidth); UBSettings::settings()->rightLibPaletteBoardModeWidth->set(newWidth);
UBSettings::settings()->rightLibPaletteIsCollapsed->set(newWidth == 0); UBSettings::settings()->rightLibPaletteBoardModeIsCollapsed->set(newWidth == 0);
}
else{
if(newWidth > mCollapseWidth)
UBSettings::settings()->rightLibPaletteDesktopModeWidth->set(newWidth);
UBSettings::settings()->rightLibPaletteDesktopModeIsCollapsed->set(newWidth == 0);
}
UBDockPalette::resizeEvent(event); UBDockPalette::resizeEvent(event);
emit resized(); emit resized();
} }
@ -78,3 +92,22 @@ void UBRightPalette::updateMaxWidth()
setMaximumHeight(parentWidget()->height()); setMaximumHeight(parentWidget()->height());
setMinimumHeight(parentWidget()->height()); setMinimumHeight(parentWidget()->height());
} }
bool UBRightPalette::switchMode(eUBDockPaletteWidgetMode mode)
{
int newModeWidth;
if(mode == eUBDockPaletteWidget_BOARD){
mLastWidth = UBSettings::settings()->rightLibPaletteBoardModeWidth->get().toInt();
newModeWidth = mLastWidth;
if(UBSettings::settings()->rightLibPaletteBoardModeIsCollapsed->get().toBool())
newModeWidth = 0;
}
else{
mLastWidth = UBSettings::settings()->rightLibPaletteDesktopModeWidth->get().toInt();
newModeWidth = mLastWidth;
if(UBSettings::settings()->rightLibPaletteDesktopModeIsCollapsed->get().toBool())
newModeWidth = 0;
}
resize(newModeWidth,height());
return UBDockPalette::switchMode(mode);
}

@ -23,6 +23,7 @@ class UBRightPalette : public UBDockPalette
public: public:
UBRightPalette(QWidget* parent=0, const char* name="UBRightPalette"); UBRightPalette(QWidget* parent=0, const char* name="UBRightPalette");
~UBRightPalette(); ~UBRightPalette();
bool switchMode(eUBDockPaletteWidgetMode mode);
signals: signals:
void resized(); void resized();
@ -31,6 +32,7 @@ protected:
void updateMaxWidth(); void updateMaxWidth();
void mouseMoveEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event);
void resizeEvent(QResizeEvent *event); void resizeEvent(QResizeEvent *event);
}; };
#endif // UBRIGHTPALETTE_H #endif // UBRIGHTPALETTE_H

Loading…
Cancel
Save