added a preference in the display tab to show/hide the date column on alphabetical sort

preferencesAboutTextFull
Clément Fauconnier 5 years ago
parent 8ef272db0a
commit 1e78d64d0a
  1. 1
      resources/etc/OpenBoard.config
  2. 348
      resources/forms/preferences.ui
  3. 8
      src/core/UBPreferencesController.cpp
  4. 2
      src/core/UBSettings.cpp
  5. 2
      src/core/UBSettings.h
  6. 29
      src/document/UBDocumentController.cpp
  7. 1
      src/document/UBDocumentController.h

@ -92,6 +92,7 @@ SortKind=0
SortOrder=0
SplitterLeftSize=200
SplitterRightSize=800
ShowDateColumnOnAlphabeticalSort=false
[IntranetPodcast]
Author=

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>825</width>
<height>718</height>
<height>748</height>
</rect>
</property>
<property name="windowTitle">
@ -82,7 +82,7 @@
<item row="1" column="0">
<widget class="QTabWidget" name="mainTabWidget">
<property name="currentIndex">
<number>7</number>
<number>0</number>
</property>
<widget class="QWidget" name="displayTab">
<attribute name="title">
@ -148,8 +148,21 @@
</layout>
</widget>
</item>
<item row="8" column="0">
<widget class="QGroupBox" name="toolbarGroupBox">
<item row="14" column="0">
<spacer name="modeSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="15" column="0">
<widget class="QGroupBox" name="modeGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -157,36 +170,56 @@
</sizepolicy>
</property>
<property name="title">
<string>Toolbar</string>
<string>Mode</string>
</property>
<layout class="QGridLayout" name="gridLayout_9">
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_10">
<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="QRadioButton" name="toolbarAtTopRadioButton">
<widget class="QLabel" name="modeLabel">
<property name="text">
<string>Positioned at the Top (recommended for tablets)</string>
<string>Mode to start in:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="toolbarAtBottomRadioButton">
<property name="text">
<string>Positioned at the Bottom (recommended for white boards)</string>
</property>
<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="2" column="0">
<spacer name="verticalSpacer">
<item row="0" column="2">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<width>40</width>
<height>20</height>
</size>
</property>
@ -194,45 +227,6 @@
</item>
</layout>
</item>
<item row="0" column="0">
<spacer name="toolbarLSpacer">
<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="2">
<spacer name="toolbarRSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="toolbarDisplayTextCheckBox">
<property name="text">
<string>Display Text Under Button</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -338,75 +332,6 @@
</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="13" column="0">
<widget class="QGroupBox" name="keyboardGroupBox">
<property name="sizePolicy">
@ -472,14 +397,11 @@
</layout>
</widget>
</item>
<item row="9" column="0">
<spacer name="keyboardSpacer">
<item row="7" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
@ -488,20 +410,95 @@
</property>
</spacer>
</item>
<item row="3" column="0">
<spacer name="toolbarSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="8" column="0">
<widget class="QGroupBox" name="toolbarGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
<property name="title">
<string>Toolbar</string>
</property>
</spacer>
<layout class="QGridLayout" name="gridLayout_9">
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_10">
<item row="0" column="0">
<widget class="QRadioButton" name="toolbarAtTopRadioButton">
<property name="text">
<string>Positioned at the Top (recommended for tablets)</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="toolbarAtBottomRadioButton">
<property name="text">
<string>Positioned at the Bottom (recommended for white boards)</string>
</property>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="0" column="0">
<spacer name="toolbarLSpacer">
<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="2">
<spacer name="toolbarRSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="toolbarDisplayTextCheckBox">
<property name="text">
<string>Display Text Under Button</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="16" column="0">
<item row="17" column="0">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -514,11 +511,14 @@
</property>
</spacer>
</item>
<item row="7" column="0">
<spacer name="verticalSpacer_3">
<item row="9" column="0">
<spacer name="keyboardSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
@ -527,8 +527,8 @@
</property>
</spacer>
</item>
<item row="14" column="0">
<spacer name="modeSpacer">
<item row="3" column="0">
<spacer name="toolbarSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -540,6 +540,54 @@
</property>
</spacer>
</item>
<item row="16" column="0">
<widget class="QGroupBox" name="documentsGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Documents Mode</string>
</property>
<layout class="QGridLayout" name="gridLayout_19">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_18">
<item row="0" column="1">
<widget class="QCheckBox" name="showDateColumnOnAlphabeticalSort">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Display date column on alphabetical sort</string>
</property>
</widget>
</item>
<item row="0" column="0">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="gridTab">

