Commit b608118f authored by Clément Fauconnier's avatar Clément Fauconnier

document views resized and not collapsible + check version Openboard

parent d0c43bb1
...@@ -34,6 +34,12 @@ ...@@ -34,6 +34,12 @@
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QSplitter" name="splitter"> <widget class="QSplitter" name="splitter">
<property name="minimumSize">
<size>
<width>400</width>
<height>0</height>
</size>
</property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
...@@ -43,6 +49,9 @@ ...@@ -43,6 +49,9 @@
<property name="handleWidth"> <property name="handleWidth">
<number>6</number> <number>6</number>
</property> </property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<widget class="QWidget" name="topLeftWidget" native="true"> <widget class="QWidget" name="topLeftWidget" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
...@@ -83,17 +92,17 @@ ...@@ -83,17 +92,17 @@
</property> </property>
<item> <item>
<property name="text"> <property name="text">
<string>Creation date</string> <string>Alphabetical order</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text"> <property name="text">
<string>Update date</string> <string>Creation date</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text"> <property name="text">
<string>Alphabetical order</string> <string>Update date</string>
</property> </property>
</item> </item>
</widget> </widget>
...@@ -104,7 +113,7 @@ ...@@ -104,7 +113,7 @@
<widget class="UBDocumentTreeView" name="documentTreeView"> <widget class="UBDocumentTreeView" name="documentTreeView">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>400</width> <width>0</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
......
...@@ -93,6 +93,8 @@ static bool lessThan(UBDocumentTreeNode *lValue, UBDocumentTreeNode *rValue) ...@@ -93,6 +93,8 @@ static bool lessThan(UBDocumentTreeNode *lValue, UBDocumentTreeNode *rValue)
return false; return false;
} }
UBDocumentReplaceDialog::UBDocumentReplaceDialog(const QString &pIncommingName, const QStringList &pFileList, QWidget *parent, Qt::WindowFlags pFlags) UBDocumentReplaceDialog::UBDocumentReplaceDialog(const QString &pIncommingName, const QStringList &pFileList, QWidget *parent, Qt::WindowFlags pFlags)
: QDialog(parent, pFlags) : QDialog(parent, pFlags)
, mFileNameList(pFileList) , mFileNameList(pFileList)
...@@ -1991,6 +1993,12 @@ void UBDocumentController::setupViews() ...@@ -1991,6 +1993,12 @@ void UBDocumentController::setupViews()
mDocumentUI->documentTreeView->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); mDocumentUI->documentTreeView->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
mDocumentUI->documentTreeView->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); mDocumentUI->documentTreeView->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
//set sizes (left and right sides of the splitter) for the splitter here because it cannot be done in the form editor.
const int leftSplitterSize = 100;
const int rightSplitterSize = 1600;
QList<int> splitterSizes = { leftSplitterSize, rightSplitterSize };
mDocumentUI->splitter->setSizes(splitterSizes);
mDocumentUI->documentTreeView->hideColumn(1); mDocumentUI->documentTreeView->hideColumn(1);
mDocumentUI->documentTreeView->hideColumn(2); mDocumentUI->documentTreeView->hideColumn(2);
...@@ -2804,14 +2812,14 @@ bool UBDocumentController::isOKToOpenDocument(UBDocumentProxy* proxy) ...@@ -2804,14 +2812,14 @@ bool UBDocumentController::isOKToOpenDocument(UBDocumentProxy* proxy)
if (docVersion.isEmpty() || docVersion.startsWith("4.1") || docVersion.startsWith("4.2") if (docVersion.isEmpty() || docVersion.startsWith("4.1") || docVersion.startsWith("4.2")
|| docVersion.startsWith("4.3") || docVersion.startsWith("4.4") || docVersion.startsWith("4.5") || docVersion.startsWith("4.3") || docVersion.startsWith("4.4") || docVersion.startsWith("4.5")
|| docVersion.startsWith("4.6") || docVersion.startsWith("4.7")) // TODO UB 4.8 update if necessary || docVersion.startsWith("4.6") || docVersion.startsWith("4.8")) // TODO UB 4.7 update if necessary
{ {
return true; return true;
} }
else else
{ {
if (UBApplication::mainWindow->yesNoQuestion(tr("Open Document"), if (UBApplication::mainWindow->yesNoQuestion(tr("Open Document"),
tr("The document '%1' has been generated with a newer version of Sankore (%2). By opening it, you may lose some information. Do you want to proceed?") tr("The document '%1' has been generated with a newer version of OpenBoard (%2). By opening it, you may lose some information. Do you want to proceed?")
.arg(proxy->metaData(UBSettings::documentName).toString()) .arg(proxy->metaData(UBSettings::documentName).toString())
.arg(docVersion))) .arg(docVersion)))
{ {
......
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