2014-02-28 12:36:28 +00:00
|
|
|
#ifndef __DICTHEADWORDS_H_INCLUDED__
|
|
|
|
#define __DICTHEADWORDS_H_INCLUDED__
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QSet>
|
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
|
|
|
#include <QStringListModel>
|
|
|
|
#include <QSortFilterProxyModel>
|
2014-06-24 13:55:06 +00:00
|
|
|
#include <QAction>
|
2014-02-28 12:36:28 +00:00
|
|
|
|
|
|
|
#include "config.hh"
|
|
|
|
#include "ui_dictheadwords.h"
|
|
|
|
#include "dictionary.hh"
|
|
|
|
#include "delegate.hh"
|
2014-06-24 13:55:06 +00:00
|
|
|
#include "helpwindow.hh"
|
2014-02-28 12:36:28 +00:00
|
|
|
|
|
|
|
class DictHeadwords : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit DictHeadwords( QWidget * parent, Config::Class & cfg_,
|
2015-03-23 15:58:49 +00:00
|
|
|
Dictionary::Class * dict_ );
|
2014-02-28 12:36:28 +00:00
|
|
|
virtual ~DictHeadwords();
|
|
|
|
|
2014-03-03 13:46:41 +00:00
|
|
|
void setup( Dictionary::Class * dict_ );
|
2014-02-28 12:36:28 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
Config::Class & cfg;
|
|
|
|
Dictionary::Class * dict;
|
2022-05-05 12:59:50 +00:00
|
|
|
QStringList headers;
|
|
|
|
QStringListModel * model;
|
2014-02-28 12:36:28 +00:00
|
|
|
QSortFilterProxyModel * proxy;
|
|
|
|
WordListItemDelegate * delegate;
|
2014-11-17 14:37:19 +00:00
|
|
|
QString dictId;
|
2014-02-28 12:36:28 +00:00
|
|
|
|
2014-06-24 13:55:06 +00:00
|
|
|
QAction helpAction;
|
|
|
|
|
2014-02-28 12:36:28 +00:00
|
|
|
void saveHeadersToFile();
|
2014-03-04 17:38:47 +00:00
|
|
|
bool eventFilter( QObject * obj, QEvent * ev );
|
2014-02-28 12:36:28 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::DictHeadwords ui;
|
|
|
|
private slots:
|
2014-03-03 13:46:41 +00:00
|
|
|
void savePos();
|
2014-02-28 12:36:28 +00:00
|
|
|
void filterChangedInternal();
|
|
|
|
void filterChanged();
|
|
|
|
void exportButtonClicked();
|
|
|
|
void okButtonClicked();
|
|
|
|
void itemClicked( const QModelIndex & index );
|
|
|
|
void autoApplyStateChanged( int state );
|
|
|
|
void showHeadwordsNumber();
|
2014-03-03 13:46:41 +00:00
|
|
|
virtual void reject();
|
2014-06-24 13:55:06 +00:00
|
|
|
void helpRequested();
|
2014-02-28 12:36:28 +00:00
|
|
|
|
|
|
|
signals:
|
2014-11-17 14:37:19 +00:00
|
|
|
void headwordSelected( QString const &, QString const & );
|
2014-03-03 13:46:41 +00:00
|
|
|
void closeDialog();
|
2014-02-28 12:36:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __DICTHEADWORDS_H_INCLUDED__
|