]> granicus.if.org Git - handbrake/commitdiff
LinGui: remove GtkStatusIcon
authorjstebbins <jstebbins.hb@gmail.com>
Tue, 28 Oct 2014 17:24:53 +0000 (17:24 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Tue, 28 Oct 2014 17:24:53 +0000 (17:24 +0000)
It does nothing in gtk-3 and will be removed in future gtk versions.
Support for status icons through libappindicator remains.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6470 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/callbacks.c
gtk/src/ghb.ui
gtk/src/main.c

index ce29afac43f7ba7051a61461a76967263babe8b3..9e1f1a4956ca77c716f642123c9a4c5385b2c53d 100644 (file)
@@ -3354,34 +3354,6 @@ ghb_backend_events(signal_user_data_t *ud)
     }
 }
 
-G_MODULE_EXPORT gboolean
-status_icon_query_tooltip_cb(
-    GtkStatusIcon *si,
-    gint           x,
-    gint           y,
-    gboolean       kbd_mode,
-    GtkTooltip    *tt,
-    signal_user_data_t *ud)
-{
-    ghb_status_t status;
-    gchar *status_str;
-
-    ghb_get_status(&status);
-    if (status.queue.state & GHB_STATE_WORKING)
-        status_str = working_status_string(ud, &status.queue);
-    else if (status.queue.state & GHB_STATE_SEARCHING)
-        status_str = searching_status_string(ud, &status.queue);
-    else if (status.queue.state & GHB_STATE_WORKDONE)
-        status_str = g_strdup(_("Encode Complete"));
-    else
-        status_str = g_strdup("HandBrake");
-
-    gtk_tooltip_set_text(tt, status_str);
-    gtk_tooltip_set_icon_from_icon_name(tt, "hb-icon", GTK_ICON_SIZE_BUTTON);
-    g_free(status_str);
-    return TRUE;
-}
-
 G_MODULE_EXPORT gboolean
 ghb_timer_cb(gpointer data)
 {
@@ -4021,12 +3993,6 @@ show_status_cb(GtkWidget *widget, signal_user_data_t *ud)
             app_indicator_set_status(ud->ai, APP_INDICATOR_STATUS_PASSIVE);
         }
     }
-#else
-    GtkStatusIcon *si;
-
-    si = GTK_STATUS_ICON(GHB_OBJECT (ud->builder, "hb_status"));
-    gtk_status_icon_set_visible(si,
-            ghb_settings_get_boolean(ud->prefs, "show_status"));
 #endif
 }
 
@@ -5242,27 +5208,6 @@ hb_visibility_event_cb(
     return FALSE;
 }
 
-G_MODULE_EXPORT void
-status_activate_cb(GtkStatusIcon *si, signal_user_data_t *ud)
-{
-    GtkWindow *window;
-    GdkWindowState state;
-
-    window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window"));
-    state = gdk_window_get_state(gtk_widget_get_window(GTK_WIDGET(window)));
-    if ((state & GDK_WINDOW_STATE_ICONIFIED) ||
-        (ud->hb_visibility != GDK_VISIBILITY_UNOBSCURED))
-    {
-        gtk_window_present(window);
-        gtk_window_set_skip_taskbar_hint(window, FALSE);
-    }
-    else
-    {
-        gtk_window_set_skip_taskbar_hint(window, TRUE);
-        gtk_window_iconify(window);
-    }
-}
-
 G_MODULE_EXPORT void
 show_hide_toggle_cb(GtkWidget *xwidget, signal_user_data_t *ud)
 {
@@ -5309,9 +5254,6 @@ ghb_notify_done(signal_user_data_t *ud)
                 );
 #else
         ,NULL);
-
-    GtkStatusIcon *si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status"));
-    notify_notification_attach_to_status_icon(notification, si);
 #endif
     GtkIconTheme *theme = gtk_icon_theme_get_default();
     GdkPixbuf *pb = gtk_icon_theme_load_icon(theme, "hb-icon", 32,
index 56aa9051e86f22cd8c9f317c569c7d960ff4d64e..4adcc65c1518a5f771a613e2b2339f1dc4156af6 100644 (file)
@@ -572,11 +572,6 @@ libx264 authors:
     </child>
   </object>
 
-  <object class="GtkStatusIcon" id="hb_status">
-    <property name="icon_name">hb-icon</property>
-    <property name="visible">False</property>
-    <signal name="activate" handler="status_activate_cb" swapped="no"/>
-  </object>
   <object class="GtkWindow" id="hb_window">
     <property name="can_focus">False</property>
     <property name="events">GDK_VISIBILITY_NOTIFY_MASK</property>
index e209fe7a5f6c64296b575f14739be878b5071ec4..a4fa56e9a9c8fec06074458d2af284af00eceb7d 100644 (file)
@@ -1057,20 +1057,10 @@ main(int argc, char *argv[])
     {
         app_indicator_set_status( ud->ai, APP_INDICATOR_STATUS_PASSIVE );
     }
-    GtkStatusIcon *si;
-    si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status"));
-
-    gtk_status_icon_set_visible(si, FALSE );
 #else
-    GtkStatusIcon *si;
-    si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status"));
-
-    gtk_status_icon_set_visible(si,
-            ghb_settings_get_boolean(ud->prefs, "show_status"));
-
-    gtk_status_icon_set_has_tooltip(si, TRUE);
-    g_signal_connect(si, "query-tooltip",
-                    status_icon_query_tooltip_cb, ud);
+    // gtk-3 has eliminated status icons.  Remove the option from preferences
+    GtkWidget *status_icon_pref = GHB_WIDGET(ud->builder, "show_status");
+    gtk_widget_set_visible(status_icon_pref, FALSE);
 #endif
 
     GtkWidget *ghb_window = GHB_WIDGET(ud->builder, "hb_window");
@@ -1220,7 +1210,6 @@ main(int argc, char *argv[])
     // Everything should be go-to-go.  Lets rock!
 
     gtk_main();
-    gtk_status_icon_set_visible(si, FALSE);
     ghb_backend_close();
 
     ghb_value_free(ud->queue);