diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-08-20 22:35:16 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-08-20 22:35:16 -0500 |
commit | 1b90575c67de3cf6459785cc18e3d661a826bece (patch) | |
tree | 6ea2f73a4556c89b8dffd761e53a5e0892d08dac /src/main.cpp | |
parent | ec2c7ec58b192e0b907239ad1ff840fe69b4da56 (diff) | |
download | ayatana-indicator-display-1b90575c67de3cf6459785cc18e3d661a826bece.tar.gz ayatana-indicator-display-1b90575c67de3cf6459785cc18e3d661a826bece.tar.bz2 ayatana-indicator-display-1b90575c67de3cf6459785cc18e3d661a826bece.zip |
add rotation lock indicator
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp index 5cd3581..86bdeb3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,6 +17,9 @@ * Charles Kerr <charles.kerr@canonical.com> */ +#include <src/exporter.h> +#include <src/rotation-lock.h> + #include <glib/gi18n.h> // bindtextdomain() #include <gio/gio.h> @@ -35,14 +38,22 @@ main(int /*argc*/, char** /*argv*/) textdomain(GETTEXT_PACKAGE); auto loop = g_main_loop_new(nullptr, false); + auto on_name_lost = [loop](const std::string& name){ + g_warning("busname lost: '%s'", name.c_str()); + g_main_loop_quit(loop); + }; + + // build all our indicators. + // Right now we've only got one -- rotation lock -- but hey, we can dream. + std::vector<std::shared_ptr<Indicator>> indicators; + std::vector<std::shared_ptr<Exporter>> exporters; + indicators.push_back(std::make_shared<RotationLockIndicator>()); + for (auto& indicator : indicators) { + auto exporter = std::make_shared<Exporter>(indicator); + exporter->name_lost().connect(on_name_lost); + exporters.push_back(exporter); + } - // run until we lose the busname -// auto model = std::make_shared<MutableModel>(); - // auto world = std::shared_ptr<World>(new DBusWorld(model)); - // auto controller = std::make_shared<Controller>(model, world); - // GMenuView menu_view (model, controller); - // FIXME: listen for busname-lost - g_message("entering GMainLoop that does nothing! Woo!"); g_main_loop_run(loop); // cleanup |