@@ -49,8 +49,7 @@ ApplicationWindow {
49
49
text: " Import App"
50
50
shortcut: " Ctrl+o"
51
51
onTriggered: {
52
- generalFileDialog .callback = importApp;
53
- generalFileDialog .open ()
52
+ generalFileDialog .show (true , importApp)
54
53
}
55
54
}
56
55
@@ -62,10 +61,9 @@ ApplicationWindow {
62
61
MenuItem {
63
62
text: " Add plugin"
64
63
onTriggered: {
65
- generalFileDialog .callback = function (path ) {
64
+ generalFileDialog .show ( true , function (path ) {
66
65
addPlugin (path, {canClose: true })
67
- }
68
- generalFileDialog .open ()
66
+ })
69
67
}
70
68
}
71
69
@@ -75,20 +73,18 @@ ApplicationWindow {
75
73
text: " Import key"
76
74
shortcut: " Ctrl+i"
77
75
onTriggered: {
78
- generalFileDialog .callback = function (path ) {
79
- ui .importKey (path)
80
- }
81
- generalFileDialog .open ()
76
+ generalFileDialog .show (true , function (path ) {
77
+ gui .importKey (path)
78
+ })
82
79
}
83
80
}
84
81
85
82
MenuItem {
86
83
text: " Export keys"
87
84
shortcut: " Ctrl+e"
88
85
onTriggered: {
89
- generalFileDialog .callback = function (path ) {
90
- }
91
- generalFileDialog .open ()
86
+ generalFileDialog .show (false , function (path ) {
87
+ })
92
88
}
93
89
}
94
90
}
@@ -111,10 +107,19 @@ ApplicationWindow {
111
107
MenuItem {
112
108
text: " Run JS file"
113
109
onTriggered: {
114
- generalFileDialog .callback = function (path ) {
110
+ generalFileDialog .show ( true , function (path ) {
115
111
eth .evalJavascriptFile (path)
116
- }
117
- generalFileDialog .open ()
112
+ })
113
+ }
114
+ }
115
+
116
+ MenuItem {
117
+ text: " Dump state"
118
+ onTriggered: {
119
+ generalFileDialog .show (false , function (path ) {
120
+ // Empty hash for latest
121
+ gui .dumpState (" " , path)
122
+ })
118
123
}
119
124
}
120
125
}
@@ -396,8 +401,15 @@ ApplicationWindow {
396
401
id: generalFileDialog
397
402
property var callback;
398
403
onAccepted: {
399
- var path = this .fileUrl .toString ()
400
- callback .call (this , path)
404
+ var path = this .fileUrl .toString ();
405
+ callback .call (this , path);
406
+ }
407
+
408
+ function show (selectExisting , callback ) {
409
+ generalFileDialog .callback = callback;
410
+ generalFileDialog .selectExisting = selectExisting;
411
+
412
+ this .open ();
401
413
}
402
414
}
403
415
0 commit comments