From be766f12c4c9629d720e149a983503034d75c192 Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Tue, 4 Mar 2014 20:33:36 +0100 Subject: shell: remove old launcher grid and related widgets --- shell/app-launcher.c | 143 --------------------------------------------------- 1 file changed, 143 deletions(-) delete mode 100644 shell/app-launcher.c (limited to 'shell/app-launcher.c') diff --git a/shell/app-launcher.c b/shell/app-launcher.c deleted file mode 100644 index 84d066b..0000000 --- a/shell/app-launcher.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2013 Collabora Ltd. - * - * Author: Emilio Pozuelo Monfort - */ - -#include "config.h" - -#include "app-launcher.h" - -#include -#include -#include - -enum { - PROP_0, - PROP_INFO, -}; - -struct AppLauncherPrivate { - GDesktopAppInfo *info; -}; - -G_DEFINE_TYPE(AppLauncher, app_launcher, GTK_TYPE_BOX) - -static void -get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec) -{ - AppLauncher *self = APP_LAUNCHER (object); - - switch (param_id) - { - case PROP_INFO: - g_value_set_object (value, self->priv->info); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - } -} - -static void -set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec) -{ - AppLauncher *self = APP_LAUNCHER (object); - - switch (param_id) - { - case PROP_INFO: - self->priv->info = g_value_dup_object (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - } -} - -static void -app_launcher_dispose (GObject *object) -{ - AppLauncher *self = APP_LAUNCHER (object); - - g_clear_object (&self->priv->info); - - G_OBJECT_CLASS (app_launcher_parent_class)->dispose (object); -} - -static void -app_launcher_init (AppLauncher *self) -{ - self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, - APP_TYPE_LAUNCHER, - AppLauncherPrivate); - - gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_VERTICAL); -} - -static void -app_launcher_constructed (GObject *object) -{ - AppLauncher *self = APP_LAUNCHER (object); - GtkWidget *label; - GtkWidget *image; - GIcon *icon; - - G_OBJECT_CLASS (app_launcher_parent_class)->constructed (object); - - icon = g_app_info_get_icon (G_APP_INFO (self->priv->info)); - image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_LARGE_TOOLBAR); - gtk_box_pack_start (GTK_BOX (self), image, FALSE, FALSE, 6); - - label = gtk_label_new (g_app_info_get_display_name (G_APP_INFO (self->priv->info))); - gtk_box_pack_start (GTK_BOX (self), label, FALSE, FALSE, 6); -} - -static void -app_launcher_class_init (AppLauncherClass *klass) -{ - GObjectClass *object_class = (GObjectClass *)klass; - - object_class->constructed = app_launcher_constructed; - object_class->dispose = app_launcher_dispose; - object_class->get_property = get_property; - object_class->set_property = set_property; - - g_object_class_install_property (object_class, PROP_INFO, - g_param_spec_object ("info", - "Info", - "The #GDesktopAppInfo that is being displayed", - G_TYPE_DESKTOP_APP_INFO, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); - - g_type_class_add_private (object_class, sizeof (AppLauncherPrivate)); -} - -GtkWidget * -app_launcher_new_from_desktop_info (GDesktopAppInfo *info) -{ - return g_object_new (APP_TYPE_LAUNCHER, - "info", info, - NULL); -} - -void -app_launcher_activate (AppLauncher *self) -{ - GError *error = NULL; - - g_app_info_launch (G_APP_INFO (self->priv->info), NULL, NULL, &error); - if (error) - { - g_warning ("Could not launch app %s: %s", - g_app_info_get_name (G_APP_INFO (self->priv->info)), - error->message); - g_clear_error (&error); - } -} -- cgit v1.3.1