[console/zbrown/term-intent: 3/6] rebase fallout
- From: Zander Brown <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [console/zbrown/term-intent: 3/6] rebase fallout
- Date: Sat, 23 Jul 2022 01:23:12 +0000 (UTC)
commit c06c3d864172e53c235c6f8424a10a918081f916
Author: Zander Brown <zbrown gnome org>
Date: Thu Dec 9 11:45:33 2021 +0000
rebase fallout
src/kgx-session-manager.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++
src/kgx-session-manager.h | 31 +++++++++++++++++++
src/kgx-window.c | 15 +++++-----
src/meson.build | 2 +-
4 files changed, 116 insertions(+), 8 deletions(-)
---
diff --git a/src/kgx-session-manager.c b/src/kgx-session-manager.c
new file mode 100644
index 0000000..af0c76c
--- /dev/null
+++ b/src/kgx-session-manager.c
@@ -0,0 +1,76 @@
+/* kgx-session-manager.c
+ *
+ * Copyright 2021 Zander Brown
+ *
+ * This program 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.
+ *
+ * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * SECTION:kgx-session-manager
+ * @short_description: An object with proxy details
+ * @title: KgxSessionManager
+ *
+ * #KgxSessionManager maps org.gnome.system.proxy to environmental variables
+ * when launching new sessions
+ *
+ * Note that whilst changes to system settings are tracked, they _cannot_ be
+ * applied existing terminals
+ *
+ * Only manual proxies are supported
+ */
+
+#include "kgx-config.h"
+
+#include <gio/gio.h>
+
+#include "kgx-session-manager.h"
+
+
+struct _KgxSessionManager {
+ GObject parent_instance;
+
+ GFile *cache_dir;
+};
+
+
+G_DEFINE_TYPE (KgxSessionManager, kgx_session_manager, G_TYPE_OBJECT)
+
+
+static void
+kgx_session_manager_dispose (GObject *object)
+{
+ KgxSessionManager *self = KGX_SESSION_MANAGER (object);
+
+ g_clear_object (&self->cache_dir);
+
+ G_OBJECT_CLASS (kgx_session_manager_parent_class)->dispose (object);
+}
+
+
+static void
+kgx_session_manager_class_init (KgxSessionManagerClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->dispose = kgx_session_manager_dispose;
+}
+
+
+static void
+kgx_session_manager_init (KgxSessionManager *self)
+{
+ self->cache_dir = g_file_new_build_filename (g_get_user_cache_dir (),
+ KGX_APPLICATION_ID,
+ TRUE);
+}
diff --git a/src/kgx-session-manager.h b/src/kgx-session-manager.h
new file mode 100644
index 0000000..c57228d
--- /dev/null
+++ b/src/kgx-session-manager.h
@@ -0,0 +1,31 @@
+/* kgx-session-manager.h
+ *
+ * Copyright 2021 Zander Brown
+ *
+ * This program 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.
+ *
+ * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define KGX_TYPE_SESSION_MANAGER kgx_session_manager_get_type ()
+
+G_DECLARE_FINAL_TYPE (KgxSessionManager, kgx_session_manager, KGX, SESSION_MANAGER, GObject)
+
+KgxSessionManager *kgx_session_manager_new (void);
+
+G_END_DECLS
diff --git a/src/kgx-window.c b/src/kgx-window.c
index ced2289..d23f38e 100644
--- a/src/kgx-window.c
+++ b/src/kgx-window.c
@@ -133,11 +133,11 @@ kgx_window_constructed (GObject *object)
priv->pages, "theme",
G_BINDING_SYNC_CREATE);
g_object_bind_property (application, "theme",
- self->theme_switcher, "theme",
+ priv->theme_switcher, "theme",
G_BINDING_SYNC_CREATE |
G_BINDING_BIDIRECTIONAL);
g_object_bind_property (style_manager, "system-supports-color-schemes",
- self->theme_switcher, "show-system",
+ priv->theme_switcher, "show-system",
G_BINDING_SYNC_CREATE);
g_object_bind_property (application, "font",
@@ -592,8 +592,9 @@ tab_switcher_activated (GSimpleAction *action,
gpointer data)
{
KgxWindow *self = data;
+ KgxWindowPrivate *priv = kgx_window_get_instance_private (self);
- kgx_tab_switcher_open (KGX_TAB_SWITCHER (self->tab_switcher));
+ kgx_tab_switcher_open (KGX_TAB_SWITCHER (priv->tab_switcher));
}
@@ -720,11 +721,11 @@ kgx_window_init (KgxWindow *self)
g_object_bind_property (priv->pages, "tab-view",
priv->tab_bar, "view",
G_BINDING_SYNC_CREATE);
- g_object_bind_property (self->pages, "tab-view",
- self->tab_button, "view",
+ g_object_bind_property (priv->pages, "tab-view",
+ priv->tab_button, "view",
G_BINDING_SYNC_CREATE);
- g_object_bind_property (self->pages, "tab-view",
- self->tab_switcher, "view",
+ g_object_bind_property (priv->pages, "tab-view",
+ priv->tab_switcher, "view",
G_BINDING_SYNC_CREATE);
target_list = gtk_target_list_new (NULL, 0);
diff --git a/src/meson.build b/src/meson.build
index f5b9184..153ebe7 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -64,7 +64,7 @@ kgx_sources += gnome.gdbus_codegen('xdg-term1',
namespace: 'Xdg',
)
-kgx_sources += gnome.mkenums_simple('kgx-enums',
+kgx_enums = gnome.mkenums_simple('kgx-enums',
sources: [
'kgx-close-dialog.h',
'kgx-terminal.h',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]