Launch Sankore on desktop mode
preferencesAboutTextFull
Anatoly Mihalchenko 13 years ago
parent 48bce1d8b1
commit e304b03fc2
  1. 202
      resources/forms/preferences.ui
  2. 14
      src/board/UBBoardController.cpp
  3. 3
      src/core/UBApplication.cpp
  4. 5
      src/core/UBApplicationController.cpp
  5. 4
      src/core/UBDisplayManager.cpp
  6. 2
      src/core/UBDisplayManager.h
  7. 10
      src/core/UBPreferencesController.cpp
  8. 2
      src/core/UBSettings.cpp
  9. 2
      src/core/UBSettings.h

@ -292,66 +292,8 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="12" column="0"> <item row="14" column="0">
<widget class="QGroupBox" name="keyboardGroupBox"> <spacer name="modeSpacer">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Virtual Keyboard</string>
</property>
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" rowspan="2">
<layout class="QGridLayout" name="gridLayout_11">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Keyboard button size:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="keyboardPaletteKeyButtonSize"/>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="13" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
@ -566,6 +508,146 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="12" column="0">
<widget class="QGroupBox" name="keyboardGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Virtual Keyboard</string>
</property>
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" rowspan="2">
<layout class="QGridLayout" name="gridLayout_11">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Keyboard button size:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="keyboardPaletteKeyButtonSize"/>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="15" column="0">
<widget class="QGroupBox" name="modeGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Mode</string>
</property>
<layout class="QGridLayout" name="gridLayout_15">
<item row="0" column="0">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" rowspan="2">
<layout class="QGridLayout" name="gridLayout_16">
<item row="0" column="0">
<widget class="QLabel" name="modeLabel">
<property name="text">
<string>Mode to start in:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="startModeComboBox">
<item>
<property name="text">
<string>Board</string>
</property>
</item>
<item>
<property name="text">
<string>Desktop</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="16" column="0">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="penTab"> <widget class="QWidget" name="penTab">

@ -365,7 +365,7 @@ void UBBoardController::connectToolbar()
void UBBoardController::startScript() void UBBoardController::startScript()
{ {
freezeW3CWidgets(true); freezeW3CWidgets(false);
} }
void UBBoardController::stopScript() void UBBoardController::stopScript()
@ -453,6 +453,7 @@ void UBBoardController::addScene()
setActiveDocumentScene(mActiveDocument, mActiveSceneIndex + 1); setActiveDocumentScene(mActiveDocument, mActiveSceneIndex + 1);
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
centerOn();
} }
@ -2162,13 +2163,14 @@ void UBBoardController::freezeW3CWidget(QGraphicsItem *item, bool freeze)
{ {
if(item->type() == UBGraphicsW3CWidgetItem::Type) if(item->type() == UBGraphicsW3CWidgetItem::Type)
{ {
QString scriptString;
if (freeze)
scriptString = "setfreezed(true);";
else
scriptString = "setfreezed(false);";
UBGraphicsW3CWidgetItem* item_casted = dynamic_cast<UBGraphicsW3CWidgetItem*>(item); UBGraphicsW3CWidgetItem* item_casted = dynamic_cast<UBGraphicsW3CWidgetItem*>(item);
if (0 == item_casted) if (0 == item_casted)
return; return;
item_casted->widgetWebView()->page()->mainFrame()->evaluateJavaScript(scriptString);
if (freeze) {
item_casted->widgetWebView()->page()->mainFrame()->setContent(UBW3CWidget::freezedWidgetPage().toAscii());
} else
item_casted->widgetWebView()->loadMainHtml();
} }
} }

@ -310,6 +310,9 @@ int UBApplication::exec(const QString& pFileToImport)
static AEEventHandlerUPP ub_proc_ae_handlerUPP = AEEventHandlerUPP(ub_appleEventProcessor); static AEEventHandlerUPP ub_proc_ae_handlerUPP = AEEventHandlerUPP(ub_appleEventProcessor);
AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, ub_proc_ae_handlerUPP, SRefCon(UBApplication::applicationController), true); AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, ub_proc_ae_handlerUPP, SRefCon(UBApplication::applicationController), true);
#endif #endif
if (UBSettings::settings()->appStartMode->get() == "Desktop")
applicationController->showDesktop();
else applicationController->showBoard();
if (UBSettings::settings()->appIsInSoftwareUpdateProcess->get().toBool()) if (UBSettings::settings()->appIsInSoftwareUpdateProcess->get().toBool())

@ -137,7 +137,7 @@ void UBApplicationController::initViewState(int horizontalPosition, int vertical
void UBApplicationController::initScreenLayout() void UBApplicationController::initScreenLayout()
{ {
mDisplayManager->setAsControl(mMainWindow); mDisplayManager->setAsControl(mMainWindow, true);
mDisplayManager->setAsDisplay(mDisplayView); mDisplayManager->setAsDisplay(mDisplayView);
mDisplayManager->setAsPreviousDisplays(mPreviousViews); mDisplayManager->setAsPreviousDisplays(mPreviousViews);
@ -352,7 +352,8 @@ void UBApplicationController::showBoard()
UBPlatformUtils::setDesktopMode(false); UBPlatformUtils::setDesktopMode(false);
mUninoteController->hideWindow(); mUninoteController->hideWindow();
mMainWindow->show();
mDisplayManager->adjustScreens(0);
emit mainModeChanged(Board); emit mainModeChanged(Board);
} }

@ -118,13 +118,15 @@ int UBDisplayManager::numPreviousViews()
} }
void UBDisplayManager::setAsControl(QWidget* pControlWidget ) void UBDisplayManager::setAsControl(QWidget* pControlWidget, bool init)
{ {
if(hasControl() && pControlWidget && (pControlWidget != mControlWidget)) if(hasControl() && pControlWidget && (pControlWidget != mControlWidget))
{ {
mControlWidget = pControlWidget; mControlWidget = pControlWidget;
mControlWidget->hide(); mControlWidget->hide();
mControlWidget->setGeometry(mDesktop->screenGeometry(mControlScreenIndex)); mControlWidget->setGeometry(mDesktop->screenGeometry(mControlScreenIndex));
if (!init)
mControlWidget->showFullScreen(); mControlWidget->showFullScreen();
// !!!! Should be included into Windows after QT recompilation // !!!! Should be included into Windows after QT recompilation
#ifdef Q_WS_MAC #ifdef Q_WS_MAC

@ -33,7 +33,7 @@ class UBDisplayManager : public QObject
int numPreviousViews(); int numPreviousViews();
void setAsControl(QWidget* pControlWidget); void setAsControl(QWidget* pControlWidget, bool init = false);
void setAsDisplay(QWidget* pDisplayWidget); void setAsDisplay(QWidget* pDisplayWidget);

@ -112,6 +112,7 @@ void UBPreferencesController::wire()
connect(mPreferencesUI->keyboardPaletteKeyButtonSize, SIGNAL(currentIndexChanged(const QString &)), settings->boardKeyboardPaletteKeyBtnSize, SLOT(setString(const QString &))); connect(mPreferencesUI->keyboardPaletteKeyButtonSize, SIGNAL(currentIndexChanged(const QString &)), settings->boardKeyboardPaletteKeyBtnSize, SLOT(setString(const QString &)));
connect(mPreferencesUI->startModeComboBox, SIGNAL(currentIndexChanged(const QString &)), settings->appStartMode, SLOT(setString(const QString &)));
connect(mPreferencesUI->useExternalBrowserCheckBox, SIGNAL(clicked(bool)), settings->webUseExternalBrowser, SLOT(setBool(bool))); connect(mPreferencesUI->useExternalBrowserCheckBox, SIGNAL(clicked(bool)), settings->webUseExternalBrowser, SLOT(setBool(bool)));
@ -180,6 +181,14 @@ void UBPreferencesController::init()
break; break;
} }
for(int i=0; i<mPreferencesUI->startModeComboBox->count(); i++)
if (mPreferencesUI->startModeComboBox->itemText(i) ==
settings->appStartMode->get().toString())
{
mPreferencesUI->startModeComboBox->setCurrentIndex(i);
break;
}
mPreferencesUI->useExternalBrowserCheckBox->setChecked(settings->webUseExternalBrowser->get().toBool()); mPreferencesUI->useExternalBrowserCheckBox->setChecked(settings->webUseExternalBrowser->get().toBool());
mPreferencesUI->displayBrowserPageCheckBox->setChecked(settings->webShowPageImmediatelyOnMirroredScreen->get().toBool()); mPreferencesUI->displayBrowserPageCheckBox->setChecked(settings->webShowPageImmediatelyOnMirroredScreen->get().toBool());
mPreferencesUI->webHomePage->setText(settings->webHomePage->get().toString()); mPreferencesUI->webHomePage->setText(settings->webHomePage->get().toString());
@ -293,6 +302,7 @@ void UBPreferencesController::defaultSettings()
mPreferencesUI->toolbarDisplayTextCheckBox->setChecked(defaultValue); mPreferencesUI->toolbarDisplayTextCheckBox->setChecked(defaultValue);
mPreferencesUI->verticalChoice->setChecked(settings->appToolBarOrientationVertical->reset().toBool()); mPreferencesUI->verticalChoice->setChecked(settings->appToolBarOrientationVertical->reset().toBool());
mPreferencesUI->horizontalChoice->setChecked(!settings->appToolBarOrientationVertical->reset().toBool()); mPreferencesUI->horizontalChoice->setChecked(!settings->appToolBarOrientationVertical->reset().toBool());
mPreferencesUI->startModeComboBox->setCurrentIndex(0);
} }
else if (mPreferencesUI->mainTabWidget->currentWidget() == mPreferencesUI->penTab) else if (mPreferencesUI->mainTabWidget->currentWidget() == mPreferencesUI->penTab)
{ {

@ -212,6 +212,8 @@ void UBSettings::init()
appLastSessionPageIndex = new UBSetting(this, "App", "LastSessionPageIndex", 0); appLastSessionPageIndex = new UBSetting(this, "App", "LastSessionPageIndex", 0);
appUseMultiscreen = new UBSetting(this, "App", "UseMusliscreenMode", true); appUseMultiscreen = new UBSetting(this, "App", "UseMusliscreenMode", true);
appStartMode = new UBSetting(this, "App", "StartMode", "");
boardPenFineWidth = new UBSetting(this, "Board", "PenFineWidth", 1.5); boardPenFineWidth = new UBSetting(this, "Board", "PenFineWidth", 1.5);
boardPenMediumWidth = new UBSetting(this, "Board", "PenMediumWidth", 3.0); boardPenMediumWidth = new UBSetting(this, "Board", "PenMediumWidth", 3.0);
boardPenStrongWidth = new UBSetting(this, "Board", "PenStrongWidth", 8.0); boardPenStrongWidth = new UBSetting(this, "Board", "PenStrongWidth", 8.0);

@ -229,6 +229,8 @@ class UBSettings : public QObject
UBSetting* boardKeyboardPaletteKeyBtnSize; UBSetting* boardKeyboardPaletteKeyBtnSize;
UBSetting* appStartMode;
UBColorListSetting* boardPenLightBackgroundColors; UBColorListSetting* boardPenLightBackgroundColors;
UBColorListSetting* boardPenLightBackgroundSelectedColors; UBColorListSetting* boardPenLightBackgroundSelectedColors;

Loading…
Cancel
Save