From 421415f7cb1ba9c8a97a1837d4f789242c2fb0e6 Mon Sep 17 00:00:00 2001 From: Perberos Date: Mon, 7 Nov 2011 21:10:16 -0300 Subject: using ./config/ instead of ./mate2/ --- plugins/checkupdate/pluma-check-update-plugin.c | 104 ++++----- plugins/checkupdate/pluma-check-update.schemas.in | 4 +- plugins/externaltools/tools/library.py | 24 +-- plugins/filebrowser/pluma-file-browser-plugin.c | 246 +++++++++++----------- plugins/filebrowser/pluma-file-browser.schemas.in | 40 ++-- plugins/pythonconsole/pythonconsole/config.py | 14 +- plugins/snippets/snippets/__init__.py | 30 +-- plugins/sort/pluma-sort-plugin.c | 22 +- plugins/taglist/pluma-taglist-plugin-parser.c | 166 +++++++-------- plugins/time/pluma-time-plugin.c | 6 +- 10 files changed, 328 insertions(+), 328 deletions(-) (limited to 'plugins') diff --git a/plugins/checkupdate/pluma-check-update-plugin.c b/plugins/checkupdate/pluma-check-update-plugin.c index bf30181c..d00b2e70 100755 --- a/plugins/checkupdate/pluma-check-update-plugin.c +++ b/plugins/checkupdate/pluma-check-update-plugin.c @@ -5,7 +5,7 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -35,7 +35,7 @@ #include #endif -#define MATECONF_KEY_BASE "/apps/pluma-2/plugins/checkupdate" +#define MATECONF_KEY_BASE "/apps/pluma/plugins/checkupdate" #define MATECONF_KEY_IGNORE_VERSION MATECONF_KEY_BASE "/ignore_version" #define WINDOW_DATA_KEY "PlumaCheckUpdatePluginWindowData" @@ -125,13 +125,13 @@ pluma_check_update_plugin_dispose (GObject *object) mateconf_client_suggest_sync (plugin->priv->mateconf_client, NULL); g_object_unref (G_OBJECT (plugin->priv->mateconf_client)); - + plugin->priv->mateconf_client = NULL; } pluma_debug_message (DEBUG_PLUGINS, "PlumaCheckUpdatePlugin disposing"); - + G_OBJECT_CLASS (pluma_check_update_plugin_parent_class)->dispose (object); } @@ -153,7 +153,7 @@ set_contents (GtkWidget *infobar, contents); #else GtkWidget *content_area; - + content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (infobar)); gtk_container_add (GTK_CONTAINER (content_area), contents); #endif @@ -210,7 +210,7 @@ set_message_area_text_and_icon (GtkWidget *message_area, gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE); gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5); } - + set_contents (message_area, hbox_content); } @@ -223,7 +223,7 @@ on_response_cb (GtkWidget *infobar, { GError *error = NULL; WindowData *data; - + data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); @@ -242,7 +242,7 @@ on_response_cb (GtkWidget *infobar, dialog = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, + GTK_BUTTONS_CLOSE, _("There was an error displaying the URI.")); gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), @@ -263,7 +263,7 @@ on_response_cb (GtkWidget *infobar, else if (response_id == GTK_RESPONSE_NO) { WindowData *data; - + data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); mateconf_client_set_string (data->plugin->priv->mateconf_client, @@ -288,7 +288,7 @@ create_infobar (PlumaWindow *window, #if !GTK_CHECK_VERSION (2, 17, 1) infobar = pluma_message_area_new (); - + pluma_message_area_add_stock_button_with_text (PLUMA_MESSAGE_AREA (infobar), _("_Download"), GTK_STOCK_SAVE, @@ -304,7 +304,7 @@ create_infobar (PlumaWindow *window, GtkWidget *button; infobar = gtk_info_bar_new (); - + button = pluma_gtk_button_new_with_stock_icon (_("_Download"), GTK_STOCK_SAVE); gtk_widget_show (button); @@ -324,7 +324,7 @@ create_infobar (PlumaWindow *window, gtk_info_bar_add_button (GTK_INFO_BAR (infobar), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); - + gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar), GTK_MESSAGE_INFO); #endif @@ -342,7 +342,7 @@ create_infobar (PlumaWindow *window, g_signal_connect (infobar, "response", G_CALLBACK (on_response_cb), window); - + return infobar; } @@ -351,9 +351,9 @@ pack_infobar (GtkWidget *window, GtkWidget *infobar) { GtkWidget *vbox; - + vbox = gtk_bin_get_child (GTK_BIN (window)); - + gtk_box_pack_start (GTK_BOX (vbox), infobar, FALSE, FALSE, 0); gtk_box_reorder_child (GTK_BOX (vbox), infobar, 2); } @@ -365,20 +365,20 @@ get_file (const gchar *text, GRegex *regex; GMatchInfo *match_info; gchar *word = NULL; - + regex = g_regex_new (regex_place, 0, 0, NULL); g_regex_match (regex, text, 0, &match_info); while (g_match_info_matches (match_info)) { g_free (word); - + word = g_match_info_fetch (match_info, 0); - + g_match_info_next (match_info, NULL); } g_match_info_free (match_info); g_regex_unref (regex); - + return word; } @@ -390,16 +390,16 @@ get_numbers (const gchar *version, { gchar **split; gint num = 2; - + if (micro != NULL) num = 3; - + split = g_strsplit (version, ".", num); *major = atoi (split[0]); *minor = atoi (split[1]); if (micro != NULL) *micro = atoi (split[2]); - + g_strfreev (split); } @@ -411,7 +411,7 @@ newer_version (const gchar *v1, gboolean newer = FALSE; gint major1, minor1, micro1; gint major2, minor2, micro2; - + if (v1 == NULL || v2 == NULL) return FALSE; @@ -438,7 +438,7 @@ newer_version (const gchar *v1, { newer = TRUE; } - + return newer; } @@ -446,21 +446,21 @@ static gchar * parse_file_version (const gchar *file) { gchar *p, *aux; - + p = (gchar *)file; - + while (*p != '\0' && !g_ascii_isdigit (*p)) { p++; } - + if (*p == '\0') return NULL; - + aux = g_strrstr (p, "-"); if (aux == NULL) aux = g_strrstr (p, "."); - + return g_strndup (p, aux - p); } @@ -500,13 +500,13 @@ parse_page_file (SoupSession *session, data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); - + file_url = g_strconcat (data->url, file, NULL); g_free (data->url); data->url = file_url; data->version = g_strdup (file_version); - + infobar = create_infobar (window, file_version); pack_infobar (GTK_WIDGET (window), infobar); gtk_widget_show (infobar); @@ -530,14 +530,14 @@ is_unstable (const gchar *version) gchar **split; gint minor; gboolean unstable = TRUE;; - + split = g_strsplit (version, ".", 2); minor = atoi (split[1]); g_strfreev (split); - + if ((minor % 2) == 0) unstable = FALSE; - + return unstable; } @@ -550,25 +550,25 @@ get_file_page_version (const gchar *text, GString *string = NULL; gchar *unstable = NULL; gchar *stable = NULL; - + regex = g_regex_new (regex_place, 0, 0, NULL); g_regex_match (regex, text, 0, &match_info); while (g_match_info_matches (match_info)) { gint end; gint i; - + g_match_info_fetch_pos (match_info, 0, NULL, &end); - + string = g_string_new (""); - + i = end; while (text[i] != '/') { string = g_string_append_c (string, text[i]); i++; } - + if (is_unstable (string->str)) { g_free (unstable); @@ -579,16 +579,16 @@ get_file_page_version (const gchar *text, g_free (stable); stable = g_string_free (string, FALSE); } - + g_match_info_next (match_info, NULL); } g_match_info_free (match_info); g_regex_unref (regex); - + if ((PLUMA_MINOR_VERSION % 2) == 0) { g_free (unstable); - + return stable; } else @@ -597,13 +597,13 @@ get_file_page_version (const gchar *text, if (newer_version (stable, unstable, FALSE)) { g_free (unstable); - + return stable; } else { g_free (stable); - + return unstable; } } @@ -621,14 +621,14 @@ parse_page_version (SoupSession *session, WindowData *data; data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); - + version = get_file_page_version (msg->response_body->data, VERSION_PLACE); - + data->url = g_strconcat (PLUMA_URL, version, "/", NULL); g_free (version); msg2 = soup_message_new ("GET", data->url); - + soup_session_queue_message (session, msg2, (SoupSessionCallback)parse_page_file, window); @@ -647,7 +647,7 @@ impl_activate (PlumaPlugin *plugin, { SoupMessage *msg; WindowData *data; - + pluma_debug (DEBUG_PLUGINS); data = g_slice_new (WindowData); @@ -661,7 +661,7 @@ impl_activate (PlumaPlugin *plugin, free_window_data); msg = soup_message_new ("GET", PLUMA_URL); - + soup_session_queue_message (PLUMA_CHECK_UPDATE_PLUGIN (plugin)->priv->session, msg, (SoupSessionCallback)parse_page_version, window); @@ -673,9 +673,9 @@ impl_deactivate (PlumaPlugin *plugin, { pluma_debug (DEBUG_PLUGINS); - + soup_session_abort (PLUMA_CHECK_UPDATE_PLUGIN (plugin)->priv->session); - + g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, NULL); @@ -686,7 +686,7 @@ pluma_check_update_plugin_class_init (PlumaCheckUpdatePluginClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass); - + g_type_class_add_private (object_class, sizeof (PlumaCheckUpdatePluginPrivate)); object_class->finalize = pluma_check_update_plugin_finalize; diff --git a/plugins/checkupdate/pluma-check-update.schemas.in b/plugins/checkupdate/pluma-check-update.schemas.in index 5d4d009a..2db4d56a 100755 --- a/plugins/checkupdate/pluma-check-update.schemas.in +++ b/plugins/checkupdate/pluma-check-update.schemas.in @@ -1,8 +1,8 @@ - /schemas/apps/pluma-2/plugins/checkupdate/ignore_version - /apps/pluma-2/plugins/checkupdate/ignore_version + /schemas/apps/pluma/plugins/checkupdate/ignore_version + /apps/pluma/plugins/checkupdate/ignore_version pluma string diff --git a/plugins/externaltools/tools/library.py b/plugins/externaltools/tools/library.py index e3dc624c..039e0a50 100755 --- a/plugins/externaltools/tools/library.py +++ b/plugins/externaltools/tools/library.py @@ -35,13 +35,13 @@ class Singleton(object): class ToolLibrary(Singleton): def __init_once__(self): self.locations = [] - + def set_locations(self, datadir): self.locations = [] if platform.platform() != 'Windows': for d in self.get_xdg_data_dirs(): - self.locations.append(os.path.join(d, 'pluma-2', 'plugins', 'externaltools', 'tools')) + self.locations.append(os.path.join(d, 'pluma', 'plugins', 'externaltools', 'tools')) self.locations.append(datadir) @@ -53,7 +53,7 @@ class ToolLibrary(Singleton): if userdir: toolsdir = os.path.join(userdir, 'pluma/tools') else: - toolsdir = os.path.expanduser('~/.mate2/pluma/tools') + toolsdir = os.path.expanduser('~/.config/pluma/tools') self.locations.insert(0, toolsdir); @@ -82,7 +82,7 @@ class ToolLibrary(Singleton): if userdir: filename = os.path.join(userdir, 'pluma/pluma-tools.xml') else: - filename = os.path.expanduser('~/.mate2/pluma/pluma-tools.xml') + filename = os.path.expanduser('~/.config/pluma/pluma-tools.xml') if not os.path.isfile(filename): return @@ -226,7 +226,7 @@ class Tool(object): return [] else: return map(lambda x: x.strip(), value.split(',')) - + def _from_list(self, value): return ','.join(value) @@ -266,7 +266,7 @@ class Tool(object): break fp.close() self.changed = False - + def _set_property_if_changed(self, key, value): if value != self._properties.get(key): self._properties[key] = value @@ -350,7 +350,7 @@ class Tool(object): def set_save_files(self, value): self._set_property_if_changed('Save-files', value) save_files = property(get_save_files, set_save_files) - + def get_languages(self): languages = self._properties.get('Languages') if languages: return languages @@ -371,7 +371,7 @@ class Tool(object): for line in fp: if line.strip() == '': continue - + return line.startswith('#!') # There is no property for this one because this function is quite @@ -417,7 +417,7 @@ class Tool(object): def save_with_script(self, script): filename = self.library.get_full_path(self.filename, 'w') - + fp = open(filename, 'w', 1) # Make sure to first print header (shebang, modeline), then @@ -429,7 +429,7 @@ class Tool(object): # Parse for line in script: line = line.rstrip("\n") - + if not inheader: content.append(line) elif line.startswith('#!'): @@ -444,10 +444,10 @@ class Tool(object): # Write out header for line in header: fp.write(line + "\n") - + fp.write(self._dump_properties()) fp.write("\n") - + for line in content: fp.write(line + "\n") diff --git a/plugins/filebrowser/pluma-file-browser-plugin.c b/plugins/filebrowser/pluma-file-browser-plugin.c index b9ac96d3..bb00133c 100755 --- a/plugins/filebrowser/pluma-file-browser-plugin.c +++ b/plugins/filebrowser/pluma-file-browser-plugin.c @@ -1,5 +1,5 @@ /* - * pluma-file-browser-plugin.c - Pluma plugin providing easy file access + * pluma-file-browser-plugin.c - Pluma plugin providing easy file access * from the sidepanel * * Copyright (C) 2006 - Jesse van den Kieboom @@ -40,7 +40,7 @@ #include "pluma-file-browser-messages.h" #define WINDOW_DATA_KEY "PlumaFileBrowserPluginWindowData" -#define FILE_BROWSER_BASE_KEY "/apps/pluma-2/plugins/filebrowser" +#define FILE_BROWSER_BASE_KEY "/apps/pluma/plugins/filebrowser" #define CAJA_CLICK_POLICY_BASE_KEY "/apps/caja/preferences" #define CAJA_CLICK_POLICY_KEY "click_policy" #define CAJA_ENABLE_DELETE_KEY "enable_delete" @@ -49,12 +49,12 @@ #define PLUMA_FILE_BROWSER_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_FILE_BROWSER_PLUGIN, PlumaFileBrowserPluginPrivate)) -struct _PlumaFileBrowserPluginPrivate +struct _PlumaFileBrowserPluginPrivate { gpointer dummy; }; -typedef struct _PlumaFileBrowserPluginData +typedef struct _PlumaFileBrowserPluginData { PlumaFileBrowserWidget * tree_widget; gulong merge_id; @@ -70,11 +70,11 @@ typedef struct _PlumaFileBrowserPluginData } PlumaFileBrowserPluginData; static void on_uri_activated_cb (PlumaFileBrowserWidget * widget, - gchar const *uri, + gchar const *uri, PlumaWindow * window); static void on_error_cb (PlumaFileBrowserWidget * widget, guint code, - gchar const *message, + gchar const *message, PlumaWindow * window); static void on_model_set_cb (PlumaFileBrowserView * widget, GParamSpec *arg1, @@ -122,7 +122,7 @@ static void filetree_plugin_finalize (GObject * object) { //PlumaFileBrowserPlugin * plugin = PLUMA_FILE_BROWSER_PLUGIN (object); - + G_OBJECT_CLASS (filetree_plugin_parent_class)->finalize (object); } @@ -132,7 +132,7 @@ get_plugin_data (PlumaWindow * window) return (PlumaFileBrowserPluginData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY)); } -static void +static void on_end_loading_cb (PlumaFileBrowserStore * store, GtkTreeIter * iter, PlumaFileBrowserPluginData * data) @@ -157,13 +157,13 @@ prepare_auto_root (PlumaFileBrowserPluginData *data) data->end_loading_handle = 0; } - data->end_loading_handle = g_signal_connect (store, + data->end_loading_handle = g_signal_connect (store, "end-loading", G_CALLBACK (on_end_loading_cb), data); } -static void +static void restore_default_location (PlumaFileBrowserPluginData *data) { gchar * root; @@ -185,12 +185,12 @@ restore_default_location (PlumaFileBrowserPluginData *data) pluma_file_browser_widget_show_bookmarks (data->tree_widget); return; } - - root = mateconf_client_get_string (client, - FILE_BROWSER_BASE_KEY "/on_load/root", + + root = mateconf_client_get_string (client, + FILE_BROWSER_BASE_KEY "/on_load/root", NULL); - virtual_root = mateconf_client_get_string (client, - FILE_BROWSER_BASE_KEY "/on_load/virtual_root", + virtual_root = mateconf_client_get_string (client, + FILE_BROWSER_BASE_KEY "/on_load/virtual_root", NULL); remote = mateconf_client_get_bool (client, @@ -205,7 +205,7 @@ restore_default_location (PlumaFileBrowserPluginData *data) if (remote || g_file_is_native (file)) { if (virtual_root != NULL && *virtual_root != '\0') { prepare_auto_root (data); - pluma_file_browser_widget_set_root_and_virtual_root (data->tree_widget, + pluma_file_browser_widget_set_root_and_virtual_root (data->tree_widget, root, virtual_root); } else { @@ -225,7 +225,7 @@ restore_default_location (PlumaFileBrowserPluginData *data) } static void -restore_filter (PlumaFileBrowserPluginData * data) +restore_filter (PlumaFileBrowserPluginData * data) { MateConfClient * client; gchar *filter_mode; @@ -240,10 +240,10 @@ restore_filter (PlumaFileBrowserPluginData * data) filter_mode = mateconf_client_get_string (client, FILE_BROWSER_BASE_KEY "/filter_mode", NULL); - + /* Filter mode */ mode = pluma_file_browser_store_filter_mode_get_default (); - + if (filter_mode != NULL) { if (strcmp (filter_mode, "hidden") == 0) { mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; @@ -253,12 +253,12 @@ restore_filter (PlumaFileBrowserPluginData * data) strcmp (filter_mode, "binary_and_hidden") == 0) { mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN | PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY; - } else if (strcmp (filter_mode, "none") == 0 || + } else if (strcmp (filter_mode, "none") == 0 || *filter_mode == '\0') { mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_NONE; } } - + /* Set the filter mode */ pluma_file_browser_store_set_filter_mode ( pluma_file_browser_widget_get_browser_store (data->tree_widget), @@ -268,7 +268,7 @@ restore_filter (PlumaFileBrowserPluginData * data) FILE_BROWSER_BASE_KEY "/filter_pattern", NULL); - pluma_file_browser_widget_set_filter_pattern (data->tree_widget, + pluma_file_browser_widget_set_filter_pattern (data->tree_widget, pattern); g_object_unref (client); @@ -297,17 +297,17 @@ on_click_policy_changed (MateConfClient *client, PlumaFileBrowserViewClickPolicy policy = PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE; PlumaFileBrowserView *view; - data = (PlumaFileBrowserPluginData *)(user_data); + data = (PlumaFileBrowserPluginData *)(user_data); value = mateconf_entry_get_value (entry); - + if (value && value->type == MATECONF_VALUE_STRING) { click_policy = mateconf_value_get_string (value); - + policy = click_policy_from_string (click_policy); } - + view = pluma_file_browser_widget_get_browser_view (data->tree_widget); - pluma_file_browser_view_set_click_policy (view, policy); + pluma_file_browser_view_set_click_policy (view, policy); } static void @@ -320,9 +320,9 @@ on_enable_delete_changed (MateConfClient *client, PlumaFileBrowserPluginData *data; gboolean enable = FALSE; - data = (PlumaFileBrowserPluginData *)(user_data); + data = (PlumaFileBrowserPluginData *)(user_data); value = mateconf_entry_get_value (entry); - + if (value && value->type == MATECONF_VALUE_BOOL) enable = mateconf_value_get_bool (value); @@ -339,9 +339,9 @@ on_confirm_trash_changed (MateConfClient *client, PlumaFileBrowserPluginData *data; gboolean enable = FALSE; - data = (PlumaFileBrowserPluginData *)(user_data); + data = (PlumaFileBrowserPluginData *)(user_data); value = mateconf_entry_get_value (entry); - + if (value && value->type == MATECONF_VALUE_BOOL) enable = mateconf_value_get_bool (value); @@ -361,7 +361,7 @@ install_caja_prefs (PlumaFileBrowserPluginData *data) if (!client) return; - mateconf_client_add_dir (client, + mateconf_client_add_dir (client, CAJA_CLICK_POLICY_BASE_KEY, MATECONF_CLIENT_PRELOAD_NONE, NULL); @@ -377,8 +377,8 @@ install_caja_prefs (PlumaFileBrowserPluginData *data) pluma_file_browser_view_set_click_policy (view, policy); if (pref) { - data->click_policy_handle = - mateconf_client_notify_add (client, + data->click_policy_handle = + mateconf_client_notify_add (client, CAJA_CLICK_POLICY_BASE_KEY "/" CAJA_CLICK_POLICY_KEY, on_click_policy_changed, data, @@ -386,16 +386,16 @@ install_caja_prefs (PlumaFileBrowserPluginData *data) NULL); g_free (pref); } - + /* Get enable_delete */ prefb = mateconf_client_get_bool (client, CAJA_CLICK_POLICY_BASE_KEY "/" CAJA_ENABLE_DELETE_KEY, NULL); - + g_object_set (G_OBJECT (data->tree_widget), "enable-delete", prefb, NULL); - data->enable_delete_handle = - mateconf_client_notify_add (client, + data->enable_delete_handle = + mateconf_client_notify_add (client, CAJA_CLICK_POLICY_BASE_KEY "/" CAJA_ENABLE_DELETE_KEY, on_enable_delete_changed, data, @@ -406,11 +406,11 @@ install_caja_prefs (PlumaFileBrowserPluginData *data) prefb = mateconf_client_get_bool (client, CAJA_CLICK_POLICY_BASE_KEY "/" CAJA_CONFIRM_TRASH_KEY, NULL); - + data->confirm_trash = prefb; - data->confirm_trash_handle = - mateconf_client_notify_add (client, + data->confirm_trash_handle = + mateconf_client_notify_add (client, CAJA_CLICK_POLICY_BASE_KEY "/" CAJA_CONFIRM_TRASH_KEY, on_confirm_trash_changed, data, @@ -458,7 +458,7 @@ on_action_set_active_root (GtkAction * action, PlumaFileBrowserPluginData *data; data = get_plugin_data (window); - set_root_from_doc (data, + set_root_from_doc (data, pluma_window_get_active_document (window)); } @@ -499,7 +499,7 @@ on_action_open_terminal (GtkAction * action, GtkTreeIter iter; PlumaFileBrowserStore * store; - + data = get_plugin_data (window); /* Get the current directory */ @@ -507,33 +507,33 @@ on_action_open_terminal (GtkAction * action, return; store = pluma_file_browser_widget_get_browser_store (data->tree_widget); - gtk_tree_model_get (GTK_TREE_MODEL (store), + gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &wd, -1); - + if (wd == NULL) return; terminal = get_terminal (); - + file = g_file_new_for_uri (wd); local = g_file_get_path (file); g_object_unref (file); argv[0] = terminal; argv[1] = NULL; - - g_spawn_async (local, - argv, - NULL, - G_SPAWN_SEARCH_PATH, + + g_spawn_async (local, + argv, + NULL, + G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL); - + g_free (terminal); g_free (wd); g_free (local); @@ -551,18 +551,18 @@ on_selection_changed_cb (GtkTreeSelection *selection, gchar * uri; data = get_plugin_data (window); - + tree_view = GTK_TREE_VIEW (pluma_file_browser_widget_get_browser_view (data->tree_widget)); model = gtk_tree_view_get_model (tree_view); - + if (!PLUMA_IS_FILE_BROWSER_STORE (model)) return; - + sensitive = pluma_file_browser_widget_get_selected_directory (data->tree_widget, &iter); if (sensitive) { - gtk_tree_model_get (model, &iter, - PLUMA_FILE_BROWSER_STORE_COLUMN_URI, + gtk_tree_model_get (model, &iter, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, -1); sensitive = pluma_utils_uri_has_file_scheme (uri); @@ -570,7 +570,7 @@ on_selection_changed_cb (GtkTreeSelection *selection, } gtk_action_set_sensitive ( - gtk_action_group_get_action (data->single_selection_action_group, + gtk_action_group_get_action (data->single_selection_action_group, "OpenTerminal"), sensitive); } @@ -592,7 +592,7 @@ on_selection_changed_cb (GtkTreeSelection *selection, " " \ "" -static GtkActionEntry extra_actions[] = +static GtkActionEntry extra_actions[] = { {"SetActiveRoot", GTK_STOCK_JUMP_TO, N_("_Set root to active document"), NULL, @@ -636,9 +636,9 @@ add_popup_ui (PlumaWindow * window) gtk_ui_manager_insert_action_group (manager, action_group, 0); data->single_selection_action_group = action_group; - data->merge_id = gtk_ui_manager_add_ui_from_string (manager, - POPUP_UI, - -1, + data->merge_id = gtk_ui_manager_add_ui_from_string (manager, + POPUP_UI, + -1, &error); if (data->merge_id == 0) { @@ -652,11 +652,11 @@ remove_popup_ui (PlumaWindow * window) { PlumaFileBrowserPluginData * data; GtkUIManager * manager; - + data = get_plugin_data (window); manager = pluma_file_browser_widget_get_ui_manager (data->tree_widget); gtk_ui_manager_remove_ui (manager, data->merge_id); - + gtk_ui_manager_remove_action_group (manager, data->action_group); g_object_unref (data->action_group); @@ -665,18 +665,18 @@ remove_popup_ui (PlumaWindow * window) } static void -impl_updateui (PlumaPlugin * plugin, PlumaWindow * window) +impl_updateui (PlumaPlugin * plugin, PlumaWindow * window) { PlumaFileBrowserPluginData * data; PlumaDocument * doc; - + data = get_plugin_data (window); - + doc = pluma_window_get_active_document (window); - - gtk_action_set_sensitive (gtk_action_group_get_action (data->action_group, + + gtk_action_set_sensitive (gtk_action_group_get_action (data->action_group, "SetActiveRoot"), - doc != NULL && + doc != NULL && !pluma_document_is_untitled (doc)); } @@ -691,7 +691,7 @@ impl_activate (PlumaPlugin * plugin, PlumaWindow * window) gchar *data_dir; data = g_new0 (PlumaFileBrowserPluginData, 1); - + data_dir = pluma_plugin_get_data_dir (plugin); data->tree_widget = PLUMA_FILE_BROWSER_WIDGET (pluma_file_browser_widget_new (data_dir)); g_free (data_dir); @@ -718,17 +718,17 @@ impl_activate (PlumaPlugin * plugin, PlumaWindow * window) G_CALLBACK (on_confirm_no_trash_cb), window); - g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW - (pluma_file_browser_widget_get_browser_view + g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW + (pluma_file_browser_widget_get_browser_view (data->tree_widget))), "changed", G_CALLBACK (on_selection_changed_cb), - window); + window); panel = pluma_window_get_side_panel (window); - pixbuf = pluma_file_browser_utils_pixbuf_from_theme("system-file-manager", + pixbuf = pluma_file_browser_utils_pixbuf_from_theme("system-file-manager", GTK_ICON_SIZE_MENU); - + if (pixbuf) { image = gtk_image_new_from_pixbuf(pixbuf); g_object_unref(pixbuf); @@ -748,10 +748,10 @@ impl_activate (PlumaPlugin * plugin, PlumaWindow * window) /* Restore filter options */ restore_filter (data); - + /* Install caja preferences */ install_caja_prefs (data); - + /* Connect signals to store the last visited location */ g_signal_connect (pluma_file_browser_widget_get_browser_view (data->tree_widget), "notify::model", @@ -778,7 +778,7 @@ impl_activate (PlumaPlugin * plugin, PlumaWindow * window) "tab-added", G_CALLBACK (on_tab_added_cb), data); - + /* Register messages on the bus */ pluma_file_browser_messages_register (window, data->tree_widget); @@ -798,13 +798,13 @@ impl_deactivate (PlumaPlugin * plugin, PlumaWindow * window) pluma_file_browser_messages_unregister (window); /* Disconnect signals */ - g_signal_handlers_disconnect_by_func (window, + g_signal_handlers_disconnect_by_func (window, G_CALLBACK (on_tab_added_cb), data); client = mateconf_client_get_default (); mateconf_client_remove_dir (client, CAJA_CLICK_POLICY_BASE_KEY, NULL); - + if (data->click_policy_handle) mateconf_client_notify_remove (client, data->click_policy_handle); @@ -855,12 +855,12 @@ on_error_cb (PlumaFileBrowserWidget * tree_widget, gchar * title; GtkWidget * dlg; PlumaFileBrowserPluginData * data; - + data = get_plugin_data (window); - + /* Do not show the error when the root has been set automatically */ if (data->auto_root && (code == PLUMA_FILE_BROWSER_ERROR_SET_ROOT || - code == PLUMA_FILE_BROWSER_ERROR_LOAD_DIRECTORY)) + code == PLUMA_FILE_BROWSER_ERROR_LOAD_DIRECTORY)) { /* Show bookmarks */ pluma_file_browser_widget_show_bookmarks (data->tree_widget); @@ -895,7 +895,7 @@ on_error_cb (PlumaFileBrowserWidget * tree_widget, _("An error occurred while setting a root directory"); break; case PLUMA_FILE_BROWSER_ERROR_LOAD_DIRECTORY: - title = + title = _("An error occurred while loading a directory"); break; default: @@ -915,7 +915,7 @@ on_error_cb (PlumaFileBrowserWidget * tree_widget, gtk_widget_destroy (dlg); } -static void +static void on_model_set_cb (PlumaFileBrowserView * widget, GParamSpec *arg1, PlumaWindow * window) @@ -925,10 +925,10 @@ on_model_set_cb (PlumaFileBrowserView * widget, MateConfClient * client; model = gtk_tree_view_get_model (GTK_TREE_VIEW (pluma_file_browser_widget_get_browser_view (data->tree_widget))); - + if (model == NULL) return; - + client = mateconf_client_get_default (); mateconf_client_set_bool (client, FILE_BROWSER_BASE_KEY "/on_load/tree_view", @@ -937,7 +937,7 @@ on_model_set_cb (PlumaFileBrowserView * widget, g_object_unref (client); } -static void +static void on_filter_mode_changed_cb (PlumaFileBrowserStore * model, GParamSpec * param, PlumaWindow * window) @@ -946,12 +946,12 @@ on_filter_mode_changed_cb (PlumaFileBrowserStore * model, PlumaFileBrowserStoreFilterMode mode; client = mateconf_client_get_default (); - + if (!client) return; - + mode = pluma_file_browser_store_get_filter_mode (model); - + if ((mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) && (mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY)) { mateconf_client_set_string (client, @@ -962,7 +962,7 @@ on_filter_mode_changed_cb (PlumaFileBrowserStore * model, mateconf_client_set_string (client, FILE_BROWSER_BASE_KEY "/filter_mode", "hidden", - NULL); + NULL); } else if (mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY) { mateconf_client_set_string (client, FILE_BROWSER_BASE_KEY "/filter_mode", @@ -974,9 +974,9 @@ on_filter_mode_changed_cb (PlumaFileBrowserStore * model, "none", NULL); } - + g_object_unref (client); - + } static void @@ -993,21 +993,21 @@ on_rename_cb (PlumaFileBrowserStore * store, GFile * oldfile; GFile * newfile; gchar * uri; - + /* Find all documents and set its uri to newuri where it matches olduri */ app = pluma_app_get_default (); documents = pluma_app_get_documents (app); - + oldfile = g_file_new_for_uri (olduri); newfile = g_file_new_for_uri (newuri); - + for (item = documents; item; item = item->next) { doc = PLUMA_DOCUMENT (item->data); uri = pluma_document_get_uri (doc); - + if (!uri) continue; - + docfile = g_file_new_for_uri (uri); if (g_file_equal (docfile, oldfile)) { @@ -1043,7 +1043,7 @@ on_rename_cb (PlumaFileBrowserStore * store, g_list_free (documents); } -static void +static void on_filter_pattern_changed_cb (PlumaFileBrowserWidget * widget, GParamSpec * param, PlumaWindow * window) @@ -1052,12 +1052,12 @@ on_filter_pattern_changed_cb (PlumaFileBrowserWidget * widget, gchar * pattern; client = mateconf_client_get_default (); - + if (!client) return; - + g_object_get (G_OBJECT (widget), "filter-pattern", &pattern, NULL); - + if (pattern == NULL) mateconf_client_set_string (client, FILE_BROWSER_BASE_KEY "/filter_pattern", @@ -1072,10 +1072,10 @@ on_filter_pattern_changed_cb (PlumaFileBrowserWidget * widget, g_free (pattern); } -static void +static void on_virtual_root_changed_cb (PlumaFileBrowserStore * store, GParamSpec * param, - PlumaWindow * window) + PlumaWindow * window) { PlumaFileBrowserPluginData * data = get_plugin_data (window); gchar * root; @@ -1083,12 +1083,12 @@ on_virtual_root_changed_cb (PlumaFileBrowserStore * store, MateConfClient * client; root = pluma_file_browser_store_get_root (store); - + if (!root) return; client = mateconf_client_get_default (); - + if (!client) return; @@ -1096,7 +1096,7 @@ on_virtual_root_changed_cb (PlumaFileBrowserStore * store, FILE_BROWSER_BASE_KEY "/on_load/root", root, NULL); - + virtual_root = pluma_file_browser_store_get_virtual_root (store); if (!virtual_root) { @@ -1105,14 +1105,14 @@ on_virtual_root_changed_cb (PlumaFileBrowserStore * store, FILE_BROWSER_BASE_KEY "/on_load/virtual_root", root, NULL); - } else { + } else { mateconf_client_set_string (client, FILE_BROWSER_BASE_KEY "/on_load/virtual_root", virtual_root, - NULL); + NULL); } - g_signal_handlers_disconnect_by_func (window, + g_signal_handlers_disconnect_by_func (window, G_CALLBACK (on_tab_added_cb), data); @@ -1121,7 +1121,7 @@ on_virtual_root_changed_cb (PlumaFileBrowserStore * store, g_free (virtual_root); } -static void +static void on_tab_added_cb (PlumaWindow * window, PlumaTab * tab, PlumaFileBrowserPluginData * data) @@ -1162,7 +1162,7 @@ on_tab_added_cb (PlumaWindow * window, g_object_unref (client); /* Disconnect this signal, it's only called once */ - g_signal_handlers_disconnect_by_func (window, + g_signal_handlers_disconnect_by_func (window, G_CALLBACK (on_tab_added_cb), data); } @@ -1177,7 +1177,7 @@ get_filename_from_path (GtkTreeModel *model, GtkTreePath *path) gtk_tree_model_get (model, &iter, PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, -1); - + return pluma_file_browser_utils_uri_basename (uri); } @@ -1202,10 +1202,10 @@ on_confirm_no_trash_cb (PlumaFileBrowserWidget * widget, } result = pluma_file_browser_utils_confirmation_dialog (window, - GTK_MESSAGE_QUESTION, - message, - secondary, - GTK_STOCK_DELETE, + GTK_MESSAGE_QUESTION, + message, + secondary, + GTK_STOCK_DELETE, NULL); g_free (secondary); @@ -1240,10 +1240,10 @@ on_confirm_delete_cb (PlumaFileBrowserWidget *widget, secondary = _("If you delete an item, it is permanently lost."); result = pluma_file_browser_utils_confirmation_dialog (window, - GTK_MESSAGE_QUESTION, - message, - secondary, - GTK_STOCK_DELETE, + GTK_MESSAGE_QUESTION, + message, + secondary, + GTK_STOCK_DELETE, NULL); g_free (message); diff --git a/plugins/filebrowser/pluma-file-browser.schemas.in b/plugins/filebrowser/pluma-file-browser.schemas.in index 0ae807d6..f27a75f4 100755 --- a/plugins/filebrowser/pluma-file-browser.schemas.in +++ b/plugins/filebrowser/pluma-file-browser.schemas.in @@ -1,8 +1,8 @@ - /schemas/apps/pluma-2/plugins/filebrowser/on_load/tree_view - /apps/pluma-2/plugins/filebrowser/on_load/tree_view + /schemas/apps/pluma/plugins/filebrowser/on_load/tree_view + /apps/pluma/plugins/filebrowser/on_load/tree_view pluma bool TRUE @@ -13,35 +13,35 @@ - /schemas/apps/pluma-2/plugins/filebrowser/on_load/root - /apps/pluma-2/plugins/filebrowser/on_load/root + /schemas/apps/pluma/plugins/filebrowser/on_load/root + /apps/pluma/plugins/filebrowser/on_load/root pluma string File Browser Root Directory - The file browser root directory to use when loading the file + The file browser root directory to use when loading the file browser plugin and onload/tree_view is TRUE. - /schemas/apps/pluma-2/plugins/filebrowser/on_load/virtual_root - /apps/pluma-2/plugins/filebrowser/on_load/virtual_root + /schemas/apps/pluma/plugins/filebrowser/on_load/virtual_root + /apps/pluma/plugins/filebrowser/on_load/virtual_root pluma string File Browser Virtual Root Directory - The file browser virtual root directory to use when loading the + The file browser virtual root directory to use when loading the file browser plugin when onload/tree_view is TRUE. The virtual root must always be below the actual root. - + - /schemas/apps/pluma-2/plugins/filebrowser/on_load/enable_remote - /apps/pluma-2/plugins/filebrowser/on_load/enable_remote + /schemas/apps/pluma/plugins/filebrowser/on_load/enable_remote + /apps/pluma/plugins/filebrowser/on_load/enable_remote pluma bool FALSE @@ -52,14 +52,14 @@ - /schemas/apps/pluma-2/plugins/filebrowser/open_at_first_doc - /apps/pluma-2/plugins/filebrowser/open_at_first_doc + /schemas/apps/pluma/plugins/filebrowser/open_at_first_doc + /apps/pluma/plugins/filebrowser/open_at_first_doc pluma bool TRUE Set Location to First Document - If TRUE the file browser plugin will view the directory of + If TRUE the file browser plugin will view the directory of the first opened document given that the file browser hasn't been used yet. (Thus this generally applies to opening a document from the command line or opening it with Caja, etc.) @@ -67,23 +67,23 @@ - /schemas/apps/pluma-2/plugins/filebrowser/filter_mode - /apps/pluma-2/plugins/filebrowser/filter_mode + /schemas/apps/pluma/plugins/filebrowser/filter_mode + /apps/pluma/plugins/filebrowser/filter_mode pluma string hidden_and_binary File Browser Filter Mode This value determines what files get filtered from the file - browser. Valid values are: none (filter nothing), - hidden (filter hidden files), binary (filter binary files) and + browser. Valid values are: none (filter nothing), + hidden (filter hidden files), binary (filter binary files) and hidden_and_binary (filter both hidden and binary files). - /schemas/apps/pluma-2/plugins/filebrowser/filter_pattern - /apps/pluma-2/plugins/filebrowser/filter_pattern + /schemas/apps/pluma/plugins/filebrowser/filter_pattern + /apps/pluma/plugins/filebrowser/filter_pattern pluma string diff --git a/plugins/pythonconsole/pythonconsole/config.py b/plugins/pythonconsole/pythonconsole/config.py index ac0e599c..d3f42158 100755 --- a/plugins/pythonconsole/pythonconsole/config.py +++ b/plugins/pythonconsole/pythonconsole/config.py @@ -8,7 +8,7 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -29,7 +29,7 @@ import gtk __all__ = ('PythonConsoleConfig', 'PythonConsoleConfigDialog') -MATECONF_KEY_BASE = '/apps/pluma-2/plugins/pythonconsole' +MATECONF_KEY_BASE = '/apps/pluma/plugins/pythonconsole' MATECONF_KEY_COMMAND_COLOR = MATECONF_KEY_BASE + '/command-color' MATECONF_KEY_ERROR_COLOR = MATECONF_KEY_BASE + '/error-color' @@ -99,16 +99,16 @@ class PythonConsoleConfigDialog(object): self.config.color_command) self.set_colorbutton_color(self._ui.get_object('colorbutton-error'), self.config.color_error) - + self._ui.connect_signals(self) - + self._dialog = self._ui.get_object('dialog-config') self._dialog.show_all() else: self._dialog.present() - + return self._dialog - + @staticmethod def set_colorbutton_color(colorbutton, value): try: @@ -124,7 +124,7 @@ class PythonConsoleConfigDialog(object): def on_dialog_config_destroy(self, dialog): self._dialog = None self._ui = None - + def on_colorbutton_command_color_set(self, colorbutton): self.config.color_command = colorbutton.get_color().to_string() diff --git a/plugins/snippets/snippets/__init__.py b/plugins/snippets/snippets/__init__.py index 609e3c0c..e74ecd28 100755 --- a/plugins/snippets/snippets/__init__.py +++ b/plugins/snippets/snippets/__init__.py @@ -20,7 +20,7 @@ import os import shutil import gtk -from gtk import gdk +from gtk import gdk import pluma import platform @@ -34,7 +34,7 @@ class SnippetsPlugin(pluma.Plugin): pluma.Plugin.__init__(self) self.dlg = None - + library = Library() library.set_accelerator_callback(self.accelerator_activated) @@ -45,7 +45,7 @@ class SnippetsPlugin(pluma.Plugin): if userdir: snippetsdir = os.path.join(userdir, 'pluma/snippets') else: - snippetsdir = os.path.expanduser('~/.mate2/pluma/snippets') + snippetsdir = os.path.expanduser('~/.config/pluma/snippets') library.set_dirs(snippetsdir, self.system_dirs()) @@ -55,18 +55,18 @@ class SnippetsPlugin(pluma.Plugin): datadirs = os.environ['XDG_DATA_DIRS'] else: datadirs = '/usr/local/share' + os.pathsep + '/usr/share' - + dirs = [] - + for d in datadirs.split(os.pathsep): - d = os.path.join(d, 'pluma-2', 'plugins', 'snippets') - + d = os.path.join(d, 'pluma', 'plugins', 'snippets') + if os.path.isdir(d): dirs.append(d) - + dirs.append(self.get_data_dir()) return dirs - + def activate(self, window): data = WindowHelper(self) window._snippets_plugin_data = data @@ -75,23 +75,23 @@ class SnippetsPlugin(pluma.Plugin): def deactivate(self, window): window._snippets_plugin_data.stop() window._snippets_plugin_data = None - + def update_ui(self, window): window._snippets_plugin_data.update() - + def create_configure_dialog(self): if not self.dlg: self.dlg = Manager(self.get_data_dir()) else: self.dlg.run() - + window = pluma.app_get_default().get_active_window() - + if window: self.dlg.dlg.set_transient_for(window) - + return self.dlg.dlg - + def accelerator_activated(self, group, obj, keyval, mod): ret = False diff --git a/plugins/sort/pluma-sort-plugin.c b/plugins/sort/pluma-sort-plugin.c index e1e5cf5e..0e21674a 100755 --- a/plugins/sort/pluma-sort-plugin.c +++ b/plugins/sort/pluma-sort-plugin.c @@ -1,6 +1,6 @@ /* * pluma-sort-plugin.c - * + * * Original author: Carlo Borreo * Ported to Pluma2 by Lee Mallabone * @@ -8,7 +8,7 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -38,7 +38,7 @@ #define PLUMA_SORT_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_SORT_PLUGIN, PlumaSortPluginPrivate)) /* Key in case the plugin ever needs any settings. */ -#define SORT_BASE_KEY "/apps/pluma-2/plugins/sort" +#define SORT_BASE_KEY "/apps/pluma/plugins/sort" #define WINDOW_DATA_KEY "PlumaSortPluginWindowData" #define MENU_PATH "/MenuBar/EditMenu/EditOps_6" @@ -232,7 +232,7 @@ sort_cb (GtkAction *action, gtk_window_set_transient_for (GTK_WINDOW (dialog->dialog), GTK_WINDOW (action_data->window)); - + gtk_window_set_modal (GTK_WINDOW (dialog->dialog), TRUE); @@ -488,7 +488,7 @@ impl_activate (PlumaPlugin *plugin, manager = pluma_window_get_ui_manager (window); data->ui_action_group = gtk_action_group_new ("PlumaSortPluginActions"); - gtk_action_group_set_translation_domain (data->ui_action_group, + gtk_action_group_set_translation_domain (data->ui_action_group, GETTEXT_PACKAGE); gtk_action_group_add_actions_full (data->ui_action_group, action_entries, @@ -502,17 +502,17 @@ impl_activate (PlumaPlugin *plugin, data->ui_id = gtk_ui_manager_new_merge_id (manager); - g_object_set_data_full (G_OBJECT (window), - WINDOW_DATA_KEY, + g_object_set_data_full (G_OBJECT (window), + WINDOW_DATA_KEY, data, (GDestroyNotify) free_window_data); - gtk_ui_manager_add_ui (manager, - data->ui_id, + gtk_ui_manager_add_ui (manager, + data->ui_id, MENU_PATH, - "Sort", "Sort", - GTK_UI_MANAGER_MENUITEM, + "Sort", + GTK_UI_MANAGER_MENUITEM, FALSE); update_ui_real (window, diff --git a/plugins/taglist/pluma-taglist-plugin-parser.c b/plugins/taglist/pluma-taglist-plugin-parser.c index bc7767d0..6f50da7b 100755 --- a/plugins/taglist/pluma-taglist-plugin-parser.c +++ b/plugins/taglist/pluma-taglist-plugin-parser.c @@ -2,7 +2,7 @@ * pluma-taglist-plugin-parser.c * This file is part of pluma * - * Copyright (C) 2002-2005 - Paolo Maggi + * Copyright (C) 2002-2005 - Paolo Maggi * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,14 +16,14 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. + * Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. */ - + /* - * Modified by the pluma Team, 2002-2005. See the AUTHORS file for a - * list of people on the pluma Team. - * See the ChangeLog files for a list of changes. + * Modified by the pluma Team, 2002-2005. See the AUTHORS file for a + * list of people on the pluma Team. + * See the ChangeLog files for a list of changes. * * $Id$ */ @@ -44,19 +44,19 @@ #include "pluma-taglist-plugin-parser.h" /* we screwed up so we still look here for compatibility */ -#define USER_PLUMA_TAGLIST_PLUGIN_LOCATION_LEGACY ".pluma-2/plugins/taglist/" +#define USER_PLUMA_TAGLIST_PLUGIN_LOCATION_LEGACY ".pluma/plugins/taglist/" #define USER_PLUMA_TAGLIST_PLUGIN_LOCATION "pluma/taglist/" TagList *taglist = NULL; static gint taglist_ref_count = 0; static gboolean parse_tag (Tag *tag, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur); -static gboolean parse_tag_group (TagGroup *tg, const gchar *fn, +static gboolean parse_tag_group (TagGroup *tg, const gchar *fn, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, gboolean sort); -static TagGroup* get_tag_group (const gchar* filename, xmlDocPtr doc, +static TagGroup* get_tag_group (const gchar* filename, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur); -static TagList* lookup_best_lang (TagList *taglist, const gchar *filename, +static TagList* lookup_best_lang (TagList *taglist, const gchar *filename, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur); static TagList *parse_taglist_file (const gchar* filename); static TagList *parse_taglist_dir (const gchar *dir); @@ -65,19 +65,19 @@ static void free_tag (Tag *tag); static void free_tag_group (TagGroup *tag_group); static gboolean -parse_tag (Tag *tag, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) +parse_tag (Tag *tag, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { /* pluma_debug_message (DEBUG_PLUGINS, " Tag name: %s", tag->name); */ /* We don't care what the top level element name is */ cur = cur->xmlChildrenNode; - - while (cur != NULL) + + while (cur != NULL) { if ((!xmlStrcmp (cur->name, (const xmlChar *)"Begin")) && (cur->ns == ns)) - { + { tag->begin = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1); /* pluma_debug_message (DEBUG_PLUGINS, " - Begin: %s", tag->begin); @@ -85,7 +85,7 @@ parse_tag (Tag *tag, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) } if ((!xmlStrcmp (cur->name, (const xmlChar *)"End")) && - (cur->ns == ns)) + (cur->ns == ns)) { tag->end = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1); /* @@ -107,26 +107,26 @@ tags_cmp (gconstpointer a, gconstpointer b) { gchar *tag_a = (gchar*)((Tag *)a)->name; gchar *tag_b = (gchar*)((Tag *)b)->name; - + return g_utf8_collate (tag_a, tag_b); } static gboolean -parse_tag_group (TagGroup *tg, const gchar* fn, xmlDocPtr doc, - xmlNsPtr ns, xmlNodePtr cur, gboolean sort) +parse_tag_group (TagGroup *tg, const gchar* fn, xmlDocPtr doc, + xmlNsPtr ns, xmlNodePtr cur, gboolean sort) { pluma_debug_message (DEBUG_PLUGINS, "Parse TagGroup: %s", tg->name); /* We don't care what the top level element name is */ cur = cur->xmlChildrenNode; - - while (cur != NULL) + + while (cur != NULL) { - if ((xmlStrcmp (cur->name, (const xmlChar *) "Tag")) || (cur->ns != ns)) + if ((xmlStrcmp (cur->name, (const xmlChar *) "Tag")) || (cur->ns != ns)) { g_warning ("The tag list file '%s' is of the wrong type, " "was '%s', 'Tag' expected.", fn, cur->name); - + return FALSE; } else @@ -160,30 +160,30 @@ parse_tag_group (TagGroup *tg, const gchar* fn, xmlDocPtr doc, { /* Error parsing Tag */ g_warning ("The tag list file '%s' is of the wrong type, " - "error parsing Tag '%s' in TagGroup '%s'.", + "error parsing Tag '%s' in TagGroup '%s'.", fn, tag->name, tg->name); - + free_tag (tag); - + return FALSE; } } } - cur = cur->next; + cur = cur->next; } if (sort) tg->tags = g_list_sort (tg->tags, tags_cmp); else - tg->tags = g_list_reverse (tg->tags); - + tg->tags = g_list_reverse (tg->tags); + return TRUE; } static TagGroup* -get_tag_group (const gchar* filename, xmlDocPtr doc, - xmlNsPtr ns, xmlNodePtr cur) +get_tag_group (const gchar* filename, xmlDocPtr doc, + xmlNsPtr ns, xmlNodePtr cur) { TagGroup *tag_group; xmlChar *sort_str; @@ -219,27 +219,27 @@ get_tag_group (const gchar* filename, xmlDocPtr doc, /* Name found */ gboolean exists = FALSE; GList *t = taglist->tag_groups; - + /* Check if the tag group already exists */ while (t && !exists) { gchar *tgn = (gchar*)((TagGroup*)(t->data))->name; - + if (strcmp (tgn, (gchar*)tag_group->name) == 0) { - pluma_debug_message (DEBUG_PLUGINS, + pluma_debug_message (DEBUG_PLUGINS, "Tag group '%s' already exists.", tgn); - + exists = TRUE; free_tag_group (tag_group); } - - t = g_list_next (t); + + t = g_list_next (t); } if (!exists) - { + { /* Parse tag group */ if (parse_tag_group (tag_group, filename, doc, ns, cur, sort)) { @@ -249,7 +249,7 @@ get_tag_group (const gchar* filename, xmlDocPtr doc, { /* Error parsing TagGroup */ g_warning ("The tag list file '%s' is of the wrong type, " - "error parsing TagGroup '%s'.", + "error parsing TagGroup '%s'.", filename, tag_group->name); free_tag_group (tag_group); @@ -264,11 +264,11 @@ groups_cmp (gconstpointer a, gconstpointer b) { gchar *g_a = (gchar *)((TagGroup *)a)->name; gchar *g_b = (gchar *)((TagGroup *)b)->name; - + return g_utf8_collate (g_a, g_b); } -/* +/* * tags file is localized by intltool-merge below. * * @@ -284,8 +284,8 @@ groups_cmp (gconstpointer a, gconstpointer b) * Therefore need to pick up the best lang on the current locale. */ static TagList* -lookup_best_lang (TagList *taglist, const gchar *filename, - xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) +lookup_best_lang (TagList *taglist, const gchar *filename, + xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { TagGroup *best_tag_group = NULL; @@ -295,13 +295,13 @@ lookup_best_lang (TagList *taglist, const gchar *filename, /* * Walk the tree. * - * First level we expect a list TagGroup + * First level we expect a list TagGroup */ cur = cur->xmlChildrenNode; - + while (cur != NULL) - { - if ((xmlStrcmp (cur->name, (const xmlChar *) "TagGroup")) || (cur->ns != ns)) + { + if ((xmlStrcmp (cur->name, (const xmlChar *) "TagGroup")) || (cur->ns != ns)) { g_warning ("The tag list file '%s' is of the wrong type, " "was '%s', 'TagGroup' expected.", filename, cur->name); @@ -321,14 +321,14 @@ lookup_best_lang (TagList *taglist, const gchar *filename, lang = (gchar*) xmlGetProp (cur, (const xmlChar*) "lang"); cur_lanking = 1; - /* - * When found a new TagGroup, prepend the best - * tag_group to taglist. In the current intltool-merge, + /* + * When found a new TagGroup, prepend the best + * tag_group to taglist. In the current intltool-merge, * the first section is the default lang NULL. */ if (lang == NULL) { if (best_tag_group != NULL) { - taglist->tag_groups = + taglist->tag_groups = g_list_prepend (taglist->tag_groups, best_tag_group); } @@ -336,8 +336,8 @@ lookup_best_lang (TagList *taglist, const gchar *filename, best_lanking = -1; } - /* - * If already find the best TagGroup on the current + /* + * If already find the best TagGroup on the current * locale, ignore the logic. */ if (best_lanking != -1 && best_lanking <= cur_lanking) { @@ -351,20 +351,20 @@ lookup_best_lang (TagList *taglist, const gchar *filename, const gchar *best_lang = langs_pointer[i]; /* - * if launch on C, POSIX locale or does + * if launch on C, POSIX locale or does * not find the best lang on the current locale, * this is called. - * g_get_language_names returns lang + * g_get_language_names returns lang * lists with C locale. */ if (lang == NULL && - (!g_ascii_strcasecmp (best_lang, "C") || + (!g_ascii_strcasecmp (best_lang, "C") || !g_ascii_strcasecmp (best_lang, "POSIX"))) { tag_group = get_tag_group (filename, doc, ns, cur); if (tag_group != NULL) { - if (best_tag_group !=NULL) + if (best_tag_group !=NULL) free_tag_group (best_tag_group); best_lanking = cur_lanking; best_tag_group = tag_group; @@ -384,7 +384,7 @@ lookup_best_lang (TagList *taglist, const gchar *filename, tag_group = get_tag_group (filename, doc, ns, cur); if (tag_group != NULL) { - if (best_tag_group !=NULL) + if (best_tag_group !=NULL) free_tag_group (best_tag_group); best_lanking = cur_lanking; best_tag_group = tag_group; @@ -396,18 +396,18 @@ lookup_best_lang (TagList *taglist, const gchar *filename, if (lang) g_free (lang); } /* End of else */ - + cur = cur->next; } /* End of while (cur != NULL) */ /* Prepend TagGroup to TagList */ if (best_tag_group != NULL) { - taglist->tag_groups = + taglist->tag_groups = g_list_prepend (taglist->tag_groups, best_tag_group); } taglist->tag_groups = g_list_sort (taglist->tag_groups, groups_cmp); - + return taglist; } @@ -415,7 +415,7 @@ static TagList * parse_taglist_file (const gchar* filename) { xmlDocPtr doc; - + xmlNsPtr ns; xmlNodePtr cur; @@ -427,54 +427,54 @@ parse_taglist_file (const gchar* filename) * build an XML tree from a the file; */ doc = xmlParseFile (filename); - if (doc == NULL) - { - g_warning ("The tag list file '%s' is empty.", filename); - + if (doc == NULL) + { + g_warning ("The tag list file '%s' is empty.", filename); + return taglist; } /* * Check the document is of the right kind */ - + cur = xmlDocGetRootElement (doc); - if (cur == NULL) + if (cur == NULL) { - g_warning ("The tag list file '%s' is empty.", filename); - xmlFreeDoc(doc); + g_warning ("The tag list file '%s' is empty.", filename); + xmlFreeDoc(doc); return taglist; } ns = xmlSearchNsByHref (doc, cur, (const xmlChar *) "http://pluma.sourceforge.net/some-location"); - if (ns == NULL) + if (ns == NULL) { g_warning ("The tag list file '%s' is of the wrong type, " "pluma namespace not found.", filename); xmlFreeDoc (doc); - + return taglist; } - if (xmlStrcmp(cur->name, (const xmlChar *) "TagList")) + if (xmlStrcmp(cur->name, (const xmlChar *) "TagList")) { g_warning ("The tag list file '%s' is of the wrong type, " "root node != TagList.", filename); xmlFreeDoc (doc); - + return taglist; } - /* + /* * If needed, allocate taglist */ if (taglist == NULL) taglist = g_new0 (TagList, 1); - + taglist = lookup_best_lang (taglist, filename, doc, ns, cur); xmlFreeDoc (doc); @@ -553,7 +553,7 @@ free_taglist (void) pluma_debug_message (DEBUG_PLUGINS, "Really freed"); } -static TagList * +static TagList * parse_taglist_dir (const gchar *dir) { GError *error = NULL; @@ -593,9 +593,9 @@ TagList* create_taglist (const gchar *data_dir) pluma_debug_message (DEBUG_PLUGINS, "ref_count: %d", taglist_ref_count); if (taglist_ref_count > 0) - { + { ++taglist_ref_count; - + return taglist; } @@ -629,14 +629,14 @@ TagList* create_taglist (const gchar *data_dir) else if (home != NULL) { pdir = g_build_filename (home, - ".mate2", + ".config", USER_PLUMA_TAGLIST_PLUGIN_LOCATION, NULL); parse_taglist_dir (pdir); g_free (pdir); } -#else +#else pdir = g_build_filename (g_get_user_config_dir (), "pluma", "taglist", @@ -644,12 +644,12 @@ TagList* create_taglist (const gchar *data_dir) parse_taglist_dir (pdir); g_free (pdir); #endif - + /* load system's taglists */ parse_taglist_dir (data_dir); ++taglist_ref_count; g_return_val_if_fail (taglist_ref_count == 1, taglist); - + return taglist; } diff --git a/plugins/time/pluma-time-plugin.c b/plugins/time/pluma-time-plugin.c index d504bdf4..5709e713 100755 --- a/plugins/time/pluma-time-plugin.c +++ b/plugins/time/pluma-time-plugin.c @@ -53,7 +53,7 @@ #define MENU_PATH "/MenuBar/EditMenu/EditOps_4" /* mateconf keys */ -#define TIME_BASE_KEY "/apps/pluma-2/plugins/time" +#define TIME_BASE_KEY "/apps/pluma/plugins/time" #define PROMPT_TYPE_KEY TIME_BASE_KEY "/prompt_type" #define SELECTED_FORMAT_KEY TIME_BASE_KEY "/selected_format" #define CUSTOM_FORMAT_KEY TIME_BASE_KEY "/custom_format" @@ -758,7 +758,7 @@ get_configure_dialog (PlumaTimePlugin *plugin) "time_dialog_content", NULL }; - + pluma_debug (DEBUG_PLUGINS); dialog = g_new0 (TimeConfigureDialog, 1); @@ -938,7 +938,7 @@ get_choose_format_dialog (GtkWindow *parent, gboolean ret; gchar *sf, *cf; GtkWindowGroup *wg = NULL; - + if (parent != NULL) wg = gtk_window_get_group (parent); -- cgit v1.2.1