@@ -6,6 +6,7 @@ import QtQuick.Window 2.1;
6
6
import QtQuick.Controls.Styles 1.1
7
7
import Ethereum 1.0
8
8
9
+
9
10
ApplicationWindow {
10
11
id: root
11
12
@@ -30,12 +31,14 @@ ApplicationWindow {
30
31
31
32
// Takes care of loading all default plugins
32
33
Component .onCompleted : {
33
- var historyView = addPlugin (" ./views/history.qml" , {default: true })
34
- var newTxView = addPlugin (" ./views/transaction.qml" , {default: true })
35
- var chainView = addPlugin (" ./views/chain.qml" , {default: true })
36
- var infoView = addPlugin (" ./views/info.qml" , {default: true })
37
- var pendingTxView = addPlugin (" ./views/pending_tx.qml" , {default: true })
38
- var pendingTxView = addPlugin (" ./views/javascript.qml" , {default: true })
34
+ var walletView = addPlugin (" ./views/wallet.qml" , {section: " ethereum" })
35
+
36
+ var historyView = addPlugin (" ./views/history.qml" , {section: " legacy" })
37
+ var newTxView = addPlugin (" ./views/transaction.qml" , {section: " legacy" })
38
+ var chainView = addPlugin (" ./views/chain.qml" , {section: " legacy" })
39
+ var infoView = addPlugin (" ./views/info.qml" , {section: " legacy" })
40
+ var pendingTxView = addPlugin (" ./views/pending_tx.qml" , {section: " legacy" })
41
+ var pendingTxView = addPlugin (" ./views/javascript.qml" , {section: " legacy" })
39
42
40
43
// Call the ready handler
41
44
gui .done ()
@@ -252,10 +255,10 @@ ApplicationWindow {
252
255
253
256
function setView (view , menu ) {
254
257
for (var i = 0 ; i < views .length ; i++ ) {
255
- views[i][ 0 ] .visible = false
258
+ views[i]. view .visible = false
256
259
257
- views[i][ 1 ] .border .color = " #00000000"
258
- views[i][ 1 ] .color = " #00000000"
260
+ views[i]. menuItem .border .color = " #00000000"
261
+ views[i]. menuItem .color = " #00000000"
259
262
}
260
263
view .visible = true
261
264
@@ -265,14 +268,21 @@ ApplicationWindow {
265
268
266
269
function addComponent (component , options ) {
267
270
var view = mainView .createView (component, options)
271
+
268
272
if (! view .hasOwnProperty (" iconFile" )) {
269
273
console .log (" Could not load plugin. Property 'iconFile' not found on view." );
270
274
return ;
271
275
}
272
276
273
277
var menuItem = menu .createMenuItem (view .iconFile , view, options);
278
+ if (view .hasOwnProperty (" menuItem" )) {
279
+ view .menuItem = menuItem;
280
+ }
281
+ mainSplit .views .push ({view: view, menuItem: menuItem});
274
282
275
- mainSplit .views .push ([view, menuItem]);
283
+ if (view .hasOwnProperty (" onReady" )) {
284
+ view .onReady .call (view)
285
+ }
276
286
277
287
return view
278
288
}
@@ -294,6 +304,7 @@ ApplicationWindow {
294
304
property var view;
295
305
296
306
property alias title: label .text
307
+ property alias icon: icon .source
297
308
property alias secondary: secondary .text
298
309
299
310
width: 180
@@ -310,22 +321,24 @@ ApplicationWindow {
310
321
311
322
Image {
312
323
id: icon
324
+ height: 20
325
+ width: 20
313
326
anchors {
314
327
left: parent .left
315
328
verticalCenter: parent .verticalCenter
329
+ leftMargin: 3
316
330
}
317
- source: " ../pick.png"
318
331
}
319
332
320
333
Text {
321
334
id: label
322
335
anchors {
323
336
left: icon .right
324
337
verticalCenter: parent .verticalCenter
338
+ leftMargin: 3
325
339
}
326
340
327
- text: " Chain"
328
- font .bold : true
341
+ // font.bold: true
329
342
color: " #0D0A01"
330
343
font .pixelSize : 12
331
344
}
@@ -355,15 +368,29 @@ ApplicationWindow {
355
368
options = {};
356
369
}
357
370
358
- if (options .default ) {
359
- var comp = menuItemTemplate .createObject (menuDefault)
371
+ var section;
372
+ switch (options .section ) {
373
+ case " ethereum" :
374
+ section = menuDefault;
375
+ break ;
376
+ case " legacy" :
377
+ section = menuLegacy;
378
+ break ;
379
+ default :
380
+ section = menuApps;
381
+ break ;
360
382
}
383
+
384
+ var comp = menuItemTemplate .createObject (section)
361
385
362
386
comp .view = view
363
387
comp .title = view .title
388
+ comp .icon = view .iconFile
389
+ /*
364
390
if(view.secondary !== undefined) {
365
391
comp.secondary = view.secondary
366
392
}
393
+ */
367
394
368
395
return comp
369
396
@@ -376,7 +403,7 @@ ApplicationWindow {
376
403
377
404
ColumnLayout {
378
405
id: menuColumn
379
- y: 30
406
+ y: 10
380
407
width: parent .width
381
408
anchors .left : parent .left
382
409
anchors .right : parent .right
@@ -401,6 +428,25 @@ ApplicationWindow {
401
428
}
402
429
}
403
430
431
+ Text {
432
+ text: " LEGACY"
433
+ font .bold : true
434
+ anchors {
435
+ left: parent .left
436
+ leftMargin: 5
437
+ }
438
+ color: " #888888"
439
+ }
440
+
441
+ ColumnLayout {
442
+ id: menuLegacy
443
+ spacing: 3
444
+ anchors {
445
+ left: parent .left
446
+ right: parent .right
447
+ }
448
+ }
449
+
404
450
Text {
405
451
text: " APPS"
406
452
font .bold : true
0 commit comments