Add exit button
This commit is contained in:
@@ -12,6 +12,9 @@ $(TARGET): $(SRCS)
|
||||
run: $(TARGET)
|
||||
./$(TARGET)
|
||||
|
||||
install:
|
||||
cp olympuswifi /usr/local/bin/
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET)
|
||||
|
||||
|
||||
+20
-1
@@ -120,6 +120,7 @@ public class ImageItem : Gtk.FlowBoxChild {
|
||||
|
||||
public class ConnectPage : Gtk.Box {
|
||||
private Gtk.Button connect_button;
|
||||
private Gtk.Button exit_button;
|
||||
private Gtk.Label status_label;
|
||||
private Gtk.Spinner spinner;
|
||||
private Gtk.Box status_box;
|
||||
@@ -151,7 +152,7 @@ public class ConnectPage : Gtk.Box {
|
||||
append (new Gtk.Label (""));
|
||||
|
||||
// Connect button
|
||||
connect_button = new Gtk.Button.with_label( "Connect to Camera");
|
||||
connect_button = new Gtk.Button.with_label("connect to camera");
|
||||
connect_button.add_css_class ("suggested-action");
|
||||
connect_button.add_css_class ("circular");
|
||||
connect_button.hexpand = false;
|
||||
@@ -159,9 +160,19 @@ public class ConnectPage : Gtk.Box {
|
||||
connect_button.height_request = 60;
|
||||
connect_button.valign = Gtk.Align.CENTER;
|
||||
|
||||
// Exit button
|
||||
exit_button = new Gtk.Button.with_label("exit");
|
||||
exit_button.add_css_class ("circular");
|
||||
exit_button.hexpand = false;
|
||||
exit_button.width_request = 120;
|
||||
exit_button.height_request = 60;
|
||||
exit_button.valign = Gtk.Align.CENTER;
|
||||
|
||||
|
||||
var button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
|
||||
button_box.halign = Gtk.Align.CENTER;
|
||||
button_box.append (connect_button);
|
||||
button_box.append (exit_button);
|
||||
append (button_box);
|
||||
|
||||
// Status box (spinner + label)
|
||||
@@ -178,6 +189,7 @@ public class ConnectPage : Gtk.Box {
|
||||
append (status_box);
|
||||
|
||||
connect_button.clicked.connect (on_connect_clicked);
|
||||
exit_button.clicked.connect (on_exit_clicked);
|
||||
}
|
||||
|
||||
private void on_connect_clicked () {
|
||||
@@ -186,6 +198,13 @@ public class ConnectPage : Gtk.Box {
|
||||
new Thread<void*> ("connect", connect_thread);
|
||||
}
|
||||
|
||||
private void on_exit_clicked () {
|
||||
var window = (Gtk.Window) this.get_root ();
|
||||
if (window != null) {
|
||||
window.destroy ();
|
||||
}
|
||||
}
|
||||
|
||||
private void* connect_thread () {
|
||||
var camera = new CameraClient ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user