From d9f89e0ecdfd79f9a4d08ff76b65c3b9a3ab46ef Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Sat, 18 Jun 2011 14:10:05 -0400 Subject: [PATCH] ocarina: Add experimental settings page Right now it just contains a checkbox for running the server. It should probably contain some kind of warning text, and eventually other settings. --- ocarina/settings/__init__.py | 3 +++ ocarina/settings/experimental.py | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 ocarina/settings/experimental.py diff --git a/ocarina/settings/__init__.py b/ocarina/settings/__init__.py index f4bb41ee..278a7983 100644 --- a/ocarina/settings/__init__.py +++ b/ocarina/settings/__init__.py @@ -39,3 +39,6 @@ def add_category(module): import library add_category(library) + +import experimental +add_category(experimental) diff --git a/ocarina/settings/experimental.py b/ocarina/settings/experimental.py new file mode 100644 index 00000000..7595d95f --- /dev/null +++ b/ocarina/settings/experimental.py @@ -0,0 +1,21 @@ +# Bryan Schumaker (6 / 18 / 2011) + +import gtk +import libsaria + +page = gtk.VBox() +text = "Experimental" + +def toggled(button, func): + func(button.get_active()) + +def make_check_button(text, func, active): + button = gtk.CheckButton(text) + button.set_active(active) + button.connect("toggled", toggled, func) + return button + +SERVER = make_check_button("Enable web server", libsaria.server.toggle_state, libsaria.server.get_state()) + +page.pack_start(SERVER, False, False) +page.show_all()