Options: Sort by category, id.

Separate category and trCategory and introduce sorting characters
to the categories. Same for id/name.
This commit is contained in:
Friedemann Kleint
2009-11-27 16:12:12 +01:00
parent f928145163
commit a8ac34c347
51 changed files with 262 additions and 123 deletions

View File

@@ -28,9 +28,11 @@
**************************************************************************/
#include "docsettingspage.h"
#include "helpconstants.h"
#include <QtGui/QFileDialog>
#include <QtGui/QMessageBox>
#include <QtCore/QCoreApplication>
#include <QtHelp/QHelpEngine>
using namespace Help::Internal;
@@ -43,7 +45,7 @@ DocSettingsPage::DocSettingsPage(QHelpEngine *helpEngine)
QString DocSettingsPage::id() const
{
return QLatin1String("Documentation");
return QLatin1String("B.Documentation");
}
QString DocSettingsPage::trName() const
@@ -51,15 +53,14 @@ QString DocSettingsPage::trName() const
return tr("Documentation");
}
QString DocSettingsPage::category() const
{
return QLatin1String("Help");
return QLatin1String(Help::Constants::HELP_CATEGORY);
}
QString DocSettingsPage::trCategory() const
{
return tr("Help");
return QCoreApplication::translate("Help", Help::Constants::HELP_TR_CATEGORY);
}
QWidget *DocSettingsPage::createPage(QWidget *parent)

View File

@@ -28,10 +28,13 @@
**************************************************************************/
#include "filtersettingspage.h"
#include "helpconstants.h"
#include "filternamedialog.h"
#include <QtGui/QFileDialog>
#include <QtGui/QMessageBox>
#include <QtCore/QCoreApplication>
#include <QtHelp/QHelpEngine>
using namespace Help::Internal;
@@ -43,7 +46,7 @@ FilterSettingsPage::FilterSettingsPage(QHelpEngine *helpEngine) :
QString FilterSettingsPage::id() const
{
return QLatin1String("Filters");
return QLatin1String("D.Filters");
}
QString FilterSettingsPage::trName() const
@@ -53,12 +56,12 @@ QString FilterSettingsPage::trName() const
QString FilterSettingsPage::category() const
{
return QLatin1String("Help");
return QLatin1String(Help::Constants::HELP_CATEGORY);
}
QString FilterSettingsPage::trCategory() const
{
return tr("Help");
return QCoreApplication::translate("Help", Help::Constants::HELP_TR_CATEGORY);
}
QWidget *FilterSettingsPage::createPage(QWidget *parent)

View File

@@ -28,6 +28,7 @@
**************************************************************************/
#include "generalsettingspage.h"
#include "helpconstants.h"
#include "bookmarkmanager.h"
#include "centralwidget.h"
@@ -40,6 +41,7 @@
#include <QtWebKit/QWebSettings>
#endif
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtGui/QFileDialog>
#include <QtHelp/QHelpEngine>
@@ -66,7 +68,7 @@ GeneralSettingsPage::GeneralSettingsPage(QHelpEngine *helpEngine,
QString GeneralSettingsPage::id() const
{
return QLatin1String("General settings");
return QLatin1String("A.General settings");
}
QString GeneralSettingsPage::trName() const
@@ -76,12 +78,12 @@ QString GeneralSettingsPage::trName() const
QString GeneralSettingsPage::category() const
{
return QLatin1String("Help");
return QLatin1String(Help::Constants::HELP_CATEGORY);
}
QString GeneralSettingsPage::trCategory() const
{
return tr("Help");
return QCoreApplication::translate("Help", Help::Constants::HELP_TR_CATEGORY);
}
QWidget *GeneralSettingsPage::createPage(QWidget *parent)

View File

@@ -11,6 +11,7 @@ DEFINES += QT_CLUCENE_SUPPORT \
HEADERS += helpplugin.h \
docsettingspage.h \
filtersettingspage.h \
helpconstants.h \
helpmode.h \
centralwidget.h \
searchwidget.h \

View File

@@ -0,0 +1,42 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef HELPCONSTANTS_H
#define HELPCONSTANTS_H
#include <QtCore/QtGlobal>
namespace Help {
namespace Constants {
const char * const HELP_CATEGORY = "H.Help";
const char * const HELP_TR_CATEGORY = QT_TRANSLATE_NOOP("Help", "Help");
}
}
#endif // HELPCONSTANTS_H