[gnome-mud] Delete the tray (status icon)



commit c2441e38fb6d9f7ce06840dc735bfc2a65dfd37b
Author: Mart Raudsepp <leio gentoo org>
Date:   Sun Jan 6 13:50:00 2019 +0200

    Delete the tray (status icon)
    
    Not exactly a favored concept in GNOME3, and all we did was allow
    to hide the window into tray, and show connection status, but that
    was not working due to always same icon used since some old
    refactoring.

 src/meson.build           |   2 -
 src/mud-connection-view.c |  24 ----
 src/mud-connection-view.h |   2 -
 src/mud-connections.c     |   6 -
 src/mud-tray.c            | 313 ----------------------------------------------
 src/mud-tray.h            |  71 -----------
 src/mud-window.c          |  28 +----
 src/mud-window.h          |   2 -
 8 files changed, 1 insertion(+), 447 deletions(-)
---
diff --git a/src/meson.build b/src/meson.build
index a5f512c..34f9eed 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -47,8 +47,6 @@ gnome_mud_sources = [
   'mud-telnet.h',
   'mud-trigger.c',
   'mud-trigger.h',
-  'mud-tray.c',
-  'mud-tray.h',
   'mud-window.c',
   'mud-window.h',
   'mud-window-prefs.c',
diff --git a/src/mud-connection-view.c b/src/mud-connection-view.c
index 42f61f7..9f80240 100644
--- a/src/mud-connection-view.c
+++ b/src/mud-connection-view.c
@@ -31,7 +31,6 @@
 #include "mud-connection-view.h"
 #include "mud-profile.h"
 #include "mud-window.h"
-#include "mud-tray.h"
 #include "mud-log.h"
 #include "mud-parse-base.h"
 #include "mud-telnet.h"
@@ -84,7 +83,6 @@ enum
     PROP_MUD_NAME,
     PROP_HOSTNAME,
     PROP_LOG,
-    PROP_TRAY,
     PROP_PROFILE,
     PROP_PARSE_BASE,
     PROP_TELNET,
@@ -256,14 +254,6 @@ mud_connection_view_class_init (MudConnectionViewClass *klass)
                 G_PARAM_READWRITE));
 
     // Readable Properties
-    g_object_class_install_property(object_class,
-            PROP_TRAY,
-            g_param_spec_object("tray",
-                "mud tray",
-                "mud status tray icon",
-                MUD_TYPE_TRAY,
-                G_PARAM_READABLE));
-
     g_object_class_install_property(object_class,
             PROP_CONNECTION,
             g_param_spec_pointer("connection",
@@ -368,7 +358,6 @@ mud_connection_view_init (MudConnectionView *self)
     self->hostname = NULL;
 
     self->log = NULL;
-    self->tray = NULL;
     self->profile = NULL;
     self->parse = NULL;
     self->window = NULL;
@@ -392,7 +381,6 @@ mud_connection_connected_cb(MudConnection *conn, MudConnectionView *self)
                                 "connection", conn,
                                 NULL);
 
-    mud_tray_update_icon(self->tray, online);
     mud_connection_view_add_text(self, _("*** Connected.\n"), System);
 }
 
@@ -470,7 +458,6 @@ mud_connection_view_constructor (GType gtype,
 #endif
     GtkWidget *term_box;
     GtkWidget *main_window;
-    MudTray *tray;
     gchar *buf;
     gchar *proxy_uri;
     MudProfile *profile;
@@ -584,15 +571,12 @@ mud_connection_view_constructor (GType gtype,
 
     g_object_get(self->window,
                  "window", &main_window,
-                 "tray", &tray,
                  NULL);
 
     profile = self->profile; /* FIXME: Gross workaround to get around set_profile check and early bail-out 
after construct_only restructuring; hopefully this can all be cleaned up together with move away from 
constructor to constructed override */
     self->profile = NULL;
     mud_connection_view_set_profile(self, profile);
 
-    self->tray = tray;
-
     self->parse = g_object_new(MUD_TYPE_PARSE_BASE,
                                "parent-view", self,
                                NULL);
@@ -843,10 +827,6 @@ mud_connection_view_set_property(GObject *object,
             self->window = MUD_WINDOW(g_value_get_object(value));
             break;
 
-        case PROP_TRAY:
-            self->tray = MUD_TRAY(g_value_get_object(value));
-            break;
-
         case PROP_LOGGING:
             new_boolean = g_value_get_boolean(value);
 
@@ -916,10 +896,6 @@ mud_connection_view_get_property(GObject *object,
             g_value_take_object(value, self->log);
             break;
 
-        case PROP_TRAY:
-            g_value_take_object(value, self->tray);
-            break;
-
         case PROP_PROFILE:
             g_value_take_object(value, self->profile);
             break;
diff --git a/src/mud-connection-view.h b/src/mud-connection-view.h
index 74ec6d8..0b42b89 100644
--- a/src/mud-connection-view.h
+++ b/src/mud-connection-view.h
@@ -24,7 +24,6 @@ typedef struct _MudConnectionViewPrivate    MudConnectionViewPrivate;
 #include "mud-profile.h"
 #include "mud-window.h"
 #include "mud-log.h"
-#include "mud-tray.h"
 #include "mud-subwindow.h"
 
 struct _MudConnectionViewClass
@@ -57,7 +56,6 @@ struct _MudConnectionView
     gchar *hostname;
 
     MudLog *log;
-    MudTray *tray;
     MudTelnet *telnet;
     MudWindow *window;
     MudProfile *profile;
diff --git a/src/mud-connections.c b/src/mud-connections.c
index 0bf8ecf..6671541 100644
--- a/src/mud-connections.c
+++ b/src/mud-connections.c
@@ -32,7 +32,6 @@
 #include "mud-character.h"
 #include "mud-window.h"
 #include "mud-connection-view.h"
-#include "mud-tray.h"
 #include "mud-profile.h"
 #include "utils.h"
 
@@ -44,7 +43,6 @@ struct _MudConnections
 
   // Main Window
   GtkWidget *winwidget;
-  MudTray *tray;
 
   GtkWidget *window;
   GtkWidget *iconview;
@@ -269,8 +267,6 @@ mud_connections_connect_cb (GtkWidget      *widget,
                 "port", &port,
                 NULL);
 
-  mud_tray_update_icon (self->tray, offline);
-
   /* TODO: Bind these instead? */
   view = g_object_new (MUD_TYPE_CONNECTION_VIEW,
                        "hostname", host,
@@ -304,7 +300,6 @@ mud_connections_qconnect_cb (GtkWidget      *widget,
 
   if (strlen (host) != 0)
     {
-      mud_tray_update_icon (self->tray, offline);
       view = g_object_new (MUD_TYPE_CONNECTION_VIEW,
                            "hostname", host,
                            "port", port,
@@ -1028,7 +1023,6 @@ mud_connections_constructed (GObject *object)
 
   g_object_get (self->parent_window,
                 "window", &self->winwidget,
-                "tray",   &self->tray,
                 NULL);
 
   builder = gtk_builder_new_from_resource ("/org/gnome/MUD/muds.ui");
diff --git a/src/mud-window.c b/src/mud-window.c
index f344d4d..591db72 100644
--- a/src/mud-window.c
+++ b/src/mud-window.c
@@ -35,7 +35,6 @@
 #include "mud-input-view.h"
 #include "mud-window-prefs.h"
 #include "mud-window.h"
-#include "mud-tray.h"
 #include "mud-profile.h"
 #include "mud-window-profile.h"
 #include "mud-parse-base.h"
@@ -84,8 +83,7 @@ G_DEFINE_TYPE(MudWindow, mud_window, G_TYPE_OBJECT);
 enum
 {
     PROP_MUD_WINDOW_0,
-    PROP_WINDOW,
-    PROP_TRAY
+    PROP_WINDOW
 };
 
 /* Signal Indices */
@@ -182,14 +180,6 @@ mud_window_class_init (MudWindowClass *klass)
                 GTK_TYPE_WINDOW,
                 G_PARAM_READABLE));
 
-    g_object_class_install_property(object_class,
-            PROP_TRAY,
-            g_param_spec_object("tray",
-                "mud tray",
-                "mud status tray icon",
-                MUD_TYPE_TRAY,
-                G_PARAM_READABLE));
-    
     /* Register Signals */
     mud_window_signal[RESIZED] =
         g_signal_new("resized",
@@ -222,9 +212,6 @@ mud_window_init (MudWindow *self)
 
     /* set public properties */
     self->window = GTK_WINDOW(gtk_builder_get_object(builder, "main_window"));
-    self->tray = g_object_new(MUD_TYPE_TRAY,
-                              "parent-window", self->window,
-                              NULL); 
 
     /* set private members */
     self->priv->nr_of_tabs = 0;
@@ -398,8 +385,6 @@ mud_window_finalize (GObject *object)
 
     g_slist_free(self->priv->mud_views_list);
     
-    g_object_unref(self->tray);
-
     g_object_unref(self->profile_manager);
 
     parent_class = g_type_class_peek_parent(G_OBJECT_GET_CLASS(object));
@@ -422,10 +407,6 @@ mud_window_set_property(GObject *object,
             g_return_if_reached();
             break;
 
-        case PROP_TRAY:
-            g_return_if_reached();
-            break;
-
         default:
             G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
             break;
@@ -448,10 +429,6 @@ mud_window_get_property(GObject *object,
             g_value_take_object(value, self->window);
             break;
 
-        case PROP_TRAY:
-            g_value_take_object(value, self->tray);
-            break;
-
         default:
             G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
             break;
@@ -1063,9 +1040,6 @@ mud_window_close_current_window(MudWindow *self)
         gint nr = gtk_notebook_get_current_page(GTK_NOTEBOOK(self->priv->notebook));
 
         mud_window_remove_connection_view(self, nr);
-
-        if(self->priv->nr_of_tabs == 0)
-            mud_tray_update_icon(MUD_TRAY(self->tray), offline_connecting);
     }
 }
 
diff --git a/src/mud-window.h b/src/mud-window.h
index bb34d70..e916406 100644
--- a/src/mud-window.h
+++ b/src/mud-window.h
@@ -38,7 +38,6 @@ typedef struct _MudWindowClass      MudWindowClass;
 typedef struct _MudWindowPrivate    MudWindowPrivate;
 
 #include "mud-connection-view.h"
-#include "mud-tray.h"
 #include "mud-profile-manager.h"
 
 struct _MudWindowClass
@@ -55,7 +54,6 @@ struct _MudWindow
 
     /*< public >*/
     GtkWindow *window;
-    MudTray *tray;
     MudProfileManager *profile_manager;
 };
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]