SVN_SILENT made messages (.desktop file)
[kdegames.git] / kspaceduel / dialogs.h
blobb2d0cbc1c786fb0023905d1a02e848a9d53101b3
1 /*
2 Copyright (C) 1998-2001 Andreas Zehender <az@azweb.de>
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #ifndef KSPACEDUEL_DIALOGS_H
19 #define KSPACEDUEL_DIALOGS_H
21 class QComboBox;
22 class QTabWidget;
23 class QSlider;
24 class QLCDNumber;
26 #include <kconfigdialog.h>
28 #include "defines.h"
29 #include "structs.h"
32 class ConfigSetup:public QWidget
34 Q_OBJECT
35 public:
36 explicit ConfigSetup(SConfig *custom,QWidget *parent=0);
38 bool hasChanged();
39 bool isDefault();
40 void updateSettings();
41 void updateWidgets();
42 void updateWidgetsDefault();
44 signals:
45 void changed();
47 protected slots:
48 void configSelected(int num);
49 void sliderChanged(int val);
50 protected:
51 void valueChanged(int ednum,int val);
52 void valueChanged(int ednum,double val);
53 void displayConfig(SConfig cfg);
54 void setValue(int ednum,int val);
55 void setValue(int ednum,double val);
56 void setValue(int ednum,unsigned val);
57 private:
58 enum {EditGamespeed=0,
59 EditShotSpeed,EditShotEnergyNeed,EditMaxBullets,EditBulletDamage,
60 EditBulletLifeTime,EditBulletReloadTime,
61 EditMineFuel,EditMineEnergyNeed,EditMineActivateTime,
62 EditMineDamage,EditMaxMines,EditMineReloadTime,
63 EditAcc,EditEnergyNeed,EditRotationSpeed,
64 EditRotationEnergyNeed,EditShipDamage,
65 EditSunEnergy,EditGravity,
66 EditPosX,EditPosY,EditVelX,EditVelY,
67 EditPowerupRefreshTime,EditPowerupLifeTime,
68 EditPowerupEnergyAmount,EditPowerupShieldAmount,
69 EditNum};
70 enum {TabGeneral=0,TabBullet,TabMine,
71 TabShip,TabSun,TabStart,TabPowerups,TabNum};
72 enum Type {VarInt,VarFloat};
74 static char LabelName[EditNum][25];
75 static int Parent[EditNum];
76 static int Position[EditNum];
77 static const char *TabName[TabNum];
78 static double EditVal[EditNum][3];
79 static int EditDiv[EditNum];
80 static Type VarType[EditNum];
82 QTabWidget *tabs;
84 QSlider *slider[EditNum];
85 QLCDNumber *value[EditNum];
87 QComboBox *configCombo;
88 SConfig *customConfig,config;
90 int selectedConfig;
93 class SettingsDialog : public KConfigDialog
95 Q_OBJECT
96 public:
97 explicit SettingsDialog(SConfig *customConfig, QWidget *parent=0, const char *name=0);
98 ~SettingsDialog();
100 signals:
101 void settingsUpdated();
103 private slots:
104 void updateWidgets();
105 void updateWidgetsDefault();
106 void updateSettings();
108 private:
109 bool hasChanged();
110 bool isDefault();
112 private:
113 ConfigSetup* cs;
116 #endif // KSPACEDUEL_DIALOGS_H