+
+/**
+ * This slot function called when image button clicked.
+ *
+ */
+void ProfileDialog::on_buttonImage_clicked()
+{
+ if (imageButtonState == false)
+ {
+ ui->buttonImage->setText("Load image");
+ }
+ else
+ {
+ ui->buttonImage->setText("Change image");
+ }
+
+ QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), QDir::currentPath());
+ loadPicture(fileName);
+}
+
+/**
+ * This function load picture.
+ * @param QString
+ */
+void ProfileDialog::loadPicture(QString fileName)
+{
+ if (!fileName.isEmpty())
+ {
+ QImage image(fileName);
+ if (image.isNull())
+ {
+ QMessageBox::information(this, tr("Profile"),tr("Cannot load %1.").arg(fileName));
+ return;
+ }
+ ui->labelImage->setPixmap(QPixmap::fromImage(image.scaled(QSize(120,120), Qt::KeepAspectRatio)));
+ picture = fileName;
+ }
+}
+
+/**
+ * This slot function called when save button clicked.
+ * @todo server connection
+ */
+void ProfileDialog::on_buttonSave_clicked()
+{
+ // Save labels data
+ setManufacturer(ui->lineEditManufacturer->text());
+ setType(ui->lineEditType->text());
+ setModel(ui->lineEditModel->text());
+ setDescription(ui->textEditDescription->toPlainText());
+
+ this->close();
+ // emit settingsdialog --> mainwindow --> httpclient
+ //emit saveprofile();
+}
+
+/**
+ * This get function return manufacturer
+ * @return QString
+ */
+QString ProfileDialog::getManufacturer()
+{
+ return manufacturer;
+}
+
+/**
+ * This get function return type
+ * @return QString
+ */
+QString ProfileDialog::getType()
+{
+ return type;
+}
+
+/**
+ * This get function return model
+ * @return QString
+ */
+QString ProfileDialog::getModel()
+{
+ return model;
+}
+
+/**
+ * This get function return description
+ * @return QString
+ */
+QString ProfileDialog::getDescription()
+{
+ return description;
+}
+
+/**
+ * This get function return description
+ * @return QString
+ */
+QString ProfileDialog::getPicture()
+{
+ return picture;
+}
+
+/**
+ * This set function set manufacturer
+ * @param QString
+ */
+void ProfileDialog::setManufacturer(QString m)
+{
+ manufacturer = m;
+ ui->lineEditManufacturer->setText(m);
+}
+
+/**
+ * This set function set type
+ * @param QString
+ */
+void ProfileDialog::setType(QString t)
+{
+ type = t;
+ ui->lineEditType->setText(t);
+}
+
+/**
+ * This set function set model
+ * @param QString
+ */
+void ProfileDialog::setModel(QString m)
+{
+ model = m;
+ ui->lineEditModel->setText(m);
+}
+
+/**
+ * This set function set description
+ * @param QString
+ */
+void ProfileDialog::setDescription(QString d)
+{
+ description = d;
+ ui->textEditDescription->setText(d);
+}
+
+/**
+ * This set function set description
+ * @param QString
+ */
+void ProfileDialog::setPicture(QString p)
+{
+ picture = p;
+ loadPicture(p);
+}
+
+/**
+ * This function set label info text to user
+ * @param QString
+ */
+void ProfileDialog::setLabelInfoToUser(QString infoText)
+{
+ ui->labelInfoToUser->setVisible(1);
+ this->ui->labelInfoToUser->setText(infoText);
+}