mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-25 02:36:07 +00:00
2007-07-23 Christian Persch <chpe@gnome.org> * configure.in: * src/nautilus-navigation-action.c: (connect_proxy), (disconnect_proxy): * src/nautilus-navigation-window-menus.c: (connect_proxy_cb), (refresh_go_menu): * src/nautilus-navigation-window.c: (location_button_create), (nautilus_navigation_window_init), (nautilus_navigation_window_destroy), (nautilus_navigation_window_finalize), (nautilus_navigation_window_class_init): * src/nautilus-query-editor.c: (nautilus_query_editor_dispose), (nautilus_query_editor_add_row), (nautilus_query_editor_init), (finish_first_line): * src/nautilus-side-pane.c: (side_panel_free), (nautilus_side_pane_class_init), (nautilus_side_pane_init), (nautilus_side_pane_dispose), (nautilus_side_pane_finalize), (nautilus_side_pane_add_panel), (create_shortcut): * src/nautilus-trash-bar.c: (nautilus_trash_bar_class_init), (nautilus_trash_bar_init): * src/nautilus-window-private.h: Port to new gtk+ 2.11 tooltips API. Bug #458284 and bug #455616. svn path=/trunk/; revision=13011
This commit is contained in:
parent
3e82bc94a6
commit
aab97ab541
24
ChangeLog
24
ChangeLog
|
@ -1,3 +1,27 @@
|
|||
2007-07-23 Christian Persch <chpe@gnome.org>
|
||||
|
||||
* configure.in:
|
||||
* src/nautilus-navigation-action.c: (connect_proxy),
|
||||
(disconnect_proxy):
|
||||
* src/nautilus-navigation-window-menus.c: (connect_proxy_cb),
|
||||
(refresh_go_menu):
|
||||
* src/nautilus-navigation-window.c: (location_button_create),
|
||||
(nautilus_navigation_window_init),
|
||||
(nautilus_navigation_window_destroy),
|
||||
(nautilus_navigation_window_finalize),
|
||||
(nautilus_navigation_window_class_init):
|
||||
* src/nautilus-query-editor.c: (nautilus_query_editor_dispose),
|
||||
(nautilus_query_editor_add_row), (nautilus_query_editor_init),
|
||||
(finish_first_line):
|
||||
* src/nautilus-side-pane.c: (side_panel_free),
|
||||
(nautilus_side_pane_class_init), (nautilus_side_pane_init),
|
||||
(nautilus_side_pane_dispose), (nautilus_side_pane_finalize),
|
||||
(nautilus_side_pane_add_panel), (create_shortcut):
|
||||
* src/nautilus-trash-bar.c: (nautilus_trash_bar_class_init),
|
||||
(nautilus_trash_bar_init):
|
||||
* src/nautilus-window-private.h: Port to new gtk+ 2.11 tooltips API.
|
||||
Bug #458284 and bug #455616.
|
||||
|
||||
2007-07-23 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* libnautilus-private/nautilus-search-engine-simple.c:
|
||||
|
|
|
@ -14,7 +14,7 @@ m4_define(gnome_ui_minver, 2.6.0)
|
|||
m4_define(gnome_vfs_minver, 2.14.2)
|
||||
m4_define(orbit_minver, 2.4.0)
|
||||
m4_define(pango_minver, 1.1.2)
|
||||
m4_define(gtk_minver, 2.10.0)
|
||||
m4_define(gtk_minver, 2.11.6)
|
||||
m4_define(rsvg_minver, 2.0.1)
|
||||
m4_define(xml_minver, 2.4.7)
|
||||
m4_define(startup_notification_minver, 0.8)
|
||||
|
|
|
@ -176,31 +176,20 @@ show_menu_callback (GtkMenuToolButton *button,
|
|||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
set_tooltip_callback (GtkMenuToolButton *proxy,
|
||||
GtkTooltips *tooltips,
|
||||
const char *tip,
|
||||
const char *tip_private,
|
||||
NautilusNavigationAction *action)
|
||||
{
|
||||
gtk_menu_tool_button_set_arrow_tooltip (proxy, tooltips,
|
||||
action->priv->arrow_tooltip,
|
||||
NULL);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
connect_proxy (GtkAction *action, GtkWidget *proxy)
|
||||
{
|
||||
GtkWidget *menu;
|
||||
|
||||
if (GTK_IS_MENU_TOOL_BUTTON (proxy)) {
|
||||
NautilusNavigationAction *naction = NAUTILUS_NAVIGATION_ACTION (action);
|
||||
GtkMenuToolButton *button = GTK_MENU_TOOL_BUTTON (proxy);
|
||||
GtkWidget *menu;
|
||||
|
||||
/* set an empty menu, so the arrow button becomes sensitive */
|
||||
menu = gtk_menu_new ();
|
||||
gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (proxy),
|
||||
menu);
|
||||
g_signal_connect (proxy, "set-tooltip",
|
||||
G_CALLBACK (set_tooltip_callback), action);
|
||||
gtk_menu_tool_button_set_menu (button, menu);
|
||||
|
||||
gtk_menu_tool_button_set_arrow_tooltip_text (button,
|
||||
naction->priv->arrow_tooltip);
|
||||
|
||||
g_signal_connect (proxy, "show-menu",
|
||||
G_CALLBACK (show_menu_callback), action);
|
||||
|
@ -213,7 +202,6 @@ static void
|
|||
disconnect_proxy (GtkAction *action, GtkWidget *proxy)
|
||||
{
|
||||
if (GTK_IS_MENU_TOOL_BUTTON (proxy)) {
|
||||
g_signal_handlers_disconnect_by_func (proxy, G_CALLBACK (set_tooltip_callback), action);
|
||||
g_signal_handlers_disconnect_by_func (proxy, G_CALLBACK (show_menu_callback), action);
|
||||
}
|
||||
|
||||
|
|
|
@ -182,8 +182,8 @@ location_button_create (NautilusNavigationWindow *window)
|
|||
"active", location_button_should_be_active (window),
|
||||
NULL);
|
||||
|
||||
gtk_tooltips_set_tip (window->details->tooltips, button,
|
||||
_("Toggle between button and text-based location bar"), NULL);
|
||||
gtk_widget_set_tooltip_text (button,
|
||||
_("Toggle between button and text-based location bar"));
|
||||
|
||||
g_signal_connect (button, "toggled",
|
||||
G_CALLBACK (location_button_toggled_cb), window);
|
||||
|
@ -199,12 +199,8 @@ nautilus_navigation_window_init (NautilusNavigationWindow *window)
|
|||
GtkWidget *view_as_menu_vbox;
|
||||
GtkToolItem *item;
|
||||
GtkWidget *hbox, *vbox, *eventbox, *extras_vbox;
|
||||
|
||||
window->details = g_new0 (NautilusNavigationWindowDetails, 1);
|
||||
|
||||
window->details->tooltips = gtk_tooltips_new ();
|
||||
g_object_ref (window->details->tooltips);
|
||||
gtk_object_sink (GTK_OBJECT (window->details->tooltips));
|
||||
window->details = G_TYPE_INSTANCE_GET_PRIVATE (window, NAUTILUS_TYPE_NAVIGATION_WINDOW, NautilusNavigationWindowDetails);
|
||||
|
||||
window->details->content_paned = nautilus_horizontal_splitter_new ();
|
||||
gtk_table_attach (GTK_TABLE (NAUTILUS_WINDOW (window)->details->table),
|
||||
|
@ -696,11 +692,6 @@ nautilus_navigation_window_destroy (GtkObject *object)
|
|||
|
||||
window->details->content_paned = NULL;
|
||||
|
||||
if (window->details->tooltips) {
|
||||
g_object_unref (window->details->tooltips);
|
||||
window->details->tooltips = NULL;
|
||||
}
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
|
@ -715,8 +706,6 @@ nautilus_navigation_window_finalize (GObject *object)
|
|||
nautilus_navigation_window_clear_back_list (window);
|
||||
nautilus_navigation_window_clear_forward_list (window);
|
||||
|
||||
g_free (window->details);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
|
@ -1591,4 +1580,6 @@ nautilus_navigation_window_class_init (NautilusNavigationWindowClass *class)
|
|||
NAUTILUS_WINDOW_CLASS (class)->get_icon_name = real_get_icon_name;
|
||||
NAUTILUS_WINDOW_CLASS (class)->get_default_size = real_get_default_size;
|
||||
NAUTILUS_WINDOW_CLASS (class)->close = real_window_close;
|
||||
|
||||
g_type_class_add_private (G_OBJECT_CLASS (class), sizeof (NautilusNavigationWindowDetails));
|
||||
}
|
||||
|
|
|
@ -72,8 +72,6 @@ struct _NautilusNavigationWindow {
|
|||
|
||||
/* Widgets to keep track of (for state changes, etc) */
|
||||
GtkWidget *zoom_control;
|
||||
|
||||
GtkTooltips *tooltips;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include "gtk/gtkscrolledwindow.h"
|
||||
#include <gtk/gtkfilechooserbutton.h>
|
||||
#include "gtk/gtkcelllayout.h"
|
||||
#include "gtk/gtktooltips.h"
|
||||
#include "gtk/gtkcellrenderertext.h"
|
||||
#include <libgnomevfs/gnome-vfs-utils.h>
|
||||
#include <libgnomevfs/gnome-vfs-mime-info.h>
|
||||
|
@ -87,7 +86,6 @@ struct NautilusQueryEditorDetails {
|
|||
gboolean is_visible;
|
||||
GtkWidget *invisible_vbox;
|
||||
GtkWidget *visible_vbox;
|
||||
GtkTooltips *tooltips;
|
||||
|
||||
GList *rows;
|
||||
|
||||
|
@ -179,11 +177,6 @@ nautilus_query_editor_dispose (GObject *object)
|
|||
eel_remove_weak_pointer (&editor->details->bar);
|
||||
}
|
||||
|
||||
if (editor->details->tooltips) {
|
||||
g_object_unref (editor->details->tooltips);
|
||||
editor->details->tooltips = NULL;
|
||||
}
|
||||
|
||||
EEL_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
|
||||
}
|
||||
|
||||
|
@ -931,9 +924,8 @@ nautilus_query_editor_add_row (NautilusQueryEditor *editor,
|
|||
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (remove_row_cb), row);
|
||||
|
||||
gtk_tooltips_set_tip (editor->details->tooltips, button,
|
||||
_("Remove this criterion from the search"), NULL);
|
||||
gtk_widget_set_tooltip_text (button,
|
||||
_("Remove this criterion from the search"));
|
||||
|
||||
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
||||
|
||||
|
@ -991,12 +983,8 @@ nautilus_query_editor_init (NautilusQueryEditor *editor)
|
|||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (edit_clicked), editor);
|
||||
|
||||
editor->details->tooltips = gtk_tooltips_new ();
|
||||
g_object_ref (editor->details->tooltips);
|
||||
gtk_object_sink (GTK_OBJECT (editor->details->tooltips));
|
||||
|
||||
gtk_tooltips_set_tip (editor->details->tooltips, button,
|
||||
_("Edit the saved search"), NULL);
|
||||
gtk_widget_set_tooltip_text (button,
|
||||
_("Edit the saved search"));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1026,8 +1014,8 @@ finish_first_line (NautilusQueryEditor *editor, GtkWidget *hbox, gboolean use_go
|
|||
|
||||
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
||||
|
||||
gtk_tooltips_set_tip (editor->details->tooltips, button,
|
||||
_("Add a new criterion to this search"), NULL);
|
||||
gtk_widget_set_tooltip_text (button,
|
||||
_("Add a new criterion to this search"));
|
||||
|
||||
if (!editor->details->is_indexed) {
|
||||
if (use_go) {
|
||||
|
@ -1036,9 +1024,9 @@ finish_first_line (NautilusQueryEditor *editor, GtkWidget *hbox, gboolean use_go
|
|||
button = gtk_button_new_with_label (_("Reload"));
|
||||
}
|
||||
gtk_widget_show (button);
|
||||
|
||||
gtk_tooltips_set_tip (editor->details->tooltips, button,
|
||||
_("Perform or update the search"), NULL);
|
||||
|
||||
gtk_widget_set_tooltip_text (button,
|
||||
_("Perform or update the search"));
|
||||
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (go_search_cb), editor);
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include <gtk/gtkimagemenuitem.h>
|
||||
#include <gtk/gtknotebook.h>
|
||||
#include <gtk/gtkstock.h>
|
||||
#include <gtk/gtktooltips.h>
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
|
@ -56,14 +55,13 @@ struct _NautilusSidePaneDetails {
|
|||
GtkWidget *title_hbox;
|
||||
GtkWidget *title_label;
|
||||
GtkWidget *shortcut_box;
|
||||
GtkTooltips *tooltips;
|
||||
GList *panels;
|
||||
};
|
||||
|
||||
static void nautilus_side_pane_class_init (GtkObjectClass *object_klass);
|
||||
static void nautilus_side_pane_init (GtkObject *object);
|
||||
static void nautilus_side_pane_destroy (GtkObject *object);
|
||||
static void nautilus_side_pane_finalize (GObject *object);
|
||||
static void nautilus_side_pane_class_init (NautilusSidePaneClass *klass);
|
||||
static void nautilus_side_pane_init (GObject *object);
|
||||
static void nautilus_side_pane_dispose (GObject *object);
|
||||
static void nautilus_side_pane_finalize (GObject *object);
|
||||
|
||||
enum {
|
||||
CLOSE_REQUESTED,
|
||||
|
@ -96,7 +94,7 @@ side_panel_free (SidePanel *panel)
|
|||
{
|
||||
g_free (panel->title);
|
||||
g_free (panel->tooltip);
|
||||
g_free (panel);
|
||||
g_slice_free (SidePanel, panel);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -162,24 +160,21 @@ nautilus_side_pane_size_allocate (GtkWidget *widget,
|
|||
|
||||
/* initializing the class object by installing the operations we override */
|
||||
static void
|
||||
nautilus_side_pane_class_init (GtkObjectClass *object_klass)
|
||||
nautilus_side_pane_class_init (NautilusSidePaneClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class;
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
NautilusSidePaneClass *klass;
|
||||
|
||||
widget_class = GTK_WIDGET_CLASS (object_klass);
|
||||
klass = NAUTILUS_SIDE_PANE_CLASS (object_klass);
|
||||
gobject_class = G_OBJECT_CLASS (object_klass);
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
gobject_class = G_OBJECT_CLASS (klass);
|
||||
widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
gobject_class->finalize = nautilus_side_pane_finalize;
|
||||
object_klass->destroy = nautilus_side_pane_destroy;
|
||||
gobject_class->dispose = nautilus_side_pane_dispose;
|
||||
widget_class->size_allocate = nautilus_side_pane_size_allocate;
|
||||
|
||||
signals[CLOSE_REQUESTED] = g_signal_new
|
||||
("close_requested",
|
||||
G_TYPE_FROM_CLASS (object_klass),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NautilusSidePaneClass,
|
||||
close_requested),
|
||||
|
@ -188,13 +183,15 @@ nautilus_side_pane_class_init (GtkObjectClass *object_klass)
|
|||
G_TYPE_NONE, 0);
|
||||
signals[SWITCH_PAGE] = g_signal_new
|
||||
("switch_page",
|
||||
G_TYPE_FROM_CLASS (object_klass),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NautilusSidePaneClass,
|
||||
switch_page),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1, GTK_TYPE_WIDGET);
|
||||
|
||||
g_type_class_add_private (gobject_class, sizeof (NautilusSidePaneDetails));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -313,7 +310,7 @@ menu_detach_callback (GtkWidget *widget,
|
|||
}
|
||||
|
||||
static void
|
||||
nautilus_side_pane_init (GtkObject *object)
|
||||
nautilus_side_pane_init (GObject *object)
|
||||
{
|
||||
NautilusSidePane *side_pane;
|
||||
GtkWidget *frame;
|
||||
|
@ -326,7 +323,7 @@ nautilus_side_pane_init (GtkObject *object)
|
|||
|
||||
side_pane = NAUTILUS_SIDE_PANE (object);
|
||||
|
||||
side_pane->details = g_new0 (NautilusSidePaneDetails, 1);
|
||||
side_pane->details = G_TYPE_INSTANCE_GET_PRIVATE (object, NAUTILUS_TYPE_SIDE_PANE, NautilusSidePaneDetails);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
side_pane->details->title_frame = frame;
|
||||
|
@ -419,16 +416,12 @@ nautilus_side_pane_init (GtkObject *object)
|
|||
|
||||
gtk_widget_show (side_pane->details->menu);
|
||||
|
||||
side_pane->details->tooltips = gtk_tooltips_new ();
|
||||
g_object_ref (side_pane->details->tooltips);
|
||||
gtk_object_sink (GTK_OBJECT (side_pane->details->tooltips));
|
||||
|
||||
gtk_tooltips_set_tip (side_pane->details->tooltips, close_button,
|
||||
_("Close the side pane"), NULL);
|
||||
gtk_widget_set_tooltip_text (close_button,
|
||||
_("Close the side pane"));
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_side_pane_destroy (GtkObject *object)
|
||||
nautilus_side_pane_dispose (GObject *object)
|
||||
{
|
||||
NautilusSidePane *side_pane;
|
||||
|
||||
|
@ -439,12 +432,7 @@ nautilus_side_pane_destroy (GtkObject *object)
|
|||
side_pane->details->menu = NULL;
|
||||
}
|
||||
|
||||
if (side_pane->details->tooltips) {
|
||||
g_object_unref (side_pane->details->tooltips);
|
||||
side_pane->details->tooltips = NULL;
|
||||
}
|
||||
|
||||
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
|
||||
EEL_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -461,8 +449,6 @@ nautilus_side_pane_finalize (GObject *object)
|
|||
|
||||
g_list_free (side_pane->details->panels);
|
||||
|
||||
g_free (side_pane->details);
|
||||
|
||||
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
|
||||
}
|
||||
|
||||
|
@ -487,7 +473,7 @@ nautilus_side_pane_add_panel (NautilusSidePane *side_pane,
|
|||
g_return_if_fail (title != NULL);
|
||||
g_return_if_fail (tooltip != NULL);
|
||||
|
||||
panel = g_new0 (SidePanel, 1);
|
||||
panel = g_slice_new0 (SidePanel);
|
||||
panel->title = g_strdup (title);
|
||||
panel->tooltip = g_strdup (tooltip);
|
||||
panel->widget = widget;
|
||||
|
@ -597,7 +583,7 @@ create_shortcut (NautilusSidePane *side_pane,
|
|||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (shortcut_clicked_callback), side_pane);
|
||||
|
||||
gtk_tooltips_set_tip (side_pane->details->tooltips, button, panel->tooltip, NULL);
|
||||
gtk_widget_set_tooltip_text (button, panel->tooltip);
|
||||
|
||||
image = gtk_image_new_from_pixbuf (pixbuf);
|
||||
gtk_widget_show (image);
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
struct NautilusTrashBarPrivate
|
||||
{
|
||||
GtkTooltips *tooltips;
|
||||
GtkWidget *button;
|
||||
};
|
||||
|
||||
|
@ -73,20 +72,6 @@ nautilus_trash_bar_get_property (GObject *object,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_trash_bar_finalize (GObject *object)
|
||||
{
|
||||
NautilusTrashBar *bar;
|
||||
|
||||
bar = NAUTILUS_TRASH_BAR (object);
|
||||
|
||||
if (bar->priv->tooltips != NULL) {
|
||||
g_object_unref (bar->priv->tooltips);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (nautilus_trash_bar_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_trash_bar_trash_state_changed (NautilusTrashMonitor *trash_monitor,
|
||||
gboolean state,
|
||||
|
@ -107,7 +92,6 @@ nautilus_trash_bar_class_init (NautilusTrashBarClass *klass)
|
|||
|
||||
object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = nautilus_trash_bar_finalize;
|
||||
object_class->get_property = nautilus_trash_bar_get_property;
|
||||
object_class->set_property = nautilus_trash_bar_set_property;
|
||||
|
||||
|
@ -144,14 +128,8 @@ nautilus_trash_bar_init (NautilusTrashBar *bar)
|
|||
|
||||
gtk_widget_set_sensitive (bar->priv->button,
|
||||
!nautilus_trash_monitor_is_empty ());
|
||||
|
||||
bar->priv->tooltips = gtk_tooltips_new ();
|
||||
g_object_ref_sink (bar->priv->tooltips);
|
||||
|
||||
gtk_tooltips_set_tip (GTK_TOOLTIPS (bar->priv->tooltips),
|
||||
bar->priv->button,
|
||||
_("Delete all items in the Trash"),
|
||||
NULL);
|
||||
gtk_widget_set_tooltip_text (bar->priv->button,
|
||||
_("Delete all items in the Trash"));
|
||||
|
||||
g_signal_connect (bar->priv->button,
|
||||
"clicked",
|
||||
|
|
|
@ -123,7 +123,6 @@ struct _NautilusNavigationWindowDetails {
|
|||
|
||||
/* Toolbar */
|
||||
GtkWidget *toolbar;
|
||||
GtkTooltips *tooltips;
|
||||
GtkWidget *location_bar;
|
||||
|
||||
guint extensions_toolbar_merge_id;
|
||||
|
|
Loading…
Reference in a new issue