Skip to content

Commit 5ac119d

Browse files
committed
travis: remove gui package before_install
1 parent f0270c2 commit 5ac119d

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
language: go
2-
install:
3-
script: go test ./w1 ./ibutton ./netlink ./connector
2+
before_install: rm -r ./ibutton/ibutton-gui

ibutton/ibutton-gui/iButton.goproject.user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE QtCreatorProject>
3-
<!-- Written by QtCreator 3.1.1, 2015-05-26T17:01:16. -->
3+
<!-- Written by QtCreator 3.1.1, 2015-05-26T18:45:21. -->
44
<qtcreator>
55
<data>
66
<variable>ProjectExplorer.Project.ActiveTarget</variable>

ibutton/ibutton-gui/share/iButton/Main.qml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import QtQuick 2.0
22
import Ubuntu.Components 1.2
3+
import GoExtensions 1.0
34

45
/*!
56
\brief MainView with a Label and Button elements.
@@ -12,6 +13,11 @@ MainView {
1213
width: units.gu(100)
1314
height: units.gu(75)
1415

16+
Status {
17+
id: status
18+
time: "-"
19+
}
20+
1521
Page {
1622
id: page2
1723
title: i18n.tr("iButton")
@@ -53,7 +59,7 @@ MainView {
5359
Label {
5460
id: labelStatus
5561
objectName: "label"
56-
text: status
62+
text: status.time
5763
}
5864

5965
}

ibutton/ibutton-gui/src/iButton/main.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ type App struct {
1111
State string
1212
}
1313

14+
type Status struct {
15+
Time string
16+
}
17+
1418
func main() {
1519
err := qml.Run(run)
1620
if err != nil {
@@ -19,6 +23,10 @@ func main() {
1923
}
2024

2125
func run() error {
26+
qml.RegisterTypes("GoExtensions", 1, 0, []qml.TypeSpec{{
27+
Init: func(s *Status, obj qml.Object) { s.Time = "" },
28+
}})
29+
2230
engine := qml.NewEngine()
2331
component, err := engine.LoadFile("share/iButton/Main.qml")
2432
if err != nil {
@@ -27,6 +35,7 @@ func run() error {
2735

2836
app := App{new(ibutton.Button), engine.Context(), "DISCONNECTED"}
2937
app.SetVar("app", &app)
38+
app.SetVar("mainVoew.status2", &Status{})
3039

3140
window := component.CreateWindow(nil)
3241
window.Show()
@@ -65,12 +74,13 @@ func (app *App) Error() {
6574
// Update the button status
6675
func (app *App) Update() {
6776
go func() {
68-
status, err := app.Status()
77+
_, err := app.Status()
6978
if err != nil {
7079
app.Error()
7180
return
7281
}
73-
app.SetVar("status", status.Time().String())
82+
status := app.Object("status").(Status)
83+
qml.Changed(status, &status.Time)
7484
}()
7585
}
7686

0 commit comments

Comments
 (0)