The threading model should be set from configure, not config.h.
[maemo-rb.git] / rbutil / rbutilqt / encttscfggui.h
blob9c3dbbecb2d403241a0bebc9e4cf42c01582d7b0
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
9 * Copyright (C) 2007 by Dominik Wenger
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
19 ****************************************************************************/
21 #ifndef ENCTTSCFGGUI_H
22 #define ENCTTSCFGGUI_H
24 #include <QtGui>
25 #include "encttssettings.h"
27 //! \brief Shows and manages a configuration gui for encoders and tts enignes
28 //!
29 class EncTtsCfgGui: public QDialog
31 Q_OBJECT
32 public:
33 //! Creates the UI. give it a endoer or tts engine with already set config. uses show() or exec() to show it.
34 EncTtsCfgGui(QDialog* parent, EncTtsSettingInterface* interface,QString name);
36 private slots:
37 //! accept current configuration values and close window
38 void accept(void);
39 //! close window and dont save configuration
40 void reject(void);
41 //! updates the corresponding setting from the sending Widget
42 void updateSetting();
43 //! updates corresponding Widget from the sending Setting.
44 void updateWidget();
45 //! shows a busy dialog. counts calls.
46 void showBusy();
47 //! hides the busy dialog, counts calls
48 void hideBusy();
49 //! used via the SignalMapper for all Browse buttons
50 void browse(QObject*);
52 private:
53 //! creates all dynamic window content
54 void setUpWindow();
55 //! creates the Widgets needed for one setting. returns a Layout with the widgets
56 QWidget* createWidgets(EncTtsSetting* setting);
57 //! creates a button when needed by the setting.
58 QWidget* createButton(EncTtsSetting* setting);
59 //! name of the Encoder or TTS for which this UI is
60 QString m_name;
61 //! the interface pointer to the TTS or encoder
62 EncTtsSettingInterface* m_settingInterface;
63 //! Dialog, shown when enc or tts is busy
64 QProgressDialog* m_busyDlg;
65 //! List of settings from the TTS or Encoder
66 QList<EncTtsSetting*> m_settingsList;
67 //! Maps settings and the correspondig Widget
68 QMap<EncTtsSetting*,QWidget*> m_settingsWidgetsMap;
69 //! Maps all browse buttons to the corresponding Setting
70 QSignalMapper m_browseBtnMap;
71 //! counter how often busyShow() is called,
72 int m_busyCnt;
76 #endif