@ -39,6 +39,7 @@
#include "core/UBDisplayManager.h"
#include "board/UBBoardController.h"
#include "document/UBDocumentController.h"
#include "domain/UBGraphicsScene.h"
#include "board/UBDrawingController.h"
#include "podcast/UBPodcastController.h"
@ -137,6 +138,9 @@ void UBPreferencesController::wire()
connect(mPreferencesUI->useSystemOSKCheckBox, SIGNAL(clicked(bool)), settings->useSystemOnScreenKeyboard, SLOT(setBool(bool)));
connect(mPreferencesUI->useSystemOSKCheckBox, SIGNAL(clicked(bool)), this, SLOT(systemOSKCheckBoxToggled(bool)));
connect(mPreferencesUI->showDateColumnOnAlphabeticalSort, SIGNAL(clicked(bool)), settings->showDateColumnOnAlphabeticalSort, SLOT(setBool(bool)));
connect(mPreferencesUI->showDateColumnOnAlphabeticalSort, SIGNAL(clicked(bool)), UBApplication::documentController, SLOT(refreshDateColumns()));
connect(mPreferencesUI->keyboardPaletteKeyButtonSize, SIGNAL(currentIndexChanged(const QString &)), settings->boardKeyboardPaletteKeyBtnSize, SLOT(setString(const QString &)));
connect(mPreferencesUI->startModeComboBox, SIGNAL(currentIndexChanged(int)), settings->appStartMode, SLOT(setInt(int)));
@ -274,6 +278,8 @@ void UBPreferencesController::init()
mPreferencesUI->useSystemOSKCheckBox->setChecked(settings->useSystemOnScreenKeyboard->get().toBool());
this->systemOSKCheckBoxToggled(mPreferencesUI->useSystemOSKCheckBox->isChecked());
mPreferencesUI->showDateColumnOnAlphabeticalSort->setChecked(settings->showDateColumnOnAlphabeticalSort->get().toBool());
mPreferencesUI->startModeComboBox->setCurrentIndex(settings->appStartMode->get().toInt());
mPreferencesUI->useExternalBrowserCheckBox->setChecked(settings->webUseExternalBrowser->get().toBool());
@ -338,6 +344,8 @@ void UBPreferencesController::defaultSettings()
mPreferencesUI->startModeComboBox->setCurrentIndex(0);
mPreferencesUI->useSystemOSKCheckBox->setChecked(settings->useSystemOnScreenKeyboard->reset().toBool());
mPreferencesUI->showDateColumnOnAlphabeticalSort->setChecked(settings->showDateColumnOnAlphabeticalSort->reset().toBool());
UBApplication::documentController->refreshDateColumns();
}
else if (mPreferencesUI->mainTabWidget->currentWidget() == mPreferencesUI->penTab)
{

@ -458,6 +458,8 @@ void UBSettings::init()
useSystemOnScreenKeyboard = new UBSetting(this, "App", "UseSystemOnScreenKeyboard", true);
showDateColumnOnAlphabeticalSort = new UBSetting(this, "Document", "ShowDateColumnOnAlphabeticalSort", false);
cleanNonPersistentSettings();
checkNewSettings();
}

@ -413,6 +413,8 @@ class UBSettings : public QObject
UBSetting* useSystemOnScreenKeyboard;
UBSetting* showDateColumnOnAlphabeticalSort;
UBSetting* magnifierDrawingMode;
UBSetting* autoSaveInterval;

@ -1989,9 +1989,7 @@ void UBDocumentController::setupViews()
// sort documents according to preferences
int sortKind = UBSettings::settings()->documentSortKind->get().toInt();
int sortOrder = UBSettings::settings()->documentSortOrder->get().toInt();
sortDocuments(sortKind, sortOrder);
int sortOrder = UBSettings::settings()->documentSortOrder->get().toInt();
// update icon and button
mDocumentUI->sortKind->setCurrentIndex(sortKind);
@ -2020,6 +2018,8 @@ void UBDocumentController::setupViews()
//mDocumentUI->documentTreeView->hideColumn(1);
mDocumentUI->documentTreeView->hideColumn(2);
sortDocuments(sortKind, sortOrder);
connect(mDocumentUI->sortKind, SIGNAL(activated(int)), this, SLOT(onSortKindChanged(int)));
connect(mDocumentUI->sortOrder, SIGNAL(toggled(bool)), this, SLOT(onSortOrderChanged(bool)));
@ -2055,6 +2055,24 @@ void UBDocumentController::setupViews()
}
//N/C - NNE - 20140403
void UBDocumentController::refreshDateColumns()
{
if (UBSettings::settings()->documentSortKind->get().toInt() == UBDocumentController::Alphabetical)
{
if (!UBSettings::settings()->showDateColumnOnAlphabeticalSort->get().toBool())
{
mDocumentUI->documentTreeView->hideColumn(1);
mDocumentUI->documentTreeView->hideColumn(2);
}
else
{
mDocumentUI->documentTreeView->showColumn(1);
mDocumentUI->documentTreeView->hideColumn(2);
}
}
}
void UBDocumentController::sortDocuments(int kind, int order)
{
Qt::SortOrder sortOrder = Qt::AscendingOrder;
@ -2074,6 +2092,11 @@ void UBDocumentController::sortDocuments(int kind, int order)
}else{
mSortFilterProxyModel->setSortRole(Qt::DisplayRole);
mSortFilterProxyModel->sort(0, sortOrder);
if (!UBSettings::settings()->showDateColumnOnAlphabeticalSort->get().toBool())
{
mDocumentUI->documentTreeView->hideColumn(1);
mDocumentUI->documentTreeView->hideColumn(2);
}
}
}

@ -429,6 +429,7 @@ class UBDocumentController : public UBDocumentContainer
public slots:
void createNewDocument();
void refreshDateColumns();
//issue 1629 - NNE - 20131105
void createNewDocumentInUntitledFolder();

Loading…
Cancel
Save