HelpDialog.hpp   HelpDialog.hpp 
skipping to change at line 25 skipping to change at line 25
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _HELPDIALOG_HPP_ #ifndef _HELPDIALOG_HPP_
#define _HELPDIALOG_HPP_ #define _HELPDIALOG_HPP_
#include <QString> #include <QString>
#include <QObject> #include <QObject>
#include <QMultiMap>
#include <QPair> #include <QPair>
#include <QHash>
#include "StelDialog.hpp" #include "StelDialog.hpp"
class Ui_helpDialogForm; class Ui_helpDialogForm;
class QListWidgetItem; class QListWidgetItem;
class StelShortcutMgr;
typedef QPair<QString, QString> KeyDescription;
class HelpDialog : public StelDialog class HelpDialog : public StelDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
HelpDialog(); HelpDialog();
~HelpDialog(); ~HelpDialog();
//! Set a key and description.
//!
//! @note @a group and @a description must be in English; this funct
ion takes
//! care of translating them. Of course, they still have to be marke
d for
//! translation using the <tt>N_()</tt> macro.
//!
//! @param group is the help group. e.g. "Movement" or "Time & Date
"
//! @param oldKey is the textual representation of the old key bindi
ng (in the
//! case or re-mapping), e.g. "CTRL + H". Can be an empty st
ring
//! @param newKey is the textual representation of the key binding,
e.g. "CTRL + H"
//! @param description is a short description of what the key does
void setKey(QString group, QString oldKey, QString newKey, QString d
escription);
//! Notify that the application style changed //! Notify that the application style changed
void styleChanged(); void styleChanged();
public slots: public slots:
void retranslate(); void retranslate();
void updateIconsColor(); void updateIconsColor();
protected: protected:
//! Initialize the dialog widgets and connect the signals/slots //! Initialize the dialog widgets and connect the signals/slots
virtual void createDialogContent(); virtual void createDialogContent();
Ui_helpDialogForm* ui; Ui_helpDialogForm* ui;
private slots: private slots:
//! Slot that's called when the current tab changes. Updates log fil //! Show/bring to foreground the shortcut editor window.
e void showShortcutsWindow();
//! if Log tab is selected.
//! On tab change, if the Log tab is selected, call refreshLog().
void updateLog(int); void updateLog(int);
//! Sync the displayed log. //! Sync the displayed log.
void refreshLog(); void refreshLog();
void changePage(QListWidgetItem *current, QListWidgetItem *previous) ; void changePage(QListWidgetItem *current, QListWidgetItem *previous) ;
private: private:
//! Return the header text. //! Return the help text with keys description and external links.
QString getHeaderText(void); QString getHelpText(void);
//! Return the footer text.
QString getFooterText(void);
//! This function concatenates the header, key codes and footer to b uild //! This function concatenates the header, key codes and footer to b uild
//! up the help text. //! up the help text.
void updateText(void); void updateText(void);
//! This uses the group key description as the key to the map, and a StelShortcutMgr* keyMgr;
//! containing the helpGroup and description as the map value.
//! code and description.
QMultiMap<QString, QPair<QString, QString> > keyData;
//! A hash that maps some special keys to translatable strings.
QHash<QString, QString> specialKeys;
//! Sort function for qSort to compare QPair<QString,QString> values
.
//! This is used when displaying the hlp text to sort the items in a
group
//! by the key code (first item of the QPair)
static bool helpItemSort(const QPair<QString, QString>& p1, const QP
air<QString, QString>& p2);
//! Sort function for putting the Misc group at the end of the list
of groups
static bool helpGroupSort(const QString& s1, const QString& s2);
}; };
#endif /*_HELPDIALOG_HPP_*/ #endif /*_HELPDIALOG_HPP_*/
 End of changes. 7 change blocks. 
49 lines changed or deleted 10 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/