summaryrefslogtreecommitdiff
path: root/sowatchui/qml/sowatch.js
blob: f2d48dd704a460a317bcee2b169756267ba2b40f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var service = null;

function getService() {
	var component = Qt.createComponent("ServiceLoader.qml");
	if (component.status == Component.Ready) {
		var loader = component.createObject(null);
		service = loader.serviceObject;
	}
}

function checkService() {
	if (service === null) {
		getService();
	}
}

function start() {
	getService();
}

function stop() {
	checkService();
	service.terminate();
}

function restart() {
	stop();
	start();
}