Line |
Branch |
Exec |
Source |
1 |
|
|
/* |
2 |
|
|
* Copyright 2023 Gotam Gorabh <gautamy672@gmail.com> |
3 |
|
|
* |
4 |
|
|
* This program is free software: you can redistribute it and/or modify |
5 |
|
|
* it under the terms of the GNU General Public License as published by |
6 |
|
|
* the Free Software Foundation, either version 3 of the License, or |
7 |
|
|
* (at your option) any later version. |
8 |
|
|
* |
9 |
|
|
* This program is distributed in the hope that it will be useful, |
10 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 |
|
|
* GNU General Public License for more details. |
13 |
|
|
* |
14 |
|
|
* You should have received a copy of the GNU General Public License |
15 |
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 |
|
|
* |
17 |
|
|
* SPDX-License-Identifier: GPL-3.0-or-later |
18 |
|
|
*/ |
19 |
|
|
|
20 |
|
|
#undef G_LOG_DOMAIN |
21 |
|
|
#define G_LOG_DOMAIN "cc-remote-desktop-page" |
22 |
|
|
|
23 |
|
|
#include "cc-remote-desktop-page.h" |
24 |
|
|
#include "cc-desktop-sharing-page.h" |
25 |
|
|
#include "cc-remote-login-page.h" |
26 |
|
|
|
27 |
|
|
#ifdef HAVE_CONFIG_H |
28 |
|
|
# include "config.h" |
29 |
|
|
#endif |
30 |
|
|
|
31 |
|
|
struct _CcRemoteDesktopPage { |
32 |
|
|
AdwNavigationPage parent_instance; |
33 |
|
|
|
34 |
|
|
CcDesktopSharingPage *desktop_sharing_page; |
35 |
|
|
|
36 |
|
|
GCancellable *cancellable; |
37 |
|
|
}; |
38 |
|
|
|
39 |
|
✗ |
G_DEFINE_TYPE (CcRemoteDesktopPage, cc_remote_desktop_page, ADW_TYPE_NAVIGATION_PAGE) |
40 |
|
|
|
41 |
|
|
static void |
42 |
|
✗ |
cc_remote_desktop_page_dispose (GObject *object) |
43 |
|
|
{ |
44 |
|
✗ |
CcRemoteDesktopPage *self = (CcRemoteDesktopPage *)object; |
45 |
|
|
|
46 |
|
✗ |
g_cancellable_cancel (self->cancellable); |
47 |
|
✗ |
g_clear_object (&self->cancellable); |
48 |
|
|
|
49 |
|
✗ |
G_OBJECT_CLASS (cc_remote_desktop_page_parent_class)->dispose (object); |
50 |
|
✗ |
} |
51 |
|
|
|
52 |
|
|
static void |
53 |
|
✗ |
cc_remote_desktop_page_class_init (CcRemoteDesktopPageClass * klass) |
54 |
|
|
{ |
55 |
|
✗ |
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); |
56 |
|
✗ |
GObjectClass *object_class = G_OBJECT_CLASS (klass); |
57 |
|
|
|
58 |
|
✗ |
object_class->dispose = cc_remote_desktop_page_dispose; |
59 |
|
|
|
60 |
|
✗ |
g_type_ensure (CC_TYPE_DESKTOP_SHARING_PAGE); |
61 |
|
✗ |
g_type_ensure (CC_TYPE_REMOTE_LOGIN_PAGE); |
62 |
|
|
|
63 |
|
✗ |
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/system/remote-desktop/cc-remote-desktop-page.ui"); |
64 |
|
|
|
65 |
|
✗ |
gtk_widget_class_bind_template_child (widget_class, CcRemoteDesktopPage, desktop_sharing_page); |
66 |
|
✗ |
} |
67 |
|
|
|
68 |
|
|
static void |
69 |
|
✗ |
cc_remote_desktop_page_init (CcRemoteDesktopPage *self) |
70 |
|
|
{ |
71 |
|
✗ |
g_autoptr(GtkCssProvider) provider = NULL; |
72 |
|
|
|
73 |
|
✗ |
gtk_widget_init_template (GTK_WIDGET (self)); |
74 |
|
|
|
75 |
|
✗ |
self->cancellable = g_cancellable_new (); |
76 |
|
✗ |
} |
77 |
|
|
|