src/dbconfigureform.h
changeset 0 04114bce8fd0
equal deleted inserted replaced
-1:000000000000 0:04114bce8fd0
       
     1 #include <qdialog.h>
       
     2 #include <tdbconfig.h>
       
     3 
       
     4 class InputField;
       
     5 class InputCombo;
       
     6 
       
     7 /*!
       
     8   DataBase configuration form, which asks for enough information to connect to a
       
     9   database.
       
    10   The information is stored in a structure given in the constructor.
       
    11   \sa DBConfigureForm()
       
    12   */
       
    13 class DBConfigureForm : public QDialog
       
    14 {
       
    15 	Q_OBJECT
       
    16 
       
    17 private:
       
    18 	InputField *host, *username, *database, *password;
       
    19 	InputCombo *driver;
       
    20 	Tdb_config *db_config;
       
    21 	QPushButton *apply_button;
       
    22 
       
    23 public slots:
       
    24 	/*!
       
    25 	  Accept the changes made in the form. It also closes the dialog.
       
    26 	  */
       
    27 	void acceptChanges();
       
    28 	/*!
       
    29 	  Updates the contents of the #db_config structure using the actual
       
    30 	  values of the input fields
       
    31 	  Returns 0 if no error, error happened otherwise.
       
    32 	  */
       
    33 	int updateVariables();
       
    34 	/*!
       
    35 	  Sets the state of the Apply button to Enabled
       
    36 	  */
       
    37 	void setFormChanged();
       
    38 	/*!
       
    39 	  Sets the state of the Apply button to Disabled
       
    40 	  */
       
    41 	void setFormNoChanged();
       
    42 
       
    43 public:
       
    44 	/*!
       
    45 	  Constructs the configuration form using #mydbconfig for storing
       
    46 	  the form values.
       
    47 	  \param mydbconfig The structure used to store the database information
       
    48 	  */
       
    49 	DBConfigureForm(Tdb_config *mydbconfig,
       
    50 		QWidget *parent=0, const char *name=0);
       
    51 };