Skip to content
Snippets Groups Projects
Commit d6b67fb2 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Reorganized Options dialog into categories and tabs

Instead of using a tree based options hierarchy.

Task-number: QTCREATORBUG-954
Reviewed-by: Friedemann Kleint
parent 510cae20
No related branches found
No related tags found
No related merge requests found
...@@ -32,13 +32,9 @@ ...@@ -32,13 +32,9 @@
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include "icore.h" #include "icore.h"
#include <utils/qtcassert.h>
#include <utils/filterlineedit.h> #include <utils/filterlineedit.h>
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtGui/QHeaderView>
#include <QtGui/QStandardItemModel>
#include <QtGui/QStandardItem>
#include <QtGui/QSortFilterProxyModel> #include <QtGui/QSortFilterProxyModel>
#include <QtGui/QItemSelectionModel> #include <QtGui/QItemSelectionModel>
#include <QtGui/QHBoxLayout> #include <QtGui/QHBoxLayout>
...@@ -54,151 +50,148 @@ ...@@ -54,151 +50,148 @@
#include <QtGui/QLineEdit> #include <QtGui/QLineEdit>
#include <QtGui/QFrame> #include <QtGui/QFrame>
#include <QtGui/QDialogButtonBox> #include <QtGui/QDialogButtonBox>
#include <QtGui/QTreeView> #include <QtGui/QListView>
#include <QtGui/QApplication> #include <QtGui/QApplication>
enum ItemType { CategoryItem, PageItem };
enum { TypeRole = Qt::UserRole + 1,
IndexRole = Qt::UserRole + 2,
PageRole = Qt::UserRole + 3 };
Q_DECLARE_METATYPE(Core::IOptionsPage*)
static const char categoryKeyC[] = "General/LastPreferenceCategory"; static const char categoryKeyC[] = "General/LastPreferenceCategory";
static const char pageKeyC[] = "General/LastPreferencePage"; static const char pageKeyC[] = "General/LastPreferencePage";
namespace Core { namespace Core {
namespace Internal { namespace Internal {
// Create item on either model or parent item // ----------- Category model
template<class Parent>
inline QStandardItem *createStandardItem(Parent *parent, struct Category {
const QString &text, QString id;
ItemType type = CategoryItem, QString displayName;
int index = -1, QList<IOptionsPage*> pages;
IOptionsPage *page = 0) int index;
QTabWidget *tabWidget;
};
class CategoryModel : public QAbstractListModel
{
public:
CategoryModel(QObject *parent = 0);
~CategoryModel();
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
void setPages(const QList<IOptionsPage*> &pages);
const QList<Category*> &categories() const { return m_categories; }
private:
Category *findCategoryById(const QString &id);
QList<Category*> m_categories;
};
CategoryModel::CategoryModel(QObject *parent)
: QAbstractListModel(parent)
{ {
QStandardItem *rc = new QStandardItem(text);
rc->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable);
rc->setData(QVariant(int(type)), TypeRole);
rc->setData(QVariant(index), IndexRole);
rc->setData(qVariantFromValue(page), PageRole);
parent->appendRow(rc);
return rc;
} }
static inline ItemType itemTypeOfItem(const QStandardItem *item) CategoryModel::~CategoryModel()
{ {
return static_cast<ItemType>(item->data(TypeRole).toInt()); qDeleteAll(m_categories);
} }
static inline ItemType itemTypeOfItem(const QAbstractItemModel *model, const QModelIndex &index) int CategoryModel::rowCount(const QModelIndex &parent) const
{ {
return static_cast<ItemType>(model->data(index, TypeRole).toInt()); return parent.isValid() ? 0 : m_categories.size();
} }
static inline int indexOfItem(const QStandardItem *item) QVariant CategoryModel::data(const QModelIndex &index, int role) const
{ {
return item->data(IndexRole).toInt(); switch (role) {
case Qt::DisplayRole:
return m_categories.at(index.row())->displayName;
}
return QVariant();
} }
static inline IOptionsPage *pageOfItem(const QStandardItem *item) void CategoryModel::setPages(const QList<IOptionsPage*> &pages)
{ {
return qvariant_cast<IOptionsPage *>(item->data(PageRole)); // Clear any previous categories
qDeleteAll(m_categories);
m_categories.clear();
// Put the pages in categories
foreach (IOptionsPage *page, pages) {
const QString &categoryId = page->category();
Category *category = findCategoryById(categoryId);
if (!category) {
category = new Category;
category->id = categoryId;
category->displayName = page->displayCategory();
category->pages.append(page);
m_categories.append(category);
} else {
category->pages.append(page);
}
}
reset();
} }
static inline IOptionsPage *pageOfItem(const QAbstractItemModel *model, const QModelIndex &index) Category *CategoryModel::findCategoryById(const QString &id)
{ {
return qvariant_cast<IOptionsPage *>(model->data(index, PageRole)); for (int i = 0; i < m_categories.size(); ++i) {
Category *category = m_categories.at(i);
if (category->id == id)
return category;
}
return 0;
} }
// A filter model that returns true for the parent (category) nodes // ----------- Category filter model
// (which by default do not match the search string and are thus collapsed)
// and additionally checks IOptionsPage::matches(). /**
class PageFilterModel : public QSortFilterProxyModel { * A filter model that returns true for each category node that has pages that
* match the search string.
*/
class CategoryFilterModel : public QSortFilterProxyModel
{
public: public:
explicit PageFilterModel(QObject *parent = 0) : QSortFilterProxyModel(parent) {} explicit CategoryFilterModel(QObject *parent = 0)
: QSortFilterProxyModel(parent)
{}
protected: protected:
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
}; };
bool PageFilterModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const bool CategoryFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
{ {
if (!source_parent.isValid())
return true; // Always true for parents/categories.
// Regular contents check, then check page-filter. // Regular contents check, then check page-filter.
if (QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent)) if (QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent))
return true; return true;
if (const IOptionsPage *page = pageOfItem(sourceModel(), source_parent.child(source_row, 0))) {
const CategoryModel *cm = static_cast<CategoryModel*>(sourceModel());
foreach (const IOptionsPage *page, cm->categories().at(sourceRow)->pages) {
const QString pattern = filterRegExp().pattern(); const QString pattern = filterRegExp().pattern();
return page->displayCategory().contains(pattern, Qt::CaseInsensitive) || if (page->displayCategory().contains(pattern, Qt::CaseInsensitive)
page->matches(pattern); || page->displayName().contains(pattern, Qt::CaseInsensitive)
|| page->matches(pattern))
return true;
} }
return false;
}
// Populate a model with pages. return false;
static QStandardItemModel *pageModel(const QList<IOptionsPage*> &pages,
QObject *parent,
const QString &initialCategory,
const QString &initialPageId,
QModelIndex *initialIndex)
{
QStandardItemModel *model = new QStandardItemModel(0, 1, parent);
const QChar hierarchySeparator = QLatin1Char('|');
int index = 0;
QMap<QString, QStandardItem *> categories;
foreach (IOptionsPage *page, pages) {
const QStringList categoriesId = page->category().split(hierarchySeparator);
const QStringList displayCategories = page->displayCategory().split(hierarchySeparator);
const int categoryDepth = categoriesId.size();
if (categoryDepth != displayCategories.size()) {
qWarning("Internal error: Hierarchy mismatch in settings page %s.", qPrintable(page->id()));
continue;
}
// Retrieve/Create parent items for nested categories "Cat1|Cat2|Cat3"
QString currentCategory = categoriesId.at(0);
QStandardItem *treeItem = categories.value(currentCategory, 0);
if (!treeItem) {
treeItem = createStandardItem(model, displayCategories.at(0), CategoryItem);
categories.insert(currentCategory, treeItem);
}
for (int cat = 1; cat < categoryDepth; cat++) {
const QString fullCategory = currentCategory + hierarchySeparator + categoriesId.at(cat);
treeItem = categories.value(fullCategory, 0);
if (!treeItem) {
QStandardItem *parentItem = categories.value(currentCategory);
QTC_ASSERT(parentItem, return model)
treeItem = createStandardItem(parentItem, displayCategories.at(cat), CategoryItem);
categories.insert(fullCategory, treeItem);
}
currentCategory = fullCategory;
}
// Append page item
QTC_ASSERT(treeItem, return model)
QStandardItem *item = createStandardItem(treeItem, page->displayName(), PageItem, index, page);
if (currentCategory == initialCategory && page->id() == initialPageId) {
*initialIndex = model->indexFromItem(item);
}
index++;
}
return model;
} }
// ----------- Pages tree view // ----------- Category list view
/** /**
* Special version of a QTreeView that has the width of the first column as * Special version of a QListView that has the width of the first column as
* minimum size. * minimum size.
*/ */
class PageTree : public QTreeView class CategoryListView : public QListView
{ {
public: public:
PageTree(QWidget *parent = 0) : QTreeView(parent) CategoryListView(QWidget *parent = 0) : QListView(parent)
{ {
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding);
} }
...@@ -230,12 +223,12 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId, ...@@ -230,12 +223,12 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId,
const QString &pageId) : const QString &pageId) :
QDialog(parent), QDialog(parent),
m_pages(sortedOptionsPages()), m_pages(sortedOptionsPages()),
m_proxyModel(new PageFilterModel), m_proxyModel(new CategoryFilterModel(this)),
m_model(0), m_model(new CategoryModel(this)),
m_applied(false), m_applied(false),
m_stackedLayout(new QStackedLayout), m_stackedLayout(new QStackedLayout),
m_filterLineEdit(new Utils::FilterLineEdit), m_filterLineEdit(new Utils::FilterLineEdit),
m_pageTree(new PageTree), m_categoryList(new CategoryListView),
m_headerLabel(new QLabel) m_headerLabel(new QLabel)
{ {
createGui(); createGui();
...@@ -245,6 +238,9 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId, ...@@ -245,6 +238,9 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId,
#else #else
setWindowTitle(tr("Options")); setWindowTitle(tr("Options"));
#endif #endif
m_model->setPages(m_pages);
QString initialCategory = categoryId; QString initialCategory = categoryId;
QString initialPage = pageId; QString initialPage = pageId;
if (initialCategory.isEmpty() && initialPage.isEmpty()) { if (initialCategory.isEmpty() && initialPage.isEmpty()) {
...@@ -253,23 +249,44 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId, ...@@ -253,23 +249,44 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId,
initialPage = settings->value(QLatin1String(pageKeyC), QVariant(QString())).toString(); initialPage = settings->value(QLatin1String(pageKeyC), QVariant(QString())).toString();
} }
// Create pages with title labels with a larger, bold font, left-aligned int initialCategoryIndex = -1;
// with the group boxes of the page. int initialPageIndex = -1;
foreach (IOptionsPage *page, m_pages)
m_stackedLayout->addWidget(page->createPage(0)); // Create the tab widgets with the pages in each category
const QList<Category*> &categories = m_model->categories();
for (int i = 0; i < categories.size(); ++i) {
Category *category = categories.at(i);
if (category->id == initialCategory)
initialCategoryIndex = i;
QTabWidget *tabWidget = new QTabWidget;
for (int j = 0; j < category->pages.size(); ++j) {
IOptionsPage *page = category->pages.at(j);
tabWidget->addTab(page->createPage(0), page->displayName());
if (initialCategoryIndex == i && page->id() == initialPage)
initialPageIndex = j;
}
connect(tabWidget, SIGNAL(currentChanged(int)),
this, SLOT(currentTabChanged(int)));
category->tabWidget = tabWidget;
category->index = m_stackedLayout->addWidget(tabWidget);
}
QModelIndex initialIndex;
m_model = pageModel(m_pages, 0, initialCategory, initialPage, &initialIndex);
m_proxyModel->setFilterKeyColumn(0);
m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
m_proxyModel->setSourceModel(m_model); m_proxyModel->setSourceModel(m_model);
m_pageTree->setModel(m_proxyModel); m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
m_pageTree->setSelectionMode(QAbstractItemView::SingleSelection); m_categoryList->setModel(m_proxyModel);
connect(m_pageTree->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), m_categoryList->setSelectionMode(QAbstractItemView::SingleSelection);
this, SLOT(currentChanged(QModelIndex,QModelIndex)));
if (initialIndex.isValid()) { connect(m_categoryList->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
const QModelIndex proxyIndex = m_proxyModel->mapFromSource(initialIndex); this, SLOT(currentChanged(QModelIndex)));
m_pageTree->selectionModel()->setCurrentIndex(proxyIndex, QItemSelectionModel::ClearAndSelect);
if (initialCategoryIndex != -1) {
const QModelIndex modelIndex = m_proxyModel->mapFromSource(m_model->index(initialCategoryIndex));
m_categoryList->setCurrentIndex(modelIndex);
if (initialPageIndex != -1)
categories.at(initialCategoryIndex)->tabWidget->setCurrentIndex(initialPageIndex);
} }
// The order of the slot connection matters here, the filter slot // The order of the slot connection matters here, the filter slot
...@@ -291,22 +308,15 @@ void SettingsDialog::createGui() ...@@ -291,22 +308,15 @@ void SettingsDialog::createGui()
m_headerLabel->setFont(headerLabelFont); m_headerLabel->setFont(headerLabelFont);
QHBoxLayout *headerHLayout = new QHBoxLayout; QHBoxLayout *headerHLayout = new QHBoxLayout;
const int leftMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) + const int leftMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin);
qApp->style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
headerHLayout->addSpacerItem(new QSpacerItem(leftMargin, 0, QSizePolicy::Fixed, QSizePolicy::Ignored)); headerHLayout->addSpacerItem(new QSpacerItem(leftMargin, 0, QSizePolicy::Fixed, QSizePolicy::Ignored));
headerHLayout->addWidget(m_headerLabel); headerHLayout->addWidget(m_headerLabel);
// Tree
m_pageTree->header()->setVisible(false);
m_stackedLayout->setMargin(0); m_stackedLayout->setMargin(0);
// Separator Line QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
QFrame *bottomLine = new QFrame; QDialogButtonBox::Apply |
bottomLine->setFrameShape(QFrame::HLine); QDialogButtonBox::Cancel);
bottomLine->setFrameShadow(QFrame::Sunken);
// Button box
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Apply|QDialogButtonBox::Cancel);
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply())); connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply()));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
...@@ -315,10 +325,9 @@ void SettingsDialog::createGui() ...@@ -315,10 +325,9 @@ void SettingsDialog::createGui()
QGridLayout *mainGridLayout = new QGridLayout; QGridLayout *mainGridLayout = new QGridLayout;
mainGridLayout->addWidget(m_filterLineEdit, 0, 0, 1, 1); mainGridLayout->addWidget(m_filterLineEdit, 0, 0, 1, 1);
mainGridLayout->addLayout(headerHLayout, 0, 1, 1, 1); mainGridLayout->addLayout(headerHLayout, 0, 1, 1, 1);
mainGridLayout->addWidget(m_pageTree, 1, 0, 2, 1); mainGridLayout->addWidget(m_categoryList, 1, 0, 1, 1);
mainGridLayout->addLayout(m_stackedLayout, 1, 1, 1, 1); mainGridLayout->addLayout(m_stackedLayout, 1, 1, 1, 1);
mainGridLayout->addWidget(bottomLine, 2, 1, 1, 1); mainGridLayout->addWidget(buttonBox, 2, 0, 1, 2);
mainGridLayout->addWidget(buttonBox, 3, 0, 1, 2);
mainGridLayout->setColumnStretch(0, 1); mainGridLayout->setColumnStretch(0, 1);
mainGridLayout->setColumnStretch(1, 4); mainGridLayout->setColumnStretch(1, 4);
setLayout(mainGridLayout); setLayout(mainGridLayout);
...@@ -328,80 +337,70 @@ SettingsDialog::~SettingsDialog() ...@@ -328,80 +337,70 @@ SettingsDialog::~SettingsDialog()
{ {
} }
void SettingsDialog::showPage(const QStandardItem *item) void SettingsDialog::showCategory(int index)
{ {
// Show a page item or recurse to the first page of a category Category *category = m_model->categories().at(index);
// if a category was hit.
switch (itemTypeOfItem(item)) { // Update current category and page
case PageItem: { m_currentCategory = category->id;
IOptionsPage *page = pageOfItem(item); const int currentTabIndex = category->tabWidget->currentIndex();
m_currentCategory = page->category(); if (currentTabIndex != -1) {
m_currentPage = page->id(); IOptionsPage *page = category->pages.at(currentTabIndex);
m_stackedLayout->setCurrentIndex(indexOfItem(item)); m_currentPage = page->id();
m_visitedPages.insert(page); m_visitedPages.insert(page);
m_headerLabel->setText(page->displayName());
}
break;
case CategoryItem:
if (const QStandardItem *child = item->child(0, 0))
showPage(child);
break;
} }
m_stackedLayout->setCurrentIndex(category->index);
m_headerLabel->setText(category->displayName);
updateEnabledTabs(category, m_filterLineEdit->text());
} }
void SettingsDialog::currentChanged(const QModelIndex & current, const QModelIndex & /*previous */) void SettingsDialog::updateEnabledTabs(Category *category, const QString &searchText)
{ {
if (current.isValid()) for (int i = 0; i < category->pages.size(); ++i) {
if (const QStandardItem *item = m_model->itemFromIndex(m_proxyModel->mapToSource(current))) const IOptionsPage *page = category->pages.at(i);
showPage(item); const bool enabled = searchText.isEmpty()
|| page->displayName().contains(searchText, Qt::CaseInsensitive)
|| page->matches(searchText);
category->tabWidget->setTabEnabled(i, enabled);
}
} }
// Helpers that recurse down the model to find a page. void SettingsDialog::currentChanged(const QModelIndex &current)
static QModelIndex findPage(const QModelIndex &root)
{ {
QTC_ASSERT(root.isValid(), return root) if (current.isValid())
const QAbstractItemModel *model = root.model(); showCategory(m_proxyModel->mapToSource(current).row());
// Found a page!
if (itemTypeOfItem(model, root) == PageItem)
return root;
// Recurse down category.
const int childCount = model->rowCount(root);
for (int c = 0; c < childCount; c++) {
const QModelIndex page = findPage(root.child(c, 0));
if (page.isValid())
return page;
}
return QModelIndex();
} }
static QModelIndex findPage(const QAbstractItemModel *model) void SettingsDialog::currentTabChanged(int index)
{ {
const QModelIndex invalid; if (index == -1)
// Traverse top categories return;
const int rootItemCount = model->rowCount(invalid);
for (int c = 0; c < rootItemCount; c++) { const QModelIndex modelIndex = m_proxyModel->mapToSource(m_categoryList->currentIndex());
const QModelIndex page = findPage(model->index(c, 0, invalid)); if (!modelIndex.isValid())
if (page.isValid()) return;
return page;
} // Remember the current tab and mark it as visited
return invalid; const Category *category = m_model->categories().at(modelIndex.row());
IOptionsPage *page = category->pages.at(index);
m_currentPage = page->id();
m_visitedPages.insert(page);
} }
void SettingsDialog::filter(const QString &text) void SettingsDialog::filter(const QString &text)
{ {
// Filter cleared, collapse all. // When there is no current index, select the first one when possible
if (text.isEmpty()) { if (!m_categoryList->currentIndex().isValid() && m_model->rowCount() > 0)
m_pageTree->collapseAll(); m_categoryList->setCurrentIndex(m_proxyModel->index(0, 0));
return;
} const QModelIndex currentIndex = m_proxyModel->mapToSource(m_categoryList->currentIndex());
// Expand match and select the first page. Note: This depends if (!currentIndex.isValid())
// on the order of slot invocation, needs to be done after filtering
if (!m_proxyModel->rowCount(QModelIndex()))
return; return;
m_pageTree->expandAll();
const QModelIndex firstVisiblePage = findPage(m_proxyModel); Category *category = m_model->categories().at(currentIndex.row());
if (firstVisiblePage.isValid()) updateEnabledTabs(category, text);
m_pageTree->selectionModel()->setCurrentIndex(firstVisiblePage, QItemSelectionModel::ClearAndSelect);
} }
void SettingsDialog::accept() void SettingsDialog::accept()
...@@ -430,7 +429,7 @@ void SettingsDialog::apply() ...@@ -430,7 +429,7 @@ void SettingsDialog::apply()
bool SettingsDialog::execDialog() bool SettingsDialog::execDialog()
{ {
m_pageTree->setFocus(); m_categoryList->setFocus();
m_applied = false; m_applied = false;
exec(); exec();
return m_applied; return m_applied;
...@@ -452,5 +451,5 @@ QSize SettingsDialog::sizeHint() const ...@@ -452,5 +451,5 @@ QSize SettingsDialog::sizeHint() const
return minimumSize(); return minimumSize();
} }
} } // namespace Internal
} } // namespace Core
...@@ -38,14 +38,10 @@ ...@@ -38,14 +38,10 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QModelIndex; class QModelIndex;
class QStandardItemModel;
class QStandardItem;
class QSortFilterProxyModel; class QSortFilterProxyModel;
class QStackedLayout; class QStackedLayout;
class QAbstractButton;
class QLineEdit;
class QLabel; class QLabel;
class QTreeView; class QListView;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Utils { namespace Utils {
...@@ -55,6 +51,9 @@ namespace Utils { ...@@ -55,6 +51,9 @@ namespace Utils {
namespace Core { namespace Core {
namespace Internal { namespace Internal {
class Category;
class CategoryModel;
class SettingsDialog : public QDialog class SettingsDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
...@@ -78,24 +77,26 @@ private slots: ...@@ -78,24 +77,26 @@ private slots:
void accept(); void accept();
void reject(); void reject();
void apply(); void apply();
void currentChanged(const QModelIndex &current, const QModelIndex &previous); void currentChanged(const QModelIndex &current);
void currentTabChanged(int);
void filter(const QString &text); void filter(const QString &text);
private: private:
void createGui(); void createGui();
void showPage(const QStandardItem *item); void showCategory(int index);
void updateEnabledTabs(Category *category, const QString &searchText);
const QList<Core::IOptionsPage*> m_pages; const QList<Core::IOptionsPage*> m_pages;
QSet<Core::IOptionsPage*> m_visitedPages; QSet<Core::IOptionsPage*> m_visitedPages;
QSortFilterProxyModel *m_proxyModel; QSortFilterProxyModel *m_proxyModel;
QStandardItemModel *m_model; CategoryModel *m_model;
bool m_applied; bool m_applied;
QString m_currentCategory; QString m_currentCategory;
QString m_currentPage; QString m_currentPage;
QStackedLayout *m_stackedLayout; QStackedLayout *m_stackedLayout;
Utils::FilterLineEdit *m_filterLineEdit; Utils::FilterLineEdit *m_filterLineEdit;
QTreeView *m_pageTree; QListView *m_categoryList;
QLabel *m_headerLabel; QLabel *m_headerLabel;
}; };
......
...@@ -317,7 +317,7 @@ FontSettingsPage::FontSettingsPage(const FormatDescriptions &fd, ...@@ -317,7 +317,7 @@ FontSettingsPage::FontSettingsPage(const FormatDescriptions &fd,
const QString &trCategory, const QString &trCategory,
QObject *parent) : QObject *parent) :
Core::IOptionsPage(parent), Core::IOptionsPage(parent),
d_ptr(new FontSettingsPagePrivate(fd, id, tr("Font & Colors"), category, trCategory)) d_ptr(new FontSettingsPagePrivate(fd, id, tr("Font && Colors"), category, trCategory))
{ {
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment