aboutsummaryrefslogtreecommitdiffstats
path: root/mist/errors.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-09-19 19:33:15 +0800
committerobscuren <geffobscura@gmail.com>2014-09-19 19:34:37 +0800
commitae1de6593c31fbaa4429588cea2702dd5b01a722 (patch)
treed19c960d08524f0c5449ba87ab7ef4054b782b32 /mist/errors.go
parent723074e71bbe1638a5cec9b996b1eed07a76fd72 (diff)
downloadgo-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.tar
go-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.tar.gz
go-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.tar.bz2
go-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.tar.lz
go-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.tar.xz
go-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.tar.zst
go-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.zip
renamed
Diffstat (limited to 'mist/errors.go')
-rw-r--r--mist/errors.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/mist/errors.go b/mist/errors.go
new file mode 100644
index 000000000..409b7a281
--- /dev/null
+++ b/mist/errors.go
@@ -0,0 +1,36 @@
+package main
+
+import (
+ "fmt"
+ "os"
+
+ "gopkg.in/qml.v1"
+)
+
+func ErrorWindow(err error) {
+ engine := qml.NewEngine()
+ component, e := engine.LoadString("local", qmlErr)
+ if e != nil {
+ fmt.Println("err:", err)
+ os.Exit(1)
+ }
+
+ win := component.CreateWindow(nil)
+ win.Root().ObjectByName("label").Set("text", err.Error())
+ win.Show()
+ win.Wait()
+}
+
+const qmlErr = `
+import QtQuick 2.0; import QtQuick.Controls 1.0;
+ApplicationWindow {
+ width: 600; height: 150;
+ flags: Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowCloseButtonHint
+ title: "Error"
+ Text {
+ x: parent.width / 2 - this.width / 2;
+ y: parent.height / 2 - this.height / 2;
+ objectName: "label";
+ }
+}
+`