@@ -232,6 +232,7 @@ void MainWindow::createAuthorWidgetSettings()
232
232
p_author_widget->setLayout (p_about_layout);
233
233
234
234
connect (p_close_button, SIGNAL (clicked (bool )), p_author_widget, SLOT (close ()));
235
+ connect (p_close_button, SIGNAL (clicked (bool )), SLOT (clearElementInfoWidget ()));
235
236
}
236
237
237
238
void MainWindow::createLogoWidgetSettings ()
@@ -286,11 +287,6 @@ void MainWindow::processCreateNewElement(QString name, QString password, QString
286
287
void MainWindow::processRemoveElement ()
287
288
{
288
289
removeElement ((ElementInfoWidget*) sender ());
289
- core.removeElement (sender ()->objectName ());
290
- core.writeFile ();
291
- delete sender ();
292
- processRefreshScrollArea ();
293
- clearElementInfoWidget ();
294
290
}
295
291
296
292
void MainWindow::removeElement (ElementInfoWidget *p_widget)
@@ -302,6 +298,12 @@ void MainWindow::removeElement(ElementInfoWidget *p_widget)
302
298
delete p_widget->p_pair_button ;
303
299
break ;
304
300
}
301
+
302
+ core.removeElement (sender ()->objectName ());
303
+ core.writeFile ();
304
+ delete sender ();
305
+ processRefreshScrollArea ();
306
+ clearElementInfoWidget ();
305
307
}
306
308
307
309
void MainWindow::processWipeData ()
@@ -391,6 +393,10 @@ void MainWindow::createEditConnections()
391
393
connect (p_name_input, SIGNAL (sendName (QString)), SLOT (destroyEditConnections ()), Qt::UniqueConnection);
392
394
connect (p_password_input, SIGNAL (sendPassword (QString)), SLOT (destroyEditConnections ()), Qt::UniqueConnection);
393
395
connect (p_note_input, SIGNAL (sendNote (QString)), SLOT (destroyEditConnections ()), Qt::UniqueConnection);
396
+
397
+ // p_name_input->setText(sender()->objectName() + " name settings");
398
+ // p_password_input->setText(sender()->objectName() + " password settings");
399
+ // p_note_input->setText(sender()->objectName() + " note settings");
394
400
}
395
401
396
402
void MainWindow::destroyEditConnections ()
@@ -405,6 +411,31 @@ void MainWindow::destroyEditConnections()
405
411
disconnect (p_name_input, SIGNAL (sendName (QString)), this , SLOT (destroyEditConnections ()));
406
412
disconnect (p_password_input, SIGNAL (sendPassword (QString)), this , SLOT (destroyEditConnections ()));
407
413
disconnect (p_note_input, SIGNAL (sendNote (QString)), this , SLOT (destroyEditConnections ()));
414
+
415
+ processElementEdited ((ElementInfoWidget*) sender ());
416
+
417
+ // p_name_input->setText("name settings");
418
+ // p_password_input->setText("password settings");
419
+ // p_note_input->setText("note settings");
420
+ }
421
+
422
+ void MainWindow::processElementEdited (ElementInfoWidget *p_widget)
423
+ {
424
+ qDebug () << " element edited : " << p_widget->objectName ();
425
+
426
+ QString name, password, note;
427
+
428
+ name = p_widget->name ;
429
+ password = p_widget->password ;
430
+ note = p_widget->note ;
431
+
432
+ removeElement (p_widget);
433
+
434
+ core.addElement (name, password, note);
435
+ core.writeFile ();
436
+
437
+ setElementInfoWidget (createNewInfoLabel (name, password, note));
438
+ processRefreshScrollArea ();
408
439
}
409
440
410
441
void MainWindow::clearElementInfoWidget ()
0 commit comments