37 #include "vtkSQLQuery.h"
40 #include <QFormLayout>
41 #include <QMessageBox>
43 #include <QInputDialog>
45 #include <QPushButton>
55 setSubTitle(
tr(
"Create the microscopes for the gofigure projects:") );
80 "Name",
"microscope").empty() )
83 tr(
"Please create at least one microscope.") );
96 "The MySql user and the GoFigure Database \n\
97 have been successfully created !!\n\
98 Now you can save the work you do with GoFigure into the Database !!") );
113 if ( MicroscopeName.empty() )
116 tr(
"Please enter a name for your microscope.") );
122 "Name",
"Name", MicroscopeName).
size() > 0 )
125 tr(
"There is already a Microscope with the same name, please choose another one") );
131 std::stringstream queryScript;
132 queryScript <<
"INSERT INTO microscope VALUES ('";
133 queryScript << MicroscopeName;
134 queryScript <<
"') ;";
136 query->SetQuery( queryScript.str().c_str() );
137 if ( !query->Execute() )
139 std::cout <<
"Insert Microscope query failed." << std::endl;
145 tr(
"Your microscope has been successfully created") );
163 field(
"Password").toString().toStdString() );
176 std::string iUser, std::string iPassword)
181 this->
m_DBName =
"gofiguredatabase";
void NewMicroscopeCreated()
void setSubTitle(const QString &subTitle)
bool CloseDatabaseConnection(vtkMySQLDatabase *DatabaseConnector)
return true if the connection has been closed, false if the connection was already closed ...
QLineEdit * lineMicroscopeName
vtkMySQLDatabase * OpenDatabaseConnection(std::string ServerName, std::string login, std::string Password, std::string DBName)
QString tr(const char *sourceText, const char *disambiguation, int n)
void setBold(bool enable)
vtkMySQLDatabase * m_DatabaseConnector
std::vector< std::string > ListAllValuesForOneColumn(vtkMySQLDatabase *DatabaseConnector, const std::string &ColumnName, const std::string &TableName, std::string OrderByColumnName)
SELECT ColumnName from TableName ORDER BY OrderbyColumnName.
void setText(const QString &text)
std::vector< std::string > ListSpecificValuesForOneColumn(vtkMySQLDatabase *iDatabaseConnector, const std::string &TableName, const std::string &ColumnName, const std::string &field, const std::string &value, bool ExcludeZero)
SELECT ColumnName FROM TableName WHERE field = value and ColumnName <> 0 (if excludezero) ...
QVariant field(const QString &name) const
QGoDBInitCreateMicroscopePage(QWidget *iparent=0)
QPushButton * CreateButton
void SetDatabaseVariables(std::string iUser, std::string iPassword)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)