35 #include <QColorDialog>
36 #include <QInputDialog>
57 vtkMySQLDatabase *iDatabaseConnector)
61 QColorDialog::ShowAlphaChannel);
75 if ( !this->CheckEntityAlreadyExists< GoDBColorRow >(this->
m_NewColor) )
91 this->ValidateNameTemplate< GoDBColorRow >(this->
m_NewColor, iName,
106 SIGNAL( ListEntitiesToDelete(std::vector< std::string > ) ),
112 return Dialog->
exec();
118 std::list< QGoDBColorManager::ItemColorComboboxData >
121 std::list< ItemColorComboboxData > oInfoColors;
123 iDatabaseConnector,
"*",
"color",
"name");
125 while ( i < ResultsQuery.size() )
128 temp.first = ResultsQuery[i + 1];
129 QColor tempColor( atoi( ResultsQuery[i + 2].c_str() ), atoi( ResultsQuery[i + 3].c_str() ),
130 atoi( ResultsQuery[i + 4].c_str() ), atoi( ResultsQuery[i + 5].c_str() ) );
131 temp.second = tempColor;
132 oInfoColors.push_back(temp);
vtkMySQLDatabase * m_DatabaseConnector
void DeleteEntitiesFromList(std::vector< std::string > iVectorNamesEntitiesToDelete)
Delete in the database the entities with the names contained in the vector.
virtual bool DeleteEntity(vtkMySQLDatabase *iDatabaseConnector)
show the list of the existing entities so the user can choose the ones he wants to delete...
QGoDBColorManager(QWidget *iParent=0)
virtual int SaveInDB(vtkMySQLDatabase *iDatabaseConnector)
Pure Virtual :check if the entity already exists in the DB, if yes, return the existing ID...
Abstract class : the QGoDBNameDescEntityManager manages the interactions between the user and the dat...
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.
ItemColorComboboxData AddANewColor(vtkMySQLDatabase *iDatabaseConnector)
ask the user the color he wants, the name, description of the new color and saves it in the database...
QColor getColor(const QColor &initial, QWidget *parent, const QString &title, QFlags< QColorDialog::ColorDialogOption > options)
void SetField(const std::string &key, const T &value)
convert the value into a string and assign it to the key in the map
this class displays a list of entities and return the list of the ones selected by the user...
ItemColorComboboxData m_NewColorData
QGoDeleteFromListDialog::ItemColorComboboxData ItemColorComboboxData
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
std::list< ItemColorComboboxData > GetListExistingColors(vtkMySQLDatabase *iDatabaseConnector)
get the list of the existing colors from the database
virtual void SaveNewEntityInDB()
Pure Virtual method : save the new entity in the database, the m_DatabaseConnectorForNewEntity needs ...
virtual void ValidateName(std::string iName, std::string iDescription)
std::string AddAnEntity(vtkMySQLDatabase *iDatabaseConnector)
execute the dialog asking the user to enter a name and a description, validates the name...