document views resized and not collapsible + check version Openboard

preferencesAboutTextFull
Clément Fauconnier 6 years ago
parent d0c43bb1a7
commit b608118fad
  1. 17
      resources/forms/documents.ui
  2. 12
      src/document/UBDocumentController.cpp

@ -34,6 +34,12 @@
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QSplitter" name="splitter">
<property name="minimumSize">
<size>
<width>400</width>
<height>0</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -43,6 +49,9 @@
<property name="handleWidth">
<number>6</number>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<widget class="QWidget" name="topLeftWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
@ -83,17 +92,17 @@
</property>
<item>
<property name="text">
<string>Creation date</string>
<string>Alphabetical order</string>
</property>
</item>
<item>
<property name="text">
<string>Update date</string>
<string>Creation date</string>
</property>
</item>
<item>
<property name="text">
<string>Alphabetical order</string>
<string>Update date</string>
</property>
</item>
</widget>
@ -104,7 +113,7 @@
<widget class="UBDocumentTreeView" name="documentTreeView">
<property name="minimumSize">
<size>
<width>400</width>
<width>0</width>
<height>0</height>
</size>
</property>

@ -93,6 +93,8 @@ static bool lessThan(UBDocumentTreeNode *lValue, UBDocumentTreeNode *rValue)
return false;
}
UBDocumentReplaceDialog::UBDocumentReplaceDialog(const QString &pIncommingName, const QStringList &pFileList, QWidget *parent, Qt::WindowFlags pFlags)
: QDialog(parent, pFlags)
, mFileNameList(pFileList)
@ -1991,6 +1993,12 @@ void UBDocumentController::setupViews()
mDocumentUI->documentTreeView->header()->setSectionResizeMode(1, 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(2);
@ -2804,14 +2812,14 @@ bool UBDocumentController::isOKToOpenDocument(UBDocumentProxy* proxy)
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.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;
}
else
{
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(docVersion)))
{

Loading…
Cancel
Save