ShortcutsDialog.hpp   ShortcutsDialog.hpp 
skipping to change at line 31 skipping to change at line 31
#define SHORTCUTSDIALOG_HPP #define SHORTCUTSDIALOG_HPP
#include <QKeySequence> #include <QKeySequence>
#include <QModelIndex> #include <QModelIndex>
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
#include "StelDialog.hpp" #include "StelDialog.hpp"
class Ui_shortcutsDialogForm; class Ui_shortcutsDialogForm;
class ShortcutLineEdit; class ShortcutLineEdit;
class StelShortcut;
class StelShortcutGroup;
class StelShortcutMgr;
class QStandardItemModel; class QStandardItemModel;
class QStandardItem; class QStandardItem;
//! Custom filter class for filtering tree sub-items. //! Custom filter class for filtering tree sub-items.
//! (The standard QSortFilterProxyModel shows child items only if the //! (The standard QSortFilterProxyModel shows child items only if the
//! parent item matches the filter.) //! parent item matches the filter.)
class ShortcutsFilterModel : public QSortFilterProxyModel class ShortcutsFilterModel : public QSortFilterProxyModel
{ {
Q_OBJECT Q_OBJECT
skipping to change at line 58 skipping to change at line 55
protected: protected:
bool filterAcceptsRow(int source_row, bool filterAcceptsRow(int source_row,
const QModelIndex &source_parent) const; const QModelIndex &source_parent) const;
}; };
class ShortcutsDialog : public StelDialog class ShortcutsDialog : public StelDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
ShortcutsDialog(); ShortcutsDialog(QObject* parent);
~ShortcutsDialog(); ~ShortcutsDialog();
//! higlight items that have collisions with current lineEdits' stat e according to css. //! higlight items that have collisions with current lineEdits' stat e according to css.
//! Note: previous collisions aren't redrawn. //! Note: previous collisions aren't redrawn.
void drawCollisions(); void drawCollisions();
public slots: public slots:
//! restore colors of all items it TreeWidget to defaults. //! restore colors of all items it TreeWidget to defaults.
void resetCollisions(); void resetCollisions();
void retranslate(); void retranslate();
//! ititialize editors state when current item changed. //! ititialize editors state when current item changed.
void initEditors(); void initEditors();
//! checks whether one QKeySequence is prefix of another. //! checks whether one QKeySequence is prefix of another.
bool prefixMatchKeySequence(const QKeySequence &ks1, const QKeySeque nce &ks2); bool prefixMatchKeySequence(const QKeySequence &ks1, const QKeySeque nce &ks2);
//! Compile a list of items that share a prefix with this sequence. //! Compile a list of items that share a prefix with this sequence.
QList<QStandardItem*> findCollidingItems(QKeySequence ks); QList<QStandardItem*> findCollidingItems(QKeySequence ks);
void handleCollisions(ShortcutLineEdit* currentEdit); void handleCollisions(ShortcutLineEdit* currentEdit);
//! called when editors' state changed. //! called when editors' state changed.
void handleChanges(); void handleChanges();
//! called when apply button clicked. //! called when apply button clicked.
void applyChanges() const; void applyChanges();
//! called by doubleclick; if click is on editable item, switch to e ditors //! called by doubleclick; if click is on editable item, switch to e ditors
void switchToEditors(const QModelIndex& index); void switchToEditors(const QModelIndex& index);
//! update shortcut representation in tree correspondingly to its ac tual contents. //! update shortcut representation in tree correspondingly to its ac tual contents.
//! if no item is specified, search for it in tree, if no items foun d, create new item //! if no item is specified, search for it in tree, if no items foun d, create new item
void updateShortcutsItem(StelShortcut* shortcut, QStandardItem* shor tcutItem = NULL); void updateShortcutsItem(class StelAction* action, QStandardItem* sh ortcutItem = NULL);
void restoreDefaultShortcuts(); void restoreDefaultShortcuts();
void updateTreeData(); void updateTreeData();
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();
private: private:
//! checks whether given item can be changed by editors. //! checks whether given item can be changed by editors.
static bool itemIsEditable(QStandardItem *item); static bool itemIsEditable(QStandardItem *item);
//! Concatenate the header, key codes and footer to build //! Concatenate the header, key codes and footer to build
//! up the help text. //! up the help text.
//! @todo FIXME: This does nothing? //! @todo FIXME: This does nothing?
void updateText(); void updateText();
//! Apply style changes. //! Apply style changes.
//! See http://qt-project.org/faq/answer/how_can_my_stylesheet_accou nt_for_custom_properties //! See http://qt-project.org/faq/answer/how_can_my_stylesheet_accou nt_for_custom_properties
void polish(); void polish();
QStandardItem* updateGroup(StelShortcutGroup* group); QStandardItem* updateGroup(const QString& group);
//! search for first appearence of item with requested data. //! search for first appearence of item with requested data.
QStandardItem* findItemByData(QVariant value, int role, int column = 0); QStandardItem* findItemByData(QVariant value, int role, int column = 0);
//! pointer to mgr, for not getting it from stelapp every time. //! pointer to mgr, for not getting it from stelapp every time.
StelShortcutMgr* shortcutMgr; class StelActionMgr* actionMgr;
//! list for storing collisions items, so we can easy restore their colors. //! list for storing collisions items, so we can easy restore their colors.
QList<QStandardItem*> collisionItems; QList<QStandardItem*> collisionItems;
Ui_shortcutsDialogForm *ui; Ui_shortcutsDialogForm *ui;
ShortcutsFilterModel* filterModel; ShortcutsFilterModel* filterModel;
QStandardItemModel* mainModel; QStandardItemModel* mainModel;
//! Initialize or reset the main model. //! Initialize or reset the main model.
void resetModel(); void resetModel();
//! Set the main model's column lables. //! Set the main model's column lables.
 End of changes. 6 change blocks. 
8 lines changed or deleted 5 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/