@@ -18,37 +18,20 @@ MnInfoDialog::MnInfoDialog(QWidget *parent) :
1818 ui->setupUi (this );
1919 this ->setStyleSheet (parent->styleSheet ());
2020 setCssProperty (ui->frame , " container-dialog" );
21- // Title
2221 ui->labelTitle ->setText (tr (" Master Node Information" ));
2322 setCssProperty (ui->labelTitle , " text-title-dialog" );
24- // Labels
25- setCssTextBodyDialog ({ui->labelAmount , ui->labelSend , ui->labelInputs , ui->labelFee , ui->labelId , ui->labelSize , ui->labelConfirmations });
23+ setCssTextBodyDialog ({ui->labelAmount , ui->labelSend , ui->labelInputs , ui->labelFee , ui->labelId , ui->labelSize , ui->labelExport });
2624 setCssProperty ({ui->labelDivider1 , ui->labelDivider4 , ui->labelDivider5 , ui->labelDivider6 , ui->labelDivider7 , ui->labelDivider8 , ui->labelDivider9 }, " container-divider" );
27- setCssTextBodyDialog ({ui->textAmount , ui->textAddress , ui->textInputs , ui->textStatus , ui->textId , ui->textSize , ui->textConfirmations });
28- setCssProperty (ui->pushCopy , " ic-copy-big" );
29- setCssProperty (ui->pushCopyId , " ic-copy-big" );
25+ setCssTextBodyDialog ({ui->textAmount , ui->textAddress , ui->textInputs , ui->textStatus , ui->textId , ui->textSize , ui->textExport });
26+ setCssProperty ({ui->pushCopy , ui->pushCopyId }, " ic-copy-big" );
3027 setCssProperty (ui->btnEsc , " ic-close" );
31- ui->contentConfirmations ->setVisible (false );
28+ ui->contentExport ->setVisible (false );
3229 ui->labelDivider7 ->setVisible (false );
3330 ui->contentSize ->setVisible (false );
3431 ui->labelDivider5 ->setVisible (false );
3532 connect (ui->btnEsc , SIGNAL (clicked ()), this , SLOT (close ()));
36- connect (ui->pushCopy , &QPushButton::clicked, [this ](){
37- GUIUtil::setClipboard (txId);
38- SnackBar *snackBar = new SnackBar (nullptr , this );
39- snackBar->setText (tr (" Master Node public key copied" ));
40- snackBar->resize (this ->width (), snackBar->height ());
41- openDialog (snackBar, this );
42- snackBar->deleteLater ();
43- });
44- connect (ui->pushCopyId , &QPushButton::clicked, [this ](){
45- GUIUtil::setClipboard (pubKey);
46- SnackBar *snackBar = new SnackBar (nullptr , this );
47- snackBar->setText (tr (" Collateral tx id copied" ));
48- snackBar->resize (this ->width (), snackBar->height ());
49- openDialog (snackBar, this );
50- snackBar->deleteLater ();
51- });
33+ connect (ui->pushCopy , &QPushButton::clicked, [this ](){ copyInform (txId, " Master Node public key copied" ); });
34+ connect (ui->pushCopyId , &QPushButton::clicked, [this ](){ copyInform (pubKey, " Collateral tx id copied" ); });
5235}
5336
5437void MnInfoDialog::setData (QString pubKey, QString name, QString address, QString txId, QString outputIndex, QString status){
@@ -69,7 +52,15 @@ void MnInfoDialog::setData(QString pubKey, QString name, QString address, QStrin
6952 ui->textStatus ->setText (status);
7053}
7154
72- MnInfoDialog::~MnInfoDialog ()
73- {
55+ void MnInfoDialog::copyInform (QString& copyStr, QString message){
56+ GUIUtil::setClipboard (copyStr);
57+ SnackBar *snackBar = new SnackBar (nullptr , this );
58+ snackBar->setText (tr (message.toStdString ().c_str ()));
59+ snackBar->resize (this ->width (), snackBar->height ());
60+ openDialog (snackBar, this );
61+ snackBar->deleteLater ();
62+ }
63+
64+ MnInfoDialog::~MnInfoDialog (){
7465 delete ui;
7566}
0 commit comments