mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/virt-viewer
synced 2025-12-27 14:54:14 +00:00
Remove the "container" logic used by legacy browser plugin
This commit is contained in:
parent
79fd2ea3d0
commit
d0d8a9fba0
@ -106,7 +106,6 @@ static void virt_viewer_app_update_menu_displays(VirtViewerApp *self);
|
||||
struct _VirtViewerAppPrivate {
|
||||
VirtViewerWindow *main_window;
|
||||
GtkWidget *main_notebook;
|
||||
GtkWidget *container;
|
||||
GHashTable *windows;
|
||||
gchar *clipboard;
|
||||
|
||||
@ -152,7 +151,6 @@ G_DEFINE_ABSTRACT_TYPE(VirtViewerApp, virt_viewer_app, G_TYPE_OBJECT)
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_VERBOSE,
|
||||
PROP_CONTAINER,
|
||||
PROP_SESSION,
|
||||
PROP_GUEST_NAME,
|
||||
PROP_GURI,
|
||||
@ -651,15 +649,12 @@ app_window_try_fullscreen(VirtViewerApp *self, VirtViewerWindow *win, gint nth)
|
||||
}
|
||||
|
||||
static VirtViewerWindow*
|
||||
virt_viewer_app_window_new(VirtViewerApp *self, GtkWidget *container, gint nth)
|
||||
virt_viewer_app_window_new(VirtViewerApp *self, gint nth)
|
||||
{
|
||||
VirtViewerWindow* window;
|
||||
GtkWindow *w;
|
||||
|
||||
window = g_object_new(VIRT_VIEWER_TYPE_WINDOW,
|
||||
"app", self,
|
||||
"container", container,
|
||||
NULL);
|
||||
window = g_object_new(VIRT_VIEWER_TYPE_WINDOW, "app", self, NULL);
|
||||
if (self->priv->main_window)
|
||||
virt_viewer_window_set_zoom_level(window, virt_viewer_window_get_zoom_level(self->priv->main_window));
|
||||
virt_viewer_app_set_nth_window(self, nth, window);
|
||||
@ -721,13 +716,8 @@ virt_viewer_app_display_added(VirtViewerSession *session G_GNUC_UNUSED,
|
||||
if (nth == 0) {
|
||||
window = priv->main_window;
|
||||
} else {
|
||||
if (priv->container) {
|
||||
g_warning("multi-head not yet supported within container");
|
||||
return;
|
||||
}
|
||||
|
||||
g_return_if_fail(virt_viewer_app_get_nth_window(self, nth) == NULL);
|
||||
window = virt_viewer_app_window_new(self, NULL, nth);
|
||||
window = virt_viewer_app_window_new(self, nth);
|
||||
}
|
||||
|
||||
virt_viewer_window_set_display(window, display);
|
||||
@ -1243,10 +1233,6 @@ virt_viewer_app_get_property (GObject *object, guint property_id,
|
||||
g_value_set_boolean(value, priv->verbose);
|
||||
break;
|
||||
|
||||
case PROP_CONTAINER:
|
||||
g_value_set_object(value, priv->container);
|
||||
break;
|
||||
|
||||
case PROP_SESSION:
|
||||
g_value_set_object(value, priv->session);
|
||||
break;
|
||||
@ -1297,11 +1283,6 @@ virt_viewer_app_set_property (GObject *object, guint property_id,
|
||||
priv->verbose = g_value_get_boolean(value);
|
||||
break;
|
||||
|
||||
case PROP_CONTAINER:
|
||||
g_return_if_fail(priv->container == NULL);
|
||||
priv->container = g_value_dup_object(value);
|
||||
break;
|
||||
|
||||
case PROP_GUEST_NAME:
|
||||
g_free(priv->guest_name);
|
||||
priv->guest_name = g_value_dup_string(value);
|
||||
@ -1350,11 +1331,6 @@ virt_viewer_app_dispose (GObject *object)
|
||||
g_hash_table_unref(tmp);
|
||||
}
|
||||
|
||||
if (priv->container) {
|
||||
g_object_unref(priv->container);
|
||||
priv->container = NULL;
|
||||
}
|
||||
|
||||
if (priv->session) {
|
||||
g_object_unref(priv->session);
|
||||
priv->session = NULL;
|
||||
@ -1430,7 +1406,7 @@ virt_viewer_app_constructor (GType gtype,
|
||||
self = VIRT_VIEWER_APP(obj);
|
||||
priv = self->priv;
|
||||
|
||||
priv->main_window = virt_viewer_app_window_new(self, priv->container, 0);
|
||||
priv->main_window = virt_viewer_app_window_new(self, 0);
|
||||
priv->main_notebook = GTK_WIDGET(virt_viewer_window_get_notebook(priv->main_window));
|
||||
|
||||
gtk_accel_map_add_entry("<virt-viewer>/file/smartcard-insert", GDK_F8, GDK_SHIFT_MASK);
|
||||
@ -1469,17 +1445,6 @@ virt_viewer_app_class_init (VirtViewerAppClass *klass)
|
||||
G_PARAM_WRITABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property(object_class,
|
||||
PROP_CONTAINER,
|
||||
g_param_spec_object("container",
|
||||
"Container",
|
||||
"Widget container",
|
||||
GTK_TYPE_WIDGET,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_WRITABLE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property(object_class,
|
||||
PROP_SESSION,
|
||||
g_param_spec_object("session",
|
||||
|
||||
@ -129,7 +129,7 @@ int main(int argc, char **argv)
|
||||
|
||||
virt_viewer_app_set_debug(debug);
|
||||
|
||||
viewer = virt_viewer_new(uri, args[0], zoom, direct, attach, waitvm, reconnect, verbose, NULL);
|
||||
viewer = virt_viewer_new(uri, args[0], zoom, direct, attach, waitvm, reconnect, verbose);
|
||||
if (viewer == NULL)
|
||||
goto cleanup;
|
||||
|
||||
|
||||
@ -75,13 +75,11 @@ enum {
|
||||
PROP_WINDOW,
|
||||
PROP_DISPLAY,
|
||||
PROP_SUBTITLE,
|
||||
PROP_CONTAINER,
|
||||
PROP_APP,
|
||||
};
|
||||
|
||||
struct _VirtViewerWindowPrivate {
|
||||
VirtViewerApp *app;
|
||||
GtkContainer *container; /* if any, then there is no window */
|
||||
|
||||
GtkBuilder *builder;
|
||||
GtkWidget *window;
|
||||
@ -128,10 +126,6 @@ virt_viewer_window_get_property (GObject *object, guint property_id,
|
||||
g_value_set_object(value, virt_viewer_window_get_display(self));
|
||||
break;
|
||||
|
||||
case PROP_CONTAINER:
|
||||
g_value_set_object(value, priv->container);
|
||||
break;
|
||||
|
||||
case PROP_APP:
|
||||
g_value_set_object(value, priv->app);
|
||||
break;
|
||||
@ -154,11 +148,6 @@ virt_viewer_window_set_property (GObject *object, guint property_id,
|
||||
virt_viewer_window_update_title(VIRT_VIEWER_WINDOW(object));
|
||||
break;
|
||||
|
||||
case PROP_CONTAINER:
|
||||
g_return_if_fail(priv->container == NULL);
|
||||
priv->container = g_value_dup_object(value);
|
||||
break;
|
||||
|
||||
case PROP_APP:
|
||||
g_return_if_fail(priv->app == NULL);
|
||||
priv->app = g_value_get_object(value);
|
||||
@ -244,17 +233,6 @@ virt_viewer_window_class_init (VirtViewerWindowClass *klass)
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property(object_class,
|
||||
PROP_CONTAINER,
|
||||
g_param_spec_object("container",
|
||||
"Container",
|
||||
"Container widget",
|
||||
VIRT_VIEWER_TYPE_DISPLAY,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_WRITABLE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property(object_class,
|
||||
PROP_APP,
|
||||
g_param_spec_object("app",
|
||||
|
||||
@ -733,15 +733,13 @@ virt_viewer_new(const char *uri,
|
||||
gboolean attach,
|
||||
gboolean waitvm,
|
||||
gboolean reconnect,
|
||||
gboolean verbose,
|
||||
GtkWidget *container)
|
||||
gboolean verbose)
|
||||
{
|
||||
VirtViewer *self;
|
||||
VirtViewerApp *app;
|
||||
VirtViewerPrivate *priv;
|
||||
|
||||
self = g_object_new(VIRT_VIEWER_TYPE,
|
||||
"container", container,
|
||||
"verbose", verbose,
|
||||
"guest-name", name,
|
||||
NULL);
|
||||
|
||||
@ -56,8 +56,7 @@ virt_viewer_new(const char *uri,
|
||||
gboolean attach,
|
||||
gboolean waitvm,
|
||||
gboolean reconnect,
|
||||
gboolean verbose,
|
||||
GtkWidget *container);
|
||||
gboolean verbose);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user