on document load the priority is now the zero tab and not the teacher guide

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 8abe5e77a8
commit 2447d1e0d3
  1. 16
      src/board/UBBoardPaletteManager.cpp
  2. 6
      src/board/UBBoardPaletteManager.h
  3. 72
      src/gui/UBLeftPalette.cpp

@ -150,22 +150,13 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
}
mLeftPalette->connectSignals();
mLeftPalette->showTabWidget(0);
mRightPalette = new UBRightPalette(mContainer);
// RIGHT palette widgets
#ifndef USE_WEB_WIDGET
mpFeaturesWidget = new UBFeaturesWidget();
mRightPalette->registerWidget(mpFeaturesWidget);
mRightPalette->addTab(mpFeaturesWidget);
#endif
//Do not show deprecated lib widget to prevent collisions. Uncomment to return lib widget
#ifdef USE_WEB_WIDGET
mRightPalette->registerWidget(mpLibWidget);
mRightPalette->addTab(mpLibWidget);
#endif
// The cache widget will be visible only if a cache is put on the page
mRightPalette->registerWidget(mpCachePropWidget);
@ -890,14 +881,9 @@ void UBBoardPaletteManager::addItemToLibrary()
}
QImage image = mPixmap.toImage();
#ifdef USE_WEB_WIDGET
mpLibWidget->libNavigator()->libraryWidget()->libraryController()->importImageOnLibrary(image);
#else
QDateTime now = QDateTime::currentDateTime();
QString capturedName = tr("CapturedImage") + "-" + now.toString("dd-MM-yyyy hh-mm-ss") + ".png";
mpFeaturesWidget->importImage(image, capturedName);
#endif
}
else
{

@ -49,10 +49,6 @@ class UBMainWindow;
class UBApplicationController;
class UBDockTeacherGuideWidget;
// Uncomment this to use old-styles lib paletter
// #define USE_WEB_WIDGET
class UBBoardPaletteManager : public QObject
{
Q_OBJECT
@ -147,7 +143,7 @@ class UBBoardPaletteManager : public QObject
/** The cache properties widget */
UBCachePropertiesWidget* mpCachePropWidget;
UBFeaturesWidget *mpFeaturesWidget;
UBFeaturesWidget *mpFeaturesWidget;
/** The download widget */
UBDockDownloadWidget* mpDownloadWidget;

@ -38,18 +38,18 @@ UBLeftPalette::UBLeftPalette(QWidget *parent, const char *name):
bool isCollapsed = false;
if(mCurrentMode == eUBDockPaletteWidget_BOARD){
mLastWidth = UBSettings::settings()->leftLibPaletteBoardModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->get().toBool();
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();
mLastWidth = UBSettings::settings()->leftLibPaletteDesktopModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->get().toBool();
}
if(isCollapsed)
resize(0,parentWidget()->height());
resize(0,parentWidget()->height());
else
resize(mLastWidth, parentWidget()->height());
resize(mLastWidth, parentWidget()->height());
}
/**
@ -63,9 +63,11 @@ UBLeftPalette::~UBLeftPalette()
void UBLeftPalette::onDocumentSet(UBDocumentProxy* documentProxy)
{
//This is necessary to force the teacher guide to be showed in priority each time a document is set
if(documentProxy && UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool())
mLastOpenedTabForMode.insert(eUBDockPaletteWidget_BOARD, 1);
// //This is necessary to force the teacher guide to be showed in priority each time a document is set
// if(documentProxy && UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool())
// the tab zero is forced
mLastOpenedTabForMode.insert(eUBDockPaletteWidget_BOARD, 0);
}
/**
@ -82,36 +84,36 @@ void UBLeftPalette::updateMaxWidth()
*/
void UBLeftPalette::resizeEvent(QResizeEvent *event)
{
int newWidth = width();
if(mCurrentMode == eUBDockPaletteWidget_BOARD){
if(newWidth > mCollapseWidth)
UBSettings::settings()->leftLibPaletteBoardModeWidth->set(newWidth);
UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->set(newWidth == 0);
}
else{
if(newWidth > mCollapseWidth)
UBSettings::settings()->leftLibPaletteDesktopModeWidth->set(newWidth);
UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->set(newWidth == 0);
}
int newWidth = width();
if(mCurrentMode == eUBDockPaletteWidget_BOARD){
if(newWidth > mCollapseWidth)
UBSettings::settings()->leftLibPaletteBoardModeWidth->set(newWidth);
UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->set(newWidth == 0);
}
else{
if(newWidth > mCollapseWidth)
UBSettings::settings()->leftLibPaletteDesktopModeWidth->set(newWidth);
UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->set(newWidth == 0);
}
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);
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);
}

Loading…
Cancel
Save