00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "dialog-do.qt.hh"
00025 #include "window.qt.hh"
00026
00027 #include <QtGui/QVBoxLayout>
00028 #include <QtGui/QHBoxLayout>
00029 #include <QtGui/QLabel>
00030
00031
00032
00033
00034
00035 DialogDo :: DialogDo ( Window * parent )
00036 :
00037 QDialog ( parent ),
00038 FParent ( parent )
00039 {
00040
00041 QVBoxLayout * placement = new QVBoxLayout ( this ) ;
00042 placement -> setContentsMargins ( 20, 20, 20, 20 );
00043 placement -> setSpacing ( 5 );
00044
00045 QWidget * widhaut = new QWidget ( this ) ;
00046 QHBoxLayout * haut = new QHBoxLayout ( widhaut ) ;
00047 FMax = new QLabel ( "Nombre max" , widhaut ) ;
00048
00049 FNombre = new QSpinBox ( widhaut ) ;
00050 FNombre -> setMinimum ( 0 );
00051 FNombre -> setMaximum ( 999 );
00052 FNombre ->setAccelerated(true);
00053
00054 haut -> addWidget ( FMax ) ;
00055 haut -> addWidget ( FNombre ) ;
00056 FFichiers = new QCheckBox ( "Fichiers" , this ) ;
00057 FFichiers -> setChecked ( parent -> getControler() -> getUndoOnFile() ) ;
00058 placement -> addWidget ( widhaut ) ;
00059 placement -> addWidget ( FFichiers ) ;
00060 setWindowTitle ( "Undo / Redo" ) ;
00061
00062
00063 FNombre -> setValue ( 100 ) ;
00064
00065
00066 QObject :: connect ( FNombre , SIGNAL ( valueChanged ( int ) ) , this ,
00067 SLOT ( callbackNbUndos ( ) ) ) ;
00068 QObject :: connect ( FFichiers , SIGNAL ( clicked ( ) ) , this ,
00069 SLOT ( callbackToggleOnFile ( ) ) ) ;
00070
00071 FClose = new QPushButton ( "fermer" , this ) ;
00072 placement -> addWidget ( FClose ) ;
00073 FClose -> setFocus ( ) ;
00074 QObject :: connect ( FClose ,
00075 SIGNAL ( clicked ( ) ) ,
00076 this ,
00077 SLOT ( close ( ) ) ) ;
00078
00079 }
00080
00081
00082
00083
00084
00085
00086 DialogDo :: ~DialogDo ( ) { }
00087
00088
00089
00090
00091
00092
00093 void DialogDo :: callbackToggleOnFile ( )
00094 {
00095 FParent -> getControler ( ) -> setUndoOnFile ( FFichiers -> isChecked ( ) ) ;
00096 }
00097 void DialogDo :: callbackNbUndos ( )
00098 {
00099 FParent -> getControler ( ) -> setNbMaxUndos ( FNombre -> value ( ) ) ;
00100 }
00101