2012-02-20 21:47:14 +00:00
|
|
|
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
|
2009-02-01 00:08:08 +00:00
|
|
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
|
|
|
|
#ifndef __GROUPCOMBOBOX_HH_INCLUDED__
|
|
|
|
#define __GROUPCOMBOBOX_HH_INCLUDED__
|
|
|
|
|
|
|
|
#include <QComboBox>
|
2009-05-10 11:49:14 +00:00
|
|
|
#include <QAction>
|
2009-02-01 00:08:08 +00:00
|
|
|
#include "instances.hh"
|
|
|
|
|
|
|
|
/// This is a combo box which is for choosing the dictionary group
|
|
|
|
class GroupComboBox: public QComboBox
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
GroupComboBox( QWidget * parent );
|
|
|
|
|
|
|
|
/// Fills combo-box with the given groups
|
|
|
|
void fill( Instances::Groups const & );
|
2009-02-06 17:04:11 +00:00
|
|
|
|
|
|
|
/// Chooses the given group in the combobox. If there's no such group,
|
|
|
|
/// does nothing.
|
2009-04-10 12:48:40 +00:00
|
|
|
void setCurrentGroup( unsigned id );
|
|
|
|
|
2010-07-05 14:13:29 +00:00
|
|
|
|
2009-04-10 12:48:40 +00:00
|
|
|
/// Returns current group.
|
|
|
|
unsigned getCurrentGroup() const;
|
2010-07-05 14:13:29 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
/// We handle shortcut events here.
|
|
|
|
virtual bool event( QEvent * event );
|
|
|
|
|
2009-05-10 11:49:14 +00:00
|
|
|
private slots:
|
|
|
|
|
|
|
|
void popupGroups();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
QAction popupAction;
|
2010-07-05 14:13:29 +00:00
|
|
|
QMap< int, int > shortcuts;
|
2009-02-01 00:08:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|