Commit f25888ae authored by Aleksei Kanash's avatar Aleksei Kanash

Fix to SANKORE-324 and to SANKORE-297.

parent 11f702cb
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -141,6 +141,7 @@ void UBApplicationController::initScreenLayout() ...@@ -141,6 +141,7 @@ void UBApplicationController::initScreenLayout()
mDisplayManager->setAsDisplay(mDisplayView); mDisplayManager->setAsDisplay(mDisplayView);
mDisplayManager->setAsPreviousDisplays(mPreviousViews); mDisplayManager->setAsPreviousDisplays(mPreviousViews);
mDisplayManager->setAsDesktop(mUninoteController->drawingView());
mDisplayManager->adjustScreens(-1); mDisplayManager->adjustScreens(-1);
} }
......
...@@ -34,6 +34,7 @@ UBDisplayManager::UBDisplayManager(QObject *parent) ...@@ -34,6 +34,7 @@ UBDisplayManager::UBDisplayManager(QObject *parent)
, mDisplayScreenIndex(-1) , mDisplayScreenIndex(-1)
, mControlWidget(0) , mControlWidget(0)
, mDisplayWidget(0) , mDisplayWidget(0)
, mDesktopWidget(0)
{ {
mDesktop = qApp->desktop(); mDesktop = qApp->desktop();
...@@ -55,8 +56,10 @@ void UBDisplayManager::initScreenIndexes() ...@@ -55,8 +56,10 @@ void UBDisplayManager::initScreenIndexes()
if (screenCount > 0) if (screenCount > 0)
{ {
mControlScreenIndex = mDesktop->primaryScreen(); mControlScreenIndex = mDesktop->primaryScreen();
if (UBSettings::settings()->swapControlAndDisplayScreens->get().toBool())
//qDebug() << "The primary screen: " << mControlScreenIndex << mDesktop->screenGeometry(mControlScreenIndex); {
mControlScreenIndex = mControlScreenIndex^1;
}
mScreenIndexesRoles << Control; mScreenIndexesRoles << Control;
} }
...@@ -130,6 +133,20 @@ void UBDisplayManager::setAsControl(QWidget* pControlWidget ) ...@@ -130,6 +133,20 @@ void UBDisplayManager::setAsControl(QWidget* pControlWidget )
} }
} }
void UBDisplayManager::setAsDesktop(QWidget* pControlWidget )
{
if(hasControl() && pControlWidget && (pControlWidget != mControlWidget))
{
mDesktopWidget = pControlWidget;
mDesktopWidget->hide();
mDesktopWidget->setGeometry(mDesktop->screenGeometry(mControlScreenIndex));
// mDisplayWidget->showFullScreen();
// !!!! Should be included into Windows after QT recompilation
#ifdef Q_WS_MAC
// mControlWidget->setAttribute(Qt::WA_MacNoShadow);
#endif
}
}
void UBDisplayManager::setAsDisplay(QWidget* pDisplayWidget) void UBDisplayManager::setAsDisplay(QWidget* pDisplayWidget)
{ {
...@@ -163,6 +180,12 @@ QRect UBDisplayManager::displayGeometry() ...@@ -163,6 +180,12 @@ QRect UBDisplayManager::displayGeometry()
return mDesktop->screenGeometry(mDisplayScreenIndex); return mDesktop->screenGeometry(mDisplayScreenIndex);
} }
void UBDisplayManager::swapScreens(bool swap)
{
adjustScreens(-1);
}
void UBDisplayManager::adjustScreens(int screen) void UBDisplayManager::adjustScreens(int screen)
{ {
Q_UNUSED(screen); Q_UNUSED(screen);
...@@ -189,6 +212,11 @@ void UBDisplayManager::positionScreens() ...@@ -189,6 +212,11 @@ void UBDisplayManager::positionScreens()
mDisplayWidget->setGeometry(mDesktop->screenGeometry(mDisplayScreenIndex)); mDisplayWidget->setGeometry(mDesktop->screenGeometry(mDisplayScreenIndex));
mDisplayWidget->showFullScreen(); mDisplayWidget->showFullScreen();
} }
if(mDesktopWidget && mControlScreenIndex > -1)
{
mDesktopWidget->setGeometry(mDesktop->screenGeometry(mControlScreenIndex));
// mDesktopWidget->showFullScreen();
}
else if(mDisplayWidget) else if(mDisplayWidget)
{ {
mDisplayWidget->hide(); mDisplayWidget->hide();
......
...@@ -37,6 +37,8 @@ class UBDisplayManager : public QObject ...@@ -37,6 +37,8 @@ class UBDisplayManager : public QObject
void setAsDisplay(QWidget* pDisplayWidget); void setAsDisplay(QWidget* pDisplayWidget);
void setAsDesktop(QWidget* pControlWidget);
void setAsPreviousDisplays(QList<UBBoardView*> pPreviousViews); void setAsPreviousDisplays(QList<UBBoardView*> pPreviousViews);
bool hasControl() bool hasControl()
...@@ -75,6 +77,8 @@ class UBDisplayManager : public QObject ...@@ -75,6 +77,8 @@ class UBDisplayManager : public QObject
public slots: public slots:
void swapScreens(bool bswap);
void adjustScreens(int screen); void adjustScreens(int screen);
void blackout(); void blackout();
...@@ -101,6 +105,8 @@ class UBDisplayManager : public QObject ...@@ -101,6 +105,8 @@ class UBDisplayManager : public QObject
QWidget* mDisplayWidget; QWidget* mDisplayWidget;
QWidget *mDesktopWidget;
QList<UBBoardView*> mPreviousDisplayWidgets; QList<UBBoardView*> mPreviousDisplayWidgets;
QList<UBBlackoutWidget*> mBlackoutWidgets; QList<UBBlackoutWidget*> mBlackoutWidgets;
......
...@@ -116,6 +116,8 @@ void UBPreferencesController::wire() ...@@ -116,6 +116,8 @@ void UBPreferencesController::wire()
connect(mPreferencesUI->useExternalBrowserCheckBox, SIGNAL(clicked(bool)), settings->webUseExternalBrowser, SLOT(setBool(bool))); connect(mPreferencesUI->useExternalBrowserCheckBox, SIGNAL(clicked(bool)), settings->webUseExternalBrowser, SLOT(setBool(bool)));
connect(mPreferencesUI->displayBrowserPageCheckBox, SIGNAL(clicked(bool)), settings->webShowPageImmediatelyOnMirroredScreen, SLOT(setBool(bool))); connect(mPreferencesUI->displayBrowserPageCheckBox, SIGNAL(clicked(bool)), settings->webShowPageImmediatelyOnMirroredScreen, SLOT(setBool(bool)));
connect(mPreferencesUI->swapControlAndDisplayScreensCheckBox, SIGNAL(clicked(bool)), settings->swapControlAndDisplayScreens, SLOT(setBool(bool)));
connect(mPreferencesUI->swapControlAndDisplayScreensCheckBox, SIGNAL(clicked(bool)), UBApplication::applicationController->displayManager(), SLOT(swapScreens(bool)));
connect(mPreferencesUI->toolbarAtTopRadioButton, SIGNAL(clicked(bool)), this, SLOT(toolbarPositionChanged(bool))); connect(mPreferencesUI->toolbarAtTopRadioButton, SIGNAL(clicked(bool)), this, SLOT(toolbarPositionChanged(bool)));
connect(mPreferencesUI->toolbarAtBottomRadioButton, SIGNAL(clicked(bool)), this, SLOT(toolbarPositionChanged(bool))); connect(mPreferencesUI->toolbarAtBottomRadioButton, SIGNAL(clicked(bool)), this, SLOT(toolbarPositionChanged(bool)));
...@@ -193,6 +195,7 @@ void UBPreferencesController::init() ...@@ -193,6 +195,7 @@ void UBPreferencesController::init()
mPreferencesUI->Username_textBox->setText(settings->communityUsername()); mPreferencesUI->Username_textBox->setText(settings->communityUsername());
mPreferencesUI->Password_textEdit->setText(settings->communityPassword()); mPreferencesUI->Password_textEdit->setText(settings->communityPassword());
mPreferencesUI->swapControlAndDisplayScreensCheckBox->setChecked(settings->swapControlAndDisplayScreens->get().toBool());
// pen tab // pen tab
mPenProperties->fineSlider->setValue(settings->boardPenFineWidth->get().toDouble() * sSliderRatio); mPenProperties->fineSlider->setValue(settings->boardPenFineWidth->get().toDouble() * sSliderRatio);
......
...@@ -373,6 +373,7 @@ void UBSettings::init() ...@@ -373,6 +373,7 @@ void UBSettings::init()
intranetPodcastAuthor = new UBSetting(this, "IntranetPodcast", "Author", ""); intranetPodcastAuthor = new UBSetting(this, "IntranetPodcast", "Author", "");
KeyboardLocale = new UBSetting(this, "Board", "StartupKeyboardLocale", 0); KeyboardLocale = new UBSetting(this, "Board", "StartupKeyboardLocale", 0);
swapControlAndDisplayScreens = new UBSetting(this, "App", "SwapControlAndDisplayScreens", false);
} }
......
...@@ -321,6 +321,7 @@ class UBSettings : public QObject ...@@ -321,6 +321,7 @@ class UBSettings : public QObject
UBSetting* pageSize; UBSetting* pageSize;
UBSetting* KeyboardLocale; UBSetting* KeyboardLocale;
UBSetting* swapControlAndDisplayScreens;
public slots: public slots:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment