aboutsummaryrefslogtreecommitdiff
path: root/tests/manual-test-snap.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-07-01 09:36:57 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-07-01 09:36:57 +0000
commit6ad9b8d2449c745953a1692b27e8d2b993a722d6 (patch)
treed0ce34b82460f52322d3bc9215fc7d989e642731 /tests/manual-test-snap.cpp
parent6880613bbc6535242e95e7f5c65d9a9140eaa28b (diff)
parent194e79302027047ae36146f6ec4e7c0e9c1d2fc2 (diff)
downloadayatana-indicator-datetime-6ad9b8d2449c745953a1692b27e8d2b993a722d6.tar.gz
ayatana-indicator-datetime-6ad9b8d2449c745953a1692b27e8d2b993a722d6.tar.bz2
ayatana-indicator-datetime-6ad9b8d2449c745953a1692b27e8d2b993a722d6.zip
Expose the new alarm settings as DBus properties. Fixes: 1318997
Diffstat (limited to 'tests/manual-test-snap.cpp')
-rw-r--r--tests/manual-test-snap.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/manual-test-snap.cpp b/tests/manual-test-snap.cpp
index 90dbe08..cc24a67 100644
--- a/tests/manual-test-snap.cpp
+++ b/tests/manual-test-snap.cpp
@@ -41,10 +41,29 @@ namespace
g_main_loop_quit(static_cast<GMainLoop*>(gloop));
return G_SOURCE_REMOVE;
};
+
+ int volume = 50;
+
+ GOptionEntry entries[] =
+ {
+ { "volume", 'v', 0, G_OPTION_ARG_INT, &volume, "Volume level [1..100]", "volume" },
+ { NULL }
+ };
}
-int main()
+int main(int argc, const char* argv[])
{
+ GError* error = nullptr;
+ GOptionContext* context = g_option_context_new(nullptr);
+ g_option_context_add_main_entries(context, entries, nullptr);
+ if (!g_option_context_parse(context, &argc, (gchar***)&argv, &error))
+ {
+ g_print("option parsing failed: %s\n", error->message);
+ exit(1);
+ }
+ g_option_context_free(context);
+ volume = CLAMP(volume, 1, 100);
+
Appointment a;
a.color = "green";
a.summary = "Alarm";
@@ -74,6 +93,7 @@ int main()
g_debug("SCHEMA_DIR is %s", SCHEMA_DIR);
auto settings = std::make_shared<LiveSettings>();
+ settings->alarm_volume.set(volume);
auto timezones = std::make_shared<LiveTimezones>(settings, TIMEZONE_FILE);
auto clock = std::make_shared<LiveClock>(timezones);
Snap snap (clock, settings);