2010-11-14 15:47:03 +00:00
|
|
|
/* This file is (c) 2008-2011 Konstantin Isakov <ikm@users.berlios.de>
|
2009-01-28 20:55:45 +00:00
|
|
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
|
|
|
|
#ifndef __GROUPS_HH_INCLUDED__
|
|
|
|
#define __GROUPS_HH_INCLUDED__
|
|
|
|
|
|
|
|
#include "ui_groups.h"
|
|
|
|
#include "config.hh"
|
|
|
|
#include "dictionary.hh"
|
|
|
|
#include "groups_widgets.hh"
|
|
|
|
#include <QToolButton>
|
|
|
|
|
2009-04-30 15:29:03 +00:00
|
|
|
class Groups: public QWidget
|
2009-01-28 20:55:45 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
Groups( QWidget * parent,
|
|
|
|
std::vector< sptr< Dictionary::Class > > const &,
|
2009-05-18 18:01:50 +00:00
|
|
|
Config::Groups const &,
|
|
|
|
Config::Group const & order );
|
|
|
|
|
2010-05-08 14:01:59 +00:00
|
|
|
/// Instructs the dialog to position itself on editing the given group.
|
|
|
|
void editGroup( unsigned id );
|
|
|
|
|
2009-05-18 18:01:50 +00:00
|
|
|
/// Should be called when the dictionary order has changed to reflect on
|
|
|
|
/// that changes. It would only do anything if the order has actually
|
|
|
|
/// changed.
|
|
|
|
void updateDictionaryOrder( Config::Group const & order );
|
2009-01-28 20:55:45 +00:00
|
|
|
|
|
|
|
Config::Groups getGroups() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::Groups ui;
|
|
|
|
std::vector< sptr< Dictionary::Class > > const & dicts;
|
|
|
|
Config::Groups groups;
|
|
|
|
|
|
|
|
// Reacts to the event that the number of groups is possibly changed
|
|
|
|
void countChanged();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void addNew();
|
|
|
|
void renameCurrent();
|
|
|
|
void removeCurrent();
|
2009-04-29 23:32:42 +00:00
|
|
|
void removeAll();
|
2009-05-02 17:12:52 +00:00
|
|
|
void addToGroup();
|
|
|
|
void removeFromGroup();
|
2010-09-16 18:50:31 +00:00
|
|
|
void addAutoGroups();
|
2009-01-28 20:55:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|