Commit af93ab5e authored by Guido Gunther's avatar Guido Gunther
Browse files

network-auth-prompt: Use PhoshSystemModal


Signed-off-by: Guido Gunther's avatarGuido Günther <guido.gunther@puri.sm>
parent 11d5be84
......@@ -37,7 +37,7 @@ static guint signals[N_SIGNALS] = { 0 };
struct _PhoshNetworkAuthPrompt
{
PhoshLayerSurface parent;
PhoshSystemModal parent;
GtkWidget *cancel_button;
GtkWidget *connect_button;
......@@ -62,7 +62,7 @@ struct _PhoshNetworkAuthPrompt
gboolean visible; /* is input visible */
};
G_DEFINE_TYPE(PhoshNetworkAuthPrompt, phosh_network_auth_prompt, PHOSH_TYPE_LAYER_SURFACE);
G_DEFINE_TYPE(PhoshNetworkAuthPrompt, phosh_network_auth_prompt, PHOSH_TYPE_SYSTEM_MODAL);
static void
......@@ -370,28 +370,14 @@ phosh_network_auth_prompt_init (PhoshNetworkAuthPrompt *self)
GtkWidget *
phosh_network_auth_prompt_new (ShellNetworkAgent *agent,
NMClient *nm_client,
gpointer layer_shell,
gpointer wl_output)
NMClient *nm_client)
{
PhoshNetworkAuthPrompt *self;
g_return_val_if_fail (SHELL_IS_NETWORK_AGENT (agent), NULL);
g_return_val_if_fail (NM_CLIENT (nm_client), NULL);
self = g_object_new (PHOSH_TYPE_NETWORK_AUTH_PROMPT,
/* layer shell */
"layer-shell", layer_shell,
"wl-output", wl_output,
"anchor", ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT,
"layer", ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY,
"kbd-interactivity", TRUE,
"exclusive-zone", -1,
"namespace", "phosh prompter",
NULL);
self = g_object_new (PHOSH_TYPE_NETWORK_AUTH_PROMPT, NULL);
self->nm_client = g_object_ref (nm_client);
self->agent = g_object_ref (agent);
......
......@@ -7,18 +7,16 @@
#include <gtk/gtk.h>
#include <NetworkManager.h>
#include "layersurface.h"
#include "system-modal.h"
G_BEGIN_DECLS
#define PHOSH_TYPE_NETWORK_AUTH_PROMPT (phosh_network_auth_prompt_get_type())
G_DECLARE_FINAL_TYPE (PhoshNetworkAuthPrompt, phosh_network_auth_prompt, PHOSH, NETWORK_AUTH_PROMPT, PhoshLayerSurface);
G_DECLARE_FINAL_TYPE (PhoshNetworkAuthPrompt, phosh_network_auth_prompt, PHOSH, NETWORK_AUTH_PROMPT, PhoshSystemModal);
GtkWidget *phosh_network_auth_prompt_new (ShellNetworkAgent *agent,
NMClient *nm_client,
gpointer layer_shell,
gpointer wl_output);
NMClient *nm_client);
void phosh_network_auth_prompt_set_request (PhoshNetworkAuthPrompt *self,
char *request_id,
NMConnection *connection,
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="PhoshNetworkAuthPrompt" parent="PhoshLayerSurface">
<template class="PhoshNetworkAuthPrompt" parent="PhoshSystemModal">
<signal name="key-press-event" handler="network_prompt_key_press_event_cb"/>
<child>
<object class="GtkBox">
......
......@@ -448,9 +448,6 @@ network_prompt_done_cb (PhoshWifiManager *self)
static void
network_agent_setup_prompt (PhoshWifiManager *self)
{
PhoshMonitor *primary_monitor;
PhoshWayland *wl = phosh_wayland_get_default ();
PhoshShell *shell = phosh_shell_get_default ();
GtkWidget *network_prompt;
g_return_if_fail (PHOSH_IS_WIFI_MANAGER (self));
......@@ -458,11 +455,8 @@ network_agent_setup_prompt (PhoshWifiManager *self)
if (self->network_prompt)
return;
primary_monitor = phosh_shell_get_primary_monitor (shell);
network_prompt = phosh_network_auth_prompt_new (self->network_agent,
self->nmclient,
phosh_wayland_get_zwlr_layer_shell_v1(wl),
primary_monitor->wl_output);
self->nmclient);
self->network_prompt = PHOSH_NETWORK_AUTH_PROMPT (network_prompt);
g_signal_connect_object (self->network_prompt, "done",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment