2018-05-17 13:16:51 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 Purism SPC
|
|
|
|
*
|
|
|
|
* This file is part of Calls.
|
|
|
|
*
|
|
|
|
* Calls is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Calls is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY 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 Calls. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* Author: Bob Ham <bob.ham@puri.sm>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#define HANDY_USE_UNSTABLE_API
|
|
|
|
#include <handy.h>
|
|
|
|
|
2018-07-27 14:19:12 +00:00
|
|
|
#include "calls-encryption-indicator.h"
|
2018-08-01 08:21:53 +00:00
|
|
|
#include "calls-history-box.h"
|
2018-05-17 13:16:51 +00:00
|
|
|
#include "calls-main-window.h"
|
2018-08-03 14:22:12 +00:00
|
|
|
#include "calls-mm-provider.h"
|
2018-08-01 09:41:25 +00:00
|
|
|
#include "calls-new-call-box.h"
|
2018-08-30 08:26:00 +00:00
|
|
|
#include "config.h"
|
2018-08-29 11:29:07 +00:00
|
|
|
|
2018-05-17 13:16:51 +00:00
|
|
|
static void
|
|
|
|
show_window (GtkApplication *app)
|
|
|
|
{
|
|
|
|
GError *error = NULL;
|
|
|
|
GDBusConnection *connection;
|
|
|
|
CallsProvider *provider;
|
|
|
|
CallsMainWindow *main_window;
|
|
|
|
|
2018-07-27 14:19:12 +00:00
|
|
|
CALLS_TYPE_ENCRYPTION_INDICATOR;
|
2018-08-01 08:21:53 +00:00
|
|
|
CALLS_TYPE_HISTORY_BOX;
|
2018-08-01 09:41:25 +00:00
|
|
|
CALLS_TYPE_NEW_CALL_BOX;
|
2018-05-17 13:16:51 +00:00
|
|
|
HDY_TYPE_DIALER;
|
|
|
|
|
|
|
|
connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
|
|
|
|
if (!connection)
|
|
|
|
{
|
|
|
|
g_error ("Error creating D-Bus connection: %s",
|
|
|
|
error->message);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-08-03 14:22:12 +00:00
|
|
|
provider = CALLS_PROVIDER (calls_mm_provider_new (connection));
|
|
|
|
g_assert (provider != NULL);
|
2018-05-17 13:16:51 +00:00
|
|
|
|
|
|
|
main_window = calls_main_window_new (app, provider);
|
|
|
|
|
|
|
|
gtk_window_set_title (GTK_WINDOW (main_window), "Calls");
|
|
|
|
|
|
|
|
gtk_widget_show_all (GTK_WIDGET (main_window));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc,
|
|
|
|
char **argv)
|
|
|
|
{
|
|
|
|
GtkApplication *app;
|
|
|
|
int status;
|
|
|
|
|
2018-08-29 11:29:07 +00:00
|
|
|
app = gtk_application_new (APP_ID, G_APPLICATION_FLAGS_NONE);
|
2018-08-29 11:29:50 +00:00
|
|
|
g_set_prgname (APP_ID);
|
2018-05-17 13:16:51 +00:00
|
|
|
g_signal_connect (app, "activate", G_CALLBACK (show_window), NULL);
|
|
|
|
status = g_application_run (G_APPLICATION (app), argc, argv);
|
|
|
|
g_object_unref (app);
|
|
|
|
|
|
|
|
return status;
|
|
|
|
}
|