MySQL realated stuff documented.
[mediadatabase.git] / gui-Win32 / SRC / DbPreferencesDialog.cpp
blob2065fb94050d2b67bb1403bfee3ef72c8163006b
1 //---------------------------------------------------------------------------
3 #include <vcl.h>
4 #pragma hdrstop
6 #include "DBAccess.hpp"
8 #include "DbPreferencesDialog.h"
9 //---------------------------------------------------------------------------
10 #pragma package(smart_init)
11 #pragma link "DBAccess"
12 #pragma link "MyAccess"
13 #pragma resource "*.dfm"
14 TDatabasePreferences *DatabasePreferences;
15 //---------------------------------------------------------------------------
16 __fastcall TDatabasePreferences::TDatabasePreferences(TComponent* Owner)
17 : TForm(Owner)
20 //---------------------------------------------------------------------------
21 void __fastcall TDatabasePreferences::cbDefaultPortClick(TObject *Sender)
23 if ( cbDefaultPort->Checked == TRUE ) {
24 ebPort->Text = "3306";
25 ebPort->Enabled = FALSE;
27 else
28 ebPort->Enabled = TRUE;
30 //---------------------------------------------------------------------------
31 void __fastcall TDatabasePreferences::cbDefaultUserClick(TObject *Sender)
33 if ( cbDefaultUser->Checked == TRUE ) {
34 ebUsername->Text = "mediabase";
35 ebUsername->Enabled = FALSE;
36 ebPassword->Text = "mediabase";
37 ebPassword->Enabled = FALSE;
39 else {
40 ebUsername->Enabled = TRUE;
41 ebPassword->Enabled = TRUE;
44 //---------------------------------------------------------------------------
45 void __fastcall TDatabasePreferences::Button2Click(TObject *Sender)
47 this->Close();
49 //---------------------------------------------------------------------------
53 void __fastcall TDatabasePreferences::TestConnectionClick(TObject *Sender)
55 bool debug;
57 MySQLTest->Username = this->ebUsername->Text;
58 MySQLTest->Password = this->ebPassword->Text;
59 MySQLTest->Port = this->ebPort->Text.ToInt();
61 debug = MySQLTest->Connected;
63 MySQLTest->Connect();
67 //---------------------------------------------------------------------------