diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-09-21 23:59:48 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-09-21 23:59:48 +0200 |
commit | ce5fa07af99ac9d53e38213fd286fe8ac208e789 (patch) | |
tree | 1b203e7b677d78fabf431ce986cc09ff0b0ecd5c /src/main.c | |
parent | 4e646dac54541c70532374463767428e3f22cbd2 (diff) | |
parent | 0c689d5662beef6b90a0104ab3933058f23ce7f9 (diff) | |
download | ayatana-indicator-printers-ce5fa07af99ac9d53e38213fd286fe8ac208e789.tar.gz ayatana-indicator-printers-ce5fa07af99ac9d53e38213fd286fe8ac208e789.tar.bz2 ayatana-indicator-printers-ce5fa07af99ac9d53e38213fd286fe8ac208e789.zip |
Merge branch 'tari01-pr/indicator-ng'
Attributes GH PR #18: https://github.com/AyatanaIndicators/ayatana-indicator-printers/pull/18
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..6cc5103 --- /dev/null +++ b/src/main.c @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Robert Tari + * + * Authors: + * Robert Tari <robert@tari.in> + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <locale.h> +#include <glib.h> +#include <glib/gi18n.h> +#include "indicator-printers-service.h" + +static void onNameLost (gpointer pInstance G_GNUC_UNUSED, gpointer pLoop) +{ + g_message("Exiting: service couldn't acquire or lost ownership of busname"); + g_main_loop_quit ((GMainLoop*) pLoop); +} + +int main (int argc G_GNUC_UNUSED, char **argv G_GNUC_UNUSED) +{ + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + + IndicatorPrintersService *pService = indicator_printers_service_new (NULL); + GMainLoop *pLoop = g_main_loop_new (NULL, FALSE); + g_signal_connect (pService, "name-lost", G_CALLBACK (onNameLost), pLoop); + g_main_loop_run (pLoop); + + g_main_loop_unref (pLoop); + g_clear_object (&pService); + + return 0; +} |