*******************************************************************************/
-//Created by Mateusz Półrola
+//! \file DictManagerWidget.h
+//! \brief Dictionary management widget
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
#ifndef DICTMANAGERWIDGET_H
#define DICTMANAGERWIDGET_H
#include <QtGui>
#include "../../includes/GUIInterface.h"
+
+//! Implements dictionaries management widget
+/*!
+ Shows list of loaded dictionaries and their states (active/inactive).
+ It allow to change dicts states, add new dict, remove selected one or
+ change settings of selected dict. All changes are saved automatically after
+ hiding of this widget.
+ */
class DictManagerWidget : public QWidget {
Q_OBJECT
public:
+ //! Constructor
+ /*!
+ \param parent parent of this widget, which must be subclass of
+ GUIInterface, because it will use it to get info about loaded plugins
+ and dicts.
+ */
explicit DictManagerWidget(GUIInterface *parent = 0);
protected:
void hideEvent(QHideEvent *e);
Q_SIGNALS:
+ //! Emited when hiding widget, it will save states of dictionaries
+ /*! \param list of only active dictionaries
+ */
void selectedDictionaries(QList<CommonDictInterface*>);
+
+ //! Emited when user wants to add new dictionary
+ /*! \param new dictionary returned by specyfic plugin dialog
+ */
void addDictionary(CommonDictInterface*);
+
+ //! Emited when user wants to remove dictionary
+ /*! \param dictionary which will be removed
+ */
void removeDictionary(CommonDictInterface*);
+
+
private Q_SLOTS:
+ /*! Shows plugin select dialog and then specific plugin add new dictionary
+ dialog, which will return new CommonDictInterface* object, which is
+ later passed as parameter of addDictionary signal*/
void addNewDictButtonClicked();
+
+ /*! Pass selected dictionary from list as parameter of removeDictionary
+ signal */
void removeButtonClicked();
void itemSelected(QListWidgetItem*);
+
+ /*! Shows plugin's settings dialog*/
void settingsButtonClicked();
private:
QHBoxLayout* buttonGroup;
QListWidget* dictListWidget;
+ //holds association between items on list and CommonDictInterface objects
QHash<QListWidgetItem*, CommonDictInterface*> dictsHash;
GUIInterface* guiInterface;