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. 27
      src/document/UBDocumentController.cpp
  7. 1
      src/document/UBDocumentController.h

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

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

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

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

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

@ -1991,8 +1991,6 @@ void UBDocumentController::setupViews()
int sortKind = UBSettings::settings()->documentSortKind->get().toInt(); int sortKind = UBSettings::settings()->documentSortKind->get().toInt();
int sortOrder = UBSettings::settings()->documentSortOrder->get().toInt(); int sortOrder = UBSettings::settings()->documentSortOrder->get().toInt();
sortDocuments(sortKind, sortOrder);
// update icon and button // update icon and button
mDocumentUI->sortKind->setCurrentIndex(sortKind); mDocumentUI->sortKind->setCurrentIndex(sortKind);
if (sortOrder == UBDocumentController::DESC) if (sortOrder == UBDocumentController::DESC)
@ -2020,6 +2018,8 @@ void UBDocumentController::setupViews()
//mDocumentUI->documentTreeView->hideColumn(1); //mDocumentUI->documentTreeView->hideColumn(1);
mDocumentUI->documentTreeView->hideColumn(2); mDocumentUI->documentTreeView->hideColumn(2);
sortDocuments(sortKind, sortOrder);
connect(mDocumentUI->sortKind, SIGNAL(activated(int)), this, SLOT(onSortKindChanged(int))); connect(mDocumentUI->sortKind, SIGNAL(activated(int)), this, SLOT(onSortKindChanged(int)));
connect(mDocumentUI->sortOrder, SIGNAL(toggled(bool)), this, SLOT(onSortOrderChanged(bool))); connect(mDocumentUI->sortOrder, SIGNAL(toggled(bool)), this, SLOT(onSortOrderChanged(bool)));
@ -2055,6 +2055,24 @@ void UBDocumentController::setupViews()
} }
//N/C - NNE - 20140403 //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) void UBDocumentController::sortDocuments(int kind, int order)
{ {
Qt::SortOrder sortOrder = Qt::AscendingOrder; Qt::SortOrder sortOrder = Qt::AscendingOrder;
@ -2074,6 +2092,11 @@ void UBDocumentController::sortDocuments(int kind, int order)
}else{ }else{
mSortFilterProxyModel->setSortRole(Qt::DisplayRole); mSortFilterProxyModel->setSortRole(Qt::DisplayRole);
mSortFilterProxyModel->sort(0, sortOrder); 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: public slots:
void createNewDocument(); void createNewDocument();
void refreshDateColumns();
//issue 1629 - NNE - 20131105 //issue 1629 - NNE - 20131105
void createNewDocumentInUntitledFolder(); void createNewDocumentInUntitledFolder();

Loading…
Cancel
Save