anjuta r3866 - in trunk: . plugins/file-loader plugins/tools
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r3866 - in trunk: . plugins/file-loader plugins/tools
- Date: Wed, 16 Apr 2008 08:29:52 +0100 (BST)
Author: jhs
Date: Wed Apr 16 08:29:52 2008
New Revision: 3866
URL: http://svn.gnome.org/viewvc/anjuta?rev=3866&view=rev
Log:
2008-04-16 Johannes Schmid <jhs gnome org>
Patch from Ignacio Casal Quinteiro:
* plugins/file-loader/anjuta-recent-chooser-menu.c
(anjuta_recent_chooser_menu_insert_item),
(anjuta_recent_chooser_menu_populate):
* plugins/file-loader/plugin.c (activate_plugin):
Fix recent files in the toolbar
* plugins/tools/plugin.c (ipreferences_merge):
Fixed some warnings
Modified:
trunk/ChangeLog
trunk/plugins/file-loader/anjuta-recent-chooser-menu.c
trunk/plugins/file-loader/plugin.c
trunk/plugins/tools/plugin.c
Modified: trunk/plugins/file-loader/anjuta-recent-chooser-menu.c
==============================================================================
--- trunk/plugins/file-loader/anjuta-recent-chooser-menu.c (original)
+++ trunk/plugins/file-loader/anjuta-recent-chooser-menu.c Wed Apr 16 08:29:52 2008
@@ -67,6 +67,8 @@
gulong manager_changed_id;
gulong populate_id;
+
+ gint prj_pos;
};
typedef enum {
@@ -1030,7 +1032,6 @@
{
AnjutaRecentChooserMenuPrivate *priv = menu->priv;
gint real_position;
- static gint anjuta_pos = 0;
if (priv->first_recent_item_pos == -1)
{
@@ -1054,7 +1055,7 @@
g_list_free (children);
priv->first_recent_item_pos = real_position;
- anjuta_pos = 0;
+ priv->prj_pos = 0;
}
else
real_position = priv->first_recent_item_pos;
@@ -1062,8 +1063,8 @@
if (anjuta_project)
{
gtk_menu_shell_insert (GTK_MENU_SHELL (menu), menuitem,
- anjuta_pos);
- anjuta_pos++;
+ priv->prj_pos);
+ priv->prj_pos++;
}
else gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
@@ -1238,6 +1239,7 @@
pdata->placeholder = g_object_ref (priv->placeholder);
priv->icon_size = get_icon_size_for_widget (GTK_WIDGET (menu));
+ priv->prj_pos = 0;
/* remove our menu items first and hide the placeholder */
anjuta_recent_chooser_menu_dispose_items (menu);
Modified: trunk/plugins/file-loader/plugin.c
==============================================================================
--- trunk/plugins/file-loader/plugin.c (original)
+++ trunk/plugins/file-loader/plugin.c Wed Apr 16 08:29:52 2008
@@ -1145,6 +1145,7 @@
GtkActionGroup *group;
GtkWidget *widget;
GtkWidget* recent_menu;
+ GtkWidget* toolbar_menu;
loader_plugin = ANJUTA_PLUGIN_FILE_LOADER (plugin);
@@ -1181,9 +1182,8 @@
"is-important", TRUE, NULL);
group = gtk_action_group_new ("ActionGroupLoaderRecent");
- action = gtk_recent_action_new_for_manager ("ActionFileOpenRecent", _("Open _Recent"),
- _("Open recent file"), NULL,
- loader_plugin->recent_manager);
+ action = gtk_recent_action_new ("ActionFileOpenRecent", _("Open _Recent"),
+ _("Open recent file"), NULL);
g_object_set (action, "stock-id", GTK_STOCK_OPEN, NULL);
setup_recent_chooser_menu (GTK_RECENT_CHOOSER (action), loader_plugin);
g_signal_connect (action, "activate", G_CALLBACK (on_open_activate), loader_plugin);
@@ -1212,6 +1212,13 @@
"/ToolbarMain/PlaceholderFileToolbar/New");
gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (widget), on_create_submenu(loader_plugin));
+ widget = gtk_ui_manager_get_widget (GTK_UI_MANAGER(ui),
+ "/ToolbarMain/PlaceholderFileToolbar/Open");
+ toolbar_menu = anjuta_recent_chooser_menu_new_for_manager (loader_plugin->recent_manager);
+ setup_recent_chooser_menu (GTK_RECENT_CHOOSER (toolbar_menu), loader_plugin);
+ gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (widget),
+ toolbar_menu);
+
/* Install drag n drop handler */
dnd_drop_init (GTK_WIDGET (plugin->shell), dnd_dropped, plugin,
"text/plain", "text/html", "text/source", "application-x/anjuta",
Modified: trunk/plugins/tools/plugin.c
==============================================================================
--- trunk/plugins/tools/plugin.c (original)
+++ trunk/plugins/tools/plugin.c Wed Apr 16 08:29:52 2008
@@ -165,11 +165,6 @@
/* finalize used to free object created with instance init is not used */
-
-static void test (GtkAction *action)
-{
-}
-
static gboolean
atp_plugin_activate (AnjutaPlugin *plugin)
{
@@ -252,7 +247,7 @@
/* Load glade file */
atp_plugin->gxml = glade_xml_new (GLADE_FILE, "list_tools", NULL);
if (atp_plugin->gxml == NULL)
- return FALSE;
+ return;
atp_tool_dialog_show(&atp_plugin->dialog, atp_plugin->gxml);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]