41 #include <QFormLayout>
42 #include <QMessageBox>
92 if (
field(
"ServerName").toString() ==
""
93 ||
field(
"User").toString() ==
""
94 ||
field(
"Password").toString() ==
"" )
98 tr(
"Please fill all the fields.") );
107 tr(
"Unable to connect to the server: please make sure you entered the right fields.") );
112 if ( ListGoDB.empty() )
117 "You have not yet set up your Gofigure Database\nPlease go to the menu 'Settings' and select 'Set Up Database'.") );
123 if ( ListGoDB.size() > 1 )
125 std::cout <<
"There is more than one Gofigure DataBase" << std::endl;
126 std::cout <<
"Debug: In " << __FILE__ <<
", line " << __LINE__;
127 std::cout << std::endl;
131 std::list< std::string >::iterator i = ListGoDB.begin();
132 std::string DBName = *i;
167 std::list< std::string > ListGoDB;
168 for (
unsigned int i = 0; i < vectListDB.size(); ++i )
173 field(
"ServerName").toString().toStdString(),
174 field(
"User").toString().toStdString(),
175 field(
"Password").toString().toStdString(), vectListDB[i]);
176 if ( !DatabaseConnection.first )
178 std::cout <<
"Cannot check if " << vectListDB[i].c_str()
183 std::cout <<
"Debug: In " << __FILE__ <<
", line " << __LINE__;
184 std::cout << std::endl;
189 ListGoDB.push_back(vectListDB[i]);
191 DatabaseConnection.second->Close();
192 DatabaseConnection.second->Delete();
218 field(
"ServerName").toString().toStdString(),
219 field(
"User").toString().toStdString(),
220 field(
"Password").toString().toStdString() );
bool m_IsAnOpenRecentFile
void registerField(const QString &name, QWidget *widget, const char *property, const char *changedSignal)
void setSubTitle(const QString &subTitle)
void setEchoMode(EchoMode)
std::string m_ImgSessionName
std::vector< std::string > ListDatabases(vtkMySQLDatabase *ServerConnector)
QString tr(const char *sourceText, const char *disambiguation, int n)
QLineEdit * lineServerName
void SetIsAnOpenRecentFile(bool iIsAnOpenRecentFile)
void setBold(bool enable)
void setText(const QString &text)
QGoConnectServerPage(QWidget *parent=0)
void NoGofigureDatabase() const
QVariant field(const QString &name) const
std::pair< bool, vtkMySQLDatabase * > ConnectToDatabase(std::string ServerName, std::string login, std::string Password, std::string DBName)
std::pair< bool, vtkMySQLDatabase * > ConnectToServer(std::string ServerName, std::string login, std::string Password)
std::list< std::string > ListGofigureDatabases() const
return the list of the names of the databases of gofigure type
void CloseServerConnection() const
void setField(const QString &name, const QVariant &value)
void SetImgSessionName(std::string iImgSessionName)
bool IsDatabaseOfGoFigureType(vtkMySQLDatabase *DatabaseConnector)
std::pair< bool, vtkMySQLDatabase * > m_ConnectionServer
void GofigureDatabaseExists() const
void OpenConnectionToServer() const