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. 294
      resources/forms/preferences.ui
  3. 8
      src/core/UBPreferencesController.cpp
  4. 2
      src/core/UBSettings.cpp
  5. 2
      src/core/UBSettings.h
  6. 27
      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,54 +148,33 @@
</layout>
</widget>
</item>
<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="title">
<string>Toolbar</string>
</property>
<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">
<item row="14" column="0">
<spacer name="modeSpacer">
<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>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</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="toolbarLSpacer">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -210,14 +189,34 @@
</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="toolbarRSpacer">
<spacer name="horizontalSpacer_6">
<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>
@ -226,12 +225,7 @@
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="toolbarDisplayTextCheckBox">
<property name="text">
<string>Display Text Under Button</string>
</property>
</widget>
</layout>
</item>
</layout>
</widget>
@ -338,8 +332,8 @@
</layout>
</widget>
</item>
<item row="15" column="0">
<widget class="QGroupBox" name="modeGroupBox">
<item row="13" column="0">
<widget class="QGroupBox" name="keyboardGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -347,11 +341,32 @@
</sizepolicy>
</property>
<property name="title">
<string>Mode</string>
<string>Virtual Keyboard</string>
</property>
<layout class="QGridLayout" name="gridLayout_15">
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="1" colspan="2">
<layout class="QGridLayout" name="oskGridLayout">
<item row="3" column="1">
<widget class="QComboBox" name="keyboardPaletteKeyButtonSize"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="keyboardPaletteKeyButtonSize_Label">
<property name="text">
<string>Built-in virtual keyboard button size:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="useSystemOSKCheckBox">
<property name="text">
<string>Use system keyboard (recommended)</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<spacer name="horizontalSpacer_5">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -366,31 +381,8 @@
</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">
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -403,12 +395,23 @@
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="13" column="0">
<widget class="QGroupBox" name="keyboardGroupBox">
<item row="7" column="0">
<spacer name="verticalSpacer_3">
<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="8" column="0">
<widget class="QGroupBox" name="toolbarGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -416,32 +419,45 @@
</sizepolicy>
</property>
<property name="title">
<string>Virtual Keyboard</string>
<string>Toolbar</string>
</property>
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="1" colspan="2">
<layout class="QGridLayout" name="oskGridLayout">
<item row="3" column="1">
<widget class="QComboBox" name="keyboardPaletteKeyButtonSize"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="keyboardPaletteKeyButtonSize_Label">
<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>Built-in virtual keyboard button size:</string>
<string>Positioned at the Top (recommended for tablets)</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="useSystemOSKCheckBox">
<item row="1" column="0">
<widget class="QRadioButton" name="toolbarAtBottomRadioButton">
<property name="text">
<string>Use system keyboard (recommended)</string>
<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="horizontalSpacer">
<spacer name="toolbarLSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -456,11 +472,14 @@
</property>
</spacer>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<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>
@ -469,17 +488,21 @@
</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="9" column="0">
<spacer name="keyboardSpacer">
<item row="17" column="0">
<spacer name="verticalSpacer_7">
<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,11 +511,14 @@
</property>
</spacer>
</item>
<item row="3" column="0">
<spacer name="toolbarSpacer">
<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>
@ -501,8 +527,8 @@
</property>
</spacer>
</item>
<item row="16" column="0">
<spacer name="verticalSpacer_7">
<item row="3" column="0">
<spacer name="toolbarSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -514,33 +540,55 @@
</property>
</spacer>
</item>
<item row="7" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
<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="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
<property name="title">
<string>Documents Mode</string>
</property>
</spacer>
<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="14" column="0">
<spacer name="modeSpacer">
<item row="0" column="0">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="gridTab">
<attribute name="title">

@ -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;

@ -1991,8 +1991,6 @@ void UBDocumentController::setupViews()
int sortKind = UBSettings::settings()->documentSortKind->get().toInt();
int sortOrder = UBSettings::settings()->documentSortOrder->get().toInt();
sortDocuments(sortKind, sortOrder);
// update icon and button
mDocumentUI->sortKind->setCurrentIndex(sortKind);
if (sortOrder == UBDocumentController::DESC)
@ -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