postmarketos-demos: Add shutdown button (#516)

This commit is contained in:
Ben Iofel 2017-09-06 11:29:17 -05:00 committed by Oliver Smith
parent 89f94a9c63
commit ae40819471
2 changed files with 6 additions and 4 deletions

View file

@ -1,6 +1,6 @@
pkgname=postmarketos-demos
pkgver=4
pkgrel=3
pkgrel=4
pkgdesc="Simple touch menu for a few demo programs"
url="https://github.com/postmarketOS"
arch="all"
@ -20,5 +20,5 @@ package() {
install -D -m755 "$srcdir"/postmarketos-demos \
"$pkgdir"/usr/bin/postmarketos-demos || return 1
}
sha512sums="7cb25e4d6a0224800703d0ee138edbf1b4ab71120190445d1fa57bec0835a9ab0b37fb343a4f6e01de3e3c7ffc2fc5c0c9bbcb15f9e867a9f9014ed682a10275 main.c
sha512sums="ae51469e6105dfd07e1ffb2ab3b6e2261239ca80b6e897951e7223cc8dd8fcb7c98f06f2e3870203a2f840ce4b5d425b4943ae0091631bbf48ae283d3cf1f86a main.c
83d8a95e9e1e95dffa8661e547444e83e72e572dcd0c637376f678bbd20a351c4b971a315311edefeb58a4cca14fd3e586fb581a262b2d217e25092459539b98 Makefile"

View file

@ -31,7 +31,9 @@ static void activate(GtkApplication *app, gpointer user_data)
"GTK3 Demo",
"gtk3-demo &",
"Restart Weston",
"killall weston &"
"killall weston &",
"Shutdown",
"poweroff &"
};
for(int i=0;i<(sizeof(programs) / sizeof(const char*));i+=2)
@ -40,7 +42,7 @@ static void activate(GtkApplication *app, gpointer user_data)
const char *command = programs[i+1];
GtkWidget *button = gtk_button_new_with_label(title);
gtk_widget_set_size_request(button, 200, 80);
gtk_widget_set_size_request(button, 200, 70);
g_signal_connect(button, "clicked", G_CALLBACK (onclick),
(void*)command);
gtk_container_add(GTK_CONTAINER(button_box), button);