trunk 20080912
[gitenigma.git] / src / satconfig.h
blob6fbb288e8ae1c464e1f5c3e5bae16c2f68a1e373
1 #ifndef __satconfig_h
2 #define __satconfig_h
4 #include <list>
6 #include <scan.h>
7 #include <lib/gui/ebutton.h>
8 #include <lib/gui/combobox.h>
9 #include <lib/gui/enumber.h>
10 #include <lib/gui/multipage.h>
11 #include <lib/gui/listbox.h>
12 #include <lib/dvb/dvb.h>
14 class eFEStatusWidget;
15 class eTransponderWidget;
17 struct SatelliteEntry
19 eComboBox *sat, *voltage, *hilo;
20 eLabel *fixed, *description;
21 eButton *lnb;
24 class eSatelliteConfigurationManager: public eWindow
26 eTimer* refresh;
27 eWidget *buttonWidget;
28 eWidget *w_buttons;
29 eButton *button_close, *button_new, *button_erase;
30 eLabel *lSatPos, *lLNB, *l22Khz, *lVoltage;
31 eProgress *scrollbar;
32 eComboBox *combo_type;
33 eMultipage satPages;
34 std::list<SatelliteEntry*> deleteEntryList;
35 int pageEnds[17];
36 int curScrollPos;
37 ePtrList<eSatellite> sats;
39 int complexity;
40 int eventHandler(const eWidgetEvent &event);
41 std::map< eSatellite*, SatelliteEntry > entryMap;
42 eSatellite *getSat4SatCombo( const eComboBox* );
43 eSatellite *getSat4HiLoCombo( const eComboBox* );
44 eSatellite *getSat4VoltageCombo( const eComboBox* );
45 eSatellite *getSat4LnbButton( const eButton* );
46 void createControlElements();
47 eComboBox *createSatWidgets(eSatellite* sat);
48 eSatellite *createSatellite();
49 void updateButtons(int comp);
50 void cleanupWidgets();
51 void setComplexity(int complexity);
52 void repositionWidgets();
53 void closePressed();
54 void erasePressed();
55 void newPressed();
56 void updateScrollbar(int show);
57 void lnbSelected(eButton *who);
58 void delSatellite( eSatellite* sat, bool redraw=true, bool atomic=false );
59 void satChanged(eComboBox *who, eListBoxEntryText *le);
60 void hiloChanged(eComboBox *who, eListBoxEntryText *le);
61 void voltageChanged(eComboBox *who, eListBoxEntryText *le);
62 void focusChanged( const eWidget* focus );
63 void addSatellitesToCombo( eButton*);
64 void deleteSatellite(eSatellite *s);
66 void typeChanged(eListBoxEntryText* newtype);
67 int checkComplexity(); // check overall complexity
68 int checkDiseqcComplexity(eSatellite *s);
69 void deleteSatellitesAbove(int nr);
71 // according to "complexity" (works only for complexity <= 2, of course)
72 void setSimpleDiseqc(eSatellite *s, int diseqcnr);
73 void init_eSatelliteConfigurationManager();
74 public:
75 void extSetComplexity(int complexity);
76 eSatelliteConfigurationManager();
77 ~eSatelliteConfigurationManager();
80 class eLNBPage;
81 class eDiSEqCPage;
83 class eLNBSetup : public eWindow // Selitor = "Sel"ector + Ed"itor" :-)
85 eMultipage mp;
86 eDiSEqCPage *DiSEqCPage;
87 eLNBPage *LNBPage;
88 eSatellite* sat;
89 void onSave();
90 void onNext() { mp.next(); }
91 void onPrev() { mp.prev(); }
92 int eventHandler(const eWidgetEvent &event);
93 eServiceReference service;
94 public:
95 eLNBSetup( eSatellite *sat, eWidget* lcdTitle=0, eWidget* lcdElement=0 );
98 class eLNBPage : public eWidget
100 friend class eLNBSetup;
101 struct selectlnb;
102 eSatellite *sat;
103 eLabel *lMapping;
104 eComboBox *lnb_list;
105 // eListBox<eListBoxEntryText> *lnb_list;
106 eNumber *lofH, *lofL, *threshold;
107 eButton *save; // use this LNB for Satelite and close LNBSelitor
108 eButton *next; // shows the DiSEqC Configuration Dialog
109 eCheckbox *increased_voltage, *relais_12V_out;
110 eStatusBar *statusbar;
112 void numSelected(int*);
113 void lnbChanged( eListBoxEntryText* );
114 public:
115 eLNBPage( eWidget *parent, eSatellite *sat );
118 class eDiSEqCPage : public eWidget
120 friend class eLNBSetup;
121 eSatellite *sat;
122 eComboBox *DiSEqCMode, *DiSEqCParam, *MiniDiSEqCParam, *DiSEqCRepeats,
123 *ucInput;
124 eButton *save; // use this LNB for Satelite and close LNBSelitor
125 eButton *prev; // shows the LNB Configuration Dialog
126 // eButton *next; // shows the Rotor Setup (for non GotoXX Rotors)
127 eCheckbox *SeqRepeat, *SwapCmds,
128 *FastDiSEqC; // sends no DiSEqC when only hi/lo or H/V Changed
129 eLabel *lDiSEqCRepeats, *lDiSEqCParam, *lucInput;
130 eStatusBar *statusbar;
132 void lnbChanged( eListBoxEntryText* );
133 void DiSEqCModeChanged( eListBoxEntryText* );
134 void numSelected(int*);
135 void init_eDiSEqCPage( eWidget *parent, eSatellite *sat );
136 public:
137 eDiSEqCPage( eWidget *parent, eSatellite *sat );
140 #endif