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_,
|
|
|
|
Dictionary::Class * dict_ );
|
|
|
|
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;
|
|
|
|
QStringList headers;
|
|
|
|
QStringListModel * model;
|
|
|
|
QSortFilterProxyModel * proxy;
|
|
|
|
WordListItemDelegate * delegate;
|
|
|
|
|
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:
|
|
|
|
void headwordSelected( QString const & );
|
2014-03-03 13:46:41 +00:00
|
|
|
void closeDialog();
|
2014-02-28 12:36:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __DICTHEADWORDS_H_INCLUDED__
|