tokenhelpdialog.h (krename-4.0.9) | : | tokenhelpdialog.h (krename-4.90.90) | ||
---|---|---|---|---|
skipping to change at line 18 | skipping to change at line 18 | |||
/*************************************************************************** | /*************************************************************************** | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify * | * This program is free software; you can redistribute it and/or modify * | |||
* it under the terms of the GNU General Public License as published by * | * it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
***************************************************************************/ | ***************************************************************************/ | |||
#ifndef _TOKEN_HELP_DIALOG_H_ | #ifndef TOKEN_HELP_DIALOG_H | |||
#define _TOKEN_HELP_DIALOG_H_ | #define TOKEN_HELP_DIALOG_H | |||
#include <kdialog.h> | #include <QDialog> | |||
#include "ui_tokenhelpwidget.h" | #include "ui_tokenhelpwidget.h" | |||
#include <KTreeWidgetSearchLineWidget> | ||||
class QLineEdit; | class QLineEdit; | |||
class QTreeWidgetItem; | class QTreeWidgetItem; | |||
class BatchRenamer; | class BatchRenamer; | |||
class KRenameModel; | class KRenameModel; | |||
class KRenameUnformattedWrappedModel; | class KRenameUnformattedWrappedModel; | |||
class TokenHelpDialog : public KDialog { | class TokenHelpDialog : public QDialog | |||
Q_OBJECT | { | |||
public: | Q_OBJECT | |||
TokenHelpDialog( KRenameModel* model, BatchRenamer* renamer, | public: | |||
QLineEdit* edit, QWidget* parent = NULL ); | TokenHelpDialog(KRenameModel *model, BatchRenamer *renamer, | |||
QLineEdit *edit, QWidget *parent = nullptr); | ||||
~TokenHelpDialog(); | ~TokenHelpDialog(); | |||
/** Adds a category to the help dialog. | /** Adds a category to the help dialog. | |||
* The category will be added and all its commands will also be added to th e "All" category. | * The category will be added and all its commands will also be added to th e "All" category. | |||
* | * | |||
* \param headline headline of the category | * \param headline headline of the category | |||
* \param commands list of all tokens | * \param commands list of all tokens | |||
* \param icon icon of the category | * \param icon icon of the category | |||
* \param first if true make sure that this is the first category (after al l) and is selected by | * \param first if true make sure that this is the first category (after al l) and is selected by | |||
* default. | * default. | |||
*/ | */ | |||
void add( const QString & headline, const QStringList & commands, const QPix map & icon, bool first = false ); | void add(const QString &headline, const QStringList &commands, const QPixmap &icon, bool first = false); | |||
/** | /** | |||
* Retrieve the separator between token and help | * Retrieve the separator between token and help | |||
* \returns the token separator | * \returns the token separator | |||
*/ | */ | |||
static const QString getTokenSeparator(); | static const QString getTokenSeparator(); | |||
public slots: | public Q_SLOTS: | |||
int exec(); | int exec(); | |||
private slots: | private Q_SLOTS: | |||
void slotInsert(); | void slotInsert(); | |||
void slotCategoryChanged( QTreeWidgetItem* item ); | void slotCategoryChanged(QTreeWidgetItem *item); | |||
void saveConfig(); | void saveConfig(); | |||
void slotEnableControls(); | void slotEnableControls(); | |||
void slotPreviewClicked(bool bPreview); | void slotPreviewClicked(bool bPreview); | |||
void slotUpdatePreview(); | void slotUpdatePreview(); | |||
private: | private: | |||
void loadConfig(); | void loadConfig(); | |||
/** | /** | |||
* Select a category by its name. | * Select a category by its name. | |||
* \param category user visible name of a category | * \param category user visible name of a category | |||
*/ | */ | |||
void selectCategory( const QString & category ); | void selectCategory(const QString &category); | |||
/** | /** | |||
* Add all tokens stored in the list | * Add all tokens stored in the list | |||
* m_recent to the list of tokens and to categories. | * m_recent to the list of tokens and to categories. | |||
*/ | */ | |||
void addRecentTokens(); | void addRecentTokens(); | |||
/** | /** | |||
* Add a token to the list of recent tokens. | * Add a token to the list of recent tokens. | |||
* \param token the token itself | * \param token the token itself | |||
* \param help the help string for the token | * \param help the help string for the token | |||
*/ | */ | |||
void addToRecentTokens( const QString & token, const QString & help ); | void addToRecentTokens(const QString &token, const QString &help); | |||
private: | private: | |||
KRenameUnformattedWrappedModel* m_model; | KRenameUnformattedWrappedModel *m_model; | |||
Ui::TokenHelpWidget m_widget; | Ui::TokenHelpWidget m_widget; | |||
QLineEdit* m_edit; | QLineEdit *m_edit; | |||
BatchRenamer* m_renamer; | BatchRenamer *m_renamer; | |||
QMap<QString,QStringList> m_map; | QMap<QString, QStringList> m_map; | |||
QString m_first; | QString m_first; | |||
QString m_lastSelected; | QString m_lastSelected; | |||
QStringList m_recent; | QStringList m_recent; | |||
static const int S_MAX_RECENT; ///< Maximum number of recent tokens | static const int S_MAX_RECENT; ///< Maximum number of recent tokens | |||
}; | }; | |||
#endif // _TOKEN_HELP_DIALOG_H_ | #endif // TOKEN_HELP_DIALOG_H | |||
End of changes. 15 change blocks. | ||||
21 lines changed or deleted | 23 lines changed or added |