22// Created by user on 23.06.18.
33//
44#include " cmd.hpp"
5- #include " Transaction.h"
6- #include " keychain_gui_win.h"
75
86Q_DECLARE_METATYPE (std::string)
97
@@ -14,7 +12,7 @@ namespace slave
1412 struct cmd : cmd_base {
1513 cmd () : cmd_base(cmd_) {};
1614 virtual ~cmd () {};
17- virtual void operator ()(Widget* w, const fc_light::variant& v) const override {
15+ virtual void operator ()(keychain_gui_win& w, const fc_light::variant& v) const override {
1816 throw std::runtime_error (" operation is not implemented" );
1917 };
2018 using params_t = void ;
@@ -27,13 +25,13 @@ namespace slave
2725 virtual ~cmd () {};
2826 struct params {std::string rawtrx;};
2927 using params_t = params;
30- virtual void operator ()(Widget * w, const fc_light::variant& v) const override {
28+ virtual void operator ()(keychain_gui_win& w, const fc_light::variant& v) const override {
3129 try {
3230 auto a = v.as <params_t >();
33- // w->pte->setText( QString(a.rawtrx.c_str() ));
34- QString value (a. rawtrx . c_str () );
35- Transaction trans (value );
36- keychain_gui_win w (trans );
31+ QString trx (a.rawtrx .c_str ());
32+ Transaction trans (trx );
33+ w. refresh (trans );
34+ w. show ( );
3735 }
3836 catch (const std::exception &e) {throw std::runtime_error (e.what ());}
3937 catch (const fc_light::exception &e) {throw std::runtime_error (e.what ());}
@@ -45,8 +43,11 @@ namespace slave
4543 cmd () : cmd_base(cmds::close) {};
4644 virtual ~cmd () {};
4745 using params_t = void ;
48- virtual void operator ()(Widget* w, const fc_light::variant& v) const override {
49- try { w->close (); }
46+ virtual void operator ()(keychain_gui_win& w, const fc_light::variant& v) const override {
47+ try
48+ {
49+ // w->close();
50+ }
5051 catch (const std::exception &e) {throw std::runtime_error (e.what ());}
5152 catch (const fc_light::exception &e) {throw std::runtime_error (e.what ());}
5253 };
@@ -58,7 +59,7 @@ namespace slave
5859 virtual ~cmd () {};
5960 struct params { bool caps, num, shift; };
6061 using params_t = params;
61- virtual void operator ()(Widget* w, const fc_light::variant& v) const override {
62+ virtual void operator ()(keychain_gui_win& w, const fc_light::variant& v) const override {
6263 try {
6364 auto a = v.as <params_t >();
6465 // a.caps ? w->caps->setText("caps: on") : w->caps->setText("caps: off");
@@ -76,10 +77,10 @@ namespace slave
7677 virtual ~cmd () {};
7778 struct params {int len;};
7879 using params_t = params;
79- virtual void operator ()(Widget* w, const fc_light::variant& v) const override {
80+ virtual void operator ()(keychain_gui_win& w, const fc_light::variant& v) const override {
8081 try {
8182 auto a = v.as <params_t >();
82- // w->ple ->setText(QString (a.len, '*'));
83+ w. password -> value ->setText (QString (a.len , ' *' ));
8384 }
8485 catch (const std::exception &e) {throw std::runtime_error (e.what ());}
8586 catch (const fc_light::exception &e) {throw std::runtime_error (e.what ());}
0 commit comments