Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 189580 Details for
Bug 266402
[EBUILD] www-client/midori-0.1.8 another ebuild
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
reverse trash menu order
midori-0.1.6-history_menu_order.patch (text/plain), 7.01 KB, created by
Ivan Anishchuk
on 2009-04-27 01:20:34 UTC
(
hide
)
Description:
reverse trash menu order
Filename:
MIME Type:
Creator:
Ivan Anishchuk
Created:
2009-04-27 01:20:34 UTC
Size:
7.01 KB
patch
obsolete
>diff --git a/katze/katze-arrayaction.c b/katze/katze-arrayaction.c >index 7d704b8..b3cf8a9 100644 >--- a/katze/katze-arrayaction.c >+++ b/katze/katze-arrayaction.c >@@ -24,6 +24,8 @@ struct _KatzeArrayAction > > KatzeArray* array; > KatzeNet* net; >+ >+ gboolean* reversed; > }; > > struct _KatzeArrayActionClass >@@ -37,7 +39,8 @@ enum > { > PROP_0, > >- PROP_ARRAY >+ PROP_ARRAY, >+ PROP_REVERSED > }; > > enum >@@ -127,6 +130,16 @@ katze_array_action_class_init (KatzeArrayActionClass* class) > "The array the action represents", > KATZE_TYPE_ARRAY, > G_PARAM_READWRITE)); >+ >+ g_object_class_install_property (gobject_class, >+ PROP_REVERSED, >+ g_param_spec_boolean ( >+ "reversed", >+ "Reversed", >+ "Whether the array should be walked " \ >+ "backwards when building menus", >+ FALSE, >+ G_PARAM_READWRITE)); > } > > static void >@@ -134,6 +147,7 @@ katze_array_action_init (KatzeArrayAction* array_action) > { > array_action->array = NULL; > array_action->net = katze_net_new (); >+ array_action->reversed = FALSE; > } > > static void >@@ -143,6 +157,7 @@ katze_array_action_finalize (GObject* object) > > katze_object_assign (array_action->array, NULL); > katze_object_assign (array_action->net, NULL); >+ katze_object_assign (array_action->reversed, NULL); > > G_OBJECT_CLASS (katze_array_action_parent_class)->finalize (object); > } >@@ -153,6 +168,7 @@ katze_array_action_set_property (GObject* object, > const GValue* value, > GParamSpec* pspec) > { >+ gboolean reversed; > KatzeArrayAction* array_action = KATZE_ARRAY_ACTION (object); > > switch (prop_id) >@@ -160,6 +176,10 @@ katze_array_action_set_property (GObject* object, > case PROP_ARRAY: > katze_array_action_set_array (array_action, g_value_get_object (value)); > break; >+ case PROP_REVERSED: >+ reversed = g_value_get_boolean (value); >+ array_action->reversed = &reversed; >+ break; > default: > G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); > break; >@@ -179,6 +199,9 @@ katze_array_action_get_property (GObject* object, > case PROP_ARRAY: > g_value_set_object (value, array_action->array); > break; >+ case PROP_REVERSED: >+ g_value_set_boolean (value, *array_action->reversed); >+ break; > default: > G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); > break; >@@ -218,29 +241,24 @@ katze_array_action_menu_item_select_cb (GtkWidget* proxy, > KatzeArrayAction* array_action); > > static void >-katze_array_action_generate_menu (KatzeArrayAction* array_action, >- KatzeArray* array, >+katze_array_action_add_menu_item (KatzeArrayAction* array_action, >+ KatzeItem* item, > GtkWidget* menu, > GtkWidget* proxy) > { >- guint i; >- KatzeItem* item; > GtkWidget* menuitem; > const gchar* icon_name; > GdkPixbuf* icon; > GtkWidget* image; > GtkWidget* submenu; > >- i = 0; >- while ((item = katze_array_get_nth_item (array, i++))) >- { > /* FIXME: The menu item should reflect changes to the item */ > if (!KATZE_IS_ARRAY (item) && !katze_item_get_uri (item)) > { > menuitem = gtk_separator_menu_item_new (); > gtk_widget_show (menuitem); > gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); >- continue; >+ return; > } > menuitem = katze_image_menu_item_new_ellipsized ( > katze_item_get_name (item)); >@@ -271,13 +289,43 @@ katze_array_action_generate_menu (KatzeArrayAction* array_action, > g_signal_connect (menuitem, "activate", > G_CALLBACK (katze_array_action_menu_item_activate_cb), array_action); > gtk_widget_show (menuitem); >- } >- if (!i) >+ >+} >+ >+static void >+katze_array_action_generate_menu (KatzeArrayAction* array_action, >+ KatzeArray* array, >+ GtkWidget* menu, >+ GtkWidget* proxy) >+{ >+ guint i; >+ KatzeItem* item; >+ GtkWidget* menuitem; >+ >+ if (katze_array_is_empty (array)) > { > menuitem = gtk_image_menu_item_new_with_label (_("Empty")); > gtk_widget_set_sensitive (menuitem, FALSE); > gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); > gtk_widget_show (menuitem); >+ return; >+ } >+ >+ if (array_action->reversed) >+ { >+ i = katze_array_get_length (array); >+ while ((item = katze_array_get_nth_item (array, --i))) >+ { >+ katze_array_action_add_menu_item (array_action, item, menu, proxy); >+ } >+ } >+ else >+ { >+ i = 0; >+ while ((item = katze_array_get_nth_item (array, i++))) >+ { >+ katze_array_action_add_menu_item (array_action, item, menu, proxy); >+ } > } > } > >diff --git a/midori/midori-browser.c b/midori/midori-browser.c >index 48b205c..b4f4675 100644 >--- a/midori/midori-browser.c >+++ b/midori/midori-browser.c >@@ -3832,13 +3832,19 @@ midori_browser_set_history (MidoriBrowser* browser, > > midori_browser_history_clear_cb (history, browser); > >+ action = _action_by_name (browser, "RecentlyVisited"); >+ > if (history && ((recently_visited = katze_array_get_nth_item (history, > katze_array_get_length (KATZE_ARRAY (history)) - 1)))) >- g_object_set (_action_by_name (browser, "RecentlyVisited"), >- "array", recently_visited, NULL); >+ g_object_set (action, >+ "reversed", TRUE, >+ "array", recently_visited, >+ NULL); > else >- g_object_set (_action_by_name (browser, "RecentlyVisited"), >- "array", NULL, NULL); >+ g_object_set (action, >+ "reversed", FALSE, >+ "array", NULL, >+ NULL); > > if (!history) > return; >@@ -4696,8 +4702,10 @@ midori_browser_set_property (GObject* object, > case PROP_TRASH: > /* FIXME: Disconnect handlers */ > katze_object_assign (browser->trash, g_value_dup_object (value)); >- g_object_set (_action_by_name (browser, "Trash"), "array", >- browser->trash, NULL); >+ g_object_set (_action_by_name (browser, "Trash"), >+ "reversed", TRUE, >+ "array", browser->trash, >+ NULL); > /* FIXME: Connect to updates */ > _midori_browser_update_actions (browser); > break;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 266402
:
188595
|
189563
|
189567
|
189580
|
189581
|
189583
|
189612
|
189939
|
189940
|
191794
|
191796
|
192960
|
192962
|
192963
|
193174
|
193177
|
194758
|
194759
|
197559
|
198121
|
198123
|
198419
|
198420
|
198422
|
198423
|
198686