Fixed issue 769

preferencesAboutTextFull
shibakaneki 12 years ago
parent f2b92ee42e
commit bb561c3869
  1. 4
      src/board/UBDrawingController.cpp
  2. 5
      src/board/UBDrawingController.h
  3. 2
      src/core/UBApplicationController.cpp
  4. 2
      src/desktop/UBDesktopAnnotationController.cpp
  5. 6
      src/domain/UBGraphicsScene.cpp

@ -46,7 +46,7 @@ UBDrawingController::UBDrawingController(QObject * parent)
, mStylusTool((UBStylusTool::Enum)-1) , mStylusTool((UBStylusTool::Enum)-1)
, mLatestDrawingTool((UBStylusTool::Enum)-1) , mLatestDrawingTool((UBStylusTool::Enum)-1)
, mDrawingMode(DRAWING_MODE) , mDrawingMode(DRAWING_MODE)
, mIsDesktopMode(false)
{ {
connect(UBSettings::settings(), SIGNAL(colorContextChanged()), this, SIGNAL(colorPaletteChanged())); connect(UBSettings::settings(), SIGNAL(colorContextChanged()), this, SIGNAL(colorPaletteChanged()));
@ -107,7 +107,7 @@ void UBDrawingController::setStylusTool(int tool)
mStylusTool = (UBStylusTool::Enum)tool; mStylusTool = (UBStylusTool::Enum)tool;
if(eDrawingMode_Vector == DRAWING_MODE){ if(eDrawingMode_Vector == DRAWING_MODE && !mIsDesktopMode){
mDrawingMode = eDrawingMode_Vector; mDrawingMode = eDrawingMode_Vector;
} }

@ -61,6 +61,10 @@ class UBDrawingController : public QObject
UBAbstractDrawRuler* mActiveRuler; UBAbstractDrawRuler* mActiveRuler;
void setInDestopMode(bool mode){
mIsDesktopMode = mode;
}
public slots: public slots:
void setStylusTool(int tool); void setStylusTool(int tool);
@ -79,6 +83,7 @@ class UBDrawingController : public QObject
UBStylusTool::Enum mStylusTool; UBStylusTool::Enum mStylusTool;
UBStylusTool::Enum mLatestDrawingTool; UBStylusTool::Enum mLatestDrawingTool;
eDrawingMode mDrawingMode; eDrawingMode mDrawingMode;
bool mIsDesktopMode;
static UBDrawingController* sDrawingController; static UBDrawingController* sDrawingController;

@ -69,7 +69,6 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBo
, mCheckingForUpdates(false) , mCheckingForUpdates(false)
, mIsShowingDesktop(false) , mIsShowingDesktop(false)
, mHttp(0) , mHttp(0)
{ {
mDisplayManager = new UBDisplayManager(this); mDisplayManager = new UBDisplayManager(this);
@ -457,6 +456,7 @@ void UBApplicationController::showDesktop(bool dontSwitchFrontProcess)
UBPlatformUtils::bringPreviousProcessToFront(); UBPlatformUtils::bringPreviousProcessToFront();
} }
UBDrawingController::drawingController()->setInDestopMode(true);
UBDrawingController::drawingController()->setDrawingMode(eDrawingMode_Artistic); UBDrawingController::drawingController()->setDrawingMode(eDrawingMode_Artistic);
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
} }

@ -385,6 +385,8 @@ void UBDesktopAnnotationController::goToUniboard()
hideWindow(); hideWindow();
UBPlatformUtils::setDesktopMode(false); UBPlatformUtils::setDesktopMode(false);
UBDrawingController::drawingController()->setInDestopMode(false);
UBDrawingController::drawingController()->setDrawingMode(eDrawingMode_Vector);
emit restoreUniboard(); emit restoreUniboard();
} }

@ -558,7 +558,7 @@ bool UBGraphicsScene::inputDeviceRelease()
} }
}else if (mCurrentStroke) }else if (mCurrentStroke)
{ {
if(eDrawingMode_Vector == DRAWING_MODE){ if(eDrawingMode_Vector == UBDrawingController::drawingController()->drawingMode()){
UBGraphicsStrokesGroup* pStrokes = new UBGraphicsStrokesGroup(); UBGraphicsStrokesGroup* pStrokes = new UBGraphicsStrokesGroup();
// Remove the strokes that were just drawn here and replace them by a stroke item // Remove the strokes that were just drawn here and replace them by a stroke item
@ -902,7 +902,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
} }
} }
if(eDrawingMode_Vector == DRAWING_MODE){ if(eDrawingMode_Vector == UBDrawingController::drawingController()->drawingMode()){
foreach(QGraphicsItem* item, toBeRemovedItems){ foreach(QGraphicsItem* item, toBeRemovedItems){
UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item); UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item);
if(NULL != poly){ if(NULL != poly){
@ -920,7 +920,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
mRemovedItems += toBeRemovedItems; mRemovedItems += toBeRemovedItems;
} }
if(eDrawingMode_Vector == DRAWING_MODE){ if(eDrawingMode_Vector == UBDrawingController::drawingController()->drawingMode()){
foreach(QGraphicsItem* item, toBeAddedItems){ foreach(QGraphicsItem* item, toBeAddedItems){
UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item); UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item);
if(NULL != poly && NULL != poly->strokesGroup()){ if(NULL != poly && NULL != poly->strokesGroup()){

Loading…
Cancel
Save