00001
00007
00008 #ifndef CONFIG_H
00009 #define CONFIG_H
00010
00011 #include <QtGui>
00012 #include <QHostAddress>
00013
00018 class Config : public QDialog
00019 {
00020 Q_OBJECT
00021
00022 public :
00023
00025 Config( QWidget *parent = 0 ) ;
00026
00027 public slots :
00028
00030 void changePage( QListWidgetItem *current, QListWidgetItem *previous ) ;
00031
00033 void readConfig() ;
00034
00036 void writeConfig() ;
00037
00038 private slots :
00039
00041 void accept() ;
00042
00043 signals :
00044
00046 void viewMultiWinModeChanged( bool );
00047
00049 void userPathChanged( QString ) ;
00050
00052 void railsFileChanged( QString ) ;
00053
00055 void serverAdressChanged( QString ) ;
00056
00058 void serverPortChanged( quint16 ) ;
00059
00061 void clientPortChanged( quint16 ) ;
00062
00063 protected :
00064
00067 void showEvent( QShowEvent *event ) ;
00068
00069 private :
00070
00072 void createIcons() ;
00073
00075 QListWidget *_contentsWidget ;
00076
00078 QStackedWidget *_pagesWidget ;
00079
00081 QListWidgetItem *_general, *_network, *_view ;
00082 QWidget *_generalConfig, *_networkConfig, *_viewConfig ;
00083
00084 QComboBox *_uiModeCombo, *_protocolCombo ;
00085 QLineEdit *_userPathEdit, *_railsFileEdit, *_addressEdit, *_portEdit ;
00086
00087 bool _multiWinFlag ;
00088 QString _userPath, _railsFile ;
00089 int _protocol ;
00090 QString _serverAddress ;
00091 int _clientPort, _serverPort ;
00092 } ;
00093
00094
00095 #endif // CONFIG_H