rhythmbox r6159 - in trunk: . data/glade lib plugins/visualizer widgets
- From: jmatthew svn gnome org
- To: svn-commits-list gnome org
- Subject: rhythmbox r6159 - in trunk: . data/glade lib plugins/visualizer widgets
- Date: Mon, 23 Feb 2009 12:23:53 +0000 (UTC)
Author: jmatthew
Date: Mon Feb 23 12:23:53 2009
New Revision: 6159
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=6159&view=rev
Log:
2009-02-23 Jonathan Matthew <jonathan d14n org>
* data/glade/create-playlist.glade:
* widgets/rb-query-creator-properties.c: (update_time_unit_limits),
(create_time_unit_option_menu), (relativeTimeCriteriaCreateWidget),
(relativeTimeCriteriaSetWidgetData),
(relativeTimeCriteriaGetWidgetData):
* widgets/rb-query-creator.c: (rb_query_creator_load_query),
(rb_query_creator_set_sorting), (rb_query_creator_get_query),
(rb_query_creator_get_limit), (rb_query_creator_get_sort_order),
(append_row), (select_criteria_from_value),
(property_option_menu_changed), (create_property_option_menu),
(create_criteria_option_menu), (sort_option_menu_changed),
(setup_sort_option_menu):
Replace GtkOptionMenu with GtkComboBox in the query creator.
* lib/rb-string-value-map.h:
* plugins/visualizer/rb-vis-widget.h:
* widgets/rb-cell-renderer-pixbuf.h:
* widgets/rb-cell-renderer-rating.h:
* widgets/rb-rating.h:
Replace GTK_CHECK macros with G_TYPE_CHECK equivalents.
* lib/rb-tree-dnd.c: (scroll_row_timeout):
* widgets/gossip-cell-renderer-expander.c:
(gossip_cell_renderer_expander_activate):
* widgets/rb-cell-renderer-pixbuf.c: (rb_cell_renderer_pixbuf_new),
(rb_cell_renderer_pixbuf_activate):
* widgets/rb-cell-renderer-rating.c: (rb_cell_renderer_rating_new),
(rb_cell_renderer_rating_activate):
Replace gtk_tree_view_widget_to_tree_coords.
* widgets/rb-property-view.c: (rb_property_view_set_search_func):
* widgets/rb-property-view.h:
Replace GtkDestroyNotify with GDestroyNotify.
No more deprecated gtk+ stuff. Fixes #564800.
Modified:
trunk/ChangeLog
trunk/data/glade/create-playlist.glade
trunk/lib/rb-string-value-map.h
trunk/lib/rb-tree-dnd.c
trunk/plugins/visualizer/rb-vis-widget.h
trunk/widgets/gossip-cell-renderer-expander.c
trunk/widgets/rb-cell-renderer-pixbuf.c
trunk/widgets/rb-cell-renderer-pixbuf.h
trunk/widgets/rb-cell-renderer-rating.c
trunk/widgets/rb-cell-renderer-rating.h
trunk/widgets/rb-property-view.c
trunk/widgets/rb-property-view.h
trunk/widgets/rb-query-creator-properties.c
trunk/widgets/rb-query-creator.c
trunk/widgets/rb-rating.h
Modified: trunk/data/glade/create-playlist.glade
==============================================================================
--- trunk/data/glade/create-playlist.glade (original)
+++ trunk/data/glade/create-playlist.glade Mon Feb 23 12:23:53 2009
@@ -1,378 +1,264 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
+<?xml version="1.0"?>
<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkDialog" id="complex-playlist-creator">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes"></property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">False</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox3">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area3">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="cancelbutton3">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="okbutton3">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-new</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button107">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-help</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-11</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="main_vbox">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox101">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="createLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Create automatically updating playlist where:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="sub_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox102">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox200">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkCheckButton" id="disjunctionCheck">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">A_dd if any criteria are matched</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="addButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox197">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkCheckButton" id="limitCheck">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Limit to: </property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="limitEntry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 1 100000 1 10 0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="limitOption">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child>
- <widget class="GtkMenu" id="menu8">
-
- <child>
- <widget class="GtkMenuItem" id="songs1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">songs</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="mb1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">MB</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="gb1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">GB</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="minutes1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Minutes</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox201">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="sortLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_When sorted by:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">sortMenu</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="sortMenu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">-1</property>
-
- <child>
- <widget class="GtkMenu" id="menu9">
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="sortDesc">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
+ <!--interface-requires gtk+ 2.14-->
+ <widget class="GtkDialog" id="complex-playlist-creator">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="resizable">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox3">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkVBox" id="main_vbox">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkVBox" id="vbox101">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="createLabel">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Create automatically updating playlist where:</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="sub_vbox">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox102">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkHBox" id="hbox200">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkCheckButton" id="disjunctionCheck">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">A_dd if any criteria are matched</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="addButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox197">
+ <property name="visible">True</property>
+ <property name="spacing">12</property>
+ <child>
+ <widget class="GtkCheckButton" id="limitCheck">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Limit to: </property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="limitEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">1 1 100000 1 10 0</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="limitOption">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">songs
+MB
+GB
+Minutes</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox201">
+ <property name="visible">True</property>
+ <property name="spacing">12</property>
+ <child>
+ <widget class="GtkLabel" id="sortLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_When sorted by:</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="sortMenu">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes"> </property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="sortDesc">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area3">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <widget class="GtkButton" id="cancelbutton3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="okbutton3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-new</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button107">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-help</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-11</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</glade-interface>
Modified: trunk/lib/rb-string-value-map.h
==============================================================================
--- trunk/lib/rb-string-value-map.h (original)
+++ trunk/lib/rb-string-value-map.h Mon Feb 23 12:23:53 2009
@@ -33,10 +33,10 @@
G_BEGIN_DECLS
#define RB_TYPE_STRING_VALUE_MAP (rb_string_value_map_get_type ())
-#define RB_STRING_VALUE_MAP(obj) (GTK_CHECK_CAST ((obj), RB_TYPE_STRING_VALUE_MAP, RBStringValueMap))
-#define RB_STRING_VALUE_MAP_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), RB_TYPE_STRING_VALUE_MAP, RBStringValueMapClass))
-#define RB_IS_STRING_VALUE_MAP(obj) (GTK_CHECK_TYPE ((obj), RB_TYPE_STRING_VALUE_MAP))
-#define RB_IS_STRING_VALUE_MAP_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), RB_TYPE_STRING_VALUE_MAP))
+#define RB_STRING_VALUE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), RB_TYPE_STRING_VALUE_MAP, RBStringValueMap))
+#define RB_STRING_VALUE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), RB_TYPE_STRING_VALUE_MAP, RBStringValueMapClass))
+#define RB_IS_STRING_VALUE_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), RB_TYPE_STRING_VALUE_MAP))
+#define RB_IS_STRING_VALUE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), RB_TYPE_STRING_VALUE_MAP))
typedef struct _RBStringValueMap RBStringValueMap;
typedef struct _RBStringValueMapClass RBStringValueMapClass;
Modified: trunk/lib/rb-tree-dnd.c
==============================================================================
--- trunk/lib/rb-tree-dnd.c (original)
+++ trunk/lib/rb-tree-dnd.c Mon Feb 23 12:23:53 2009
@@ -474,7 +474,7 @@
g_return_val_if_fail(priv_data != NULL, TRUE);
gdk_window_get_pointer (gtk_tree_view_get_bin_window (tree_view), &x, &y, NULL);
- gtk_tree_view_widget_to_tree_coords (tree_view, x, y, &x, &y);
+ gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y, &x, &y);
gtk_tree_view_get_visible_rect (tree_view, &visible_rect);
/* see if we are near the edge. */
Modified: trunk/plugins/visualizer/rb-vis-widget.h
==============================================================================
--- trunk/plugins/visualizer/rb-vis-widget.h (original)
+++ trunk/plugins/visualizer/rb-vis-widget.h Mon Feb 23 12:23:53 2009
@@ -32,11 +32,11 @@
G_BEGIN_DECLS
#define RB_TYPE_VIS_WIDGET (rb_vis_widget_get_type ())
-#define RB_VIS_WIDGET(obj) (GTK_CHECK_CAST ((obj), RB_TYPE_VIS_WIDGET, RBVisWidget))
-#define RB_VIS_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), RB_TYPE_VIS_WIDGET, RBVisWidgetClass))
-#define RB_IS_VIS_WIDGET(obj) (GTK_CHECK_TYPE ((obj), RB_TYPE_VIS_WIDGET))
-#define RB_IS_VIS_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), RB_TYPE_VIS_WIDGET))
-#define RB_VIS_WIDGET_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), RB_TYPE_VIS_WIDGET, RBVisWidgetClass))
+#define RB_VIS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RB_TYPE_VIS_WIDGET, RBVisWidget))
+#define RB_VIS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RB_TYPE_VIS_WIDGET, RBVisWidgetClass))
+#define RB_IS_VIS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RB_TYPE_VIS_WIDGET))
+#define RB_IS_VIS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RB_TYPE_VIS_WIDGET))
+#define RB_VIS_WIDGET_GET_CLASS(obj) (G_TYPE_CHECK_GET_CLASS ((obj), RB_TYPE_VIS_WIDGET, RBVisWidgetClass))
typedef struct _RBVisWidget
{
Modified: trunk/widgets/gossip-cell-renderer-expander.c
==============================================================================
--- trunk/widgets/gossip-cell-renderer-expander.c (original)
+++ trunk/widgets/gossip-cell-renderer-expander.c Mon Feb 23 12:23:53 2009
@@ -457,11 +457,9 @@
path = gtk_tree_path_new_from_string (path_string);
gtk_widget_get_pointer (widget, &mouse_x, &mouse_y);
- gtk_tree_view_widget_to_tree_coords (GTK_TREE_VIEW (widget),
- mouse_x,
- mouse_y,
- &mouse_x,
- &mouse_y);
+ gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW (widget),
+ mouse_x, mouse_y,
+ &mouse_x, &mouse_y);
/* check if click is within the cell */
if (mouse_x - cell_area->x >= 0
Modified: trunk/widgets/rb-cell-renderer-pixbuf.c
==============================================================================
--- trunk/widgets/rb-cell-renderer-pixbuf.c (original)
+++ trunk/widgets/rb-cell-renderer-pixbuf.c Mon Feb 23 12:23:53 2009
@@ -195,7 +195,7 @@
GtkCellRenderer *
rb_cell_renderer_pixbuf_new (void)
{
- return GTK_CELL_RENDERER (gtk_type_new (rb_cell_renderer_pixbuf_get_type ()));
+ return GTK_CELL_RENDERER (g_object_new (rb_cell_renderer_pixbuf_get_type (), NULL, NULL));
}
static void
@@ -321,11 +321,9 @@
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &icon_width, NULL);
gtk_widget_get_pointer (widget, &mouse_x, &mouse_y);
- gtk_tree_view_widget_to_tree_coords (GTK_TREE_VIEW (widget),
- mouse_x,
- mouse_y,
- &mouse_x,
- &mouse_y);
+ gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW (widget),
+ mouse_x, mouse_y,
+ &mouse_x, &mouse_y);
/* ensure the user clicks within the good cell */
if (mouse_x - cell_area->x >= 0
Modified: trunk/widgets/rb-cell-renderer-pixbuf.h
==============================================================================
--- trunk/widgets/rb-cell-renderer-pixbuf.h (original)
+++ trunk/widgets/rb-cell-renderer-pixbuf.h Mon Feb 23 12:23:53 2009
@@ -31,11 +31,11 @@
#endif /* __cplusplus */
#define RB_TYPE_CELL_RENDERER_PIXBUF (rb_cell_renderer_pixbuf_get_type ())
-#define RB_CELL_RENDERER_PIXBUF(obj) (GTK_CHECK_CAST ((obj), RB_TYPE_CELL_RENDERER_PIXBUF, RBCellRendererPixbuf))
-#define RB_CELL_RENDERER_PIXBUF_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), RB_TYPE_CELL_RENDERER_PIXBUF, RBCellRendererPixbufClass))
-#define RB_IS_CELL_RENDERER_PIXBUF(obj) (GTK_CHECK_TYPE ((obj), RB_TYPE_CELL_RENDERER_PIXBUF))
-#define RB_IS_CELL_RENDERER_PIXBUF_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), RB_TYPE_CELL_RENDERER_PIXBUF))
-#define RB_CELL_RENDERER_PIXBUF_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), RB_TYPE_CELL_RENDERER_PIXBUF, RBCellRendererPixbufClass))
+#define RB_CELL_RENDERER_PIXBUF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RB_TYPE_CELL_RENDERER_PIXBUF, RBCellRendererPixbuf))
+#define RB_CELL_RENDERER_PIXBUF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RB_TYPE_CELL_RENDERER_PIXBUF, RBCellRendererPixbufClass))
+#define RB_IS_CELL_RENDERER_PIXBUF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RB_TYPE_CELL_RENDERER_PIXBUF))
+#define RB_IS_CELL_RENDERER_PIXBUF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RB_TYPE_CELL_RENDERER_PIXBUF))
+#define RB_CELL_RENDERER_PIXBUF_GET_CLASS(obj) (G_TYPE_CHECK_GET_CLASS ((obj), RB_TYPE_CELL_RENDERER_PIXBUF, RBCellRendererPixbufClass))
typedef struct _RBCellRendererPixbuf RBCellRendererPixbuf;
typedef struct _RBCellRendererPixbufClass RBCellRendererPixbufClass;
@@ -54,7 +54,7 @@
void (*pixbuf_clicked) (RBCellRendererPixbuf *renderer, GtkTreePath *path);
};
-GtkType rb_cell_renderer_pixbuf_get_type (void);
+GType rb_cell_renderer_pixbuf_get_type (void);
GtkCellRenderer *rb_cell_renderer_pixbuf_new (void);
#ifdef __cplusplus
Modified: trunk/widgets/rb-cell-renderer-rating.c
==============================================================================
--- trunk/widgets/rb-cell-renderer-rating.c (original)
+++ trunk/widgets/rb-cell-renderer-rating.c Mon Feb 23 12:23:53 2009
@@ -226,7 +226,7 @@
GtkCellRenderer *
rb_cell_renderer_rating_new ()
{
- return GTK_CELL_RENDERER (gtk_type_new (rb_cell_renderer_rating_get_type ()));
+ return GTK_CELL_RENDERER (g_object_new (rb_cell_renderer_rating_get_type (), NULL, NULL));
}
static void
@@ -313,11 +313,9 @@
g_return_val_if_fail (RB_IS_CELL_RENDERER_RATING (cellrating), FALSE);
gtk_widget_get_pointer (widget, &mouse_x, &mouse_y);
- gtk_tree_view_widget_to_tree_coords (GTK_TREE_VIEW (widget),
- mouse_x,
- mouse_y,
- &mouse_x,
- &mouse_y);
+ gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW (widget),
+ mouse_x, mouse_y,
+ &mouse_x, &mouse_y);
rating = rb_rating_get_rating_from_widget (widget,
mouse_x - cell_area->x,
Modified: trunk/widgets/rb-cell-renderer-rating.h
==============================================================================
--- trunk/widgets/rb-cell-renderer-rating.h (original)
+++ trunk/widgets/rb-cell-renderer-rating.h Mon Feb 23 12:23:53 2009
@@ -29,11 +29,11 @@
G_BEGIN_DECLS
#define RB_TYPE_CELL_RENDERER_RATING (rb_cell_renderer_rating_get_type ())
-#define RB_CELL_RENDERER_RATING(obj) (GTK_CHECK_CAST ((obj), RB_TYPE_CELL_RENDERER_RATING, RBCellRendererRating))
-#define RB_CELL_RENDERER_RATING_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), RB_TYPE_CELL_RENDERER_RATING, RBCellRendererRatingClass))
-#define RB_IS_CELL_RENDERER_RATING(obj) (GTK_CHECK_TYPE ((obj), RB_TYPE_CELL_RENDERER_RATING))
-#define RB_IS_CELL_RENDERER_RATING_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), RB_TYPE_CELL_RENDERER_RATING))
-#define RB_CELL_RENDERER_RATING_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), RB_TYPE_CELL_RENDERER_RATING, RBCellRendererRatingClass))
+#define RB_CELL_RENDERER_RATING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RB_TYPE_CELL_RENDERER_RATING, RBCellRendererRating))
+#define RB_CELL_RENDERER_RATING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RB_TYPE_CELL_RENDERER_RATING, RBCellRendererRatingClass))
+#define RB_IS_CELL_RENDERER_RATING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RB_TYPE_CELL_RENDERER_RATING))
+#define RB_IS_CELL_RENDERER_RATING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RB_TYPE_CELL_RENDERER_RATING))
+#define RB_CELL_RENDERER_RATING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RB_TYPE_CELL_RENDERER_RATING, RBCellRendererRatingClass))
typedef struct RBCellRendererRatingPrivate RBCellRendererRatingPrivate;
typedef struct RBCellRendererRatingClassPrivate RBCellRendererRatingClassPrivate;
@@ -57,7 +57,7 @@
};
-GtkType rb_cell_renderer_rating_get_type (void);
+GType rb_cell_renderer_rating_get_type (void);
GtkCellRenderer *rb_cell_renderer_rating_new (void);
Modified: trunk/widgets/rb-property-view.c
==============================================================================
--- trunk/widgets/rb-property-view.c (original)
+++ trunk/widgets/rb-property-view.c Mon Feb 23 12:23:53 2009
@@ -961,7 +961,7 @@
rb_property_view_set_search_func (RBPropertyView *view,
GtkTreeViewSearchEqualFunc func,
gpointer func_data,
- GtkDestroyNotify notify)
+ GDestroyNotify notify)
{
g_return_if_fail (RB_IS_PROPERTY_VIEW (view));
Modified: trunk/widgets/rb-property-view.h
==============================================================================
--- trunk/widgets/rb-property-view.h (original)
+++ trunk/widgets/rb-property-view.h Mon Feb 23 12:23:53 2009
@@ -96,7 +96,7 @@
void rb_property_view_set_search_func (RBPropertyView *view,
GtkTreeViewSearchEqualFunc func,
gpointer func_data,
- GtkDestroyNotify notify);
+ GDestroyNotify notify);
G_END_DECLS
Modified: trunk/widgets/rb-query-creator-properties.c
==============================================================================
--- trunk/widgets/rb-query-creator-properties.c (original)
+++ trunk/widgets/rb-query-creator-properties.c Mon Feb 23 12:23:53 2009
@@ -469,12 +469,12 @@
*/
static void
-update_time_unit_limits (GtkOptionMenu *menu, GtkWidget *spin_button)
+update_time_unit_limits (GtkComboBox *menu, GtkWidget *spin_button)
{
/* set the range on the spin button so it can't overflow when
* converted to seconds when we're constructing the query
*/
- gulong mult = time_unit_options [gtk_option_menu_get_history (menu)].timeMultiplier;
+ gulong mult = time_unit_options [gtk_combo_box_get_active (menu)].timeMultiplier;
gtk_spin_button_set_range (GTK_SPIN_BUTTON (spin_button), 1, G_MAXINT / mult);
}
@@ -482,19 +482,15 @@
create_time_unit_option_menu (const RBQueryCreatorTimeUnitOption *options,
int length)
{
- GtkWidget *menu = gtk_menu_new ();
- GtkWidget *option_menu = gtk_option_menu_new ();
+ GtkWidget *combo;
int i;
+ combo = gtk_combo_box_new_text ();
for (i = 0; i < length; i++) {
- GtkWidget *menu_item = gtk_menu_item_new_with_label (_(options[i].name));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _(options[i].name));
}
- gtk_widget_show_all (menu);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
-
- return option_menu;
+ return combo;
}
static GtkWidget *
@@ -511,7 +507,7 @@
gtk_box_pack_start (box, timeSpin, TRUE, TRUE, 0);
timeOption = create_time_unit_option_menu (time_unit_options, G_N_ELEMENTS (time_unit_options));
- gtk_option_menu_set_history (GTK_OPTION_MENU (timeOption), time_unit_options_default);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (timeOption), time_unit_options_default);
gtk_box_pack_start (box, timeOption, TRUE, TRUE, 0);
g_signal_connect_object (timeOption, "changed",
@@ -528,7 +524,7 @@
GtkBox *box = GTK_BOX (widget);
GtkSpinButton *timeSpin = GTK_SPIN_BUTTON (get_box_widget_at_pos (box, 0));
- GtkOptionMenu *unitMenu = GTK_OPTION_MENU (get_box_widget_at_pos (box, 1));
+ GtkComboBox *unitMenu = GTK_COMBO_BOX (get_box_widget_at_pos (box, 1));
gulong time = g_value_get_ulong (val);
gulong unit = 0;
@@ -544,7 +540,7 @@
time = time / time_unit_options[unit].timeMultiplier;
g_assert (time < G_MAXINT);
/* set the time value and unit*/
- gtk_option_menu_set_history (unitMenu, unit);
+ gtk_combo_box_set_active (unitMenu, unit);
gtk_spin_button_set_value (timeSpin, time);
}
@@ -552,9 +548,9 @@
relativeTimeCriteriaGetWidgetData (GtkWidget *widget, GValue *val)
{
GtkSpinButton *timeSpin = GTK_SPIN_BUTTON (get_box_widget_at_pos (GTK_BOX (widget), 0));
- GtkOptionMenu *unitMenu = GTK_OPTION_MENU (get_box_widget_at_pos (GTK_BOX (widget), 1));
+ GtkComboBox *unitMenu = GTK_COMBO_BOX (get_box_widget_at_pos (GTK_BOX (widget), 1));
- gulong timeMultiplier = time_unit_options [gtk_option_menu_get_history (unitMenu)].timeMultiplier;
+ gulong timeMultiplier = time_unit_options [gtk_combo_box_get_active (unitMenu)].timeMultiplier;
gint value = gtk_spin_button_get_value_as_int (timeSpin) * timeMultiplier;
g_assert (value >= 0);
Modified: trunk/widgets/rb-query-creator.c
==============================================================================
--- trunk/widgets/rb-query-creator.c (original)
+++ trunk/widgets/rb-query-creator.c Mon Feb 23 12:23:53 2009
@@ -77,7 +77,7 @@
static int get_property_index_from_proptype (const RBQueryCreatorPropertyOption *options,
int length, RhythmDBPropType prop);
-static void sort_option_menu_changed (GtkOptionMenu *propmenu, RBQueryCreator *creator);
+static void sort_option_menu_changed (GtkComboBox *propmenu, RBQueryCreator *creator);
typedef struct
{
@@ -355,6 +355,7 @@
gboolean disjunction = FALSE;
RhythmDBQueryData *qdata;
GPtrArray *subquery;
+ guint64 limit;
g_return_val_if_fail (query->len == 2, FALSE);
@@ -363,18 +364,19 @@
subquery = qdata->subquery;
- if (subquery->len > 0)
+ if (subquery->len > 0) {
for (i = 0; i < subquery->len; i++) {
RhythmDBQueryData *data = g_ptr_array_index (subquery, i);
if (data->type != RHYTHMDB_QUERY_DISJUNCTION)
append_row (creator);
}
+ }
rows = priv->rows;
for (i = 0; i < subquery->len; i++) {
RhythmDBQueryData *data = g_ptr_array_index (subquery, i);
- GtkOptionMenu *propmenu;
+ GtkComboBox *propmenu;
GtkWidget *criteria_menu;
int index;
const RBQueryCreatorPropertyType *property_type;
@@ -384,9 +386,9 @@
continue;
}
- propmenu = GTK_OPTION_MENU (get_box_widget_at_pos (GTK_BOX (rows->data), 0));
+ propmenu = GTK_COMBO_BOX (get_box_widget_at_pos (GTK_BOX (rows->data), 0));
index = get_property_index_from_proptype (property_options, num_property_options, data->propid);
- gtk_option_menu_set_history (propmenu, index);
+ gtk_combo_box_set_active (propmenu, index);
criteria_menu = get_box_widget_at_pos (GTK_BOX (rows->data), 1);
select_criteria_from_value (creator, criteria_menu, data->propid, data->type);
@@ -400,48 +402,44 @@
}
/* setup the limits */
- {
- guint64 limit;
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->disjunction_check),
- disjunction);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->limit_check),
- limit_type != RHYTHMDB_QUERY_MODEL_LIMIT_NONE);
-
- switch (limit_type) {
- case RHYTHMDB_QUERY_MODEL_LIMIT_NONE:
- limit = 0;
- break;
-
- case RHYTHMDB_QUERY_MODEL_LIMIT_COUNT:
- gtk_option_menu_set_history (GTK_OPTION_MENU (priv->limit_option), 0);
- limit = g_value_get_ulong (g_value_array_get_nth (limit_value, 0));
- break;
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->disjunction_check),
+ disjunction);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->limit_check),
+ limit_type != RHYTHMDB_QUERY_MODEL_LIMIT_NONE);
+
+ switch (limit_type) {
+ case RHYTHMDB_QUERY_MODEL_LIMIT_NONE:
+ limit = 0;
+ break;
- case RHYTHMDB_QUERY_MODEL_LIMIT_TIME:
- gtk_option_menu_set_history (GTK_OPTION_MENU (priv->limit_option), 3);
- /* convert to minutes */
- limit = g_value_get_ulong (g_value_array_get_nth (limit_value, 0)) / 60;
- break;
+ case RHYTHMDB_QUERY_MODEL_LIMIT_COUNT:
+ gtk_combo_box_set_active (GTK_COMBO_BOX (priv->limit_option), 0);
+ limit = g_value_get_ulong (g_value_array_get_nth (limit_value, 0));
+ break;
- case RHYTHMDB_QUERY_MODEL_LIMIT_SIZE:
- limit = g_value_get_uint64 (g_value_array_get_nth (limit_value, 0));
+ case RHYTHMDB_QUERY_MODEL_LIMIT_TIME:
+ gtk_combo_box_set_active (GTK_COMBO_BOX (priv->limit_option), 3);
+ /* convert to minutes */
+ limit = g_value_get_ulong (g_value_array_get_nth (limit_value, 0)) / 60;
+ break;
- if (limit % 1000 == 0) {
- gtk_option_menu_set_history (GTK_OPTION_MENU (priv->limit_option), 2);
- limit /= 1000;
- } else {
- gtk_option_menu_set_history (GTK_OPTION_MENU (priv->limit_option), 1);
- }
+ case RHYTHMDB_QUERY_MODEL_LIMIT_SIZE:
+ limit = g_value_get_uint64 (g_value_array_get_nth (limit_value, 0));
- break;
- default:
- g_assert_not_reached ();
+ if (limit % 1000 == 0) {
+ gtk_combo_box_set_active (GTK_COMBO_BOX (priv->limit_option), 2);
+ limit /= 1000;
+ } else {
+ gtk_combo_box_set_active (GTK_COMBO_BOX (priv->limit_option), 1);
}
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->limit_entry), limit);
+ break;
+ default:
+ g_assert_not_reached ();
}
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->limit_entry), limit);
+
return TRUE;
}
@@ -469,8 +467,8 @@
/* check that it is a valid sort option */
g_return_val_if_fail (i < num_property_options, FALSE);
- gtk_option_menu_set_history (GTK_OPTION_MENU (priv->sort_menu), i);
- sort_option_menu_changed (GTK_OPTION_MENU (priv->sort_menu), creator); /* force the checkbox to change label */
+ gtk_combo_box_set_active (GTK_COMBO_BOX (priv->sort_menu), i);
+ sort_option_menu_changed (GTK_COMBO_BOX (priv->sort_menu), creator); /* force the checkbox to change label */
return TRUE;
}
@@ -582,14 +580,14 @@
rows = priv->rows;
for (row = rows; row; row = row->next) {
- GtkOptionMenu *propmenu = GTK_OPTION_MENU (get_box_widget_at_pos (GTK_BOX (row->data),
+ GtkComboBox *propmenu = GTK_COMBO_BOX (get_box_widget_at_pos (GTK_BOX (row->data),
0));
- GtkOptionMenu *criteria_menu = GTK_OPTION_MENU (get_box_widget_at_pos (GTK_BOX (row->data),
+ GtkComboBox *criteria_menu = GTK_COMBO_BOX (get_box_widget_at_pos (GTK_BOX (row->data),
1));
- guint prop_position = gtk_option_menu_get_history (propmenu);
+ guint prop_position = gtk_combo_box_get_active (propmenu);
const RBQueryCreatorPropertyOption *prop_option = &property_options[prop_position];
const RBQueryCreatorCriteriaOption *criteria_options = prop_option->property_type->criteria_options;
- const RBQueryCreatorCriteriaOption *criteria_option = &criteria_options[gtk_option_menu_get_history (criteria_menu)];
+ const RBQueryCreatorCriteriaOption *criteria_option = &criteria_options[gtk_combo_box_get_active (criteria_menu)];
g_assert (prop_option->property_type->criteria_get_widget_data != NULL);
{
@@ -650,7 +648,7 @@
l = gtk_spin_button_get_value(GTK_SPIN_BUTTON (priv->limit_entry));
*limit = g_value_array_new (0);
- switch (gtk_option_menu_get_history (GTK_OPTION_MENU (priv->limit_option))) {
+ switch (gtk_combo_box_get_active (GTK_COMBO_BOX (priv->limit_option))) {
case 0:
*type = RHYTHMDB_QUERY_MODEL_LIMIT_COUNT;
rb_value_array_append_data (*limit, G_TYPE_ULONG, (gulong)l);
@@ -708,7 +706,7 @@
if (sort_key != NULL) {
int i;
- i = gtk_option_menu_get_history (GTK_OPTION_MENU (priv->sort_menu));
+ i = gtk_combo_box_get_active (GTK_COMBO_BOX (priv->sort_menu));
*sort_key = sort_options[i].sort_key;
}
}
@@ -791,11 +789,11 @@
priv->rows = g_list_prepend (priv->rows, hbox);
gtk_box_reorder_child (priv->vbox, GTK_WIDGET (hbox), -1);
- /* This is the main (leftmost) GtkOptionMenu, for types. */
+ /* This is the main (leftmost) GtkComboBox, for types. */
option = create_property_option_menu (creator, property_options, num_property_options);
gtk_size_group_add_widget (priv->property_size_group, option);
gtk_box_pack_start (hbox, GTK_WIDGET (option), TRUE, TRUE, 0);
- gtk_option_menu_set_history (GTK_OPTION_MENU (option), 0);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (option), 0);
criteria = create_criteria_option_menu (property_options[0].property_type->criteria_options,
property_options[0].property_type->num_criteria_options);
gtk_size_group_add_widget (priv->criteria_size_group, criteria);
@@ -846,7 +844,7 @@
for (i = 0; i < length; i++) {
if (qtype == options[i].val) {
- gtk_option_menu_set_history (GTK_OPTION_MENU (option_menu), i);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (option_menu), i);
return;
}
}
@@ -854,7 +852,7 @@
}
static void
-property_option_menu_changed (GtkOptionMenu *propmenu,
+property_option_menu_changed (GtkComboBox *propmenu,
RBQueryCreator *creator)
{
RBQueryCreatorPrivate *priv = QUERY_CREATOR_GET_PRIVATE (creator);
@@ -867,7 +865,7 @@
guint old_value;
gboolean constrain;
- prop_option = &property_options[gtk_option_menu_get_history (propmenu)];
+ prop_option = &property_options[gtk_combo_box_get_active (propmenu)];
old_value = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (propmenu), "prop-menu old-value"));
/* don't recreate the criteria menu and entry if they will be the same*/
@@ -875,7 +873,7 @@
return;
g_object_set_data (G_OBJECT (propmenu), "prop-menu old-value",
- GINT_TO_POINTER (gtk_option_menu_get_history (propmenu)));
+ GINT_TO_POINTER (gtk_combo_box_get_active (propmenu)));
row = lookup_row_by_widget (creator, GTK_WIDGET (propmenu));
@@ -908,63 +906,46 @@
const RBQueryCreatorPropertyOption *options,
int length)
{
- GtkWidget *option_menu;
- GtkWidget *menu;
- GtkWidget *menu_item;
+ GtkWidget *combo;
int i;
- option_menu = gtk_option_menu_new ();
- menu = gtk_menu_new ();
-
- /* add the property options */
+ combo = gtk_combo_box_new_text ();
for (i = 0; i < length; i++) {
- menu_item = gtk_menu_item_new_with_label (_(options[i].name));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
- gtk_widget_show (menu_item);
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _(options[i].name));
}
- gtk_option_menu_set_history (GTK_OPTION_MENU (option_menu), 0);
- g_object_set_data (G_OBJECT (option_menu), "prop-menu old-value", GINT_TO_POINTER (0));
-
- gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
- gtk_widget_show (menu);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
+
+ g_object_set_data (G_OBJECT (combo), "prop-menu old value", GINT_TO_POINTER (0));
- g_signal_connect_object (G_OBJECT (option_menu), "changed",
+ g_signal_connect_object (G_OBJECT (combo), "changed",
G_CALLBACK (property_option_menu_changed), creator, 0);
- return option_menu;
+ return combo;
}
static GtkWidget*
create_criteria_option_menu (const RBQueryCreatorCriteriaOption *options,
int length)
{
- GtkWidget *option_menu;
- GtkWidget *menu;
- GtkWidget *menu_item;
+ GtkWidget *combo;
int i;
- option_menu = gtk_option_menu_new ();
- menu = gtk_menu_new ();
-
+ combo = gtk_combo_box_new_text ();
for (i = 0; i < length; i++) {
- menu_item = gtk_menu_item_new_with_label (_(options[i].name));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
- gtk_widget_show (menu_item);
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _(options[i].name));
}
+ gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
- gtk_widget_show (menu);
-
- return option_menu;
+ return combo;
}
static void
-sort_option_menu_changed (GtkOptionMenu *propmenu,
+sort_option_menu_changed (GtkComboBox *propmenu,
RBQueryCreator *creator)
{
RBQueryCreatorPrivate *priv = QUERY_CREATOR_GET_PRIVATE (creator);
- int index = gtk_option_menu_get_history (propmenu);
+ int index = gtk_combo_box_get_active (propmenu);
gtk_button_set_label (GTK_BUTTON (priv->sort_desc), _(sort_options[index].sort_descending_name));
rb_debug("changing descending label to %s[%d]", sort_options[index].sort_descending_name, index);
@@ -976,21 +957,20 @@
const RBQueryCreatorSortOption *options,
int length)
{
- GtkWidget *menu;
- GtkWidget *menu_item;
+ GtkListStore *store;
int i;
- menu = gtk_menu_new ();
- gtk_widget_show (menu);
+ store = gtk_list_store_new (1, G_TYPE_STRING);
for (i = 0; i < length; i++) {
- menu_item = gtk_menu_item_new_with_label (_(options[i].name));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
- gtk_widget_show (menu_item);
+ GtkTreeIter iter;
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter, 0, _(options[i].name), -1);
}
+ gtk_combo_box_set_model (GTK_COMBO_BOX (option_menu), GTK_TREE_MODEL (store));
+
g_signal_connect_object (G_OBJECT (option_menu), "changed",
G_CALLBACK (sort_option_menu_changed), creator, 0);
-
- gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
}
Modified: trunk/widgets/rb-rating.h
==============================================================================
--- trunk/widgets/rb-rating.h (original)
+++ trunk/widgets/rb-rating.h Mon Feb 23 12:23:53 2009
@@ -35,10 +35,10 @@
G_BEGIN_DECLS
#define RB_TYPE_RATING (rb_rating_get_type ())
-#define RB_RATING(obj) (GTK_CHECK_CAST ((obj), RB_TYPE_RATING, RBRating))
-#define RB_RATING_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), RB_TYPE_RATING, RBRatingClass))
-#define RB_IS_RATING(obj) (GTK_CHECK_TYPE ((obj), RB_TYPE_RATING))
-#define RB_IS_RATING_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), RB_TYPE_RATING))
+#define RB_RATING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RB_TYPE_RATING, RBRating))
+#define RB_RATING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RB_TYPE_RATING, RBRatingClass))
+#define RB_IS_RATING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RB_TYPE_RATING))
+#define RB_IS_RATING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RB_TYPE_RATING))
typedef struct _RBRating RBRating;
typedef struct _RBRatingClass RBRatingClass;
@@ -60,7 +60,7 @@
gboolean (*adjust_rating) (RBRating *rating, double adjust);
};
-GtkType rb_rating_get_type (void);
+GType rb_rating_get_type (void);
RBRating *rb_rating_new (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]