renaming from gedit to pluma
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
# changecase plugin
|
||||
plugindir = $(GEDIT_PLUGINS_LIBS_DIR)
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir) \
|
||||
$(GEDIT_CFLAGS) \
|
||||
$(PLUMA_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(DISABLE_DEPRECATED_CFLAGS)
|
||||
|
||||
plugin_LTLIBRARIES = libchangecase.la
|
||||
|
||||
libchangecase_la_SOURCES = \
|
||||
gedit-changecase-plugin.h \
|
||||
gedit-changecase-plugin.c
|
||||
pluma-changecase-plugin.h \
|
||||
pluma-changecase-plugin.c
|
||||
|
||||
libchangecase_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
|
||||
libchangecase_la_LIBADD = $(GEDIT_LIBS)
|
||||
libchangecase_la_LIBADD = $(PLUMA_LIBS)
|
||||
|
||||
uidir = $(GEDIT_PLUGINS_DATA_DIR)/changecase
|
||||
uidir = $(PLUMA_PLUGINS_DATA_DIR)/changecase
|
||||
ui_DATA =
|
||||
|
||||
plugin_in_files = changecase.gedit-plugin.desktop.in
|
||||
plugin_in_files = changecase.pluma-plugin.desktop.in
|
||||
|
||||
%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
|
||||
plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin)
|
||||
plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin)
|
||||
|
||||
EXTRA_DIST = $(ui_DATA) $(plugin_in_files)
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
[Gedit Plugin]
|
||||
[Pluma Plugin]
|
||||
Module=changecase
|
||||
IAge=2
|
||||
_Name=Change Case
|
||||
_Description=Changes the case of selected text.
|
||||
Authors=Paolo Borelli <pborelli@katamail.com>
|
||||
Copyright=Copyright © 2004-2005 Paolo Borelli
|
||||
Website=http://www.gedit.org
|
||||
Website=http://www.pluma.org
|
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* gedit-changecase-plugin.h
|
||||
*
|
||||
* Copyright (C) 2004-2005 - Paolo Borelli
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __GEDIT_CHANGECASE_PLUGIN_H__
|
||||
#define __GEDIT_CHANGECASE_PLUGIN_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <gedit/gedit-plugin.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Type checking and casting macros
|
||||
*/
|
||||
#define GEDIT_TYPE_CHANGECASE_PLUGIN (gedit_changecase_plugin_get_type ())
|
||||
#define GEDIT_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_CHANGECASE_PLUGIN, GeditChangecasePlugin))
|
||||
#define GEDIT_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_CHANGECASE_PLUGIN, GeditChangecasePluginClass))
|
||||
#define GEDIT_IS_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_CHANGECASE_PLUGIN))
|
||||
#define GEDIT_IS_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_CHANGECASE_PLUGIN))
|
||||
#define GEDIT_CHANGECASE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_CHANGECASE_PLUGIN, GeditChangecasePluginClass))
|
||||
|
||||
/*
|
||||
* Main object structure
|
||||
*/
|
||||
typedef struct _GeditChangecasePlugin GeditChangecasePlugin;
|
||||
|
||||
struct _GeditChangecasePlugin
|
||||
{
|
||||
GeditPlugin parent_instance;
|
||||
};
|
||||
|
||||
/*
|
||||
* Class definition
|
||||
*/
|
||||
typedef struct _GeditChangecasePluginClass GeditChangecasePluginClass;
|
||||
|
||||
struct _GeditChangecasePluginClass
|
||||
{
|
||||
GeditPluginClass parent_class;
|
||||
};
|
||||
|
||||
/*
|
||||
* Public methods
|
||||
*/
|
||||
GType gedit_changecase_plugin_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* All the plugins must implement this function */
|
||||
G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GEDIT_CHANGECASE_PLUGIN_H__ */
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* gedit-changecase-plugin.c
|
||||
* pluma-changecase-plugin.c
|
||||
*
|
||||
* Copyright (C) 2004-2005 - Paolo Borelli
|
||||
*
|
||||
@@ -24,16 +24,16 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "gedit-changecase-plugin.h"
|
||||
#include "pluma-changecase-plugin.h"
|
||||
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include <gedit/gedit-debug.h>
|
||||
#include <pluma/pluma-debug.h>
|
||||
|
||||
#define WINDOW_DATA_KEY "GeditChangecasePluginWindowData"
|
||||
#define WINDOW_DATA_KEY "PlumaChangecasePluginWindowData"
|
||||
|
||||
GEDIT_PLUGIN_REGISTER_TYPE(GeditChangecasePlugin, gedit_changecase_plugin)
|
||||
PLUMA_PLUGIN_REGISTER_TYPE(PlumaChangecasePlugin, pluma_changecase_plugin)
|
||||
|
||||
typedef enum {
|
||||
TO_UPPER_CASE,
|
||||
@@ -149,15 +149,15 @@ do_title_case (GtkTextBuffer *buffer,
|
||||
}
|
||||
|
||||
static void
|
||||
change_case (GeditWindow *window,
|
||||
change_case (PlumaWindow *window,
|
||||
ChangeCaseChoice choice)
|
||||
{
|
||||
GeditDocument *doc;
|
||||
PlumaDocument *doc;
|
||||
GtkTextIter start, end;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
doc = gedit_window_get_active_document (window);
|
||||
doc = pluma_window_get_active_document (window);
|
||||
g_return_if_fail (doc != NULL);
|
||||
|
||||
if (!gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc),
|
||||
@@ -191,28 +191,28 @@ change_case (GeditWindow *window,
|
||||
|
||||
static void
|
||||
upper_case_cb (GtkAction *action,
|
||||
GeditWindow *window)
|
||||
PlumaWindow *window)
|
||||
{
|
||||
change_case (window, TO_UPPER_CASE);
|
||||
}
|
||||
|
||||
static void
|
||||
lower_case_cb (GtkAction *action,
|
||||
GeditWindow *window)
|
||||
PlumaWindow *window)
|
||||
{
|
||||
change_case (window, TO_LOWER_CASE);
|
||||
}
|
||||
|
||||
static void
|
||||
invert_case_cb (GtkAction *action,
|
||||
GeditWindow *window)
|
||||
PlumaWindow *window)
|
||||
{
|
||||
change_case (window, INVERT_CASE);
|
||||
}
|
||||
|
||||
static void
|
||||
title_case_cb (GtkAction *action,
|
||||
GeditWindow *window)
|
||||
PlumaWindow *window)
|
||||
{
|
||||
change_case (window, TO_TITLE_CASE);
|
||||
}
|
||||
@@ -251,17 +251,17 @@ const gchar submenu[] =
|
||||
"</ui>";
|
||||
|
||||
static void
|
||||
gedit_changecase_plugin_init (GeditChangecasePlugin *plugin)
|
||||
pluma_changecase_plugin_init (PlumaChangecasePlugin *plugin)
|
||||
{
|
||||
gedit_debug_message (DEBUG_PLUGINS, "GeditChangecasePlugin initializing");
|
||||
pluma_debug_message (DEBUG_PLUGINS, "PlumaChangecasePlugin initializing");
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_changecase_plugin_finalize (GObject *object)
|
||||
pluma_changecase_plugin_finalize (GObject *object)
|
||||
{
|
||||
G_OBJECT_CLASS (gedit_changecase_plugin_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (pluma_changecase_plugin_parent_class)->finalize (object);
|
||||
|
||||
gedit_debug_message (DEBUG_PLUGINS, "GeditChangecasePlugin finalizing");
|
||||
pluma_debug_message (DEBUG_PLUGINS, "PlumaChangecasePlugin finalizing");
|
||||
}
|
||||
|
||||
typedef struct
|
||||
@@ -279,16 +279,16 @@ free_window_data (WindowData *data)
|
||||
}
|
||||
|
||||
static void
|
||||
update_ui_real (GeditWindow *window,
|
||||
update_ui_real (PlumaWindow *window,
|
||||
WindowData *data)
|
||||
{
|
||||
GtkTextView *view;
|
||||
GtkAction *action;
|
||||
gboolean sensitive = FALSE;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
view = GTK_TEXT_VIEW (gedit_window_get_active_view (window));
|
||||
view = GTK_TEXT_VIEW (pluma_window_get_active_view (window));
|
||||
|
||||
if (view != NULL)
|
||||
{
|
||||
@@ -305,20 +305,20 @@ update_ui_real (GeditWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
impl_activate (GeditPlugin *plugin,
|
||||
GeditWindow *window)
|
||||
impl_activate (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
GtkUIManager *manager;
|
||||
WindowData *data;
|
||||
GError *error = NULL;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
data = g_slice_new (WindowData);
|
||||
|
||||
manager = gedit_window_get_ui_manager (window);
|
||||
manager = pluma_window_get_ui_manager (window);
|
||||
|
||||
data->action_group = gtk_action_group_new ("GeditChangecasePluginActions");
|
||||
data->action_group = gtk_action_group_new ("PlumaChangecasePluginActions");
|
||||
gtk_action_group_set_translation_domain (data->action_group,
|
||||
GETTEXT_PACKAGE);
|
||||
gtk_action_group_add_actions (data->action_group,
|
||||
@@ -348,15 +348,15 @@ impl_activate (GeditPlugin *plugin,
|
||||
}
|
||||
|
||||
static void
|
||||
impl_deactivate (GeditPlugin *plugin,
|
||||
GeditWindow *window)
|
||||
impl_deactivate (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
GtkUIManager *manager;
|
||||
WindowData *data;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
manager = gedit_window_get_ui_manager (window);
|
||||
manager = pluma_window_get_ui_manager (window);
|
||||
|
||||
data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
|
||||
g_return_if_fail (data != NULL);
|
||||
@@ -368,12 +368,12 @@ impl_deactivate (GeditPlugin *plugin,
|
||||
}
|
||||
|
||||
static void
|
||||
impl_update_ui (GeditPlugin *plugin,
|
||||
GeditWindow *window)
|
||||
impl_update_ui (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
WindowData *data;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
|
||||
g_return_if_fail (data != NULL);
|
||||
@@ -382,12 +382,12 @@ impl_update_ui (GeditPlugin *plugin,
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_changecase_plugin_class_init (GeditChangecasePluginClass *klass)
|
||||
pluma_changecase_plugin_class_init (PlumaChangecasePluginClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass);
|
||||
PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass);
|
||||
|
||||
object_class->finalize = gedit_changecase_plugin_finalize;
|
||||
object_class->finalize = pluma_changecase_plugin_finalize;
|
||||
|
||||
plugin_class->activate = impl_activate;
|
||||
plugin_class->deactivate = impl_deactivate;
|
72
plugins/changecase/pluma-changecase-plugin.h
Executable file
72
plugins/changecase/pluma-changecase-plugin.h
Executable file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* pluma-changecase-plugin.h
|
||||
*
|
||||
* Copyright (C) 2004-2005 - Paolo Borelli
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __PLUMA_CHANGECASE_PLUGIN_H__
|
||||
#define __PLUMA_CHANGECASE_PLUGIN_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <pluma/pluma-plugin.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Type checking and casting macros
|
||||
*/
|
||||
#define PLUMA_TYPE_CHANGECASE_PLUGIN (pluma_changecase_plugin_get_type ())
|
||||
#define PLUMA_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_CHANGECASE_PLUGIN, PlumaChangecasePlugin))
|
||||
#define PLUMA_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_CHANGECASE_PLUGIN, PlumaChangecasePluginClass))
|
||||
#define PLUMA_IS_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_CHANGECASE_PLUGIN))
|
||||
#define PLUMA_IS_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_CHANGECASE_PLUGIN))
|
||||
#define PLUMA_CHANGECASE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_CHANGECASE_PLUGIN, PlumaChangecasePluginClass))
|
||||
|
||||
/*
|
||||
* Main object structure
|
||||
*/
|
||||
typedef struct _PlumaChangecasePlugin PlumaChangecasePlugin;
|
||||
|
||||
struct _PlumaChangecasePlugin
|
||||
{
|
||||
PlumaPlugin parent_instance;
|
||||
};
|
||||
|
||||
/*
|
||||
* Class definition
|
||||
*/
|
||||
typedef struct _PlumaChangecasePluginClass PlumaChangecasePluginClass;
|
||||
|
||||
struct _PlumaChangecasePluginClass
|
||||
{
|
||||
PlumaPluginClass parent_class;
|
||||
};
|
||||
|
||||
/*
|
||||
* Public methods
|
||||
*/
|
||||
GType pluma_changecase_plugin_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* All the plugins must implement this function */
|
||||
G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule *module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __PLUMA_CHANGECASE_PLUGIN_H__ */
|
@@ -1,10 +1,10 @@
|
||||
# gedit win32 updater
|
||||
# pluma win32 updater
|
||||
|
||||
plugindir = $(GEDIT_PLUGINS_LIBS_DIR)
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir) \
|
||||
$(GEDIT_CFLAGS) \
|
||||
$(PLUMA_CFLAGS) \
|
||||
$(LIBSOUP_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(DISABLE_DEPRECATED_CFLAGS)
|
||||
@@ -12,20 +12,20 @@ INCLUDES = \
|
||||
plugin_LTLIBRARIES = libcheckupdate.la
|
||||
|
||||
libcheckupdate_la_SOURCES = \
|
||||
gedit-check-update-plugin.h \
|
||||
gedit-check-update-plugin.c
|
||||
pluma-check-update-plugin.h \
|
||||
pluma-check-update-plugin.c
|
||||
|
||||
libcheckupdate_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
|
||||
libcheckupdate_la_LIBADD = $(GEDIT_LIBS) $(LIBSOUP_LIBS)
|
||||
libcheckupdate_la_LIBADD = $(PLUMA_LIBS) $(LIBSOUP_LIBS)
|
||||
|
||||
plugin_in_files = checkupdate.gedit-plugin.desktop.in
|
||||
plugin_in_files = checkupdate.pluma-plugin.desktop.in
|
||||
|
||||
%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
|
||||
plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin)
|
||||
plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin)
|
||||
|
||||
schemasdir = $(MATECONF_SCHEMA_FILE_DIR)
|
||||
schemas_in_files = gedit-check-update.schemas.in
|
||||
schemas_in_files = pluma-check-update.schemas.in
|
||||
schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
|
||||
@INTLTOOL_SCHEMAS_RULE@
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
[Gedit Plugin]
|
||||
[Pluma Plugin]
|
||||
Module=checkupdate
|
||||
IAge=2
|
||||
_Name=Check update
|
||||
_Description=Check for latest version of gedit
|
||||
Icon=gedit-plugin
|
||||
_Description=Check for latest version of pluma
|
||||
Icon=pluma-plugin
|
||||
Authors=Ignacio Casal Quinteiro <icq@gnome.org>
|
||||
Copyright=Copyright © 2009 Ignacio Casal Quinteiro
|
||||
Website=http://www.gedit.org
|
||||
Website=http://www.pluma.org
|
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2009 - Ignacio Casal Quinteiro <icq@gnome.org>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __GEDIT_CHECK_UPDATE_PLUGIN_H__
|
||||
#define __GEDIT_CHECK_UPDATE_PLUGIN_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <gedit/gedit-plugin.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Type checking and casting macros
|
||||
*/
|
||||
#define GEDIT_TYPE_CHECK_UPDATE_PLUGIN (gedit_check_update_plugin_get_type ())
|
||||
#define GEDIT_CHECK_UPDATE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_CHECK_UPDATE_PLUGIN, GeditCheckUpdatePlugin))
|
||||
#define GEDIT_CHECK_UPDATE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_CHECK_UPDATE_PLUGIN, GeditCheckUpdatePluginClass))
|
||||
#define IS_GEDIT_CHECK_UPDATE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_CHECK_UPDATE_PLUGIN))
|
||||
#define IS_GEDIT_CHECK_UPDATE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_CHECK_UPDATE_PLUGIN))
|
||||
#define GEDIT_CHECK_UPDATE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_CHECK_UPDATE_PLUGIN, GeditCheckUpdatePluginClass))
|
||||
|
||||
/* Private structure type */
|
||||
typedef struct _GeditCheckUpdatePluginPrivate GeditCheckUpdatePluginPrivate;
|
||||
|
||||
/*
|
||||
* Main object structure
|
||||
*/
|
||||
typedef struct _GeditCheckUpdatePlugin GeditCheckUpdatePlugin;
|
||||
|
||||
struct _GeditCheckUpdatePlugin
|
||||
{
|
||||
GeditPlugin parent_instance;
|
||||
|
||||
/*< private >*/
|
||||
GeditCheckUpdatePluginPrivate *priv;
|
||||
};
|
||||
|
||||
/*
|
||||
* Class definition
|
||||
*/
|
||||
typedef struct _GeditCheckUpdatePluginClass GeditCheckUpdatePluginClass;
|
||||
|
||||
struct _GeditCheckUpdatePluginClass
|
||||
{
|
||||
GeditPluginClass parent_class;
|
||||
};
|
||||
|
||||
/*
|
||||
* Public methods
|
||||
*/
|
||||
GType gedit_check_update_plugin_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* All the plugins must implement this function */
|
||||
G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GEDIT_CHECK_UPDATE_PLUGIN_H__ */
|
@@ -20,11 +20,11 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "gedit-check-update-plugin.h"
|
||||
#include "pluma-check-update-plugin.h"
|
||||
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include <gedit/gedit-debug.h>
|
||||
#include <gedit/gedit-utils.h>
|
||||
#include <pluma/pluma-debug.h>
|
||||
#include <pluma/pluma-utils.h>
|
||||
#include <libsoup/soup.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdlib.h>
|
||||
@@ -32,36 +32,36 @@
|
||||
#include <mateconf/mateconf-client.h>
|
||||
|
||||
#if !GTK_CHECK_VERSION(2, 17, 1)
|
||||
#include <gedit/gedit-message-area.h>
|
||||
#include <pluma/pluma-message-area.h>
|
||||
#endif
|
||||
|
||||
#define MATECONF_KEY_BASE "/apps/gedit-2/plugins/checkupdate"
|
||||
#define MATECONF_KEY_BASE "/apps/pluma-2/plugins/checkupdate"
|
||||
#define MATECONF_KEY_IGNORE_VERSION MATECONF_KEY_BASE "/ignore_version"
|
||||
|
||||
#define WINDOW_DATA_KEY "GeditCheckUpdatePluginWindowData"
|
||||
#define WINDOW_DATA_KEY "PlumaCheckUpdatePluginWindowData"
|
||||
|
||||
#define VERSION_PLACE "<a href=\"[0-9]\\.[0-9]+/\">"
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#define GEDIT_URL "http://ftp.acc.umu.se/pub/mate/binaries/win32/gedit/"
|
||||
#define FILE_REGEX "gedit\\-setup\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.exe"
|
||||
#define PLUMA_URL "http://ftp.acc.umu.se/pub/mate/binaries/win32/pluma/"
|
||||
#define FILE_REGEX "pluma\\-setup\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.exe"
|
||||
#else
|
||||
#define GEDIT_URL "http://ftp.acc.umu.se/pub/mate/binaries/mac/gedit/"
|
||||
#define FILE_REGEX "gedit\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.dmg"
|
||||
#define PLUMA_URL "http://ftp.acc.umu.se/pub/mate/binaries/mac/pluma/"
|
||||
#define FILE_REGEX "pluma\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.dmg"
|
||||
#endif
|
||||
|
||||
#ifdef OS_OSX
|
||||
#include "gedit/osx/gedit-osx.h"
|
||||
#include "pluma/osx/pluma-osx.h"
|
||||
#endif
|
||||
|
||||
#define GEDIT_CHECK_UPDATE_PLUGIN_GET_PRIVATE(object) \
|
||||
#define PLUMA_CHECK_UPDATE_PLUGIN_GET_PRIVATE(object) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
|
||||
GEDIT_TYPE_CHECK_UPDATE_PLUGIN, \
|
||||
GeditCheckUpdatePluginPrivate))
|
||||
PLUMA_TYPE_CHECK_UPDATE_PLUGIN, \
|
||||
PlumaCheckUpdatePluginPrivate))
|
||||
|
||||
GEDIT_PLUGIN_REGISTER_TYPE (GeditCheckUpdatePlugin, gedit_check_update_plugin)
|
||||
PLUMA_PLUGIN_REGISTER_TYPE (PlumaCheckUpdatePlugin, pluma_check_update_plugin)
|
||||
|
||||
struct _GeditCheckUpdatePluginPrivate
|
||||
struct _PlumaCheckUpdatePluginPrivate
|
||||
{
|
||||
SoupSession *session;
|
||||
|
||||
@@ -70,7 +70,7 @@ struct _GeditCheckUpdatePluginPrivate
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GeditCheckUpdatePlugin *plugin;
|
||||
PlumaCheckUpdatePlugin *plugin;
|
||||
|
||||
gchar *url;
|
||||
gchar *version;
|
||||
@@ -92,12 +92,12 @@ free_window_data (gpointer data)
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_check_update_plugin_init (GeditCheckUpdatePlugin *plugin)
|
||||
pluma_check_update_plugin_init (PlumaCheckUpdatePlugin *plugin)
|
||||
{
|
||||
plugin->priv = GEDIT_CHECK_UPDATE_PLUGIN_GET_PRIVATE (plugin);
|
||||
plugin->priv = PLUMA_CHECK_UPDATE_PLUGIN_GET_PRIVATE (plugin);
|
||||
|
||||
gedit_debug_message (DEBUG_PLUGINS,
|
||||
"GeditCheckUpdatePlugin initializing");
|
||||
pluma_debug_message (DEBUG_PLUGINS,
|
||||
"PlumaCheckUpdatePlugin initializing");
|
||||
|
||||
plugin->priv->session = soup_session_async_new ();
|
||||
|
||||
@@ -110,9 +110,9 @@ gedit_check_update_plugin_init (GeditCheckUpdatePlugin *plugin)
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_check_update_plugin_dispose (GObject *object)
|
||||
pluma_check_update_plugin_dispose (GObject *object)
|
||||
{
|
||||
GeditCheckUpdatePlugin *plugin = GEDIT_CHECK_UPDATE_PLUGIN (object);
|
||||
PlumaCheckUpdatePlugin *plugin = PLUMA_CHECK_UPDATE_PLUGIN (object);
|
||||
|
||||
if (plugin->priv->session != NULL)
|
||||
{
|
||||
@@ -129,19 +129,19 @@ gedit_check_update_plugin_dispose (GObject *object)
|
||||
plugin->priv->mateconf_client = NULL;
|
||||
}
|
||||
|
||||
gedit_debug_message (DEBUG_PLUGINS,
|
||||
"GeditCheckUpdatePlugin disposing");
|
||||
pluma_debug_message (DEBUG_PLUGINS,
|
||||
"PlumaCheckUpdatePlugin disposing");
|
||||
|
||||
G_OBJECT_CLASS (gedit_check_update_plugin_parent_class)->dispose (object);
|
||||
G_OBJECT_CLASS (pluma_check_update_plugin_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_check_update_plugin_finalize (GObject *object)
|
||||
pluma_check_update_plugin_finalize (GObject *object)
|
||||
{
|
||||
gedit_debug_message (DEBUG_PLUGINS,
|
||||
"GeditCheckUpdatePlugin finalizing");
|
||||
pluma_debug_message (DEBUG_PLUGINS,
|
||||
"PlumaCheckUpdatePlugin finalizing");
|
||||
|
||||
G_OBJECT_CLASS (gedit_check_update_plugin_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (pluma_check_update_plugin_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -149,7 +149,7 @@ set_contents (GtkWidget *infobar,
|
||||
GtkWidget *contents)
|
||||
{
|
||||
#if !GTK_CHECK_VERSION (2, 17, 1)
|
||||
gedit_message_area_set_contents (GEDIT_MESSAGE_AREA (infobar),
|
||||
pluma_message_area_set_contents (PLUMA_MESSAGE_AREA (infobar),
|
||||
contents);
|
||||
#else
|
||||
GtkWidget *content_area;
|
||||
@@ -217,7 +217,7 @@ set_message_area_text_and_icon (GtkWidget *message_area,
|
||||
static void
|
||||
on_response_cb (GtkWidget *infobar,
|
||||
gint response_id,
|
||||
GeditWindow *window)
|
||||
PlumaWindow *window)
|
||||
{
|
||||
if (response_id == GTK_RESPONSE_YES)
|
||||
{
|
||||
@@ -228,7 +228,7 @@ on_response_cb (GtkWidget *infobar,
|
||||
WINDOW_DATA_KEY);
|
||||
|
||||
#ifdef OS_OSX
|
||||
gedit_osx_show_url (data->url);
|
||||
pluma_osx_show_url (data->url);
|
||||
#else
|
||||
gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (window)),
|
||||
data->url,
|
||||
@@ -280,24 +280,24 @@ on_response_cb (GtkWidget *infobar,
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_infobar (GeditWindow *window,
|
||||
create_infobar (PlumaWindow *window,
|
||||
const gchar *version)
|
||||
{
|
||||
GtkWidget *infobar;
|
||||
gchar *message;
|
||||
|
||||
#if !GTK_CHECK_VERSION (2, 17, 1)
|
||||
infobar = gedit_message_area_new ();
|
||||
infobar = pluma_message_area_new ();
|
||||
|
||||
gedit_message_area_add_stock_button_with_text (GEDIT_MESSAGE_AREA (infobar),
|
||||
pluma_message_area_add_stock_button_with_text (PLUMA_MESSAGE_AREA (infobar),
|
||||
_("_Download"),
|
||||
GTK_STOCK_SAVE,
|
||||
GTK_RESPONSE_YES);
|
||||
gedit_message_area_add_stock_button_with_text (GEDIT_MESSAGE_AREA (infobar),
|
||||
pluma_message_area_add_stock_button_with_text (PLUMA_MESSAGE_AREA (infobar),
|
||||
_("_Ignore Version"),
|
||||
GTK_STOCK_DISCARD,
|
||||
GTK_RESPONSE_NO);
|
||||
gedit_message_area_add_button (GEDIT_MESSAGE_AREA (infobar),
|
||||
pluma_message_area_add_button (PLUMA_MESSAGE_AREA (infobar),
|
||||
GTK_STOCK_CANCEL,
|
||||
GTK_RESPONSE_CANCEL);
|
||||
#else
|
||||
@@ -305,7 +305,7 @@ create_infobar (GeditWindow *window,
|
||||
|
||||
infobar = gtk_info_bar_new ();
|
||||
|
||||
button = gedit_gtk_button_new_with_stock_icon (_("_Download"),
|
||||
button = pluma_gtk_button_new_with_stock_icon (_("_Download"),
|
||||
GTK_STOCK_SAVE);
|
||||
gtk_widget_show (button);
|
||||
|
||||
@@ -313,7 +313,7 @@ create_infobar (GeditWindow *window,
|
||||
button,
|
||||
GTK_RESPONSE_YES);
|
||||
|
||||
button = gedit_gtk_button_new_with_stock_icon (_("_Ignore Version"),
|
||||
button = pluma_gtk_button_new_with_stock_icon (_("_Ignore Version"),
|
||||
GTK_STOCK_DISCARD);
|
||||
gtk_widget_show (button);
|
||||
|
||||
@@ -329,11 +329,11 @@ create_infobar (GeditWindow *window,
|
||||
GTK_MESSAGE_INFO);
|
||||
#endif
|
||||
|
||||
message = g_strdup_printf ("%s (%s)", _("There is a new version of gedit"), version);
|
||||
message = g_strdup_printf ("%s (%s)", _("There is a new version of pluma"), version);
|
||||
set_message_area_text_and_icon (infobar,
|
||||
"gtk-dialog-info",
|
||||
message,
|
||||
_("You can download the new version of gedit"
|
||||
_("You can download the new version of pluma"
|
||||
" by clicking on the download button or"
|
||||
" ignore that version and wait for a new one"));
|
||||
|
||||
@@ -465,7 +465,7 @@ parse_file_version (const gchar *file)
|
||||
}
|
||||
|
||||
static gchar *
|
||||
get_ignore_version (GeditCheckUpdatePlugin *plugin)
|
||||
get_ignore_version (PlumaCheckUpdatePlugin *plugin)
|
||||
{
|
||||
return mateconf_client_get_string (plugin->priv->mateconf_client,
|
||||
MATECONF_KEY_IGNORE_VERSION,
|
||||
@@ -475,7 +475,7 @@ get_ignore_version (GeditCheckUpdatePlugin *plugin)
|
||||
static void
|
||||
parse_page_file (SoupSession *session,
|
||||
SoupMessage *msg,
|
||||
GeditWindow *window)
|
||||
PlumaWindow *window)
|
||||
{
|
||||
if (msg->status_code == SOUP_STATUS_OK)
|
||||
{
|
||||
@@ -585,7 +585,7 @@ get_file_page_version (const gchar *text,
|
||||
g_match_info_free (match_info);
|
||||
g_regex_unref (regex);
|
||||
|
||||
if ((GEDIT_MINOR_VERSION % 2) == 0)
|
||||
if ((PLUMA_MINOR_VERSION % 2) == 0)
|
||||
{
|
||||
g_free (unstable);
|
||||
|
||||
@@ -612,7 +612,7 @@ get_file_page_version (const gchar *text,
|
||||
static void
|
||||
parse_page_version (SoupSession *session,
|
||||
SoupMessage *msg,
|
||||
GeditWindow *window)
|
||||
PlumaWindow *window)
|
||||
{
|
||||
if (msg->status_code == SOUP_STATUS_OK)
|
||||
{
|
||||
@@ -625,7 +625,7 @@ parse_page_version (SoupSession *session,
|
||||
version = get_file_page_version (msg->response_body->data,
|
||||
VERSION_PLACE);
|
||||
|
||||
data->url = g_strconcat (GEDIT_URL, version, "/", NULL);
|
||||
data->url = g_strconcat (PLUMA_URL, version, "/", NULL);
|
||||
g_free (version);
|
||||
msg2 = soup_message_new ("GET", data->url);
|
||||
|
||||
@@ -642,16 +642,16 @@ parse_page_version (SoupSession *session,
|
||||
}
|
||||
|
||||
static void
|
||||
impl_activate (GeditPlugin *plugin,
|
||||
GeditWindow *window)
|
||||
impl_activate (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
SoupMessage *msg;
|
||||
WindowData *data;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
data = g_slice_new (WindowData);
|
||||
data->plugin = GEDIT_CHECK_UPDATE_PLUGIN (plugin);
|
||||
data->plugin = PLUMA_CHECK_UPDATE_PLUGIN (plugin);
|
||||
data->url = NULL;
|
||||
data->version = NULL;
|
||||
|
||||
@@ -660,21 +660,21 @@ impl_activate (GeditPlugin *plugin,
|
||||
data,
|
||||
free_window_data);
|
||||
|
||||
msg = soup_message_new ("GET", GEDIT_URL);
|
||||
msg = soup_message_new ("GET", PLUMA_URL);
|
||||
|
||||
soup_session_queue_message (GEDIT_CHECK_UPDATE_PLUGIN (plugin)->priv->session, msg,
|
||||
soup_session_queue_message (PLUMA_CHECK_UPDATE_PLUGIN (plugin)->priv->session, msg,
|
||||
(SoupSessionCallback)parse_page_version,
|
||||
window);
|
||||
}
|
||||
|
||||
static void
|
||||
impl_deactivate (GeditPlugin *plugin,
|
||||
GeditWindow *window)
|
||||
impl_deactivate (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
soup_session_abort (GEDIT_CHECK_UPDATE_PLUGIN (plugin)->priv->session);
|
||||
soup_session_abort (PLUMA_CHECK_UPDATE_PLUGIN (plugin)->priv->session);
|
||||
|
||||
g_object_set_data (G_OBJECT (window),
|
||||
WINDOW_DATA_KEY,
|
||||
@@ -682,15 +682,15 @@ impl_deactivate (GeditPlugin *plugin,
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_check_update_plugin_class_init (GeditCheckUpdatePluginClass *klass)
|
||||
pluma_check_update_plugin_class_init (PlumaCheckUpdatePluginClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass);
|
||||
PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (GeditCheckUpdatePluginPrivate));
|
||||
g_type_class_add_private (object_class, sizeof (PlumaCheckUpdatePluginPrivate));
|
||||
|
||||
object_class->finalize = gedit_check_update_plugin_finalize;
|
||||
object_class->dispose = gedit_check_update_plugin_dispose;
|
||||
object_class->finalize = pluma_check_update_plugin_finalize;
|
||||
object_class->dispose = pluma_check_update_plugin_dispose;
|
||||
|
||||
plugin_class->activate = impl_activate;
|
||||
plugin_class->deactivate = impl_deactivate;
|
74
plugins/checkupdate/pluma-check-update-plugin.h
Executable file
74
plugins/checkupdate/pluma-check-update-plugin.h
Executable file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (C) 2009 - Ignacio Casal Quinteiro <icq@gnome.org>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __PLUMA_CHECK_UPDATE_PLUGIN_H__
|
||||
#define __PLUMA_CHECK_UPDATE_PLUGIN_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <pluma/pluma-plugin.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Type checking and casting macros
|
||||
*/
|
||||
#define PLUMA_TYPE_CHECK_UPDATE_PLUGIN (pluma_check_update_plugin_get_type ())
|
||||
#define PLUMA_CHECK_UPDATE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_CHECK_UPDATE_PLUGIN, PlumaCheckUpdatePlugin))
|
||||
#define PLUMA_CHECK_UPDATE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_CHECK_UPDATE_PLUGIN, PlumaCheckUpdatePluginClass))
|
||||
#define IS_PLUMA_CHECK_UPDATE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_CHECK_UPDATE_PLUGIN))
|
||||
#define IS_PLUMA_CHECK_UPDATE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_CHECK_UPDATE_PLUGIN))
|
||||
#define PLUMA_CHECK_UPDATE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_CHECK_UPDATE_PLUGIN, PlumaCheckUpdatePluginClass))
|
||||
|
||||
/* Private structure type */
|
||||
typedef struct _PlumaCheckUpdatePluginPrivate PlumaCheckUpdatePluginPrivate;
|
||||
|
||||
/*
|
||||
* Main object structure
|
||||
*/
|
||||
typedef struct _PlumaCheckUpdatePlugin PlumaCheckUpdatePlugin;
|
||||
|
||||
struct _PlumaCheckUpdatePlugin
|
||||
{
|
||||
PlumaPlugin parent_instance;
|
||||
|
||||
/*< private >*/
|
||||
PlumaCheckUpdatePluginPrivate *priv;
|
||||
};
|
||||
|
||||
/*
|
||||
* Class definition
|
||||
*/
|
||||
typedef struct _PlumaCheckUpdatePluginClass PlumaCheckUpdatePluginClass;
|
||||
|
||||
struct _PlumaCheckUpdatePluginClass
|
||||
{
|
||||
PlumaPluginClass parent_class;
|
||||
};
|
||||
|
||||
/*
|
||||
* Public methods
|
||||
*/
|
||||
GType pluma_check_update_plugin_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* All the plugins must implement this function */
|
||||
G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule *module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __PLUMA_CHECK_UPDATE_PLUGIN_H__ */
|
@@ -1,9 +1,9 @@
|
||||
<mateconfschemafile>
|
||||
<schemalist>
|
||||
<schema>
|
||||
<key>/schemas/apps/gedit-2/plugins/checkupdate/ignore_version</key>
|
||||
<applyto>/apps/gedit-2/plugins/checkupdate/ignore_version</applyto>
|
||||
<owner>gedit</owner>
|
||||
<key>/schemas/apps/pluma-2/plugins/checkupdate/ignore_version</key>
|
||||
<applyto>/apps/pluma-2/plugins/checkupdate/ignore_version</applyto>
|
||||
<owner>pluma</owner>
|
||||
<type>string</type>
|
||||
<locale name="C">
|
||||
<short>Version to ignore until the next version is released</short>
|
@@ -1,29 +1,29 @@
|
||||
# docinfo plugin
|
||||
plugindir = $(GEDIT_PLUGINS_LIBS_DIR)
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir) \
|
||||
$(GEDIT_CFLAGS) \
|
||||
$(PLUMA_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(DISABLE_DEPRECATED_CFLAGS)
|
||||
|
||||
plugin_LTLIBRARIES = libdocinfo.la
|
||||
|
||||
libdocinfo_la_SOURCES = \
|
||||
gedit-docinfo-plugin.h \
|
||||
gedit-docinfo-plugin.c
|
||||
pluma-docinfo-plugin.h \
|
||||
pluma-docinfo-plugin.c
|
||||
|
||||
libdocinfo_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
|
||||
libdocinfo_la_LIBADD = $(GEDIT_LIBS)
|
||||
libdocinfo_la_LIBADD = $(PLUMA_LIBS)
|
||||
|
||||
uidir = $(GEDIT_PLUGINS_DATA_DIR)/docinfo
|
||||
uidir = $(PLUMA_PLUGINS_DATA_DIR)/docinfo
|
||||
ui_DATA = docinfo.ui
|
||||
|
||||
plugin_in_files = docinfo.gedit-plugin.desktop.in
|
||||
plugin_in_files = docinfo.pluma-plugin.desktop.in
|
||||
|
||||
%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
|
||||
plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin)
|
||||
plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin)
|
||||
|
||||
EXTRA_DIST = $(ui_DATA) $(plugin_in_files)
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[Gedit Plugin]
|
||||
[Pluma Plugin]
|
||||
Module=docinfo
|
||||
IAge=2
|
||||
_Name=Document Statistics
|
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
* gedit-docinfo-plugin.h
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __GEDIT_DOCINFO_PLUGIN_H__
|
||||
#define __GEDIT_DOCINFO_PLUGIN_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <gedit/gedit-plugin.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Type checking and casting macros
|
||||
*/
|
||||
#define GEDIT_TYPE_DOCINFO_PLUGIN (gedit_docinfo_plugin_get_type ())
|
||||
#define GEDIT_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_DOCINFO_PLUGIN, GeditDocInfoPlugin))
|
||||
#define GEDIT_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_DOCINFO_PLUGIN, GeditDocInfoPluginClass))
|
||||
#define GEDIT_IS_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_DOCINFO_PLUGIN))
|
||||
#define GEDIT_IS_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_DOCINFO_PLUGIN))
|
||||
#define GEDIT_DOCINFO_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_DOCINFO_PLUGIN, GeditDocInfoPluginClass))
|
||||
|
||||
/* Private structure type */
|
||||
typedef struct _GeditDocInfoPluginPrivate GeditDocInfoPluginPrivate;
|
||||
|
||||
/*
|
||||
* Main object structure
|
||||
*/
|
||||
typedef struct _GeditDocInfoPlugin GeditDocInfoPlugin;
|
||||
|
||||
struct _GeditDocInfoPlugin
|
||||
{
|
||||
GeditPlugin parent_instance;
|
||||
};
|
||||
|
||||
/*
|
||||
* Class definition
|
||||
*/
|
||||
typedef struct _GeditDocInfoPluginClass GeditDocInfoPluginClass;
|
||||
|
||||
struct _GeditDocInfoPluginClass
|
||||
{
|
||||
GeditPluginClass parent_class;
|
||||
};
|
||||
|
||||
/*
|
||||
* Public methods
|
||||
*/
|
||||
GType gedit_docinfo_plugin_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* All the plugins must implement this function */
|
||||
G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GEDIT_DOCINFO_PLUGIN_H__ */
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* gedit-docinfo-plugin.c
|
||||
* pluma-docinfo-plugin.c
|
||||
*
|
||||
* Copyright (C) 2002-2005 Paolo Maggi
|
||||
*
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "gedit-docinfo-plugin.h"
|
||||
#include "pluma-docinfo-plugin.h"
|
||||
|
||||
#include <string.h> /* For strlen (...) */
|
||||
|
||||
@@ -32,13 +32,13 @@
|
||||
#include <pango/pango-break.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include <gedit/gedit-debug.h>
|
||||
#include <gedit/gedit-utils.h>
|
||||
#include <pluma/pluma-debug.h>
|
||||
#include <pluma/pluma-utils.h>
|
||||
|
||||
#define WINDOW_DATA_KEY "GeditDocInfoWindowData"
|
||||
#define WINDOW_DATA_KEY "PlumaDocInfoWindowData"
|
||||
#define MENU_PATH "/MenuBar/ToolsMenu/ToolsOps_2"
|
||||
|
||||
GEDIT_PLUGIN_REGISTER_TYPE(GeditDocInfoPlugin, gedit_docinfo_plugin)
|
||||
PLUMA_PLUGIN_REGISTER_TYPE(PlumaDocInfoPlugin, pluma_docinfo_plugin)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -59,7 +59,7 @@ typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GeditPlugin *plugin;
|
||||
PlumaPlugin *plugin;
|
||||
|
||||
GtkActionGroup *ui_action_group;
|
||||
guint ui_id;
|
||||
@@ -69,13 +69,13 @@ typedef struct
|
||||
|
||||
static void docinfo_dialog_response_cb (GtkDialog *widget,
|
||||
gint res_id,
|
||||
GeditWindow *window);
|
||||
PlumaWindow *window);
|
||||
|
||||
static void
|
||||
docinfo_dialog_destroy_cb (GtkObject *obj,
|
||||
WindowData *data)
|
||||
{
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
if (data != NULL)
|
||||
{
|
||||
@@ -85,7 +85,7 @@ docinfo_dialog_destroy_cb (GtkObject *obj,
|
||||
}
|
||||
|
||||
static DocInfoDialog *
|
||||
get_docinfo_dialog (GeditWindow *window,
|
||||
get_docinfo_dialog (PlumaWindow *window,
|
||||
WindowData *data)
|
||||
{
|
||||
DocInfoDialog *dialog;
|
||||
@@ -95,13 +95,13 @@ get_docinfo_dialog (GeditWindow *window,
|
||||
GtkWidget *error_widget;
|
||||
gboolean ret;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
dialog = g_new (DocInfoDialog, 1);
|
||||
|
||||
data_dir = gedit_plugin_get_data_dir (data->plugin);
|
||||
data_dir = pluma_plugin_get_data_dir (data->plugin);
|
||||
ui_file = g_build_filename (data_dir, "docinfo.ui", NULL);
|
||||
ret = gedit_utils_get_ui_objects (ui_file,
|
||||
ret = pluma_utils_get_ui_objects (ui_file,
|
||||
NULL,
|
||||
&error_widget,
|
||||
"dialog", &dialog->dialog,
|
||||
@@ -128,7 +128,7 @@ get_docinfo_dialog (GeditWindow *window,
|
||||
const gchar *err_message;
|
||||
|
||||
err_message = gtk_label_get_label (GTK_LABEL (error_widget));
|
||||
gedit_warning (GTK_WINDOW (window), "%s", err_message);
|
||||
pluma_warning (GTK_WINDOW (window), "%s", err_message);
|
||||
|
||||
g_free (dialog);
|
||||
gtk_widget_destroy (error_widget);
|
||||
@@ -154,7 +154,7 @@ get_docinfo_dialog (GeditWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
calculate_info (GeditDocument *doc,
|
||||
calculate_info (PlumaDocument *doc,
|
||||
GtkTextIter *start,
|
||||
GtkTextIter *end,
|
||||
gint *chars,
|
||||
@@ -164,7 +164,7 @@ calculate_info (GeditDocument *doc,
|
||||
{
|
||||
gchar *text;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
text = gtk_text_buffer_get_slice (GTK_TEXT_BUFFER (doc),
|
||||
start,
|
||||
@@ -209,7 +209,7 @@ calculate_info (GeditDocument *doc,
|
||||
}
|
||||
|
||||
static void
|
||||
docinfo_real (GeditDocument *doc,
|
||||
docinfo_real (PlumaDocument *doc,
|
||||
DocInfoDialog *dialog)
|
||||
{
|
||||
GtkTextIter start, end;
|
||||
@@ -221,7 +221,7 @@ docinfo_real (GeditDocument *doc,
|
||||
gchar *tmp_str;
|
||||
gchar *doc_name;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (doc),
|
||||
&start,
|
||||
@@ -236,13 +236,13 @@ docinfo_real (GeditDocument *doc,
|
||||
if (chars == 0)
|
||||
lines = 0;
|
||||
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Chars: %d", chars);
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Lines: %d", lines);
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Words: %d", words);
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Chars non-space: %d", chars - white_chars);
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Bytes: %d", bytes);
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Chars: %d", chars);
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Lines: %d", lines);
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Words: %d", words);
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Chars non-space: %d", chars - white_chars);
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Bytes: %d", bytes);
|
||||
|
||||
doc_name = gedit_document_get_short_name_for_display (doc);
|
||||
doc_name = pluma_document_get_short_name_for_display (doc);
|
||||
tmp_str = g_strdup_printf ("<span weight=\"bold\">%s</span>", doc_name);
|
||||
gtk_label_set_markup (GTK_LABEL (dialog->file_name_label), tmp_str);
|
||||
g_free (doc_name);
|
||||
@@ -270,7 +270,7 @@ docinfo_real (GeditDocument *doc,
|
||||
}
|
||||
|
||||
static void
|
||||
selectioninfo_real (GeditDocument *doc,
|
||||
selectioninfo_real (PlumaDocument *doc,
|
||||
DocInfoDialog *dialog)
|
||||
{
|
||||
gboolean sel;
|
||||
@@ -282,7 +282,7 @@ selectioninfo_real (GeditDocument *doc,
|
||||
gint bytes = 0;
|
||||
gchar *tmp_str;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
sel = gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc),
|
||||
&start,
|
||||
@@ -296,11 +296,11 @@ selectioninfo_real (GeditDocument *doc,
|
||||
&start, &end,
|
||||
&chars, &words, &white_chars, &bytes);
|
||||
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Selected chars: %d", chars);
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Selected lines: %d", lines);
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Selected words: %d", words);
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Selected chars non-space: %d", chars - white_chars);
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Selected bytes: %d", bytes);
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Selected chars: %d", chars);
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Selected lines: %d", lines);
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Selected words: %d", words);
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Selected chars non-space: %d", chars - white_chars);
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Selected bytes: %d", bytes);
|
||||
|
||||
gtk_widget_set_sensitive (dialog->selection_vbox, TRUE);
|
||||
}
|
||||
@@ -308,7 +308,7 @@ selectioninfo_real (GeditDocument *doc,
|
||||
{
|
||||
gtk_widget_set_sensitive (dialog->selection_vbox, FALSE);
|
||||
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Selection empty");
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Selection empty");
|
||||
}
|
||||
|
||||
if (chars == 0)
|
||||
@@ -337,17 +337,17 @@ selectioninfo_real (GeditDocument *doc,
|
||||
|
||||
static void
|
||||
docinfo_cb (GtkAction *action,
|
||||
GeditWindow *window)
|
||||
PlumaWindow *window)
|
||||
{
|
||||
GeditDocument *doc;
|
||||
PlumaDocument *doc;
|
||||
WindowData *data;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
data = (WindowData *) g_object_get_data (G_OBJECT (window),
|
||||
WINDOW_DATA_KEY);
|
||||
|
||||
doc = gedit_window_get_active_document (window);
|
||||
doc = pluma_window_get_active_document (window);
|
||||
g_return_if_fail (doc != NULL);
|
||||
|
||||
if (data->dialog != NULL)
|
||||
@@ -376,11 +376,11 @@ docinfo_cb (GtkAction *action,
|
||||
static void
|
||||
docinfo_dialog_response_cb (GtkDialog *widget,
|
||||
gint res_id,
|
||||
GeditWindow *window)
|
||||
PlumaWindow *window)
|
||||
{
|
||||
WindowData *data;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
data = (WindowData *) g_object_get_data (G_OBJECT (window),
|
||||
WINDOW_DATA_KEY);
|
||||
@@ -389,7 +389,7 @@ docinfo_dialog_response_cb (GtkDialog *widget,
|
||||
{
|
||||
case GTK_RESPONSE_CLOSE:
|
||||
{
|
||||
gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CLOSE");
|
||||
pluma_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CLOSE");
|
||||
gtk_widget_destroy (data->dialog->dialog);
|
||||
|
||||
break;
|
||||
@@ -397,11 +397,11 @@ docinfo_dialog_response_cb (GtkDialog *widget,
|
||||
|
||||
case GTK_RESPONSE_OK:
|
||||
{
|
||||
GeditDocument *doc;
|
||||
PlumaDocument *doc;
|
||||
|
||||
gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK");
|
||||
pluma_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK");
|
||||
|
||||
doc = gedit_window_get_active_document (window);
|
||||
doc = pluma_window_get_active_document (window);
|
||||
g_return_if_fail (doc != NULL);
|
||||
|
||||
docinfo_real (doc,
|
||||
@@ -430,7 +430,7 @@ free_window_data (WindowData *data)
|
||||
{
|
||||
g_return_if_fail (data != NULL);
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
g_object_unref (data->plugin);
|
||||
|
||||
@@ -445,14 +445,14 @@ free_window_data (WindowData *data)
|
||||
}
|
||||
|
||||
static void
|
||||
update_ui_real (GeditWindow *window,
|
||||
update_ui_real (PlumaWindow *window,
|
||||
WindowData *data)
|
||||
{
|
||||
GeditView *view;
|
||||
PlumaView *view;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
view = gedit_window_get_active_view (window);
|
||||
view = pluma_window_get_active_view (window);
|
||||
|
||||
gtk_action_group_set_sensitive (data->ui_action_group,
|
||||
(view != NULL));
|
||||
@@ -466,33 +466,33 @@ update_ui_real (GeditWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_docinfo_plugin_init (GeditDocInfoPlugin *plugin)
|
||||
pluma_docinfo_plugin_init (PlumaDocInfoPlugin *plugin)
|
||||
{
|
||||
gedit_debug_message (DEBUG_PLUGINS, "GeditDocInfoPlugin initializing");
|
||||
pluma_debug_message (DEBUG_PLUGINS, "PlumaDocInfoPlugin initializing");
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_docinfo_plugin_finalize (GObject *object)
|
||||
pluma_docinfo_plugin_finalize (GObject *object)
|
||||
{
|
||||
gedit_debug_message (DEBUG_PLUGINS, "GeditDocInfoPlugin finalizing");
|
||||
pluma_debug_message (DEBUG_PLUGINS, "PlumaDocInfoPlugin finalizing");
|
||||
|
||||
G_OBJECT_CLASS (gedit_docinfo_plugin_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (pluma_docinfo_plugin_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
impl_activate (GeditPlugin *plugin,
|
||||
GeditWindow *window)
|
||||
impl_activate (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
GtkUIManager *manager;
|
||||
WindowData *data;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
data = g_new (WindowData, 1);
|
||||
|
||||
data->plugin = g_object_ref (plugin);
|
||||
data->dialog = NULL;
|
||||
data->ui_action_group = gtk_action_group_new ("GeditDocInfoPluginActions");
|
||||
data->ui_action_group = gtk_action_group_new ("PlumaDocInfoPluginActions");
|
||||
|
||||
gtk_action_group_set_translation_domain (data->ui_action_group,
|
||||
GETTEXT_PACKAGE);
|
||||
@@ -501,7 +501,7 @@ impl_activate (GeditPlugin *plugin,
|
||||
G_N_ELEMENTS (action_entries),
|
||||
window);
|
||||
|
||||
manager = gedit_window_get_ui_manager (window);
|
||||
manager = pluma_window_get_ui_manager (window);
|
||||
gtk_ui_manager_insert_action_group (manager,
|
||||
data->ui_action_group,
|
||||
-1);
|
||||
@@ -526,15 +526,15 @@ impl_activate (GeditPlugin *plugin,
|
||||
}
|
||||
|
||||
static void
|
||||
impl_deactivate (GeditPlugin *plugin,
|
||||
GeditWindow *window)
|
||||
impl_deactivate (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
GtkUIManager *manager;
|
||||
WindowData *data;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
manager = gedit_window_get_ui_manager (window);
|
||||
manager = pluma_window_get_ui_manager (window);
|
||||
|
||||
data = (WindowData *) g_object_get_data (G_OBJECT (window),
|
||||
WINDOW_DATA_KEY);
|
||||
@@ -551,12 +551,12 @@ impl_deactivate (GeditPlugin *plugin,
|
||||
}
|
||||
|
||||
static void
|
||||
impl_update_ui (GeditPlugin *plugin,
|
||||
GeditWindow *window)
|
||||
impl_update_ui (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
WindowData *data;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
data = (WindowData *) g_object_get_data (G_OBJECT (window),
|
||||
WINDOW_DATA_KEY);
|
||||
@@ -567,12 +567,12 @@ impl_update_ui (GeditPlugin *plugin,
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_docinfo_plugin_class_init (GeditDocInfoPluginClass *klass)
|
||||
pluma_docinfo_plugin_class_init (PlumaDocInfoPluginClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass);
|
||||
PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass);
|
||||
|
||||
object_class->finalize = gedit_docinfo_plugin_finalize;
|
||||
object_class->finalize = pluma_docinfo_plugin_finalize;
|
||||
|
||||
plugin_class->activate = impl_activate;
|
||||
plugin_class->deactivate = impl_deactivate;
|
75
plugins/docinfo/pluma-docinfo-plugin.h
Executable file
75
plugins/docinfo/pluma-docinfo-plugin.h
Executable file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* pluma-docinfo-plugin.h
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __PLUMA_DOCINFO_PLUGIN_H__
|
||||
#define __PLUMA_DOCINFO_PLUGIN_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <pluma/pluma-plugin.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Type checking and casting macros
|
||||
*/
|
||||
#define PLUMA_TYPE_DOCINFO_PLUGIN (pluma_docinfo_plugin_get_type ())
|
||||
#define PLUMA_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_DOCINFO_PLUGIN, PlumaDocInfoPlugin))
|
||||
#define PLUMA_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_DOCINFO_PLUGIN, PlumaDocInfoPluginClass))
|
||||
#define PLUMA_IS_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_DOCINFO_PLUGIN))
|
||||
#define PLUMA_IS_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_DOCINFO_PLUGIN))
|
||||
#define PLUMA_DOCINFO_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_DOCINFO_PLUGIN, PlumaDocInfoPluginClass))
|
||||
|
||||
/* Private structure type */
|
||||
typedef struct _PlumaDocInfoPluginPrivate PlumaDocInfoPluginPrivate;
|
||||
|
||||
/*
|
||||
* Main object structure
|
||||
*/
|
||||
typedef struct _PlumaDocInfoPlugin PlumaDocInfoPlugin;
|
||||
|
||||
struct _PlumaDocInfoPlugin
|
||||
{
|
||||
PlumaPlugin parent_instance;
|
||||
};
|
||||
|
||||
/*
|
||||
* Class definition
|
||||
*/
|
||||
typedef struct _PlumaDocInfoPluginClass PlumaDocInfoPluginClass;
|
||||
|
||||
struct _PlumaDocInfoPluginClass
|
||||
{
|
||||
PlumaPluginClass parent_class;
|
||||
};
|
||||
|
||||
/*
|
||||
* Public methods
|
||||
*/
|
||||
GType pluma_docinfo_plugin_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* All the plugins must implement this function */
|
||||
G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule *module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __PLUMA_DOCINFO_PLUGIN_H__ */
|
@@ -1,11 +1,11 @@
|
||||
# External Tools plugin
|
||||
SUBDIRS = tools data scripts
|
||||
plugindir = $(GEDIT_PLUGINS_LIBS_DIR)
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
|
||||
|
||||
plugin_in_files = externaltools.gedit-plugin.desktop.in
|
||||
%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
plugin_in_files = externaltools.pluma-plugin.desktop.in
|
||||
%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
|
||||
plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin)
|
||||
plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin)
|
||||
|
||||
EXTRA_DIST = $(plugin_in_files)
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
TOOL_MERGE=$(top_srcdir)/plugins/externaltools/scripts/gedit-tool-merge.pl
|
||||
TOOL_MERGE=$(top_srcdir)/plugins/externaltools/scripts/pluma-tool-merge.pl
|
||||
|
||||
tools_in_files = \
|
||||
build.tool.in \
|
||||
@@ -29,7 +29,7 @@ desktop_in_files = $(install_tools_in_files:.tool.in=.desktop.in)
|
||||
desktop_files = $(install_tools_in_files:.tool.in=.desktop)
|
||||
|
||||
tools_SCRIPTS = $(install_tools_in_files:.tool.in=)
|
||||
toolsdir = $(GEDIT_PLUGINS_DATA_DIR)/externaltools/tools
|
||||
toolsdir = $(PLUMA_PLUGINS_DATA_DIR)/externaltools/tools
|
||||
|
||||
all_tools_in_files = \
|
||||
$(tools_in_files) \
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[Gedit Tool]
|
||||
[Pluma Tool]
|
||||
_Name=Build
|
||||
_Comment=Run "make" in the document directory
|
||||
Input=nothing
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
EHOME=`echo $HOME | sed "s/#/\#/"`
|
||||
DIR=$GEDIT_CURRENT_DOCUMENT_DIR
|
||||
DIR=$PLUMA_CURRENT_DOCUMENT_DIR
|
||||
while test "$DIR" != "/"; do
|
||||
for m in GNUmakefile makefile Makefile; do
|
||||
if [ -f "${DIR}/${m}" ]; then
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[Gedit Tool]
|
||||
[Pluma Tool]
|
||||
_Name=Open terminal here
|
||||
_Comment=Open a terminal in the document location
|
||||
Input=nothing
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/osascript
|
||||
|
||||
set the_path to system attribute "GEDIT_CURRENT_DOCUMENT_DIR"
|
||||
set the_path to system attribute "PLUMA_CURRENT_DOCUMENT_DIR"
|
||||
set cmd to "cd " & quoted form of the_path
|
||||
|
||||
tell application "System Events" to set terminalIsRunning to exists application process "Terminal"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[Gedit Tool]
|
||||
[Pluma Tool]
|
||||
_Name=Open terminal here
|
||||
_Comment=Open a terminal in the document location
|
||||
Input=nothing
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
#TODO: use "mateconftool-2 -g /desktop/mate/applications/terminal/exec"
|
||||
mate-terminal --working-directory=$GEDIT_CURRENT_DOCUMENT_DIR &
|
||||
mate-terminal --working-directory=$PLUMA_CURRENT_DOCUMENT_DIR &
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[Gedit Tool]
|
||||
[Pluma Tool]
|
||||
_Name=Remove trailing spaces
|
||||
_Comment=Remove useless trailing spaces in your file
|
||||
Input=document
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[Gedit Tool]
|
||||
[Pluma Tool]
|
||||
_Name=Run command
|
||||
_Comment=Execute a custom command and put its output in a new document
|
||||
Input=nothing
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
#TODO: use "mateconftool-2 -g /desktop/mate/applications/terminal/exec"
|
||||
exec `matedialog --entry --title="Run command - gedit" --text="Command to run"`
|
||||
exec `matedialog --entry --title="Run command - pluma" --text="Command to run"`
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[Gedit Plugin]
|
||||
[Pluma Plugin]
|
||||
Loader=python
|
||||
Module=externaltools
|
||||
IAge=2
|
||||
@@ -6,4 +6,4 @@ _Name=External Tools
|
||||
_Description=Execute external commands and shell scripts.
|
||||
Authors=Steve Frécinaux <steve@istique.net>
|
||||
Copyright=Copyright © 2005 Steve Frécinaux
|
||||
Website=http://www.gedit.org
|
||||
Website=http://www.pluma.org
|
@@ -1,4 +1,4 @@
|
||||
EXTRA_DIST = gedit-tool-merge.pl
|
||||
EXTRA_DIST = pluma-tool-merge.pl
|
||||
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
@@ -1,22 +1,22 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# gedit-tool-merge.pl
|
||||
# This file is part of gedit
|
||||
# pluma-tool-merge.pl
|
||||
# This file is part of pluma
|
||||
#
|
||||
# Copyright (C) 2006 - Steve Frécinaux <code@istique.net>
|
||||
#
|
||||
# gedit is free software; you can redistribute it and/or modify
|
||||
# pluma is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# gedit is distributed in the hope that it will be useful,
|
||||
# pluma 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
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with gedit; if not, write to the Free Software
|
||||
# along with pluma; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
# Boston, MA 02110-1301 USA
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Python snippets plugin
|
||||
|
||||
plugindir = $(GEDIT_PLUGINS_LIBS_DIR)/externaltools
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)/externaltools
|
||||
plugin_PYTHON = \
|
||||
__init__.py \
|
||||
capture.py \
|
||||
@@ -11,7 +11,7 @@ plugin_PYTHON = \
|
||||
filelookup.py \
|
||||
linkparsing.py
|
||||
|
||||
uidir = $(GEDIT_PLUGINS_DATA_DIR)/externaltools/ui
|
||||
uidir = $(PLUMA_PLUGINS_DATA_DIR)/externaltools/ui
|
||||
ui_DATA = tools.ui \
|
||||
outputpanel.ui
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# -*- coding: UTF-8 -*-
|
||||
# Gedit External Tools plugin
|
||||
# Pluma External Tools plugin
|
||||
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -19,7 +19,7 @@
|
||||
__all__ = ('ExternalToolsPlugin', 'ExternalToolsWindowHelper',
|
||||
'Manager', 'OutputPanel', 'Capture', 'UniqueById')
|
||||
|
||||
import gedit
|
||||
import pluma
|
||||
import gtk
|
||||
from manager import Manager
|
||||
from library import ToolLibrary
|
||||
@@ -166,7 +166,7 @@ class ExternalToolsWindowHelper(object):
|
||||
manager = window.get_ui_manager()
|
||||
|
||||
self._action_group = gtk.ActionGroup('ExternalToolsPluginActions')
|
||||
self._action_group.set_translation_domain('gedit')
|
||||
self._action_group.set_translation_domain('pluma')
|
||||
self._action_group.add_actions([('ExternalToolManager',
|
||||
None,
|
||||
_('Manage _External Tools...'),
|
||||
@@ -229,7 +229,7 @@ class ExternalToolsWindowHelper(object):
|
||||
def update_manager(self, tool):
|
||||
self._plugin.update_manager(tool)
|
||||
|
||||
class ExternalToolsPlugin(gedit.Plugin):
|
||||
class ExternalToolsPlugin(pluma.Plugin):
|
||||
WINDOW_DATA_KEY = "ExternalToolsPluginWindowData"
|
||||
|
||||
def __init__(self):
|
||||
@@ -263,7 +263,7 @@ class ExternalToolsPlugin(gedit.Plugin):
|
||||
|
||||
self._manager.dialog.connect('destroy', self.on_manager_destroy)
|
||||
|
||||
window = gedit.app_get_default().get_active_window()
|
||||
window = pluma.app_get_default().get_active_window()
|
||||
self._manager.run(window)
|
||||
|
||||
return self._manager.dialog
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Gedit External Tools plugin
|
||||
# Pluma External Tools plugin
|
||||
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
import os
|
||||
import gio
|
||||
import gedit
|
||||
import pluma
|
||||
|
||||
class FileLookup:
|
||||
"""
|
||||
@@ -110,7 +110,7 @@ class OpenDocumentRelPathFileLookupProvider(FileLookupProvider):
|
||||
if path.startswith('/'):
|
||||
return None
|
||||
|
||||
for doc in gedit.app_get_default().get_documents():
|
||||
for doc in pluma.app_get_default().get_documents():
|
||||
if doc.is_local():
|
||||
location = doc.get_location()
|
||||
if location:
|
||||
@@ -135,7 +135,7 @@ class OpenDocumentFileLookupProvider(FileLookupProvider):
|
||||
if path.startswith('/'):
|
||||
return None
|
||||
|
||||
for doc in gedit.app_get_default().get_documents():
|
||||
for doc in pluma.app_get_default().get_documents():
|
||||
if doc.is_local():
|
||||
location = doc.get_location()
|
||||
if location and location.get_uri().endswith(path):
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Gedit External Tools plugin
|
||||
# Pluma External Tools plugin
|
||||
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -20,7 +20,7 @@ import os
|
||||
import gtk
|
||||
from gtk import gdk
|
||||
import gio
|
||||
import gedit
|
||||
import pluma
|
||||
#import gtksourceview
|
||||
from outputpanel import OutputPanel
|
||||
from capture import *
|
||||
@@ -53,7 +53,7 @@ def run_external_tool(window, node):
|
||||
|
||||
capture = Capture(node.command, cwd)
|
||||
capture.env = os.environ.copy()
|
||||
capture.set_env(GEDIT_CWD = cwd)
|
||||
capture.set_env(PLUMA_CWD = cwd)
|
||||
|
||||
view = window.get_active_view()
|
||||
if view is not None:
|
||||
@@ -63,7 +63,7 @@ def run_external_tool(window, node):
|
||||
|
||||
# Current line number
|
||||
piter = document.get_iter_at_mark(document.get_insert())
|
||||
capture.set_env(GEDIT_CURRENT_LINE_NUMBER=str(piter.get_line() + 1))
|
||||
capture.set_env(PLUMA_CURRENT_LINE_NUMBER=str(piter.get_line() + 1))
|
||||
|
||||
# Current line text
|
||||
piter.set_line_offset(0)
|
||||
@@ -72,42 +72,42 @@ def run_external_tool(window, node):
|
||||
if not end.ends_line():
|
||||
end.forward_to_line_end()
|
||||
|
||||
capture.set_env(GEDIT_CURRENT_LINE=piter.get_text(end))
|
||||
capture.set_env(PLUMA_CURRENT_LINE=piter.get_text(end))
|
||||
|
||||
# Selected text (only if input is not selection)
|
||||
if node.input != 'selection' and node.input != 'selection-document':
|
||||
bounds = document.get_selection_bounds()
|
||||
|
||||
if bounds:
|
||||
capture.set_env(GEDIT_SELECTED_TEXT=bounds[0].get_text(bounds[1]))
|
||||
capture.set_env(PLUMA_SELECTED_TEXT=bounds[0].get_text(bounds[1]))
|
||||
|
||||
bounds = current_word(document)
|
||||
capture.set_env(GEDIT_CURRENT_WORD=bounds[0].get_text(bounds[1]))
|
||||
capture.set_env(PLUMA_CURRENT_WORD=bounds[0].get_text(bounds[1]))
|
||||
|
||||
capture.set_env(GEDIT_CURRENT_DOCUMENT_TYPE=document.get_mime_type())
|
||||
capture.set_env(PLUMA_CURRENT_DOCUMENT_TYPE=document.get_mime_type())
|
||||
|
||||
if uri is not None:
|
||||
gfile = gio.File(uri)
|
||||
scheme = gfile.get_uri_scheme()
|
||||
name = os.path.basename(uri)
|
||||
capture.set_env(GEDIT_CURRENT_DOCUMENT_URI = uri,
|
||||
GEDIT_CURRENT_DOCUMENT_NAME = name,
|
||||
GEDIT_CURRENT_DOCUMENT_SCHEME = scheme)
|
||||
if gedit.utils.uri_has_file_scheme(uri):
|
||||
capture.set_env(PLUMA_CURRENT_DOCUMENT_URI = uri,
|
||||
PLUMA_CURRENT_DOCUMENT_NAME = name,
|
||||
PLUMA_CURRENT_DOCUMENT_SCHEME = scheme)
|
||||
if pluma.utils.uri_has_file_scheme(uri):
|
||||
path = gfile.get_path()
|
||||
cwd = os.path.dirname(path)
|
||||
capture.set_cwd(cwd)
|
||||
capture.set_env(GEDIT_CURRENT_DOCUMENT_PATH = path,
|
||||
GEDIT_CURRENT_DOCUMENT_DIR = cwd)
|
||||
capture.set_env(PLUMA_CURRENT_DOCUMENT_PATH = path,
|
||||
PLUMA_CURRENT_DOCUMENT_DIR = cwd)
|
||||
|
||||
documents_uri = [doc.get_uri()
|
||||
for doc in window.get_documents()
|
||||
if doc.get_uri() is not None]
|
||||
documents_path = [gio.File(uri).get_path()
|
||||
for uri in documents_uri
|
||||
if gedit.utils.uri_has_file_scheme(uri)]
|
||||
capture.set_env(GEDIT_DOCUMENTS_URI = ' '.join(documents_uri),
|
||||
GEDIT_DOCUMENTS_PATH = ' '.join(documents_path))
|
||||
if pluma.utils.uri_has_file_scheme(uri)]
|
||||
capture.set_env(PLUMA_DOCUMENTS_URI = ' '.join(documents_uri),
|
||||
PLUMA_DOCUMENTS_PATH = ' '.join(documents_path))
|
||||
|
||||
flags = capture.CAPTURE_BOTH
|
||||
|
||||
@@ -224,7 +224,7 @@ class MultipleDocumentsSaver:
|
||||
|
||||
for doc in docs:
|
||||
signals[doc] = doc.connect('saving', self.on_document_saving)
|
||||
gedit.commands.save_document(window, doc)
|
||||
pluma.commands.save_document(window, doc)
|
||||
doc.disconnect(signals[doc])
|
||||
|
||||
def on_document_saving(self, doc, size, total_size):
|
||||
@@ -277,7 +277,7 @@ def capture_end_execute_panel(capture, exit_code, panel, view, output_type):
|
||||
end.forward_chars(300)
|
||||
|
||||
mtype = gio.content_type_guess(data=doc.get_text(start, end))
|
||||
lmanager = gedit.get_language_manager()
|
||||
lmanager = pluma.get_language_manager()
|
||||
|
||||
language = lmanager.guess_language(doc.get_uri(), mtype)
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Gedit External Tools plugin
|
||||
# Pluma External Tools plugin
|
||||
# Copyright (C) 2006 Steve Frécinaux <code@istique.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -41,19 +41,19 @@ class ToolLibrary(Singleton):
|
||||
|
||||
if platform.platform() != 'Windows':
|
||||
for d in self.get_xdg_data_dirs():
|
||||
self.locations.append(os.path.join(d, 'gedit-2', 'plugins', 'externaltools', 'tools'))
|
||||
self.locations.append(os.path.join(d, 'pluma-2', 'plugins', 'externaltools', 'tools'))
|
||||
|
||||
self.locations.append(datadir)
|
||||
|
||||
# self.locations[0] is where we save the custom scripts
|
||||
if platform.platform() == 'Windows':
|
||||
toolsdir = os.path.expanduser('~/gedit/tools')
|
||||
toolsdir = os.path.expanduser('~/pluma/tools')
|
||||
else:
|
||||
userdir = os.getenv('MATE22_USER_DIR')
|
||||
if userdir:
|
||||
toolsdir = os.path.join(userdir, 'gedit/tools')
|
||||
toolsdir = os.path.join(userdir, 'pluma/tools')
|
||||
else:
|
||||
toolsdir = os.path.expanduser('~/.mate2/gedit/tools')
|
||||
toolsdir = os.path.expanduser('~/.mate2/pluma/tools')
|
||||
|
||||
self.locations.insert(0, toolsdir);
|
||||
|
||||
@@ -80,9 +80,9 @@ class ToolLibrary(Singleton):
|
||||
import xml.etree.ElementTree as et
|
||||
userdir = os.getenv('MATE22_USER_DIR')
|
||||
if userdir:
|
||||
filename = os.path.join(userdir, 'gedit/gedit-tools.xml')
|
||||
filename = os.path.join(userdir, 'pluma/pluma-tools.xml')
|
||||
else:
|
||||
filename = os.path.expanduser('~/.mate2/gedit/gedit-tools.xml')
|
||||
filename = os.path.expanduser('~/.mate2/pluma/pluma-tools.xml')
|
||||
|
||||
if not os.path.isfile(filename):
|
||||
return
|
||||
@@ -250,7 +250,7 @@ class Tool(object):
|
||||
|
||||
for line in fp:
|
||||
if not in_block:
|
||||
in_block = line.startswith('# [Gedit Tool]')
|
||||
in_block = line.startswith('# [Pluma Tool]')
|
||||
continue
|
||||
if line.startswith('##') or line.startswith('# #'): continue
|
||||
if not line.startswith('# '): break
|
||||
@@ -389,7 +389,7 @@ class Tool(object):
|
||||
|
||||
# before entering the data block
|
||||
for line in fp:
|
||||
if line.startswith('# [Gedit Tool]'):
|
||||
if line.startswith('# [Pluma Tool]'):
|
||||
break
|
||||
lines.append(line)
|
||||
# in the block:
|
||||
@@ -407,7 +407,7 @@ class Tool(object):
|
||||
return lines
|
||||
|
||||
def _dump_properties(self):
|
||||
lines = ['# [Gedit Tool]']
|
||||
lines = ['# [Pluma Tool]']
|
||||
for item in self._properties.iteritems():
|
||||
if item[0] in self._transform:
|
||||
lines.append('# %s=%s' % (item[0], self._transform[item[0]][1](item[1])))
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Gedit External Tools plugin
|
||||
# Pluma External Tools plugin
|
||||
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
__all__ = ('Manager', )
|
||||
|
||||
import gedit
|
||||
import pluma
|
||||
import gtk
|
||||
import gtksourceview2 as gsv
|
||||
import os.path
|
||||
@@ -114,7 +114,7 @@ class LanguagesPopup(gtk.Window):
|
||||
|
||||
def init_languages(self, languages):
|
||||
manager = gsv.LanguageManager()
|
||||
langs = gedit.language_manager_list_languages_sorted(manager, True)
|
||||
langs = pluma.language_manager_list_languages_sorted(manager, True)
|
||||
|
||||
self.model.append([_('All languages'), None, not languages])
|
||||
self.model.append(['-', None, False])
|
||||
@@ -548,7 +548,7 @@ class Manager:
|
||||
|
||||
self.script_hash = self.compute_hash(script)
|
||||
contenttype = gio.content_type_guess(data=script)
|
||||
lmanager = gedit.get_language_manager()
|
||||
lmanager = pluma.get_language_manager()
|
||||
language = lmanager.guess_language(content_type=contenttype)
|
||||
|
||||
if language is not None:
|
||||
@@ -818,7 +818,7 @@ class Manager:
|
||||
|
||||
def on_tool_manager_dialog_response(self, dialog, response):
|
||||
if response == gtk.RESPONSE_HELP:
|
||||
gedit.help_display(self.dialog, 'gedit', 'gedit-external-tools-plugin')
|
||||
pluma.help_display(self.dialog, 'pluma', 'pluma-external-tools-plugin')
|
||||
return
|
||||
|
||||
self.on_tool_manager_dialog_focus_out(dialog, None)
|
||||
@@ -830,7 +830,7 @@ class Manager:
|
||||
def on_tool_manager_dialog_focus_out(self, dialog, event):
|
||||
self.save_current_tool()
|
||||
|
||||
for window in gedit.app_get_default().get_windows():
|
||||
for window in pluma.app_get_default().get_windows():
|
||||
helper = window.get_data("ExternalToolsPluginWindowData")
|
||||
helper.menu.update()
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Gedit External Tools plugin
|
||||
# Pluma External Tools plugin
|
||||
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
|
||||
# Copyright (C) 2010 Per Arneng <per.arneng@anyplanet.com>
|
||||
#
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
__all__ = ('OutputPanel', 'UniqueById')
|
||||
|
||||
import gtk, gedit
|
||||
import gtk, pluma
|
||||
import pango
|
||||
import gobject
|
||||
import os
|
||||
@@ -217,7 +217,7 @@ class OutputPanel(UniqueById):
|
||||
gfile = self.file_lookup.lookup(link.path)
|
||||
|
||||
if gfile:
|
||||
gedit.commands.load_uri(self.window, gfile.get_uri(), None,
|
||||
pluma.commands.load_uri(self.window, gfile.get_uri(), None,
|
||||
link.line_nr)
|
||||
gobject.idle_add(self.idle_grab_focus)
|
||||
|
||||
|
@@ -122,7 +122,7 @@
|
||||
</row>
|
||||
</data>
|
||||
</object>
|
||||
<object class="GeditDocument" id="commands_buffer">
|
||||
<object class="PlumaDocument" id="commands_buffer">
|
||||
<property name="highlight-matching-brackets">True</property>
|
||||
</object>
|
||||
<object class="GtkDialog" id="tool-manager-dialog">
|
||||
@@ -517,7 +517,7 @@
|
||||
<property name="vscrollbar_policy">automatic</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GeditView" id="commands">
|
||||
<object class="PlumaView" id="commands">
|
||||
<property name="buffer">commands_buffer</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="auto-indent">True</property>
|
||||
|
@@ -1,72 +1,72 @@
|
||||
# filebrowser
|
||||
|
||||
plugindir = $(GEDIT_PLUGINS_LIBS_DIR)
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir) \
|
||||
$(GEDIT_CFLAGS) \
|
||||
$(PLUMA_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(DISABLE_DEPRECATED_CFLAGS)
|
||||
|
||||
BUILT_SOURCES = \
|
||||
gedit-file-browser-enum-types.h \
|
||||
gedit-file-browser-enum-types.c \
|
||||
gedit-file-browser-marshal.h \
|
||||
gedit-file-browser-marshal.c
|
||||
pluma-file-browser-enum-types.h \
|
||||
pluma-file-browser-enum-types.c \
|
||||
pluma-file-browser-marshal.h \
|
||||
pluma-file-browser-marshal.c
|
||||
|
||||
plugin_LTLIBRARIES = libfilebrowser.la
|
||||
|
||||
NOINST_H_FILES = \
|
||||
gedit-file-bookmarks-store.h \
|
||||
gedit-file-browser-store.h \
|
||||
gedit-file-browser-view.h \
|
||||
gedit-file-browser-widget.h \
|
||||
gedit-file-browser-error.h \
|
||||
gedit-file-browser-utils.h \
|
||||
gedit-file-browser-plugin.h \
|
||||
gedit-file-browser-messages.h
|
||||
pluma-file-bookmarks-store.h \
|
||||
pluma-file-browser-store.h \
|
||||
pluma-file-browser-view.h \
|
||||
pluma-file-browser-widget.h \
|
||||
pluma-file-browser-error.h \
|
||||
pluma-file-browser-utils.h \
|
||||
pluma-file-browser-plugin.h \
|
||||
pluma-file-browser-messages.h
|
||||
|
||||
libfilebrowser_la_SOURCES = \
|
||||
$(BUILT_SOURCES) \
|
||||
gedit-file-bookmarks-store.c \
|
||||
gedit-file-browser-store.c \
|
||||
gedit-file-browser-view.c \
|
||||
gedit-file-browser-widget.c \
|
||||
gedit-file-browser-utils.c \
|
||||
gedit-file-browser-plugin.c \
|
||||
gedit-file-browser-messages.c \
|
||||
pluma-file-bookmarks-store.c \
|
||||
pluma-file-browser-store.c \
|
||||
pluma-file-browser-view.c \
|
||||
pluma-file-browser-widget.c \
|
||||
pluma-file-browser-utils.c \
|
||||
pluma-file-browser-plugin.c \
|
||||
pluma-file-browser-messages.c \
|
||||
$(NOINST_H_FILES)
|
||||
|
||||
libfilebrowser_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
|
||||
libfilebrowser_la_LIBADD = $(GEDIT_LIBS)
|
||||
libfilebrowser_la_LIBADD = $(PLUMA_LIBS)
|
||||
|
||||
# UI files (if you use ui for your plugin, list those files here)
|
||||
uidir = $(GEDIT_PLUGINS_DATA_DIR)/filebrowser
|
||||
ui_DATA = gedit-file-browser-widget-ui.xml
|
||||
uidir = $(PLUMA_PLUGINS_DATA_DIR)/filebrowser
|
||||
ui_DATA = pluma-file-browser-widget-ui.xml
|
||||
|
||||
plugin_in_files = filebrowser.gedit-plugin.desktop.in
|
||||
plugin_in_files = filebrowser.pluma-plugin.desktop.in
|
||||
|
||||
%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
|
||||
gedit-file-browser-enum-types.h: gedit-file-browser-enum-types.h.template $(NOINST_H_FILES) $(GLIB_MKENUMS)
|
||||
(cd $(srcdir) && $(GLIB_MKENUMS) --template gedit-file-browser-enum-types.h.template $(NOINST_H_FILES)) > $@
|
||||
pluma-file-browser-enum-types.h: pluma-file-browser-enum-types.h.template $(NOINST_H_FILES) $(GLIB_MKENUMS)
|
||||
(cd $(srcdir) && $(GLIB_MKENUMS) --template pluma-file-browser-enum-types.h.template $(NOINST_H_FILES)) > $@
|
||||
|
||||
gedit-file-browser-enum-types.c: gedit-file-browser-enum-types.c.template gedit-file-browser-enum-register.c.template $(NOINST_H_FILES) $(GLIB_MKENUMS)
|
||||
pluma-file-browser-enum-types.c: pluma-file-browser-enum-types.c.template pluma-file-browser-enum-register.c.template $(NOINST_H_FILES) $(GLIB_MKENUMS)
|
||||
$(AM_V_GEN) (cd $(srcdir) && \
|
||||
$(GLIB_MKENUMS) --template gedit-file-browser-enum-types.c.template $(NOINST_H_FILES) && \
|
||||
$(GLIB_MKENUMS) --template gedit-file-browser-enum-register.c.template $(NOINST_H_FILES)) > $@
|
||||
$(GLIB_MKENUMS) --template pluma-file-browser-enum-types.c.template $(NOINST_H_FILES) && \
|
||||
$(GLIB_MKENUMS) --template pluma-file-browser-enum-register.c.template $(NOINST_H_FILES)) > $@
|
||||
|
||||
gedit-file-browser-marshal.h: gedit-file-browser-marshal.list $(GLIB_GENMARSHAL)
|
||||
$(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=gedit_file_browser_marshal > $@
|
||||
pluma-file-browser-marshal.h: pluma-file-browser-marshal.list $(GLIB_GENMARSHAL)
|
||||
$(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=pluma_file_browser_marshal > $@
|
||||
|
||||
gedit-file-browser-marshal.c: gedit-file-browser-marshal.list $(GLIB_GENMARSHAL)
|
||||
$(AM_V_GEN) echo "#include \"gedit-file-browser-marshal.h\"" > $@ && \
|
||||
$(GLIB_GENMARSHAL) $< --body --prefix=gedit_file_browser_marshal >> $@
|
||||
pluma-file-browser-marshal.c: pluma-file-browser-marshal.list $(GLIB_GENMARSHAL)
|
||||
$(AM_V_GEN) echo "#include \"pluma-file-browser-marshal.h\"" > $@ && \
|
||||
$(GLIB_GENMARSHAL) $< --body --prefix=pluma_file_browser_marshal >> $@
|
||||
|
||||
plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin)
|
||||
plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin)
|
||||
|
||||
schemasdir = $(MATECONF_SCHEMA_FILE_DIR)
|
||||
schemas_in_files = gedit-file-browser.schemas.in
|
||||
schemas_in_files = pluma-file-browser.schemas.in
|
||||
schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
|
||||
@INTLTOOL_SCHEMAS_RULE@
|
||||
|
||||
@@ -86,10 +86,10 @@ EXTRA_DIST = \
|
||||
$(ui_DATA) \
|
||||
$(plugin_in_files) \
|
||||
$(schemas_in_files) \
|
||||
gedit-file-browser-enum-types.h.template \
|
||||
gedit-file-browser-enum-types.c.template \
|
||||
gedit-file-browser-enum-register.c.template \
|
||||
gedit-file-browser-marshal.list
|
||||
pluma-file-browser-enum-types.h.template \
|
||||
pluma-file-browser-enum-types.c.template \
|
||||
pluma-file-browser-enum-register.c.template \
|
||||
pluma-file-browser-marshal.list
|
||||
|
||||
CLEANFILES = \
|
||||
$(plugin_DATA) \
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[Gedit Plugin]
|
||||
[Pluma Plugin]
|
||||
Loader=C
|
||||
Module=filebrowser
|
||||
IAge=2
|
||||
@@ -7,4 +7,4 @@ _Description=Easy file access from the side pane
|
||||
Icon=system-file-manager
|
||||
Authors=Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
Copyright=Copyright © 2006 Jesse van den Kieboom
|
||||
Website=http://www.gedit.org
|
||||
Website=http://www.pluma.org
|
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* gedit-file-bookmarks-store.h - Gedit plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __GEDIT_FILE_BOOKMARKS_STORE_H__
|
||||
#define __GEDIT_FILE_BOOKMARKS_STORE_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define GEDIT_TYPE_FILE_BOOKMARKS_STORE (gedit_file_bookmarks_store_get_type ())
|
||||
#define GEDIT_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BOOKMARKS_STORE, GeditFileBookmarksStore))
|
||||
#define GEDIT_FILE_BOOKMARKS_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BOOKMARKS_STORE, GeditFileBookmarksStore const))
|
||||
#define GEDIT_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FILE_BOOKMARKS_STORE, GeditFileBookmarksStoreClass))
|
||||
#define GEDIT_IS_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FILE_BOOKMARKS_STORE))
|
||||
#define GEDIT_IS_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FILE_BOOKMARKS_STORE))
|
||||
#define GEDIT_FILE_BOOKMARKS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FILE_BOOKMARKS_STORE, GeditFileBookmarksStoreClass))
|
||||
|
||||
typedef struct _GeditFileBookmarksStore GeditFileBookmarksStore;
|
||||
typedef struct _GeditFileBookmarksStoreClass GeditFileBookmarksStoreClass;
|
||||
typedef struct _GeditFileBookmarksStorePrivate GeditFileBookmarksStorePrivate;
|
||||
|
||||
enum
|
||||
{
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_ICON = 0,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_N_COLUMNS
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
GEDIT_FILE_BOOKMARKS_STORE_NONE = 0,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR = 1 << 0, /* Separator item */
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR = 1 << 1, /* Special user dir */
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_HOME = 1 << 2, /* The special Home user directory */
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP = 1 << 3, /* The special Desktop user directory */
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_DOCUMENTS = 1 << 4, /* The special Documents user directory */
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_FS = 1 << 5, /* A mount object */
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT = 1 << 6, /* A mount object */
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_VOLUME = 1 << 7, /* A volume object */
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_DRIVE = 1 << 8, /* A drive object */
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT = 1 << 9, /* The root file system (file:///) */
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK = 1 << 10, /* A gtk bookmark */
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK = 1 << 11, /* A remote gtk bookmark */
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK = 1 << 12 /* A local gtk bookmark */
|
||||
};
|
||||
|
||||
struct _GeditFileBookmarksStore
|
||||
{
|
||||
GtkTreeStore parent;
|
||||
|
||||
GeditFileBookmarksStorePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GeditFileBookmarksStoreClass
|
||||
{
|
||||
GtkTreeStoreClass parent_class;
|
||||
};
|
||||
|
||||
GType gedit_file_bookmarks_store_get_type (void) G_GNUC_CONST;
|
||||
GType gedit_file_bookmarks_store_register_type (GTypeModule * module);
|
||||
|
||||
GeditFileBookmarksStore *gedit_file_bookmarks_store_new (void);
|
||||
gchar *gedit_file_bookmarks_store_get_uri (GeditFileBookmarksStore * model,
|
||||
GtkTreeIter * iter);
|
||||
void gedit_file_bookmarks_store_refresh (GeditFileBookmarksStore * model);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GEDIT_FILE_BOOKMARKS_STORE_H__ */
|
||||
|
||||
// ex:ts=8:noet:
|
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* gedit-file-browser-plugin.h - Gedit plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __GEDIT_FILE_BROWSER_PLUGIN_H__
|
||||
#define __GEDIT_FILE_BROWSER_PLUGIN_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <gedit/gedit-plugin.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
/*
|
||||
* Type checking and casting macros
|
||||
*/
|
||||
#define GEDIT_TYPE_FILE_BROWSER_PLUGIN (filetree_plugin_get_type ())
|
||||
#define GEDIT_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_FILE_BROWSER_PLUGIN, GeditFileBrowserPlugin))
|
||||
#define GEDIT_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_FILE_BROWSER_PLUGIN, GeditFileBrowserPluginClass))
|
||||
#define GEDIT_IS_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_FILE_BROWSER_PLUGIN))
|
||||
#define GEDIT_IS_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_FILE_BROWSER_PLUGIN))
|
||||
#define GEDIT_FILE_BROWSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_FILE_BROWSER_PLUGIN, GeditFileBrowserPluginClass))
|
||||
|
||||
/* Private structure type */
|
||||
typedef struct _GeditFileBrowserPluginPrivate GeditFileBrowserPluginPrivate;
|
||||
typedef struct _GeditFileBrowserPlugin GeditFileBrowserPlugin;
|
||||
typedef struct _GeditFileBrowserPluginClass GeditFileBrowserPluginClass;
|
||||
|
||||
struct _GeditFileBrowserPlugin
|
||||
{
|
||||
GeditPlugin parent_instance;
|
||||
|
||||
/*< private > */
|
||||
GeditFileBrowserPluginPrivate *priv;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct _GeditFileBrowserPluginClass
|
||||
{
|
||||
GeditPluginClass parent_class;
|
||||
};
|
||||
|
||||
/*
|
||||
* Public methods
|
||||
*/
|
||||
GType filetree_plugin_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* All the plugins must implement this function */
|
||||
G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule * module);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GEDIT_FILE_BROWSER_PLUGIN_H__ */
|
||||
|
||||
// ex:ts=8:noet:
|
@@ -1,200 +0,0 @@
|
||||
/*
|
||||
* gedit-file-browser-store.h - Gedit plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __GEDIT_FILE_BROWSER_STORE_H__
|
||||
#define __GEDIT_FILE_BROWSER_STORE_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define GEDIT_TYPE_FILE_BROWSER_STORE (gedit_file_browser_store_get_type ())
|
||||
#define GEDIT_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_STORE, GeditFileBrowserStore))
|
||||
#define GEDIT_FILE_BROWSER_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_STORE, GeditFileBrowserStore const))
|
||||
#define GEDIT_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FILE_BROWSER_STORE, GeditFileBrowserStoreClass))
|
||||
#define GEDIT_IS_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FILE_BROWSER_STORE))
|
||||
#define GEDIT_IS_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FILE_BROWSER_STORE))
|
||||
#define GEDIT_FILE_BROWSER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FILE_BROWSER_STORE, GeditFileBrowserStoreClass))
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_ICON = 0,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_NAME,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_NUM
|
||||
} GeditFileBrowserStoreColumn;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GEDIT_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY = 1 << 0,
|
||||
GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN = 1 << 1,
|
||||
GEDIT_FILE_BROWSER_STORE_FLAG_IS_TEXT = 1 << 2,
|
||||
GEDIT_FILE_BROWSER_STORE_FLAG_LOADED = 1 << 3,
|
||||
GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED = 1 << 4,
|
||||
GEDIT_FILE_BROWSER_STORE_FLAG_IS_DUMMY = 1 << 5
|
||||
} GeditFileBrowserStoreFlag;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GEDIT_FILE_BROWSER_STORE_RESULT_OK,
|
||||
GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE,
|
||||
GEDIT_FILE_BROWSER_STORE_RESULT_ERROR,
|
||||
GEDIT_FILE_BROWSER_STORE_RESULT_NO_TRASH,
|
||||
GEDIT_FILE_BROWSER_STORE_RESULT_MOUNTING,
|
||||
GEDIT_FILE_BROWSER_STORE_RESULT_NUM
|
||||
} GeditFileBrowserStoreResult;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GEDIT_FILE_BROWSER_STORE_FILTER_MODE_NONE = 0,
|
||||
GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN = 1 << 0,
|
||||
GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY = 1 << 1
|
||||
} GeditFileBrowserStoreFilterMode;
|
||||
|
||||
#define FILE_IS_DIR(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY)
|
||||
#define FILE_IS_HIDDEN(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN)
|
||||
#define FILE_IS_TEXT(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_TEXT)
|
||||
#define FILE_LOADED(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_LOADED)
|
||||
#define FILE_IS_FILTERED(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED)
|
||||
#define FILE_IS_DUMMY(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_DUMMY)
|
||||
|
||||
typedef struct _GeditFileBrowserStore GeditFileBrowserStore;
|
||||
typedef struct _GeditFileBrowserStoreClass GeditFileBrowserStoreClass;
|
||||
typedef struct _GeditFileBrowserStorePrivate GeditFileBrowserStorePrivate;
|
||||
|
||||
typedef gboolean (*GeditFileBrowserStoreFilterFunc) (GeditFileBrowserStore
|
||||
* model,
|
||||
GtkTreeIter * iter,
|
||||
gpointer user_data);
|
||||
|
||||
struct _GeditFileBrowserStore
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
GeditFileBrowserStorePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GeditFileBrowserStoreClass {
|
||||
GObjectClass parent_class;
|
||||
|
||||
/* Signals */
|
||||
void (*begin_loading) (GeditFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
void (*end_loading) (GeditFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
void (*error) (GeditFileBrowserStore * model,
|
||||
guint code,
|
||||
gchar * message);
|
||||
gboolean (*no_trash) (GeditFileBrowserStore * model,
|
||||
GList * files);
|
||||
void (*rename) (GeditFileBrowserStore * model,
|
||||
const gchar * olduri,
|
||||
const gchar * newuri);
|
||||
void (*begin_refresh) (GeditFileBrowserStore * model);
|
||||
void (*end_refresh) (GeditFileBrowserStore * model);
|
||||
void (*unload) (GeditFileBrowserStore * model,
|
||||
const gchar * uri);
|
||||
};
|
||||
|
||||
GType gedit_file_browser_store_get_type (void) G_GNUC_CONST;
|
||||
GType gedit_file_browser_store_register_type (GTypeModule * module);
|
||||
|
||||
GeditFileBrowserStore *gedit_file_browser_store_new (gchar const *root);
|
||||
|
||||
GeditFileBrowserStoreResult
|
||||
gedit_file_browser_store_set_root_and_virtual_root (GeditFileBrowserStore * model,
|
||||
gchar const *root,
|
||||
gchar const *virtual_root);
|
||||
GeditFileBrowserStoreResult
|
||||
gedit_file_browser_store_set_root (GeditFileBrowserStore * model,
|
||||
gchar const *root);
|
||||
GeditFileBrowserStoreResult
|
||||
gedit_file_browser_store_set_virtual_root (GeditFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
GeditFileBrowserStoreResult
|
||||
gedit_file_browser_store_set_virtual_root_from_string (GeditFileBrowserStore * model,
|
||||
gchar const *root);
|
||||
GeditFileBrowserStoreResult
|
||||
gedit_file_browser_store_set_virtual_root_up (GeditFileBrowserStore * model);
|
||||
GeditFileBrowserStoreResult
|
||||
gedit_file_browser_store_set_virtual_root_top (GeditFileBrowserStore * model);
|
||||
|
||||
gboolean
|
||||
gedit_file_browser_store_get_iter_virtual_root (GeditFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
gboolean gedit_file_browser_store_get_iter_root (GeditFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
gchar * gedit_file_browser_store_get_root (GeditFileBrowserStore * model);
|
||||
gchar * gedit_file_browser_store_get_virtual_root (GeditFileBrowserStore * model);
|
||||
|
||||
gboolean gedit_file_browser_store_iter_equal (GeditFileBrowserStore * model,
|
||||
GtkTreeIter * iter1,
|
||||
GtkTreeIter * iter2);
|
||||
|
||||
void gedit_file_browser_store_set_value (GeditFileBrowserStore * tree_model,
|
||||
GtkTreeIter * iter,
|
||||
gint column,
|
||||
GValue * value);
|
||||
|
||||
void _gedit_file_browser_store_iter_expanded (GeditFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
void _gedit_file_browser_store_iter_collapsed (GeditFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
|
||||
GeditFileBrowserStoreFilterMode
|
||||
gedit_file_browser_store_get_filter_mode (GeditFileBrowserStore * model);
|
||||
void gedit_file_browser_store_set_filter_mode (GeditFileBrowserStore * model,
|
||||
GeditFileBrowserStoreFilterMode mode);
|
||||
void gedit_file_browser_store_set_filter_func (GeditFileBrowserStore * model,
|
||||
GeditFileBrowserStoreFilterFunc func,
|
||||
gpointer user_data);
|
||||
void gedit_file_browser_store_refilter (GeditFileBrowserStore * model);
|
||||
GeditFileBrowserStoreFilterMode
|
||||
gedit_file_browser_store_filter_mode_get_default (void);
|
||||
|
||||
void gedit_file_browser_store_refresh (GeditFileBrowserStore * model);
|
||||
gboolean gedit_file_browser_store_rename (GeditFileBrowserStore * model,
|
||||
GtkTreeIter * iter,
|
||||
gchar const *new_name,
|
||||
GError ** error);
|
||||
GeditFileBrowserStoreResult
|
||||
gedit_file_browser_store_delete (GeditFileBrowserStore * model,
|
||||
GtkTreeIter * iter,
|
||||
gboolean trash);
|
||||
GeditFileBrowserStoreResult
|
||||
gedit_file_browser_store_delete_all (GeditFileBrowserStore * model,
|
||||
GList *rows,
|
||||
gboolean trash);
|
||||
|
||||
gboolean gedit_file_browser_store_new_file (GeditFileBrowserStore * model,
|
||||
GtkTreeIter * parent,
|
||||
GtkTreeIter * iter);
|
||||
gboolean gedit_file_browser_store_new_directory (GeditFileBrowserStore * model,
|
||||
GtkTreeIter * parent,
|
||||
GtkTreeIter * iter);
|
||||
|
||||
void gedit_file_browser_store_cancel_mount_operation (GeditFileBrowserStore *store);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GEDIT_FILE_BROWSER_STORE_H__ */
|
||||
|
||||
// ex:ts=8:noet:
|
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* gedit-file-browser-view.h - Gedit plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __GEDIT_FILE_BROWSER_VIEW_H__
|
||||
#define __GEDIT_FILE_BROWSER_VIEW_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define GEDIT_TYPE_FILE_BROWSER_VIEW (gedit_file_browser_view_get_type ())
|
||||
#define GEDIT_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserView))
|
||||
#define GEDIT_FILE_BROWSER_VIEW_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserView const))
|
||||
#define GEDIT_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserViewClass))
|
||||
#define GEDIT_IS_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FILE_BROWSER_VIEW))
|
||||
#define GEDIT_IS_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FILE_BROWSER_VIEW))
|
||||
#define GEDIT_FILE_BROWSER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserViewClass))
|
||||
|
||||
typedef struct _GeditFileBrowserView GeditFileBrowserView;
|
||||
typedef struct _GeditFileBrowserViewClass GeditFileBrowserViewClass;
|
||||
typedef struct _GeditFileBrowserViewPrivate GeditFileBrowserViewPrivate;
|
||||
|
||||
typedef enum {
|
||||
GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE,
|
||||
GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE
|
||||
} GeditFileBrowserViewClickPolicy;
|
||||
|
||||
struct _GeditFileBrowserView
|
||||
{
|
||||
GtkTreeView parent;
|
||||
|
||||
GeditFileBrowserViewPrivate *priv;
|
||||
};
|
||||
|
||||
struct _GeditFileBrowserViewClass
|
||||
{
|
||||
GtkTreeViewClass parent_class;
|
||||
|
||||
/* Signals */
|
||||
void (*error) (GeditFileBrowserView * filetree,
|
||||
guint code,
|
||||
gchar const *message);
|
||||
void (*file_activated) (GeditFileBrowserView * filetree,
|
||||
GtkTreeIter *iter);
|
||||
void (*directory_activated) (GeditFileBrowserView * filetree,
|
||||
GtkTreeIter *iter);
|
||||
void (*bookmark_activated) (GeditFileBrowserView * filetree,
|
||||
GtkTreeIter *iter);
|
||||
};
|
||||
|
||||
GType gedit_file_browser_view_get_type (void) G_GNUC_CONST;
|
||||
GType gedit_file_browser_view_register_type (GTypeModule * module);
|
||||
|
||||
GtkWidget *gedit_file_browser_view_new (void);
|
||||
void gedit_file_browser_view_set_model (GeditFileBrowserView * tree_view,
|
||||
GtkTreeModel * model);
|
||||
void gedit_file_browser_view_start_rename (GeditFileBrowserView * tree_view,
|
||||
GtkTreeIter * iter);
|
||||
void gedit_file_browser_view_set_click_policy (GeditFileBrowserView * tree_view,
|
||||
GeditFileBrowserViewClickPolicy policy);
|
||||
void gedit_file_browser_view_set_restore_expand_state (GeditFileBrowserView * tree_view,
|
||||
gboolean restore_expand_state);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GEDIT_FILE_BROWSER_VIEW_H__ */
|
||||
|
||||
// ex:ts=8:noet:
|
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
* gedit-file-browser-widget.h - Gedit plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __GEDIT_FILE_BROWSER_WIDGET_H__
|
||||
#define __GEDIT_FILE_BROWSER_WIDGET_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "gedit-file-browser-store.h"
|
||||
#include "gedit-file-bookmarks-store.h"
|
||||
#include "gedit-file-browser-view.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define GEDIT_TYPE_FILE_BROWSER_WIDGET (gedit_file_browser_widget_get_type ())
|
||||
#define GEDIT_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_WIDGET, GeditFileBrowserWidget))
|
||||
#define GEDIT_FILE_BROWSER_WIDGET_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_WIDGET, GeditFileBrowserWidget const))
|
||||
#define GEDIT_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FILE_BROWSER_WIDGET, GeditFileBrowserWidgetClass))
|
||||
#define GEDIT_IS_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FILE_BROWSER_WIDGET))
|
||||
#define GEDIT_IS_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FILE_BROWSER_WIDGET))
|
||||
#define GEDIT_FILE_BROWSER_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FILE_BROWSER_WIDGET, GeditFileBrowserWidgetClass))
|
||||
|
||||
typedef struct _GeditFileBrowserWidget GeditFileBrowserWidget;
|
||||
typedef struct _GeditFileBrowserWidgetClass GeditFileBrowserWidgetClass;
|
||||
typedef struct _GeditFileBrowserWidgetPrivate GeditFileBrowserWidgetPrivate;
|
||||
|
||||
typedef
|
||||
gboolean (*GeditFileBrowserWidgetFilterFunc) (GeditFileBrowserWidget * obj,
|
||||
GeditFileBrowserStore *
|
||||
model, GtkTreeIter * iter,
|
||||
gpointer user_data);
|
||||
|
||||
struct _GeditFileBrowserWidget
|
||||
{
|
||||
GtkVBox parent;
|
||||
|
||||
GeditFileBrowserWidgetPrivate *priv;
|
||||
};
|
||||
|
||||
struct _GeditFileBrowserWidgetClass
|
||||
{
|
||||
GtkVBoxClass parent_class;
|
||||
|
||||
/* Signals */
|
||||
void (*uri_activated) (GeditFileBrowserWidget * widget,
|
||||
gchar const *uri);
|
||||
void (*error) (GeditFileBrowserWidget * widget,
|
||||
guint code,
|
||||
gchar const *message);
|
||||
gboolean (*confirm_delete) (GeditFileBrowserWidget * widget,
|
||||
GeditFileBrowserStore * model,
|
||||
GList *list);
|
||||
gboolean (*confirm_no_trash) (GeditFileBrowserWidget * widget,
|
||||
GList *list);
|
||||
};
|
||||
|
||||
GType gedit_file_browser_widget_get_type (void) G_GNUC_CONST;
|
||||
GType gedit_file_browser_widget_register_type (GTypeModule * module);
|
||||
|
||||
GtkWidget *gedit_file_browser_widget_new (const gchar *data_dir);
|
||||
|
||||
void gedit_file_browser_widget_show_bookmarks (GeditFileBrowserWidget * obj);
|
||||
void gedit_file_browser_widget_show_files (GeditFileBrowserWidget * obj);
|
||||
|
||||
void gedit_file_browser_widget_set_root (GeditFileBrowserWidget * obj,
|
||||
gchar const *root,
|
||||
gboolean virtual_root);
|
||||
void
|
||||
gedit_file_browser_widget_set_root_and_virtual_root (GeditFileBrowserWidget * obj,
|
||||
gchar const *root,
|
||||
gchar const *virtual_root);
|
||||
|
||||
gboolean
|
||||
gedit_file_browser_widget_get_selected_directory (GeditFileBrowserWidget * obj,
|
||||
GtkTreeIter * iter);
|
||||
|
||||
GeditFileBrowserStore *
|
||||
gedit_file_browser_widget_get_browser_store (GeditFileBrowserWidget * obj);
|
||||
GeditFileBookmarksStore *
|
||||
gedit_file_browser_widget_get_bookmarks_store (GeditFileBrowserWidget * obj);
|
||||
GeditFileBrowserView *
|
||||
gedit_file_browser_widget_get_browser_view (GeditFileBrowserWidget * obj);
|
||||
GtkWidget *
|
||||
gedit_file_browser_widget_get_filter_entry (GeditFileBrowserWidget * obj);
|
||||
|
||||
GtkUIManager *
|
||||
gedit_file_browser_widget_get_ui_manager (GeditFileBrowserWidget * obj);
|
||||
|
||||
gulong gedit_file_browser_widget_add_filter (GeditFileBrowserWidget * obj,
|
||||
GeditFileBrowserWidgetFilterFunc func,
|
||||
gpointer user_data,
|
||||
GDestroyNotify notify);
|
||||
void gedit_file_browser_widget_remove_filter (GeditFileBrowserWidget * obj,
|
||||
gulong id);
|
||||
void gedit_file_browser_widget_set_filter_pattern (GeditFileBrowserWidget * obj,
|
||||
gchar const *pattern);
|
||||
|
||||
void gedit_file_browser_widget_refresh (GeditFileBrowserWidget * obj);
|
||||
void gedit_file_browser_widget_history_back (GeditFileBrowserWidget * obj);
|
||||
void gedit_file_browser_widget_history_forward (GeditFileBrowserWidget * obj);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GEDIT_FILE_BROWSER_WIDGET_H__ */
|
||||
|
||||
// ex:ts=8:noet:
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* gedit-file-bookmarks-store.c - Gedit plugin providing easy file access
|
||||
* pluma-file-bookmarks-store.c - Pluma plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
@@ -22,17 +22,17 @@
|
||||
#include <string.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <gio/gio.h>
|
||||
#include <gedit/gedit-utils.h>
|
||||
#include <gedit/gedit-plugin.h>
|
||||
#include <pluma/pluma-utils.h>
|
||||
#include <pluma/pluma-plugin.h>
|
||||
|
||||
#include "gedit-file-bookmarks-store.h"
|
||||
#include "gedit-file-browser-utils.h"
|
||||
#include "pluma-file-bookmarks-store.h"
|
||||
#include "pluma-file-browser-utils.h"
|
||||
|
||||
#define GEDIT_FILE_BOOKMARKS_STORE_GET_PRIVATE(object)( \
|
||||
G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_FILE_BOOKMARKS_STORE, \
|
||||
GeditFileBookmarksStorePrivate))
|
||||
#define PLUMA_FILE_BOOKMARKS_STORE_GET_PRIVATE(object)( \
|
||||
G_TYPE_INSTANCE_GET_PRIVATE((object), PLUMA_TYPE_FILE_BOOKMARKS_STORE, \
|
||||
PlumaFileBookmarksStorePrivate))
|
||||
|
||||
struct _GeditFileBookmarksStorePrivate
|
||||
struct _PlumaFileBookmarksStorePrivate
|
||||
{
|
||||
GVolumeMonitor * volume_monitor;
|
||||
GFileMonitor * bookmarks_monitor;
|
||||
@@ -43,25 +43,25 @@ static void remove_node (GtkTreeModel * model,
|
||||
|
||||
static void on_fs_changed (GVolumeMonitor *monitor,
|
||||
GObject *object,
|
||||
GeditFileBookmarksStore *model);
|
||||
PlumaFileBookmarksStore *model);
|
||||
|
||||
static void on_bookmarks_file_changed (GFileMonitor * monitor,
|
||||
GFile * file,
|
||||
GFile * other_file,
|
||||
GFileMonitorEvent event_type,
|
||||
GeditFileBookmarksStore * model);
|
||||
PlumaFileBookmarksStore * model);
|
||||
static gboolean find_with_flags (GtkTreeModel * model,
|
||||
GtkTreeIter * iter,
|
||||
gpointer obj,
|
||||
guint flags,
|
||||
guint notflags);
|
||||
|
||||
GEDIT_PLUGIN_DEFINE_TYPE(GeditFileBookmarksStore, gedit_file_bookmarks_store, GTK_TYPE_TREE_STORE)
|
||||
PLUMA_PLUGIN_DEFINE_TYPE(PlumaFileBookmarksStore, pluma_file_bookmarks_store, GTK_TYPE_TREE_STORE)
|
||||
|
||||
static void
|
||||
gedit_file_bookmarks_store_dispose (GObject * object)
|
||||
pluma_file_bookmarks_store_dispose (GObject * object)
|
||||
{
|
||||
GeditFileBookmarksStore *obj = GEDIT_FILE_BOOKMARKS_STORE (object);
|
||||
PlumaFileBookmarksStore *obj = PLUMA_FILE_BOOKMARKS_STORE (object);
|
||||
|
||||
if (obj->priv->volume_monitor != NULL) {
|
||||
g_signal_handlers_disconnect_by_func (obj->priv->volume_monitor,
|
||||
@@ -77,35 +77,35 @@ gedit_file_bookmarks_store_dispose (GObject * object)
|
||||
obj->priv->bookmarks_monitor = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (gedit_file_bookmarks_store_parent_class)->dispose (object);
|
||||
G_OBJECT_CLASS (pluma_file_bookmarks_store_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_file_bookmarks_store_finalize (GObject * object)
|
||||
pluma_file_bookmarks_store_finalize (GObject * object)
|
||||
{
|
||||
G_OBJECT_CLASS (gedit_file_bookmarks_store_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (pluma_file_bookmarks_store_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_file_bookmarks_store_class_init (GeditFileBookmarksStoreClass *klass)
|
||||
pluma_file_bookmarks_store_class_init (PlumaFileBookmarksStoreClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = gedit_file_bookmarks_store_dispose;
|
||||
object_class->finalize = gedit_file_bookmarks_store_finalize;
|
||||
object_class->dispose = pluma_file_bookmarks_store_dispose;
|
||||
object_class->finalize = pluma_file_bookmarks_store_finalize;
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (GeditFileBookmarksStorePrivate));
|
||||
g_type_class_add_private (object_class, sizeof (PlumaFileBookmarksStorePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_file_bookmarks_store_init (GeditFileBookmarksStore * obj)
|
||||
pluma_file_bookmarks_store_init (PlumaFileBookmarksStore * obj)
|
||||
{
|
||||
obj->priv = GEDIT_FILE_BOOKMARKS_STORE_GET_PRIVATE (obj);
|
||||
obj->priv = PLUMA_FILE_BOOKMARKS_STORE_GET_PRIVATE (obj);
|
||||
}
|
||||
|
||||
/* Private */
|
||||
static void
|
||||
add_node (GeditFileBookmarksStore *model,
|
||||
add_node (PlumaFileBookmarksStore *model,
|
||||
GdkPixbuf *pixbuf,
|
||||
const gchar *name,
|
||||
GObject *obj,
|
||||
@@ -117,10 +117,10 @@ add_node (GeditFileBookmarksStore *model,
|
||||
gtk_tree_store_append (GTK_TREE_STORE (model), &newiter, NULL);
|
||||
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model), &newiter,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_ICON, pixbuf,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, name,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, obj,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, flags,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_ICON, pixbuf,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_NAME, name,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, obj,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, flags,
|
||||
-1);
|
||||
|
||||
if (iter != NULL)
|
||||
@@ -128,7 +128,7 @@ add_node (GeditFileBookmarksStore *model,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
add_file (GeditFileBookmarksStore *model,
|
||||
add_file (PlumaFileBookmarksStore *model,
|
||||
GFile *file,
|
||||
const gchar *name,
|
||||
guint flags,
|
||||
@@ -144,24 +144,24 @@ add_file (GeditFileBookmarksStore *model,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_HOME)
|
||||
pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("user-home", GTK_ICON_SIZE_MENU);
|
||||
else if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP)
|
||||
pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("user-desktop", GTK_ICON_SIZE_MENU);
|
||||
else if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT)
|
||||
pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("drive-harddisk", GTK_ICON_SIZE_MENU);
|
||||
if (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_HOME)
|
||||
pixbuf = pluma_file_browser_utils_pixbuf_from_theme ("user-home", GTK_ICON_SIZE_MENU);
|
||||
else if (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_DESKTOP)
|
||||
pixbuf = pluma_file_browser_utils_pixbuf_from_theme ("user-desktop", GTK_ICON_SIZE_MENU);
|
||||
else if (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT)
|
||||
pixbuf = pluma_file_browser_utils_pixbuf_from_theme ("drive-harddisk", GTK_ICON_SIZE_MENU);
|
||||
|
||||
if (pixbuf == NULL) {
|
||||
/* getting the icon is a sync get_info call, so we just do it for local files */
|
||||
if (native) {
|
||||
pixbuf = gedit_file_browser_utils_pixbuf_from_file (file, GTK_ICON_SIZE_MENU);
|
||||
pixbuf = pluma_file_browser_utils_pixbuf_from_file (file, GTK_ICON_SIZE_MENU);
|
||||
} else {
|
||||
pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("folder", GTK_ICON_SIZE_MENU);
|
||||
pixbuf = pluma_file_browser_utils_pixbuf_from_theme ("folder", GTK_ICON_SIZE_MENU);
|
||||
}
|
||||
}
|
||||
|
||||
if (name == NULL) {
|
||||
newname = gedit_file_browser_utils_file_basename (file);
|
||||
newname = pluma_file_browser_utils_file_basename (file);
|
||||
} else {
|
||||
newname = g_strdup (name);
|
||||
}
|
||||
@@ -177,7 +177,7 @@ add_file (GeditFileBookmarksStore *model,
|
||||
}
|
||||
|
||||
static void
|
||||
check_mount_separator (GeditFileBookmarksStore * model, guint flags,
|
||||
check_mount_separator (PlumaFileBookmarksStore * model, guint flags,
|
||||
gboolean added)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
@@ -186,12 +186,12 @@ check_mount_separator (GeditFileBookmarksStore * model, guint flags,
|
||||
found =
|
||||
find_with_flags (GTK_TREE_MODEL (model), &iter, NULL,
|
||||
flags |
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR, 0);
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR, 0);
|
||||
|
||||
if (added && !found) {
|
||||
/* Add the separator */
|
||||
add_node (model, NULL, NULL, NULL,
|
||||
flags | GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR,
|
||||
flags | PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR,
|
||||
NULL);
|
||||
} else if (!added && found) {
|
||||
remove_node (GTK_TREE_MODEL (model), &iter);
|
||||
@@ -199,7 +199,7 @@ check_mount_separator (GeditFileBookmarksStore * model, guint flags,
|
||||
}
|
||||
|
||||
static void
|
||||
init_special_directories (GeditFileBookmarksStore * model)
|
||||
init_special_directories (PlumaFileBookmarksStore * model)
|
||||
{
|
||||
gchar const *path;
|
||||
GFile * file;
|
||||
@@ -208,8 +208,8 @@ init_special_directories (GeditFileBookmarksStore * model)
|
||||
if (path != NULL)
|
||||
{
|
||||
file = g_file_new_for_path (path);
|
||||
add_file (model, file, NULL, GEDIT_FILE_BOOKMARKS_STORE_IS_HOME |
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
|
||||
add_file (model, file, NULL, PLUMA_FILE_BOOKMARKS_STORE_IS_HOME |
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
|
||||
g_object_unref (file);
|
||||
}
|
||||
|
||||
@@ -217,8 +217,8 @@ init_special_directories (GeditFileBookmarksStore * model)
|
||||
if (path != NULL)
|
||||
{
|
||||
file = g_file_new_for_path (path);
|
||||
add_file (model, file, NULL, GEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP |
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
|
||||
add_file (model, file, NULL, PLUMA_FILE_BOOKMARKS_STORE_IS_DESKTOP |
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
|
||||
g_object_unref (file);
|
||||
}
|
||||
|
||||
@@ -226,16 +226,16 @@ init_special_directories (GeditFileBookmarksStore * model)
|
||||
if (path != NULL)
|
||||
{
|
||||
file = g_file_new_for_path (path);
|
||||
add_file (model, file, NULL, GEDIT_FILE_BOOKMARKS_STORE_IS_DOCUMENTS |
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
|
||||
add_file (model, file, NULL, PLUMA_FILE_BOOKMARKS_STORE_IS_DOCUMENTS |
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
|
||||
g_object_unref (file);
|
||||
}
|
||||
|
||||
file = g_file_new_for_uri ("file:///");
|
||||
add_file (model, file, _("File System"), GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT, NULL);
|
||||
add_file (model, file, _("File System"), PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT, NULL);
|
||||
g_object_unref (file);
|
||||
|
||||
check_mount_separator (model, GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT, TRUE);
|
||||
check_mount_separator (model, PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -246,7 +246,7 @@ get_fs_properties (gpointer fs,
|
||||
{
|
||||
GIcon *icon = NULL;
|
||||
|
||||
*flags = GEDIT_FILE_BOOKMARKS_STORE_IS_FS;
|
||||
*flags = PLUMA_FILE_BOOKMARKS_STORE_IS_FS;
|
||||
*name = NULL;
|
||||
*pixbuf = NULL;
|
||||
|
||||
@@ -255,33 +255,33 @@ get_fs_properties (gpointer fs,
|
||||
icon = g_drive_get_icon (G_DRIVE (fs));
|
||||
*name = g_drive_get_name (G_DRIVE (fs));
|
||||
|
||||
*flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_DRIVE;
|
||||
*flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_DRIVE;
|
||||
}
|
||||
else if (G_IS_VOLUME (fs))
|
||||
{
|
||||
icon = g_volume_get_icon (G_VOLUME (fs));
|
||||
*name = g_volume_get_name (G_VOLUME (fs));
|
||||
|
||||
*flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_VOLUME;
|
||||
*flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_VOLUME;
|
||||
}
|
||||
else if (G_IS_MOUNT (fs))
|
||||
{
|
||||
icon = g_mount_get_icon (G_MOUNT (fs));
|
||||
*name = g_mount_get_name (G_MOUNT (fs));
|
||||
|
||||
*flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT;
|
||||
*flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_MOUNT;
|
||||
}
|
||||
|
||||
if (icon)
|
||||
{
|
||||
*pixbuf = gedit_file_browser_utils_pixbuf_from_icon (icon, GTK_ICON_SIZE_MENU);
|
||||
*pixbuf = pluma_file_browser_utils_pixbuf_from_icon (icon, GTK_ICON_SIZE_MENU);
|
||||
g_object_unref (icon);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
add_fs (GeditFileBookmarksStore *model,
|
||||
add_fs (PlumaFileBookmarksStore *model,
|
||||
gpointer fs,
|
||||
guint flags,
|
||||
GtkTreeIter *iter)
|
||||
@@ -297,15 +297,15 @@ add_fs (GeditFileBookmarksStore *model,
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
g_free (name);
|
||||
check_mount_separator (model, GEDIT_FILE_BOOKMARKS_STORE_IS_FS, TRUE);
|
||||
check_mount_separator (model, PLUMA_FILE_BOOKMARKS_STORE_IS_FS, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
process_volume_cb (GVolume *volume,
|
||||
GeditFileBookmarksStore *model)
|
||||
PlumaFileBookmarksStore *model)
|
||||
{
|
||||
GMount *mount;
|
||||
guint flags = GEDIT_FILE_BOOKMARKS_STORE_NONE;
|
||||
guint flags = PLUMA_FILE_BOOKMARKS_STORE_NONE;
|
||||
mount = g_volume_get_mount (volume);
|
||||
|
||||
/* CHECK: should we use the LOCAL/REMOTE thing still? */
|
||||
@@ -324,7 +324,7 @@ process_volume_cb (GVolume *volume,
|
||||
}
|
||||
|
||||
static void
|
||||
process_drive_novolumes (GeditFileBookmarksStore *model,
|
||||
process_drive_novolumes (PlumaFileBookmarksStore *model,
|
||||
GDrive *drive)
|
||||
{
|
||||
if (g_drive_is_media_removable (drive) &&
|
||||
@@ -335,13 +335,13 @@ process_drive_novolumes (GeditFileBookmarksStore *model,
|
||||
drives where media detection fails. We show the
|
||||
drive and poll for media when the user activates
|
||||
it */
|
||||
add_fs (model, drive, GEDIT_FILE_BOOKMARKS_STORE_NONE, NULL);
|
||||
add_fs (model, drive, PLUMA_FILE_BOOKMARKS_STORE_NONE, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
process_drive_cb (GDrive *drive,
|
||||
GeditFileBookmarksStore *model)
|
||||
PlumaFileBookmarksStore *model)
|
||||
{
|
||||
GList *volumes;
|
||||
|
||||
@@ -360,7 +360,7 @@ process_drive_cb (GDrive *drive,
|
||||
}
|
||||
|
||||
static void
|
||||
init_drives (GeditFileBookmarksStore *model)
|
||||
init_drives (PlumaFileBookmarksStore *model)
|
||||
{
|
||||
GList *drives;
|
||||
|
||||
@@ -373,7 +373,7 @@ init_drives (GeditFileBookmarksStore *model)
|
||||
|
||||
static void
|
||||
process_volume_nodrive_cb (GVolume *volume,
|
||||
GeditFileBookmarksStore *model)
|
||||
PlumaFileBookmarksStore *model)
|
||||
{
|
||||
GDrive *drive;
|
||||
|
||||
@@ -389,7 +389,7 @@ process_volume_nodrive_cb (GVolume *volume,
|
||||
}
|
||||
|
||||
static void
|
||||
init_volumes (GeditFileBookmarksStore *model)
|
||||
init_volumes (PlumaFileBookmarksStore *model)
|
||||
{
|
||||
GList *volumes;
|
||||
|
||||
@@ -402,7 +402,7 @@ init_volumes (GeditFileBookmarksStore *model)
|
||||
|
||||
static void
|
||||
process_mount_novolume_cb (GMount *mount,
|
||||
GeditFileBookmarksStore *model)
|
||||
PlumaFileBookmarksStore *model)
|
||||
{
|
||||
GVolume *volume;
|
||||
|
||||
@@ -415,12 +415,12 @@ process_mount_novolume_cb (GMount *mount,
|
||||
else if (!g_mount_is_shadowed (mount))
|
||||
{
|
||||
/* Add the mount */
|
||||
add_fs (model, mount, GEDIT_FILE_BOOKMARKS_STORE_NONE, NULL);
|
||||
add_fs (model, mount, PLUMA_FILE_BOOKMARKS_STORE_NONE, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
init_mounts (GeditFileBookmarksStore *model)
|
||||
init_mounts (PlumaFileBookmarksStore *model)
|
||||
{
|
||||
GList *mounts;
|
||||
|
||||
@@ -432,7 +432,7 @@ init_mounts (GeditFileBookmarksStore *model)
|
||||
}
|
||||
|
||||
static void
|
||||
init_fs (GeditFileBookmarksStore * model)
|
||||
init_fs (PlumaFileBookmarksStore * model)
|
||||
{
|
||||
if (model->priv->volume_monitor == NULL) {
|
||||
const gchar **ptr;
|
||||
@@ -465,21 +465,21 @@ init_fs (GeditFileBookmarksStore * model)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
add_bookmark (GeditFileBookmarksStore * model,
|
||||
add_bookmark (PlumaFileBookmarksStore * model,
|
||||
gchar const * name,
|
||||
gchar const * uri)
|
||||
{
|
||||
GFile * file;
|
||||
gboolean ret;
|
||||
guint flags = GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK;
|
||||
guint flags = PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK;
|
||||
GtkTreeIter iter;
|
||||
|
||||
file = g_file_new_for_uri (uri);
|
||||
|
||||
if (g_file_is_native (file)) {
|
||||
flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK;
|
||||
flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK;
|
||||
} else {
|
||||
flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK;
|
||||
flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK;
|
||||
}
|
||||
|
||||
ret = add_file (model, file, name, flags, &iter);
|
||||
@@ -490,7 +490,7 @@ add_bookmark (GeditFileBookmarksStore * model,
|
||||
}
|
||||
|
||||
static void
|
||||
init_bookmarks (GeditFileBookmarksStore * model)
|
||||
init_bookmarks (PlumaFileBookmarksStore * model)
|
||||
{
|
||||
gchar *bookmarks;
|
||||
GError *error = NULL;
|
||||
@@ -524,7 +524,7 @@ init_bookmarks (GeditFileBookmarksStore * model)
|
||||
|
||||
/* the bookmarks file should contain valid
|
||||
* URIs, but paranoia is good */
|
||||
if (gedit_utils_is_valid_uri (*line)) {
|
||||
if (pluma_utils_is_valid_uri (*line)) {
|
||||
added |= add_bookmark (model, name, *line);
|
||||
}
|
||||
}
|
||||
@@ -554,20 +554,20 @@ init_bookmarks (GeditFileBookmarksStore * model)
|
||||
if (added) {
|
||||
/* Bookmarks separator */
|
||||
add_node (model, NULL, NULL, NULL,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK |
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR, NULL);
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK |
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR, NULL);
|
||||
}
|
||||
|
||||
g_free (bookmarks);
|
||||
}
|
||||
|
||||
static gint flags_order[] = {
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_HOME,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_FS,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_HOME,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_DESKTOP,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_FS,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK,
|
||||
-1
|
||||
};
|
||||
|
||||
@@ -600,17 +600,17 @@ bookmarks_compare_names (GtkTreeModel * model, GtkTreeIter * a,
|
||||
guint f2;
|
||||
|
||||
gtk_tree_model_get (model, a,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n1,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n1,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1,
|
||||
-1);
|
||||
gtk_tree_model_get (model, b,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n2,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n2,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2,
|
||||
-1);
|
||||
|
||||
/* do not sort actual bookmarks to keep same order as in caja */
|
||||
if ((f1 & GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK) &&
|
||||
(f2 & GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK))
|
||||
if ((f1 & PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK) &&
|
||||
(f2 & PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK))
|
||||
result = 0;
|
||||
else if (n1 == NULL && n2 == NULL)
|
||||
result = 0;
|
||||
@@ -636,13 +636,13 @@ bookmarks_compare_flags (GtkTreeModel * model, GtkTreeIter * a,
|
||||
gint *flags;
|
||||
guint sep;
|
||||
|
||||
sep = GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR;
|
||||
sep = PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR;
|
||||
|
||||
gtk_tree_model_get (model, a,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1,
|
||||
-1);
|
||||
gtk_tree_model_get (model, b,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2,
|
||||
-1);
|
||||
|
||||
for (flags = flags_order; *flags != -1; ++flags) {
|
||||
@@ -691,9 +691,9 @@ find_with_flags (GtkTreeModel * model, GtkTreeIter * iter, gpointer obj,
|
||||
|
||||
do {
|
||||
gtk_tree_model_get (model, &child,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
|
||||
&childobj,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
|
||||
&childflags, -1);
|
||||
|
||||
fequal = (obj == childobj);
|
||||
@@ -718,13 +718,13 @@ remove_node (GtkTreeModel * model, GtkTreeIter * iter)
|
||||
guint flags;
|
||||
|
||||
gtk_tree_model_get (model, iter,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &flags,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &flags,
|
||||
-1);
|
||||
|
||||
if (!(flags & GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR)) {
|
||||
if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_FS) {
|
||||
check_mount_separator (GEDIT_FILE_BOOKMARKS_STORE (model),
|
||||
flags & GEDIT_FILE_BOOKMARKS_STORE_IS_FS,
|
||||
if (!(flags & PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR)) {
|
||||
if (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_FS) {
|
||||
check_mount_separator (PLUMA_FILE_BOOKMARKS_STORE (model),
|
||||
flags & PLUMA_FILE_BOOKMARKS_STORE_IS_FS,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
@@ -733,19 +733,19 @@ remove_node (GtkTreeModel * model, GtkTreeIter * iter)
|
||||
}
|
||||
|
||||
static void
|
||||
remove_bookmarks (GeditFileBookmarksStore * model)
|
||||
remove_bookmarks (PlumaFileBookmarksStore * model)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
|
||||
while (find_with_flags (GTK_TREE_MODEL (model), &iter, NULL,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK,
|
||||
0)) {
|
||||
remove_node (GTK_TREE_MODEL (model), &iter);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
initialize_fill (GeditFileBookmarksStore * model)
|
||||
initialize_fill (PlumaFileBookmarksStore * model)
|
||||
{
|
||||
init_special_directories (model);
|
||||
init_fs (model);
|
||||
@@ -753,10 +753,10 @@ initialize_fill (GeditFileBookmarksStore * model)
|
||||
}
|
||||
|
||||
/* Public */
|
||||
GeditFileBookmarksStore *
|
||||
gedit_file_bookmarks_store_new (void)
|
||||
PlumaFileBookmarksStore *
|
||||
pluma_file_bookmarks_store_new (void)
|
||||
{
|
||||
GeditFileBookmarksStore *model;
|
||||
PlumaFileBookmarksStore *model;
|
||||
GType column_types[] = {
|
||||
GDK_TYPE_PIXBUF,
|
||||
G_TYPE_STRING,
|
||||
@@ -764,9 +764,9 @@ gedit_file_bookmarks_store_new (void)
|
||||
G_TYPE_UINT
|
||||
};
|
||||
|
||||
model = g_object_new (GEDIT_TYPE_FILE_BOOKMARKS_STORE, NULL);
|
||||
model = g_object_new (PLUMA_TYPE_FILE_BOOKMARKS_STORE, NULL);
|
||||
gtk_tree_store_set_column_types (GTK_TREE_STORE (model),
|
||||
GEDIT_FILE_BOOKMARKS_STORE_N_COLUMNS,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_N_COLUMNS,
|
||||
column_types);
|
||||
|
||||
gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (model),
|
||||
@@ -782,7 +782,7 @@ gedit_file_bookmarks_store_new (void)
|
||||
}
|
||||
|
||||
gchar *
|
||||
gedit_file_bookmarks_store_get_uri (GeditFileBookmarksStore * model,
|
||||
pluma_file_bookmarks_store_get_uri (PlumaFileBookmarksStore * model,
|
||||
GtkTreeIter * iter)
|
||||
{
|
||||
GObject * obj;
|
||||
@@ -791,22 +791,22 @@ gedit_file_bookmarks_store_get_uri (GeditFileBookmarksStore * model,
|
||||
gchar * ret = NULL;
|
||||
gboolean isfs;
|
||||
|
||||
g_return_val_if_fail (GEDIT_IS_FILE_BOOKMARKS_STORE (model), NULL);
|
||||
g_return_val_if_fail (PLUMA_IS_FILE_BOOKMARKS_STORE (model), NULL);
|
||||
g_return_val_if_fail (iter != NULL, NULL);
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (model), iter,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
|
||||
&flags,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
|
||||
&obj,
|
||||
-1);
|
||||
|
||||
if (obj == NULL)
|
||||
return NULL;
|
||||
|
||||
isfs = (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_FS);
|
||||
isfs = (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_FS);
|
||||
|
||||
if (isfs && (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT))
|
||||
if (isfs && (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_MOUNT))
|
||||
{
|
||||
file = g_mount_get_root (G_MOUNT (obj));
|
||||
}
|
||||
@@ -827,7 +827,7 @@ gedit_file_bookmarks_store_get_uri (GeditFileBookmarksStore * model,
|
||||
}
|
||||
|
||||
void
|
||||
gedit_file_bookmarks_store_refresh (GeditFileBookmarksStore * model)
|
||||
pluma_file_bookmarks_store_refresh (PlumaFileBookmarksStore * model)
|
||||
{
|
||||
gtk_tree_store_clear (GTK_TREE_STORE (model));
|
||||
initialize_fill (model);
|
||||
@@ -836,11 +836,11 @@ gedit_file_bookmarks_store_refresh (GeditFileBookmarksStore * model)
|
||||
static void
|
||||
on_fs_changed (GVolumeMonitor *monitor,
|
||||
GObject *object,
|
||||
GeditFileBookmarksStore *model)
|
||||
PlumaFileBookmarksStore *model)
|
||||
{
|
||||
GtkTreeModel *tree_model = GTK_TREE_MODEL (model);
|
||||
guint flags = GEDIT_FILE_BOOKMARKS_STORE_IS_FS;
|
||||
guint noflags = GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR;
|
||||
guint flags = PLUMA_FILE_BOOKMARKS_STORE_IS_FS;
|
||||
guint noflags = PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR;
|
||||
GtkTreeIter iter;
|
||||
|
||||
/* clear all fs items */
|
||||
@@ -856,7 +856,7 @@ on_bookmarks_file_changed (GFileMonitor * monitor,
|
||||
GFile * file,
|
||||
GFile * other_file,
|
||||
GFileMonitorEvent event_type,
|
||||
GeditFileBookmarksStore * model)
|
||||
PlumaFileBookmarksStore * model)
|
||||
{
|
||||
switch (event_type) {
|
||||
case G_FILE_MONITOR_EVENT_CHANGED:
|
90
plugins/filebrowser/pluma-file-bookmarks-store.h
Executable file
90
plugins/filebrowser/pluma-file-bookmarks-store.h
Executable file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* pluma-file-bookmarks-store.h - Pluma plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __PLUMA_FILE_BOOKMARKS_STORE_H__
|
||||
#define __PLUMA_FILE_BOOKMARKS_STORE_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define PLUMA_TYPE_FILE_BOOKMARKS_STORE (pluma_file_bookmarks_store_get_type ())
|
||||
#define PLUMA_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BOOKMARKS_STORE, PlumaFileBookmarksStore))
|
||||
#define PLUMA_FILE_BOOKMARKS_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BOOKMARKS_STORE, PlumaFileBookmarksStore const))
|
||||
#define PLUMA_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLUMA_TYPE_FILE_BOOKMARKS_STORE, PlumaFileBookmarksStoreClass))
|
||||
#define PLUMA_IS_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUMA_TYPE_FILE_BOOKMARKS_STORE))
|
||||
#define PLUMA_IS_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_FILE_BOOKMARKS_STORE))
|
||||
#define PLUMA_FILE_BOOKMARKS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_FILE_BOOKMARKS_STORE, PlumaFileBookmarksStoreClass))
|
||||
|
||||
typedef struct _PlumaFileBookmarksStore PlumaFileBookmarksStore;
|
||||
typedef struct _PlumaFileBookmarksStoreClass PlumaFileBookmarksStoreClass;
|
||||
typedef struct _PlumaFileBookmarksStorePrivate PlumaFileBookmarksStorePrivate;
|
||||
|
||||
enum
|
||||
{
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_ICON = 0,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_NAME,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_N_COLUMNS
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PLUMA_FILE_BOOKMARKS_STORE_NONE = 0,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR = 1 << 0, /* Separator item */
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR = 1 << 1, /* Special user dir */
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_HOME = 1 << 2, /* The special Home user directory */
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_DESKTOP = 1 << 3, /* The special Desktop user directory */
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_DOCUMENTS = 1 << 4, /* The special Documents user directory */
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_FS = 1 << 5, /* A mount object */
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_MOUNT = 1 << 6, /* A mount object */
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_VOLUME = 1 << 7, /* A volume object */
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_DRIVE = 1 << 8, /* A drive object */
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT = 1 << 9, /* The root file system (file:///) */
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK = 1 << 10, /* A gtk bookmark */
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK = 1 << 11, /* A remote gtk bookmark */
|
||||
PLUMA_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK = 1 << 12 /* A local gtk bookmark */
|
||||
};
|
||||
|
||||
struct _PlumaFileBookmarksStore
|
||||
{
|
||||
GtkTreeStore parent;
|
||||
|
||||
PlumaFileBookmarksStorePrivate *priv;
|
||||
};
|
||||
|
||||
struct _PlumaFileBookmarksStoreClass
|
||||
{
|
||||
GtkTreeStoreClass parent_class;
|
||||
};
|
||||
|
||||
GType pluma_file_bookmarks_store_get_type (void) G_GNUC_CONST;
|
||||
GType pluma_file_bookmarks_store_register_type (GTypeModule * module);
|
||||
|
||||
PlumaFileBookmarksStore *pluma_file_bookmarks_store_new (void);
|
||||
gchar *pluma_file_bookmarks_store_get_uri (PlumaFileBookmarksStore * model,
|
||||
GtkTreeIter * iter);
|
||||
void pluma_file_bookmarks_store_refresh (PlumaFileBookmarksStore * model);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __PLUMA_FILE_BOOKMARKS_STORE_H__ */
|
||||
|
||||
// ex:ts=8:noet:
|
@@ -1,6 +1,6 @@
|
||||
/*** BEGIN file-header ***/
|
||||
void
|
||||
gedit_file_browser_enum_and_flag_register_type (GTypeModule * module)
|
||||
pluma_file_browser_enum_and_flag_register_type (GTypeModule * module)
|
||||
{
|
||||
/*** END file-header ***/
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*** BEGIN file-header ***/
|
||||
#include "gedit-file-browser-enum-types.h"
|
||||
#include "pluma-file-browser-enum-types.h"
|
||||
|
||||
/*** END file-header ***/
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*** BEGIN file-header ***/
|
||||
#ifndef __GEDIT_FILE_BROWSER_ENUM_TYPES_H__
|
||||
#define __GEDIT_FILE_BROWSER_ENUM_TYPES_H__
|
||||
#ifndef __PLUMA_FILE_BROWSER_ENUM_TYPES_H__
|
||||
#define __PLUMA_FILE_BROWSER_ENUM_TYPES_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
@@ -14,16 +14,16 @@ G_BEGIN_DECLS
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN enumeration-production ***/
|
||||
#define GEDIT_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
|
||||
#define PLUMA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
|
||||
GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/*** END enumeration-production ***/
|
||||
|
||||
/*** BEGIN file-tail ***/
|
||||
void gedit_file_browser_enum_and_flag_register_type (GTypeModule * module);
|
||||
void pluma_file_browser_enum_and_flag_register_type (GTypeModule * module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GEDIT_FILE_BROWSER_ENUM_TYPES_H__ */
|
||||
#endif /* __PLUMA_FILE_BROWSER_ENUM_TYPES_H__ */
|
||||
/*** END file-tail ***/
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* gedit-file-browser-error.h - Gedit plugin providing easy file access
|
||||
* pluma-file-browser-error.h - Pluma plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
@@ -19,23 +19,23 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GEDIT_FILE_BROWSER_ERROR_H__
|
||||
#define __GEDIT_FILE_BROWSER_ERROR_H__
|
||||
#ifndef __PLUMA_FILE_BROWSER_ERROR_H__
|
||||
#define __PLUMA_FILE_BROWSER_ERROR_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef enum {
|
||||
GEDIT_FILE_BROWSER_ERROR_NONE,
|
||||
GEDIT_FILE_BROWSER_ERROR_RENAME,
|
||||
GEDIT_FILE_BROWSER_ERROR_DELETE,
|
||||
GEDIT_FILE_BROWSER_ERROR_NEW_FILE,
|
||||
GEDIT_FILE_BROWSER_ERROR_NEW_DIRECTORY,
|
||||
GEDIT_FILE_BROWSER_ERROR_OPEN_DIRECTORY,
|
||||
GEDIT_FILE_BROWSER_ERROR_SET_ROOT,
|
||||
GEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY,
|
||||
GEDIT_FILE_BROWSER_ERROR_NUM
|
||||
} GeditFileBrowserError;
|
||||
PLUMA_FILE_BROWSER_ERROR_NONE,
|
||||
PLUMA_FILE_BROWSER_ERROR_RENAME,
|
||||
PLUMA_FILE_BROWSER_ERROR_DELETE,
|
||||
PLUMA_FILE_BROWSER_ERROR_NEW_FILE,
|
||||
PLUMA_FILE_BROWSER_ERROR_NEW_DIRECTORY,
|
||||
PLUMA_FILE_BROWSER_ERROR_OPEN_DIRECTORY,
|
||||
PLUMA_FILE_BROWSER_ERROR_SET_ROOT,
|
||||
PLUMA_FILE_BROWSER_ERROR_LOAD_DIRECTORY,
|
||||
PLUMA_FILE_BROWSER_ERROR_NUM
|
||||
} PlumaFileBrowserError;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GEDIT_FILE_BROWSER_ERROR_H__ */
|
||||
#endif /* __PLUMA_FILE_BROWSER_ERROR_H__ */
|
@@ -1,16 +1,16 @@
|
||||
#include "gedit-file-browser-messages.h"
|
||||
#include "gedit-file-browser-store.h"
|
||||
#include <gedit/gedit-message.h>
|
||||
#include "pluma-file-browser-messages.h"
|
||||
#include "pluma-file-browser-store.h"
|
||||
#include <pluma/pluma-message.h>
|
||||
|
||||
#define MESSAGE_OBJECT_PATH "/plugins/filebrowser"
|
||||
#define WINDOW_DATA_KEY "GeditFileBrowserMessagesWindowData"
|
||||
#define WINDOW_DATA_KEY "PlumaFileBrowserMessagesWindowData"
|
||||
|
||||
#define BUS_CONNECT(bus, name, data) gedit_message_bus_connect(bus, MESSAGE_OBJECT_PATH, #name, (GeditMessageCallback) message_##name##_cb, data, NULL)
|
||||
#define BUS_CONNECT(bus, name, data) pluma_message_bus_connect(bus, MESSAGE_OBJECT_PATH, #name, (PlumaMessageCallback) message_##name##_cb, data, NULL)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GeditWindow *window;
|
||||
GeditMessage *message;
|
||||
PlumaWindow *window;
|
||||
PlumaMessage *message;
|
||||
} MessageCacheData;
|
||||
|
||||
typedef struct
|
||||
@@ -24,8 +24,8 @@ typedef struct
|
||||
GList *merge_ids;
|
||||
GtkActionGroup *merged_actions;
|
||||
|
||||
GeditMessageBus *bus;
|
||||
GeditFileBrowserWidget *widget;
|
||||
PlumaMessageBus *bus;
|
||||
PlumaFileBrowserWidget *widget;
|
||||
GHashTable *row_tracking;
|
||||
|
||||
GHashTable *filters;
|
||||
@@ -35,19 +35,19 @@ typedef struct
|
||||
{
|
||||
gulong id;
|
||||
|
||||
GeditWindow *window;
|
||||
GeditMessage *message;
|
||||
PlumaWindow *window;
|
||||
PlumaMessage *message;
|
||||
} FilterData;
|
||||
|
||||
static WindowData *
|
||||
window_data_new (GeditWindow *window,
|
||||
GeditFileBrowserWidget *widget)
|
||||
window_data_new (PlumaWindow *window,
|
||||
PlumaFileBrowserWidget *widget)
|
||||
{
|
||||
WindowData *data = g_slice_new (WindowData);
|
||||
GtkUIManager *manager;
|
||||
GList *groups;
|
||||
|
||||
data->bus = gedit_window_get_message_bus (window);
|
||||
data->bus = pluma_window_get_message_bus (window);
|
||||
data->widget = widget;
|
||||
data->row_tracking = g_hash_table_new_full (g_str_hash,
|
||||
g_str_equal,
|
||||
@@ -59,7 +59,7 @@ window_data_new (GeditWindow *window,
|
||||
(GDestroyNotify)g_free,
|
||||
NULL);
|
||||
|
||||
manager = gedit_file_browser_widget_get_ui_manager (widget);
|
||||
manager = pluma_file_browser_widget_get_ui_manager (widget);
|
||||
|
||||
data->merge_ids = NULL;
|
||||
data->merged_actions = gtk_action_group_new ("MessageMergedActions");
|
||||
@@ -73,13 +73,13 @@ window_data_new (GeditWindow *window,
|
||||
}
|
||||
|
||||
static WindowData *
|
||||
get_window_data (GeditWindow * window)
|
||||
get_window_data (PlumaWindow * window)
|
||||
{
|
||||
return (WindowData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY));
|
||||
}
|
||||
|
||||
static void
|
||||
window_data_free (GeditWindow *window)
|
||||
window_data_free (PlumaWindow *window)
|
||||
{
|
||||
WindowData *data = get_window_data (window);
|
||||
GtkUIManager *manager;
|
||||
@@ -88,7 +88,7 @@ window_data_free (GeditWindow *window)
|
||||
g_hash_table_destroy (data->row_tracking);
|
||||
g_hash_table_destroy (data->filters);
|
||||
|
||||
manager = gedit_file_browser_widget_get_ui_manager (data->widget);
|
||||
manager = pluma_file_browser_widget_get_ui_manager (data->widget);
|
||||
gtk_ui_manager_remove_action_group (manager, data->merged_actions);
|
||||
|
||||
for (item = data->merge_ids; item; item = item->next)
|
||||
@@ -103,8 +103,8 @@ window_data_free (GeditWindow *window)
|
||||
}
|
||||
|
||||
static FilterData *
|
||||
filter_data_new (GeditWindow *window,
|
||||
GeditMessage *message)
|
||||
filter_data_new (PlumaWindow *window,
|
||||
PlumaMessage *message)
|
||||
{
|
||||
FilterData *data = g_slice_new (FilterData);
|
||||
WindowData *wdata;
|
||||
@@ -116,8 +116,8 @@ filter_data_new (GeditWindow *window,
|
||||
wdata = get_window_data (window);
|
||||
|
||||
g_hash_table_insert (wdata->filters,
|
||||
gedit_message_type_identifier (gedit_message_get_object_path (message),
|
||||
gedit_message_get_method (message)),
|
||||
pluma_message_type_identifier (pluma_message_get_object_path (message),
|
||||
pluma_message_get_method (message)),
|
||||
data);
|
||||
|
||||
return data;
|
||||
@@ -129,8 +129,8 @@ filter_data_free (FilterData *data)
|
||||
WindowData *wdata = get_window_data (data->window);
|
||||
gchar *identifier;
|
||||
|
||||
identifier = gedit_message_type_identifier (gedit_message_get_object_path (data->message),
|
||||
gedit_message_get_method (data->message));
|
||||
identifier = pluma_message_type_identifier (pluma_message_get_object_path (data->message),
|
||||
pluma_message_get_method (data->message));
|
||||
|
||||
g_hash_table_remove (wdata->filters, identifier);
|
||||
g_free (identifier);
|
||||
@@ -161,8 +161,8 @@ message_cache_data_free (MessageCacheData *data)
|
||||
}
|
||||
|
||||
static MessageCacheData *
|
||||
message_cache_data_new (GeditWindow *window,
|
||||
GeditMessage *message)
|
||||
message_cache_data_new (PlumaWindow *window,
|
||||
PlumaMessage *message)
|
||||
{
|
||||
MessageCacheData *data = g_slice_new (MessageCacheData);
|
||||
|
||||
@@ -173,56 +173,56 @@ message_cache_data_new (GeditWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
message_get_root_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_get_root_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
GeditFileBrowserStore *store;
|
||||
PlumaFileBrowserStore *store;
|
||||
gchar *uri;
|
||||
|
||||
store = gedit_file_browser_widget_get_browser_store (data->widget);
|
||||
uri = gedit_file_browser_store_get_virtual_root (store);
|
||||
store = pluma_file_browser_widget_get_browser_store (data->widget);
|
||||
uri = pluma_file_browser_store_get_virtual_root (store);
|
||||
|
||||
gedit_message_set (message, "uri", uri, NULL);
|
||||
pluma_message_set (message, "uri", uri, NULL);
|
||||
g_free (uri);
|
||||
}
|
||||
|
||||
static void
|
||||
message_set_root_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_set_root_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
gchar *root = NULL;
|
||||
gchar *virtual = NULL;
|
||||
|
||||
gedit_message_get (message, "uri", &root, NULL);
|
||||
pluma_message_get (message, "uri", &root, NULL);
|
||||
|
||||
if (!root)
|
||||
return;
|
||||
|
||||
if (gedit_message_has_key (message, "virtual"))
|
||||
gedit_message_get (message, "virtual", &virtual, NULL);
|
||||
if (pluma_message_has_key (message, "virtual"))
|
||||
pluma_message_get (message, "virtual", &virtual, NULL);
|
||||
|
||||
if (virtual)
|
||||
gedit_file_browser_widget_set_root_and_virtual_root (data->widget, root, virtual);
|
||||
pluma_file_browser_widget_set_root_and_virtual_root (data->widget, root, virtual);
|
||||
else
|
||||
gedit_file_browser_widget_set_root (data->widget, root, TRUE);
|
||||
pluma_file_browser_widget_set_root (data->widget, root, TRUE);
|
||||
|
||||
g_free (root);
|
||||
g_free (virtual);
|
||||
}
|
||||
|
||||
static void
|
||||
message_set_emblem_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_set_emblem_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
gchar *id = NULL;
|
||||
gchar *emblem = NULL;
|
||||
GtkTreePath *path;
|
||||
GeditFileBrowserStore *store;
|
||||
PlumaFileBrowserStore *store;
|
||||
|
||||
gedit_message_get (message, "id", &id, "emblem", &emblem, NULL);
|
||||
pluma_message_get (message, "id", &id, "emblem", &emblem, NULL);
|
||||
|
||||
if (!id || !emblem)
|
||||
{
|
||||
@@ -250,16 +250,16 @@ message_set_emblem_cb (GeditMessageBus *bus,
|
||||
GValue value = { 0, };
|
||||
GtkTreeIter iter;
|
||||
|
||||
store = gedit_file_browser_widget_get_browser_store (data->widget);
|
||||
store = pluma_file_browser_widget_get_browser_store (data->widget);
|
||||
|
||||
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path))
|
||||
{
|
||||
g_value_init (&value, GDK_TYPE_PIXBUF);
|
||||
g_value_set_object (&value, pixbuf);
|
||||
|
||||
gedit_file_browser_store_set_value (store,
|
||||
pluma_file_browser_store_set_value (store,
|
||||
&iter,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_EMBLEM,
|
||||
&value);
|
||||
|
||||
g_value_unset (&value);
|
||||
@@ -285,7 +285,7 @@ item_id (const gchar *path,
|
||||
|
||||
static gchar *
|
||||
track_row (WindowData *data,
|
||||
GeditFileBrowserStore *store,
|
||||
PlumaFileBrowserStore *store,
|
||||
GtkTreePath *path,
|
||||
const gchar *uri)
|
||||
{
|
||||
@@ -308,18 +308,18 @@ static void
|
||||
set_item_message (WindowData *data,
|
||||
GtkTreeIter *iter,
|
||||
GtkTreePath *path,
|
||||
GeditMessage *message)
|
||||
PlumaMessage *message)
|
||||
{
|
||||
GeditFileBrowserStore *store;
|
||||
PlumaFileBrowserStore *store;
|
||||
gchar *uri = NULL;
|
||||
guint flags = 0;
|
||||
gchar *track_id;
|
||||
|
||||
store = gedit_file_browser_widget_get_browser_store (data->widget);
|
||||
store = pluma_file_browser_widget_get_browser_store (data->widget);
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
|
||||
-1);
|
||||
|
||||
if (!uri)
|
||||
@@ -330,14 +330,14 @@ set_item_message (WindowData *data,
|
||||
else
|
||||
track_id = NULL;
|
||||
|
||||
gedit_message_set (message,
|
||||
pluma_message_set (message,
|
||||
"id", track_id,
|
||||
"uri", uri,
|
||||
NULL);
|
||||
|
||||
if (gedit_message_has_key (message, "is_directory"))
|
||||
if (pluma_message_has_key (message, "is_directory"))
|
||||
{
|
||||
gedit_message_set (message,
|
||||
pluma_message_set (message,
|
||||
"is_directory", FILE_IS_DIR (flags),
|
||||
NULL);
|
||||
}
|
||||
@@ -347,8 +347,8 @@ set_item_message (WindowData *data,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
custom_message_filter_func (GeditFileBrowserWidget *widget,
|
||||
GeditFileBrowserStore *store,
|
||||
custom_message_filter_func (PlumaFileBrowserWidget *widget,
|
||||
PlumaFileBrowserStore *store,
|
||||
GtkTreeIter *iter,
|
||||
FilterData *data)
|
||||
{
|
||||
@@ -359,8 +359,8 @@ custom_message_filter_func (GeditFileBrowserWidget *widget,
|
||||
GtkTreePath *path;
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
|
||||
-1);
|
||||
|
||||
if (!uri || FILE_IS_DUMMY (flags))
|
||||
@@ -373,28 +373,28 @@ custom_message_filter_func (GeditFileBrowserWidget *widget,
|
||||
set_item_message (wdata, iter, path, data->message);
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
gedit_message_set (data->message, "filter", filter, NULL);
|
||||
pluma_message_set (data->message, "filter", filter, NULL);
|
||||
|
||||
gedit_message_bus_send_message_sync (wdata->bus, data->message);
|
||||
gedit_message_get (data->message, "filter", &filter, NULL);
|
||||
pluma_message_bus_send_message_sync (wdata->bus, data->message);
|
||||
pluma_message_get (data->message, "filter", &filter, NULL);
|
||||
|
||||
return !filter;
|
||||
}
|
||||
|
||||
static void
|
||||
message_add_filter_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
GeditWindow *window)
|
||||
message_add_filter_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
gchar *object_path = NULL;
|
||||
gchar *method = NULL;
|
||||
gulong id;
|
||||
GeditMessageType *message_type;
|
||||
GeditMessage *cbmessage;
|
||||
PlumaMessageType *message_type;
|
||||
PlumaMessage *cbmessage;
|
||||
FilterData *filter_data;
|
||||
WindowData *data = get_window_data (window);
|
||||
|
||||
gedit_message_get (message,
|
||||
pluma_message_get (message,
|
||||
"object_path", &object_path,
|
||||
"method", &method,
|
||||
NULL);
|
||||
@@ -408,7 +408,7 @@ message_add_filter_cb (GeditMessageBus *bus,
|
||||
return;
|
||||
}
|
||||
|
||||
message_type = gedit_message_bus_lookup (bus, object_path, method);
|
||||
message_type = pluma_message_bus_lookup (bus, object_path, method);
|
||||
|
||||
if (!message_type)
|
||||
{
|
||||
@@ -419,15 +419,15 @@ message_add_filter_cb (GeditMessageBus *bus,
|
||||
}
|
||||
|
||||
// Check if the message type has the correct arguments
|
||||
if (gedit_message_type_lookup (message_type, "id") != G_TYPE_STRING ||
|
||||
gedit_message_type_lookup (message_type, "uri") != G_TYPE_STRING ||
|
||||
gedit_message_type_lookup (message_type, "is_directory") != G_TYPE_BOOLEAN ||
|
||||
gedit_message_type_lookup (message_type, "filter") != G_TYPE_BOOLEAN)
|
||||
if (pluma_message_type_lookup (message_type, "id") != G_TYPE_STRING ||
|
||||
pluma_message_type_lookup (message_type, "uri") != G_TYPE_STRING ||
|
||||
pluma_message_type_lookup (message_type, "is_directory") != G_TYPE_BOOLEAN ||
|
||||
pluma_message_type_lookup (message_type, "filter") != G_TYPE_BOOLEAN)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
cbmessage = gedit_message_type_instantiate (message_type,
|
||||
cbmessage = pluma_message_type_instantiate (message_type,
|
||||
"id", NULL,
|
||||
"uri", NULL,
|
||||
"is_directory", FALSE,
|
||||
@@ -436,8 +436,8 @@ message_add_filter_cb (GeditMessageBus *bus,
|
||||
|
||||
// Register the custom filter on the widget
|
||||
filter_data = filter_data_new (window, cbmessage);
|
||||
id = gedit_file_browser_widget_add_filter (data->widget,
|
||||
(GeditFileBrowserWidgetFilterFunc)custom_message_filter_func,
|
||||
id = pluma_file_browser_widget_add_filter (data->widget,
|
||||
(PlumaFileBrowserWidgetFilterFunc)custom_message_filter_func,
|
||||
filter_data,
|
||||
(GDestroyNotify)filter_data_free);
|
||||
|
||||
@@ -445,117 +445,117 @@ message_add_filter_cb (GeditMessageBus *bus,
|
||||
}
|
||||
|
||||
static void
|
||||
message_remove_filter_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_remove_filter_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
gulong id = 0;
|
||||
|
||||
gedit_message_get (message, "id", &id, NULL);
|
||||
pluma_message_get (message, "id", &id, NULL);
|
||||
|
||||
if (!id)
|
||||
return;
|
||||
|
||||
gedit_file_browser_widget_remove_filter (data->widget, id);
|
||||
pluma_file_browser_widget_remove_filter (data->widget, id);
|
||||
}
|
||||
|
||||
static void
|
||||
message_up_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_up_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
GeditFileBrowserStore *store = gedit_file_browser_widget_get_browser_store (data->widget);
|
||||
PlumaFileBrowserStore *store = pluma_file_browser_widget_get_browser_store (data->widget);
|
||||
|
||||
gedit_file_browser_store_set_virtual_root_up (store);
|
||||
pluma_file_browser_store_set_virtual_root_up (store);
|
||||
}
|
||||
|
||||
static void
|
||||
message_history_back_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_history_back_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
gedit_file_browser_widget_history_back (data->widget);
|
||||
pluma_file_browser_widget_history_back (data->widget);
|
||||
}
|
||||
|
||||
static void
|
||||
message_history_forward_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_history_forward_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
gedit_file_browser_widget_history_forward (data->widget);
|
||||
pluma_file_browser_widget_history_forward (data->widget);
|
||||
}
|
||||
|
||||
static void
|
||||
message_refresh_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_refresh_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
gedit_file_browser_widget_refresh (data->widget);
|
||||
pluma_file_browser_widget_refresh (data->widget);
|
||||
}
|
||||
|
||||
static void
|
||||
message_set_show_hidden_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_set_show_hidden_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
gboolean active = FALSE;
|
||||
GeditFileBrowserStore *store;
|
||||
GeditFileBrowserStoreFilterMode mode;
|
||||
PlumaFileBrowserStore *store;
|
||||
PlumaFileBrowserStoreFilterMode mode;
|
||||
|
||||
gedit_message_get (message, "active", &active, NULL);
|
||||
pluma_message_get (message, "active", &active, NULL);
|
||||
|
||||
store = gedit_file_browser_widget_get_browser_store (data->widget);
|
||||
mode = gedit_file_browser_store_get_filter_mode (store);
|
||||
store = pluma_file_browser_widget_get_browser_store (data->widget);
|
||||
mode = pluma_file_browser_store_get_filter_mode (store);
|
||||
|
||||
if (active)
|
||||
mode &= ~GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
|
||||
mode &= ~PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
|
||||
else
|
||||
mode |= GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
|
||||
mode |= PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
|
||||
|
||||
gedit_file_browser_store_set_filter_mode (store, mode);
|
||||
pluma_file_browser_store_set_filter_mode (store, mode);
|
||||
}
|
||||
|
||||
static void
|
||||
message_set_show_binary_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_set_show_binary_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
gboolean active = FALSE;
|
||||
GeditFileBrowserStore *store;
|
||||
GeditFileBrowserStoreFilterMode mode;
|
||||
PlumaFileBrowserStore *store;
|
||||
PlumaFileBrowserStoreFilterMode mode;
|
||||
|
||||
gedit_message_get (message, "active", &active, NULL);
|
||||
pluma_message_get (message, "active", &active, NULL);
|
||||
|
||||
store = gedit_file_browser_widget_get_browser_store (data->widget);
|
||||
mode = gedit_file_browser_store_get_filter_mode (store);
|
||||
store = pluma_file_browser_widget_get_browser_store (data->widget);
|
||||
mode = pluma_file_browser_store_get_filter_mode (store);
|
||||
|
||||
if (active)
|
||||
mode &= ~GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
|
||||
mode &= ~PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
|
||||
else
|
||||
mode |= GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
|
||||
mode |= PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
|
||||
|
||||
gedit_file_browser_store_set_filter_mode (store, mode);
|
||||
pluma_file_browser_store_set_filter_mode (store, mode);
|
||||
}
|
||||
|
||||
static void
|
||||
message_show_bookmarks_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_show_bookmarks_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
gedit_file_browser_widget_show_bookmarks (data->widget);
|
||||
pluma_file_browser_widget_show_bookmarks (data->widget);
|
||||
}
|
||||
|
||||
static void
|
||||
message_show_files_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_show_files_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
gedit_file_browser_widget_show_files (data->widget);
|
||||
pluma_file_browser_widget_show_files (data->widget);
|
||||
}
|
||||
|
||||
static void
|
||||
message_add_context_item_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_add_context_item_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
GtkAction *action = NULL;
|
||||
@@ -564,7 +564,7 @@ message_add_context_item_cb (GeditMessageBus *bus,
|
||||
GtkUIManager *manager;
|
||||
guint merge_id;
|
||||
|
||||
gedit_message_get (message,
|
||||
pluma_message_get (message,
|
||||
"action", &action,
|
||||
"path", &path,
|
||||
NULL);
|
||||
@@ -579,7 +579,7 @@ message_add_context_item_cb (GeditMessageBus *bus,
|
||||
}
|
||||
|
||||
gtk_action_group_add_action (data->merged_actions, action);
|
||||
manager = gedit_file_browser_widget_get_ui_manager (data->widget);
|
||||
manager = pluma_file_browser_widget_get_ui_manager (data->widget);
|
||||
name = g_strconcat (gtk_action_get_name (action), "MenuItem", NULL);
|
||||
merge_id = gtk_ui_manager_new_merge_id (manager);
|
||||
|
||||
@@ -594,11 +594,11 @@ message_add_context_item_cb (GeditMessageBus *bus,
|
||||
if (gtk_ui_manager_get_widget (manager, path))
|
||||
{
|
||||
data->merge_ids = g_list_prepend (data->merge_ids, GINT_TO_POINTER (merge_id));
|
||||
gedit_message_set (message, "id", merge_id, NULL);
|
||||
pluma_message_set (message, "id", merge_id, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
gedit_message_set (message, "id", 0, NULL);
|
||||
pluma_message_set (message, "id", 0, NULL);
|
||||
}
|
||||
|
||||
g_object_unref (action);
|
||||
@@ -607,64 +607,64 @@ message_add_context_item_cb (GeditMessageBus *bus,
|
||||
}
|
||||
|
||||
static void
|
||||
message_remove_context_item_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_remove_context_item_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
guint merge_id = 0;
|
||||
GtkUIManager *manager;
|
||||
|
||||
gedit_message_get (message, "id", &merge_id, NULL);
|
||||
pluma_message_get (message, "id", &merge_id, NULL);
|
||||
|
||||
if (merge_id == 0)
|
||||
return;
|
||||
|
||||
manager = gedit_file_browser_widget_get_ui_manager (data->widget);
|
||||
manager = pluma_file_browser_widget_get_ui_manager (data->widget);
|
||||
|
||||
data->merge_ids = g_list_remove (data->merge_ids, GINT_TO_POINTER (merge_id));
|
||||
gtk_ui_manager_remove_ui (manager, merge_id);
|
||||
}
|
||||
|
||||
static void
|
||||
message_get_view_cb (GeditMessageBus *bus,
|
||||
GeditMessage *message,
|
||||
message_get_view_cb (PlumaMessageBus *bus,
|
||||
PlumaMessage *message,
|
||||
WindowData *data)
|
||||
{
|
||||
GeditFileBrowserView *view;
|
||||
view = gedit_file_browser_widget_get_browser_view (data->widget);
|
||||
PlumaFileBrowserView *view;
|
||||
view = pluma_file_browser_widget_get_browser_view (data->widget);
|
||||
|
||||
gedit_message_set (message, "view", view, NULL);
|
||||
pluma_message_set (message, "view", view, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
register_methods (GeditWindow *window,
|
||||
GeditFileBrowserWidget *widget)
|
||||
register_methods (PlumaWindow *window,
|
||||
PlumaFileBrowserWidget *widget)
|
||||
{
|
||||
GeditMessageBus *bus = gedit_window_get_message_bus (window);
|
||||
PlumaMessageBus *bus = pluma_window_get_message_bus (window);
|
||||
WindowData *data = get_window_data (window);
|
||||
|
||||
/* Register method calls */
|
||||
gedit_message_bus_register (bus,
|
||||
pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "get_root",
|
||||
1,
|
||||
"uri", G_TYPE_STRING,
|
||||
NULL);
|
||||
|
||||
gedit_message_bus_register (bus,
|
||||
pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "set_root",
|
||||
1,
|
||||
"uri", G_TYPE_STRING,
|
||||
"virtual", G_TYPE_STRING,
|
||||
NULL);
|
||||
|
||||
gedit_message_bus_register (bus,
|
||||
pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "set_emblem",
|
||||
0,
|
||||
"id", G_TYPE_STRING,
|
||||
"emblem", G_TYPE_STRING,
|
||||
NULL);
|
||||
|
||||
gedit_message_bus_register (bus,
|
||||
pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "add_filter",
|
||||
1,
|
||||
"object_path", G_TYPE_STRING,
|
||||
@@ -672,13 +672,13 @@ register_methods (GeditWindow *window,
|
||||
"id", G_TYPE_ULONG,
|
||||
NULL);
|
||||
|
||||
gedit_message_bus_register (bus,
|
||||
pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "remove_filter",
|
||||
0,
|
||||
"id", G_TYPE_ULONG,
|
||||
NULL);
|
||||
|
||||
gedit_message_bus_register (bus,
|
||||
pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "add_context_item",
|
||||
1,
|
||||
"action", GTK_TYPE_ACTION,
|
||||
@@ -686,37 +686,37 @@ register_methods (GeditWindow *window,
|
||||
"id", G_TYPE_UINT,
|
||||
NULL);
|
||||
|
||||
gedit_message_bus_register (bus,
|
||||
pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "remove_context_item",
|
||||
0,
|
||||
"id", G_TYPE_UINT,
|
||||
NULL);
|
||||
|
||||
gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "up", 0, NULL);
|
||||
pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "up", 0, NULL);
|
||||
|
||||
gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_back", 0, NULL);
|
||||
gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_forward", 0, NULL);
|
||||
pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_back", 0, NULL);
|
||||
pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_forward", 0, NULL);
|
||||
|
||||
gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "refresh", 0, NULL);
|
||||
pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "refresh", 0, NULL);
|
||||
|
||||
gedit_message_bus_register (bus,
|
||||
pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "set_show_hidden",
|
||||
0,
|
||||
"active", G_TYPE_BOOLEAN,
|
||||
NULL);
|
||||
gedit_message_bus_register (bus,
|
||||
pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "set_show_binary",
|
||||
0,
|
||||
"active", G_TYPE_BOOLEAN,
|
||||
NULL);
|
||||
|
||||
gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_bookmarks", 0, NULL);
|
||||
gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_files", 0, NULL);
|
||||
pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_bookmarks", 0, NULL);
|
||||
pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_files", 0, NULL);
|
||||
|
||||
gedit_message_bus_register (bus,
|
||||
pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "get_view",
|
||||
1,
|
||||
"view", GEDIT_TYPE_FILE_BROWSER_VIEW,
|
||||
"view", PLUMA_TYPE_FILE_BROWSER_VIEW,
|
||||
NULL);
|
||||
|
||||
BUS_CONNECT (bus, get_root, data);
|
||||
@@ -744,7 +744,7 @@ register_methods (GeditWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
store_row_inserted (GeditFileBrowserStore *store,
|
||||
store_row_inserted (PlumaFileBrowserStore *store,
|
||||
GtkTreePath *path,
|
||||
GtkTreeIter *iter,
|
||||
MessageCacheData *data)
|
||||
@@ -753,8 +753,8 @@ store_row_inserted (GeditFileBrowserStore *store,
|
||||
guint flags = 0;
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
|
||||
-1);
|
||||
|
||||
if (!FILE_IS_DUMMY (flags) && !FILE_IS_FILTERED (flags))
|
||||
@@ -762,14 +762,14 @@ store_row_inserted (GeditFileBrowserStore *store,
|
||||
WindowData *wdata = get_window_data (data->window);
|
||||
|
||||
set_item_message (wdata, iter, path, data->message);
|
||||
gedit_message_bus_send_message_sync (wdata->bus, data->message);
|
||||
pluma_message_bus_send_message_sync (wdata->bus, data->message);
|
||||
}
|
||||
|
||||
g_free (uri);
|
||||
}
|
||||
|
||||
static void
|
||||
store_row_deleted (GeditFileBrowserStore *store,
|
||||
store_row_deleted (PlumaFileBrowserStore *store,
|
||||
GtkTreePath *path,
|
||||
MessageCacheData *data)
|
||||
{
|
||||
@@ -781,8 +781,8 @@ store_row_deleted (GeditFileBrowserStore *store,
|
||||
return;
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
|
||||
-1);
|
||||
|
||||
if (!FILE_IS_DUMMY (flags) && !FILE_IS_FILTERED (flags))
|
||||
@@ -790,36 +790,36 @@ store_row_deleted (GeditFileBrowserStore *store,
|
||||
WindowData *wdata = get_window_data (data->window);
|
||||
|
||||
set_item_message (wdata, &iter, path, data->message);
|
||||
gedit_message_bus_send_message_sync (wdata->bus, data->message);
|
||||
pluma_message_bus_send_message_sync (wdata->bus, data->message);
|
||||
}
|
||||
|
||||
g_free (uri);
|
||||
}
|
||||
|
||||
static void
|
||||
store_virtual_root_changed (GeditFileBrowserStore *store,
|
||||
store_virtual_root_changed (PlumaFileBrowserStore *store,
|
||||
GParamSpec *spec,
|
||||
MessageCacheData *data)
|
||||
{
|
||||
WindowData *wdata = get_window_data (data->window);
|
||||
gchar *uri;
|
||||
|
||||
uri = gedit_file_browser_store_get_virtual_root (store);
|
||||
uri = pluma_file_browser_store_get_virtual_root (store);
|
||||
|
||||
if (!uri)
|
||||
return;
|
||||
|
||||
gedit_message_set (data->message,
|
||||
pluma_message_set (data->message,
|
||||
"uri", uri,
|
||||
NULL);
|
||||
|
||||
gedit_message_bus_send_message_sync (wdata->bus, data->message);
|
||||
pluma_message_bus_send_message_sync (wdata->bus, data->message);
|
||||
|
||||
g_free (uri);
|
||||
}
|
||||
|
||||
static void
|
||||
store_begin_loading (GeditFileBrowserStore *store,
|
||||
store_begin_loading (PlumaFileBrowserStore *store,
|
||||
GtkTreeIter *iter,
|
||||
MessageCacheData *data)
|
||||
{
|
||||
@@ -830,12 +830,12 @@ store_begin_loading (GeditFileBrowserStore *store,
|
||||
|
||||
set_item_message (wdata, iter, path, data->message);
|
||||
|
||||
gedit_message_bus_send_message_sync (wdata->bus, data->message);
|
||||
pluma_message_bus_send_message_sync (wdata->bus, data->message);
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
|
||||
static void
|
||||
store_end_loading (GeditFileBrowserStore *store,
|
||||
store_end_loading (PlumaFileBrowserStore *store,
|
||||
GtkTreeIter *iter,
|
||||
MessageCacheData *data)
|
||||
{
|
||||
@@ -846,48 +846,48 @@ store_end_loading (GeditFileBrowserStore *store,
|
||||
|
||||
set_item_message (wdata, iter, path, data->message);
|
||||
|
||||
gedit_message_bus_send_message_sync (wdata->bus, data->message);
|
||||
pluma_message_bus_send_message_sync (wdata->bus, data->message);
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
|
||||
static void
|
||||
register_signals (GeditWindow *window,
|
||||
GeditFileBrowserWidget *widget)
|
||||
register_signals (PlumaWindow *window,
|
||||
PlumaFileBrowserWidget *widget)
|
||||
{
|
||||
GeditMessageBus *bus = gedit_window_get_message_bus (window);
|
||||
GeditFileBrowserStore *store;
|
||||
GeditMessageType *inserted_type;
|
||||
GeditMessageType *deleted_type;
|
||||
GeditMessageType *begin_loading_type;
|
||||
GeditMessageType *end_loading_type;
|
||||
GeditMessageType *root_changed_type;
|
||||
PlumaMessageBus *bus = pluma_window_get_message_bus (window);
|
||||
PlumaFileBrowserStore *store;
|
||||
PlumaMessageType *inserted_type;
|
||||
PlumaMessageType *deleted_type;
|
||||
PlumaMessageType *begin_loading_type;
|
||||
PlumaMessageType *end_loading_type;
|
||||
PlumaMessageType *root_changed_type;
|
||||
|
||||
GeditMessage *message;
|
||||
PlumaMessage *message;
|
||||
WindowData *data;
|
||||
|
||||
/* Register signals */
|
||||
root_changed_type = gedit_message_bus_register (bus,
|
||||
root_changed_type = pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "root_changed",
|
||||
0,
|
||||
"id", G_TYPE_STRING,
|
||||
"uri", G_TYPE_STRING,
|
||||
NULL);
|
||||
|
||||
begin_loading_type = gedit_message_bus_register (bus,
|
||||
begin_loading_type = pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "begin_loading",
|
||||
0,
|
||||
"id", G_TYPE_STRING,
|
||||
"uri", G_TYPE_STRING,
|
||||
NULL);
|
||||
|
||||
end_loading_type = gedit_message_bus_register (bus,
|
||||
end_loading_type = pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "end_loading",
|
||||
0,
|
||||
"id", G_TYPE_STRING,
|
||||
"uri", G_TYPE_STRING,
|
||||
NULL);
|
||||
|
||||
inserted_type = gedit_message_bus_register (bus,
|
||||
inserted_type = pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "inserted",
|
||||
0,
|
||||
"id", G_TYPE_STRING,
|
||||
@@ -895,7 +895,7 @@ register_signals (GeditWindow *window,
|
||||
"is_directory", G_TYPE_BOOLEAN,
|
||||
NULL);
|
||||
|
||||
deleted_type = gedit_message_bus_register (bus,
|
||||
deleted_type = pluma_message_bus_register (bus,
|
||||
MESSAGE_OBJECT_PATH, "deleted",
|
||||
0,
|
||||
"id", G_TYPE_STRING,
|
||||
@@ -903,9 +903,9 @@ register_signals (GeditWindow *window,
|
||||
"is_directory", G_TYPE_BOOLEAN,
|
||||
NULL);
|
||||
|
||||
store = gedit_file_browser_widget_get_browser_store (widget);
|
||||
store = pluma_file_browser_widget_get_browser_store (widget);
|
||||
|
||||
message = gedit_message_type_instantiate (inserted_type,
|
||||
message = pluma_message_type_instantiate (inserted_type,
|
||||
"id", NULL,
|
||||
"uri", NULL,
|
||||
"is_directory", FALSE,
|
||||
@@ -921,7 +921,7 @@ register_signals (GeditWindow *window,
|
||||
(GClosureNotify)message_cache_data_free,
|
||||
0);
|
||||
|
||||
message = gedit_message_type_instantiate (deleted_type,
|
||||
message = pluma_message_type_instantiate (deleted_type,
|
||||
"id", NULL,
|
||||
"uri", NULL,
|
||||
"is_directory", FALSE,
|
||||
@@ -934,7 +934,7 @@ register_signals (GeditWindow *window,
|
||||
(GClosureNotify)message_cache_data_free,
|
||||
0);
|
||||
|
||||
message = gedit_message_type_instantiate (root_changed_type,
|
||||
message = pluma_message_type_instantiate (root_changed_type,
|
||||
"id", NULL,
|
||||
"uri", NULL,
|
||||
NULL);
|
||||
@@ -946,7 +946,7 @@ register_signals (GeditWindow *window,
|
||||
(GClosureNotify)message_cache_data_free,
|
||||
0);
|
||||
|
||||
message = gedit_message_type_instantiate (begin_loading_type,
|
||||
message = pluma_message_type_instantiate (begin_loading_type,
|
||||
"id", NULL,
|
||||
"uri", NULL,
|
||||
NULL);
|
||||
@@ -958,7 +958,7 @@ register_signals (GeditWindow *window,
|
||||
(GClosureNotify)message_cache_data_free,
|
||||
0);
|
||||
|
||||
message = gedit_message_type_instantiate (end_loading_type,
|
||||
message = pluma_message_type_instantiate (end_loading_type,
|
||||
"id", NULL,
|
||||
"uri", NULL,
|
||||
NULL);
|
||||
@@ -972,45 +972,45 @@ register_signals (GeditWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
message_unregistered (GeditMessageBus *bus,
|
||||
GeditMessageType *message_type,
|
||||
GeditWindow *window)
|
||||
message_unregistered (PlumaMessageBus *bus,
|
||||
PlumaMessageType *message_type,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
gchar *identifier = gedit_message_type_identifier (gedit_message_type_get_object_path (message_type),
|
||||
gedit_message_type_get_method (message_type));
|
||||
gchar *identifier = pluma_message_type_identifier (pluma_message_type_get_object_path (message_type),
|
||||
pluma_message_type_get_method (message_type));
|
||||
FilterData *data;
|
||||
WindowData *wdata = get_window_data (window);
|
||||
|
||||
data = g_hash_table_lookup (wdata->filters, identifier);
|
||||
|
||||
if (data)
|
||||
gedit_file_browser_widget_remove_filter (wdata->widget, data->id);
|
||||
pluma_file_browser_widget_remove_filter (wdata->widget, data->id);
|
||||
|
||||
g_free (identifier);
|
||||
}
|
||||
|
||||
void
|
||||
gedit_file_browser_messages_register (GeditWindow *window,
|
||||
GeditFileBrowserWidget *widget)
|
||||
pluma_file_browser_messages_register (PlumaWindow *window,
|
||||
PlumaFileBrowserWidget *widget)
|
||||
{
|
||||
window_data_new (window, widget);
|
||||
|
||||
register_methods (window, widget);
|
||||
register_signals (window, widget);
|
||||
|
||||
g_signal_connect (gedit_window_get_message_bus (window),
|
||||
g_signal_connect (pluma_window_get_message_bus (window),
|
||||
"unregistered",
|
||||
G_CALLBACK (message_unregistered),
|
||||
window);
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup_signals (GeditWindow *window)
|
||||
cleanup_signals (PlumaWindow *window)
|
||||
{
|
||||
WindowData *data = get_window_data (window);
|
||||
GeditFileBrowserStore *store;
|
||||
PlumaFileBrowserStore *store;
|
||||
|
||||
store = gedit_file_browser_widget_get_browser_store (data->widget);
|
||||
store = pluma_file_browser_widget_get_browser_store (data->widget);
|
||||
|
||||
g_signal_handler_disconnect (store, data->row_inserted_id);
|
||||
g_signal_handler_disconnect (store, data->row_deleted_id);
|
||||
@@ -1022,12 +1022,12 @@ cleanup_signals (GeditWindow *window)
|
||||
}
|
||||
|
||||
void
|
||||
gedit_file_browser_messages_unregister (GeditWindow *window)
|
||||
pluma_file_browser_messages_unregister (PlumaWindow *window)
|
||||
{
|
||||
GeditMessageBus *bus = gedit_window_get_message_bus (window);
|
||||
PlumaMessageBus *bus = pluma_window_get_message_bus (window);
|
||||
|
||||
cleanup_signals (window);
|
||||
gedit_message_bus_unregister_all (bus, MESSAGE_OBJECT_PATH);
|
||||
pluma_message_bus_unregister_all (bus, MESSAGE_OBJECT_PATH);
|
||||
|
||||
window_data_free (window);
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* gedit-file-browser-messages.h - Gedit plugin providing easy file access
|
||||
* pluma-file-browser-messages.h - Pluma plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2008 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
@@ -19,17 +19,17 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GEDIT_FILE_BROWSER_MESSAGES_H__
|
||||
#define __GEDIT_FILE_BROWSER_MESSAGES_H__
|
||||
#ifndef __PLUMA_FILE_BROWSER_MESSAGES_H__
|
||||
#define __PLUMA_FILE_BROWSER_MESSAGES_H__
|
||||
|
||||
#include <gedit/gedit-window.h>
|
||||
#include <gedit/gedit-message-bus.h>
|
||||
#include "gedit-file-browser-widget.h"
|
||||
#include <pluma/pluma-window.h>
|
||||
#include <pluma/pluma-message-bus.h>
|
||||
#include "pluma-file-browser-widget.h"
|
||||
|
||||
void gedit_file_browser_messages_register (GeditWindow *window,
|
||||
GeditFileBrowserWidget *widget);
|
||||
void gedit_file_browser_messages_unregister (GeditWindow *window);
|
||||
void pluma_file_browser_messages_register (PlumaWindow *window,
|
||||
PlumaFileBrowserWidget *widget);
|
||||
void pluma_file_browser_messages_unregister (PlumaWindow *window);
|
||||
|
||||
#endif /* __GEDIT_FILE_BROWSER_MESSAGES_H__ */
|
||||
#endif /* __PLUMA_FILE_BROWSER_MESSAGES_H__ */
|
||||
|
||||
// ex:ts=8:noet:
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* gedit-file-browser-plugin.c - Gedit 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 <jesse@icecrew.nl>
|
||||
@@ -24,39 +24,39 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gedit/gedit-commands.h>
|
||||
#include <gedit/gedit-utils.h>
|
||||
#include <gedit/gedit-app.h>
|
||||
#include <pluma/pluma-commands.h>
|
||||
#include <pluma/pluma-utils.h>
|
||||
#include <pluma/pluma-app.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include <gedit/gedit-debug.h>
|
||||
#include <pluma/pluma-debug.h>
|
||||
#include <mateconf/mateconf-client.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gedit-file-browser-enum-types.h"
|
||||
#include "gedit-file-browser-plugin.h"
|
||||
#include "gedit-file-browser-utils.h"
|
||||
#include "gedit-file-browser-error.h"
|
||||
#include "gedit-file-browser-widget.h"
|
||||
#include "gedit-file-browser-messages.h"
|
||||
#include "pluma-file-browser-enum-types.h"
|
||||
#include "pluma-file-browser-plugin.h"
|
||||
#include "pluma-file-browser-utils.h"
|
||||
#include "pluma-file-browser-error.h"
|
||||
#include "pluma-file-browser-widget.h"
|
||||
#include "pluma-file-browser-messages.h"
|
||||
|
||||
#define WINDOW_DATA_KEY "GeditFileBrowserPluginWindowData"
|
||||
#define FILE_BROWSER_BASE_KEY "/apps/gedit-2/plugins/filebrowser"
|
||||
#define WINDOW_DATA_KEY "PlumaFileBrowserPluginWindowData"
|
||||
#define FILE_BROWSER_BASE_KEY "/apps/pluma-2/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"
|
||||
#define CAJA_CONFIRM_TRASH_KEY "confirm_trash"
|
||||
#define TERMINAL_EXEC_KEY "/desktop/mate/applications/terminal/exec"
|
||||
|
||||
#define GEDIT_FILE_BROWSER_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_FILE_BROWSER_PLUGIN, GeditFileBrowserPluginPrivate))
|
||||
#define PLUMA_FILE_BROWSER_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_FILE_BROWSER_PLUGIN, PlumaFileBrowserPluginPrivate))
|
||||
|
||||
struct _GeditFileBrowserPluginPrivate
|
||||
struct _PlumaFileBrowserPluginPrivate
|
||||
{
|
||||
gpointer dummy;
|
||||
};
|
||||
|
||||
typedef struct _GeditFileBrowserPluginData
|
||||
typedef struct _PlumaFileBrowserPluginData
|
||||
{
|
||||
GeditFileBrowserWidget * tree_widget;
|
||||
PlumaFileBrowserWidget * tree_widget;
|
||||
gulong merge_id;
|
||||
GtkActionGroup * action_group;
|
||||
GtkActionGroup * single_selection_action_group;
|
||||
@@ -67,75 +67,75 @@ typedef struct _GeditFileBrowserPluginData
|
||||
guint click_policy_handle;
|
||||
guint enable_delete_handle;
|
||||
guint confirm_trash_handle;
|
||||
} GeditFileBrowserPluginData;
|
||||
} PlumaFileBrowserPluginData;
|
||||
|
||||
static void on_uri_activated_cb (GeditFileBrowserWidget * widget,
|
||||
static void on_uri_activated_cb (PlumaFileBrowserWidget * widget,
|
||||
gchar const *uri,
|
||||
GeditWindow * window);
|
||||
static void on_error_cb (GeditFileBrowserWidget * widget,
|
||||
PlumaWindow * window);
|
||||
static void on_error_cb (PlumaFileBrowserWidget * widget,
|
||||
guint code,
|
||||
gchar const *message,
|
||||
GeditWindow * window);
|
||||
static void on_model_set_cb (GeditFileBrowserView * widget,
|
||||
PlumaWindow * window);
|
||||
static void on_model_set_cb (PlumaFileBrowserView * widget,
|
||||
GParamSpec *arg1,
|
||||
GeditWindow * window);
|
||||
static void on_virtual_root_changed_cb (GeditFileBrowserStore * model,
|
||||
PlumaWindow * window);
|
||||
static void on_virtual_root_changed_cb (PlumaFileBrowserStore * model,
|
||||
GParamSpec * param,
|
||||
GeditWindow * window);
|
||||
static void on_filter_mode_changed_cb (GeditFileBrowserStore * model,
|
||||
PlumaWindow * window);
|
||||
static void on_filter_mode_changed_cb (PlumaFileBrowserStore * model,
|
||||
GParamSpec * param,
|
||||
GeditWindow * window);
|
||||
static void on_rename_cb (GeditFileBrowserStore * model,
|
||||
PlumaWindow * window);
|
||||
static void on_rename_cb (PlumaFileBrowserStore * model,
|
||||
const gchar * olduri,
|
||||
const gchar * newuri,
|
||||
GeditWindow * window);
|
||||
static void on_filter_pattern_changed_cb (GeditFileBrowserWidget * widget,
|
||||
PlumaWindow * window);
|
||||
static void on_filter_pattern_changed_cb (PlumaFileBrowserWidget * widget,
|
||||
GParamSpec * param,
|
||||
GeditWindow * window);
|
||||
static void on_tab_added_cb (GeditWindow * window,
|
||||
GeditTab * tab,
|
||||
GeditFileBrowserPluginData * data);
|
||||
static gboolean on_confirm_delete_cb (GeditFileBrowserWidget * widget,
|
||||
GeditFileBrowserStore * store,
|
||||
PlumaWindow * window);
|
||||
static void on_tab_added_cb (PlumaWindow * window,
|
||||
PlumaTab * tab,
|
||||
PlumaFileBrowserPluginData * data);
|
||||
static gboolean on_confirm_delete_cb (PlumaFileBrowserWidget * widget,
|
||||
PlumaFileBrowserStore * store,
|
||||
GList * rows,
|
||||
GeditWindow * window);
|
||||
static gboolean on_confirm_no_trash_cb (GeditFileBrowserWidget * widget,
|
||||
PlumaWindow * window);
|
||||
static gboolean on_confirm_no_trash_cb (PlumaFileBrowserWidget * widget,
|
||||
GList * files,
|
||||
GeditWindow * window);
|
||||
PlumaWindow * window);
|
||||
|
||||
GEDIT_PLUGIN_REGISTER_TYPE_WITH_CODE (GeditFileBrowserPlugin, filetree_plugin, \
|
||||
gedit_file_browser_enum_and_flag_register_type (type_module); \
|
||||
gedit_file_browser_store_register_type (type_module); \
|
||||
gedit_file_bookmarks_store_register_type (type_module); \
|
||||
gedit_file_browser_view_register_type (type_module); \
|
||||
gedit_file_browser_widget_register_type (type_module); \
|
||||
PLUMA_PLUGIN_REGISTER_TYPE_WITH_CODE (PlumaFileBrowserPlugin, filetree_plugin, \
|
||||
pluma_file_browser_enum_and_flag_register_type (type_module); \
|
||||
pluma_file_browser_store_register_type (type_module); \
|
||||
pluma_file_bookmarks_store_register_type (type_module); \
|
||||
pluma_file_browser_view_register_type (type_module); \
|
||||
pluma_file_browser_widget_register_type (type_module); \
|
||||
)
|
||||
|
||||
|
||||
static void
|
||||
filetree_plugin_init (GeditFileBrowserPlugin * plugin)
|
||||
filetree_plugin_init (PlumaFileBrowserPlugin * plugin)
|
||||
{
|
||||
plugin->priv = GEDIT_FILE_BROWSER_PLUGIN_GET_PRIVATE (plugin);
|
||||
plugin->priv = PLUMA_FILE_BROWSER_PLUGIN_GET_PRIVATE (plugin);
|
||||
}
|
||||
|
||||
static void
|
||||
filetree_plugin_finalize (GObject * object)
|
||||
{
|
||||
//GeditFileBrowserPlugin * plugin = GEDIT_FILE_BROWSER_PLUGIN (object);
|
||||
//PlumaFileBrowserPlugin * plugin = PLUMA_FILE_BROWSER_PLUGIN (object);
|
||||
|
||||
G_OBJECT_CLASS (filetree_plugin_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static GeditFileBrowserPluginData *
|
||||
get_plugin_data (GeditWindow * window)
|
||||
static PlumaFileBrowserPluginData *
|
||||
get_plugin_data (PlumaWindow * window)
|
||||
{
|
||||
return (GeditFileBrowserPluginData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY));
|
||||
return (PlumaFileBrowserPluginData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY));
|
||||
}
|
||||
|
||||
static void
|
||||
on_end_loading_cb (GeditFileBrowserStore * store,
|
||||
on_end_loading_cb (PlumaFileBrowserStore * store,
|
||||
GtkTreeIter * iter,
|
||||
GeditFileBrowserPluginData * data)
|
||||
PlumaFileBrowserPluginData * data)
|
||||
{
|
||||
/* Disconnect the signal */
|
||||
g_signal_handler_disconnect (store, data->end_loading_handle);
|
||||
@@ -144,13 +144,13 @@ on_end_loading_cb (GeditFileBrowserStore * store,
|
||||
}
|
||||
|
||||
static void
|
||||
prepare_auto_root (GeditFileBrowserPluginData *data)
|
||||
prepare_auto_root (PlumaFileBrowserPluginData *data)
|
||||
{
|
||||
GeditFileBrowserStore *store;
|
||||
PlumaFileBrowserStore *store;
|
||||
|
||||
data->auto_root = TRUE;
|
||||
|
||||
store = gedit_file_browser_widget_get_browser_store (data->tree_widget);
|
||||
store = pluma_file_browser_widget_get_browser_store (data->tree_widget);
|
||||
|
||||
if (data->end_loading_handle != 0) {
|
||||
g_signal_handler_disconnect (store, data->end_loading_handle);
|
||||
@@ -164,7 +164,7 @@ prepare_auto_root (GeditFileBrowserPluginData *data)
|
||||
}
|
||||
|
||||
static void
|
||||
restore_default_location (GeditFileBrowserPluginData *data)
|
||||
restore_default_location (PlumaFileBrowserPluginData *data)
|
||||
{
|
||||
gchar * root;
|
||||
gchar * virtual_root;
|
||||
@@ -182,7 +182,7 @@ restore_default_location (GeditFileBrowserPluginData *data)
|
||||
|
||||
if (bookmarks) {
|
||||
g_object_unref (client);
|
||||
gedit_file_browser_widget_show_bookmarks (data->tree_widget);
|
||||
pluma_file_browser_widget_show_bookmarks (data->tree_widget);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -205,12 +205,12 @@ restore_default_location (GeditFileBrowserPluginData *data)
|
||||
if (remote || g_file_is_native (file)) {
|
||||
if (virtual_root != NULL && *virtual_root != '\0') {
|
||||
prepare_auto_root (data);
|
||||
gedit_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 {
|
||||
prepare_auto_root (data);
|
||||
gedit_file_browser_widget_set_root (data->tree_widget,
|
||||
pluma_file_browser_widget_set_root (data->tree_widget,
|
||||
root,
|
||||
TRUE);
|
||||
}
|
||||
@@ -225,11 +225,11 @@ restore_default_location (GeditFileBrowserPluginData *data)
|
||||
}
|
||||
|
||||
static void
|
||||
restore_filter (GeditFileBrowserPluginData * data)
|
||||
restore_filter (PlumaFileBrowserPluginData * data)
|
||||
{
|
||||
MateConfClient * client;
|
||||
gchar *filter_mode;
|
||||
GeditFileBrowserStoreFilterMode mode;
|
||||
PlumaFileBrowserStoreFilterMode mode;
|
||||
gchar *pattern;
|
||||
|
||||
client = mateconf_client_get_default ();
|
||||
@@ -242,33 +242,33 @@ restore_filter (GeditFileBrowserPluginData * data)
|
||||
NULL);
|
||||
|
||||
/* Filter mode */
|
||||
mode = gedit_file_browser_store_filter_mode_get_default ();
|
||||
mode = pluma_file_browser_store_filter_mode_get_default ();
|
||||
|
||||
if (filter_mode != NULL) {
|
||||
if (strcmp (filter_mode, "hidden") == 0) {
|
||||
mode = GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
|
||||
mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
|
||||
} else if (strcmp (filter_mode, "binary") == 0) {
|
||||
mode = GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
|
||||
mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
|
||||
} else if (strcmp (filter_mode, "hidden_and_binary") == 0 ||
|
||||
strcmp (filter_mode, "binary_and_hidden") == 0) {
|
||||
mode = GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN |
|
||||
GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
|
||||
mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN |
|
||||
PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
|
||||
} else if (strcmp (filter_mode, "none") == 0 ||
|
||||
*filter_mode == '\0') {
|
||||
mode = GEDIT_FILE_BROWSER_STORE_FILTER_MODE_NONE;
|
||||
mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the filter mode */
|
||||
gedit_file_browser_store_set_filter_mode (
|
||||
gedit_file_browser_widget_get_browser_store (data->tree_widget),
|
||||
pluma_file_browser_store_set_filter_mode (
|
||||
pluma_file_browser_widget_get_browser_store (data->tree_widget),
|
||||
mode);
|
||||
|
||||
pattern = mateconf_client_get_string (client,
|
||||
FILE_BROWSER_BASE_KEY "/filter_pattern",
|
||||
NULL);
|
||||
|
||||
gedit_file_browser_widget_set_filter_pattern (data->tree_widget,
|
||||
pluma_file_browser_widget_set_filter_pattern (data->tree_widget,
|
||||
pattern);
|
||||
|
||||
g_object_unref (client);
|
||||
@@ -276,13 +276,13 @@ restore_filter (GeditFileBrowserPluginData * data)
|
||||
g_free (pattern);
|
||||
}
|
||||
|
||||
static GeditFileBrowserViewClickPolicy
|
||||
static PlumaFileBrowserViewClickPolicy
|
||||
click_policy_from_string (gchar const *click_policy)
|
||||
{
|
||||
if (click_policy && strcmp (click_policy, "single") == 0)
|
||||
return GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE;
|
||||
return PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE;
|
||||
else
|
||||
return GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE;
|
||||
return PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -292,12 +292,12 @@ on_click_policy_changed (MateConfClient *client,
|
||||
gpointer user_data)
|
||||
{
|
||||
MateConfValue *value;
|
||||
GeditFileBrowserPluginData * data;
|
||||
PlumaFileBrowserPluginData * data;
|
||||
gchar const *click_policy;
|
||||
GeditFileBrowserViewClickPolicy policy = GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE;
|
||||
GeditFileBrowserView *view;
|
||||
PlumaFileBrowserViewClickPolicy policy = PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE;
|
||||
PlumaFileBrowserView *view;
|
||||
|
||||
data = (GeditFileBrowserPluginData *)(user_data);
|
||||
data = (PlumaFileBrowserPluginData *)(user_data);
|
||||
value = mateconf_entry_get_value (entry);
|
||||
|
||||
if (value && value->type == MATECONF_VALUE_STRING) {
|
||||
@@ -306,8 +306,8 @@ on_click_policy_changed (MateConfClient *client,
|
||||
policy = click_policy_from_string (click_policy);
|
||||
}
|
||||
|
||||
view = gedit_file_browser_widget_get_browser_view (data->tree_widget);
|
||||
gedit_file_browser_view_set_click_policy (view, policy);
|
||||
view = pluma_file_browser_widget_get_browser_view (data->tree_widget);
|
||||
pluma_file_browser_view_set_click_policy (view, policy);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -317,10 +317,10 @@ on_enable_delete_changed (MateConfClient *client,
|
||||
gpointer user_data)
|
||||
{
|
||||
MateConfValue *value;
|
||||
GeditFileBrowserPluginData *data;
|
||||
PlumaFileBrowserPluginData *data;
|
||||
gboolean enable = FALSE;
|
||||
|
||||
data = (GeditFileBrowserPluginData *)(user_data);
|
||||
data = (PlumaFileBrowserPluginData *)(user_data);
|
||||
value = mateconf_entry_get_value (entry);
|
||||
|
||||
if (value && value->type == MATECONF_VALUE_BOOL)
|
||||
@@ -336,10 +336,10 @@ on_confirm_trash_changed (MateConfClient *client,
|
||||
gpointer user_data)
|
||||
{
|
||||
MateConfValue *value;
|
||||
GeditFileBrowserPluginData *data;
|
||||
PlumaFileBrowserPluginData *data;
|
||||
gboolean enable = FALSE;
|
||||
|
||||
data = (GeditFileBrowserPluginData *)(user_data);
|
||||
data = (PlumaFileBrowserPluginData *)(user_data);
|
||||
value = mateconf_entry_get_value (entry);
|
||||
|
||||
if (value && value->type == MATECONF_VALUE_BOOL)
|
||||
@@ -349,13 +349,13 @@ on_confirm_trash_changed (MateConfClient *client,
|
||||
}
|
||||
|
||||
static void
|
||||
install_caja_prefs (GeditFileBrowserPluginData *data)
|
||||
install_caja_prefs (PlumaFileBrowserPluginData *data)
|
||||
{
|
||||
MateConfClient *client;
|
||||
gchar *pref;
|
||||
gboolean prefb;
|
||||
GeditFileBrowserViewClickPolicy policy;
|
||||
GeditFileBrowserView *view;
|
||||
PlumaFileBrowserViewClickPolicy policy;
|
||||
PlumaFileBrowserView *view;
|
||||
|
||||
client = mateconf_client_get_default ();
|
||||
if (!client)
|
||||
@@ -373,8 +373,8 @@ install_caja_prefs (GeditFileBrowserPluginData *data)
|
||||
|
||||
policy = click_policy_from_string (pref);
|
||||
|
||||
view = gedit_file_browser_widget_get_browser_view (data->tree_widget);
|
||||
gedit_file_browser_view_set_click_policy (view, policy);
|
||||
view = pluma_file_browser_widget_get_browser_view (data->tree_widget);
|
||||
pluma_file_browser_view_set_click_policy (view, policy);
|
||||
|
||||
if (pref) {
|
||||
data->click_policy_handle =
|
||||
@@ -420,8 +420,8 @@ install_caja_prefs (GeditFileBrowserPluginData *data)
|
||||
}
|
||||
|
||||
static void
|
||||
set_root_from_doc (GeditFileBrowserPluginData * data,
|
||||
GeditDocument * doc)
|
||||
set_root_from_doc (PlumaFileBrowserPluginData * data,
|
||||
PlumaDocument * doc)
|
||||
{
|
||||
GFile *file;
|
||||
GFile *parent;
|
||||
@@ -429,7 +429,7 @@ set_root_from_doc (GeditFileBrowserPluginData * data,
|
||||
if (doc == NULL)
|
||||
return;
|
||||
|
||||
file = gedit_document_get_location (doc);
|
||||
file = pluma_document_get_location (doc);
|
||||
if (file == NULL)
|
||||
return;
|
||||
|
||||
@@ -440,7 +440,7 @@ set_root_from_doc (GeditFileBrowserPluginData * data,
|
||||
|
||||
root = g_file_get_uri (parent);
|
||||
|
||||
gedit_file_browser_widget_set_root (data->tree_widget,
|
||||
pluma_file_browser_widget_set_root (data->tree_widget,
|
||||
root,
|
||||
TRUE);
|
||||
|
||||
@@ -453,13 +453,13 @@ set_root_from_doc (GeditFileBrowserPluginData * data,
|
||||
|
||||
static void
|
||||
on_action_set_active_root (GtkAction * action,
|
||||
GeditWindow * window)
|
||||
PlumaWindow * window)
|
||||
{
|
||||
GeditFileBrowserPluginData *data;
|
||||
PlumaFileBrowserPluginData *data;
|
||||
|
||||
data = get_plugin_data (window);
|
||||
set_root_from_doc (data,
|
||||
gedit_window_get_active_document (window));
|
||||
pluma_window_get_active_document (window));
|
||||
}
|
||||
|
||||
static gchar *
|
||||
@@ -488,9 +488,9 @@ get_terminal (void)
|
||||
|
||||
static void
|
||||
on_action_open_terminal (GtkAction * action,
|
||||
GeditWindow * window)
|
||||
PlumaWindow * window)
|
||||
{
|
||||
GeditFileBrowserPluginData * data;
|
||||
PlumaFileBrowserPluginData * data;
|
||||
gchar * terminal;
|
||||
gchar * wd = NULL;
|
||||
gchar * local;
|
||||
@@ -498,18 +498,18 @@ on_action_open_terminal (GtkAction * action,
|
||||
GFile * file;
|
||||
|
||||
GtkTreeIter iter;
|
||||
GeditFileBrowserStore * store;
|
||||
PlumaFileBrowserStore * store;
|
||||
|
||||
data = get_plugin_data (window);
|
||||
|
||||
/* Get the current directory */
|
||||
if (!gedit_file_browser_widget_get_selected_directory (data->tree_widget, &iter))
|
||||
if (!pluma_file_browser_widget_get_selected_directory (data->tree_widget, &iter))
|
||||
return;
|
||||
|
||||
store = gedit_file_browser_widget_get_browser_store (data->tree_widget);
|
||||
store = pluma_file_browser_widget_get_browser_store (data->tree_widget);
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (store),
|
||||
&iter,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
&wd,
|
||||
-1);
|
||||
|
||||
@@ -541,9 +541,9 @@ on_action_open_terminal (GtkAction * action,
|
||||
|
||||
static void
|
||||
on_selection_changed_cb (GtkTreeSelection *selection,
|
||||
GeditWindow *window)
|
||||
PlumaWindow *window)
|
||||
{
|
||||
GeditFileBrowserPluginData * data;
|
||||
PlumaFileBrowserPluginData * data;
|
||||
GtkTreeView * tree_view;
|
||||
GtkTreeModel * model;
|
||||
GtkTreeIter iter;
|
||||
@@ -552,20 +552,20 @@ on_selection_changed_cb (GtkTreeSelection *selection,
|
||||
|
||||
data = get_plugin_data (window);
|
||||
|
||||
tree_view = GTK_TREE_VIEW (gedit_file_browser_widget_get_browser_view (data->tree_widget));
|
||||
tree_view = GTK_TREE_VIEW (pluma_file_browser_widget_get_browser_view (data->tree_widget));
|
||||
model = gtk_tree_view_get_model (tree_view);
|
||||
|
||||
if (!GEDIT_IS_FILE_BROWSER_STORE (model))
|
||||
if (!PLUMA_IS_FILE_BROWSER_STORE (model))
|
||||
return;
|
||||
|
||||
sensitive = gedit_file_browser_widget_get_selected_directory (data->tree_widget, &iter);
|
||||
sensitive = pluma_file_browser_widget_get_selected_directory (data->tree_widget, &iter);
|
||||
|
||||
if (sensitive) {
|
||||
gtk_tree_model_get (model, &iter,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
&uri, -1);
|
||||
|
||||
sensitive = gedit_utils_uri_has_file_scheme (uri);
|
||||
sensitive = pluma_utils_uri_has_file_scheme (uri);
|
||||
g_free (uri);
|
||||
}
|
||||
|
||||
@@ -608,15 +608,15 @@ static GtkActionEntry extra_single_selection_actions[] = {
|
||||
};
|
||||
|
||||
static void
|
||||
add_popup_ui (GeditWindow * window)
|
||||
add_popup_ui (PlumaWindow * window)
|
||||
{
|
||||
GeditFileBrowserPluginData * data;
|
||||
PlumaFileBrowserPluginData * data;
|
||||
GtkUIManager * manager;
|
||||
GtkActionGroup * action_group;
|
||||
GError * error = NULL;
|
||||
|
||||
data = get_plugin_data (window);
|
||||
manager = gedit_file_browser_widget_get_ui_manager (data->tree_widget);
|
||||
manager = pluma_file_browser_widget_get_ui_manager (data->tree_widget);
|
||||
|
||||
action_group = gtk_action_group_new ("FileBrowserPluginExtra");
|
||||
gtk_action_group_set_translation_domain (action_group, NULL);
|
||||
@@ -648,13 +648,13 @@ add_popup_ui (GeditWindow * window)
|
||||
}
|
||||
|
||||
static void
|
||||
remove_popup_ui (GeditWindow * window)
|
||||
remove_popup_ui (PlumaWindow * window)
|
||||
{
|
||||
GeditFileBrowserPluginData * data;
|
||||
PlumaFileBrowserPluginData * data;
|
||||
GtkUIManager * manager;
|
||||
|
||||
data = get_plugin_data (window);
|
||||
manager = gedit_file_browser_widget_get_ui_manager (data->tree_widget);
|
||||
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);
|
||||
@@ -665,35 +665,35 @@ remove_popup_ui (GeditWindow * window)
|
||||
}
|
||||
|
||||
static void
|
||||
impl_updateui (GeditPlugin * plugin, GeditWindow * window)
|
||||
impl_updateui (PlumaPlugin * plugin, PlumaWindow * window)
|
||||
{
|
||||
GeditFileBrowserPluginData * data;
|
||||
GeditDocument * doc;
|
||||
PlumaFileBrowserPluginData * data;
|
||||
PlumaDocument * doc;
|
||||
|
||||
data = get_plugin_data (window);
|
||||
|
||||
doc = gedit_window_get_active_document (window);
|
||||
doc = pluma_window_get_active_document (window);
|
||||
|
||||
gtk_action_set_sensitive (gtk_action_group_get_action (data->action_group,
|
||||
"SetActiveRoot"),
|
||||
doc != NULL &&
|
||||
!gedit_document_is_untitled (doc));
|
||||
!pluma_document_is_untitled (doc));
|
||||
}
|
||||
|
||||
static void
|
||||
impl_activate (GeditPlugin * plugin, GeditWindow * window)
|
||||
impl_activate (PlumaPlugin * plugin, PlumaWindow * window)
|
||||
{
|
||||
GeditPanel * panel;
|
||||
GeditFileBrowserPluginData * data;
|
||||
PlumaPanel * panel;
|
||||
PlumaFileBrowserPluginData * data;
|
||||
GtkWidget * image;
|
||||
GdkPixbuf * pixbuf;
|
||||
GeditFileBrowserStore * store;
|
||||
PlumaFileBrowserStore * store;
|
||||
gchar *data_dir;
|
||||
|
||||
data = g_new0 (GeditFileBrowserPluginData, 1);
|
||||
data = g_new0 (PlumaFileBrowserPluginData, 1);
|
||||
|
||||
data_dir = gedit_plugin_get_data_dir (plugin);
|
||||
data->tree_widget = GEDIT_FILE_BROWSER_WIDGET (gedit_file_browser_widget_new (data_dir));
|
||||
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);
|
||||
|
||||
g_signal_connect (data->tree_widget,
|
||||
@@ -719,14 +719,14 @@ impl_activate (GeditPlugin * plugin, GeditWindow * window)
|
||||
window);
|
||||
|
||||
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW
|
||||
(gedit_file_browser_widget_get_browser_view
|
||||
(pluma_file_browser_widget_get_browser_view
|
||||
(data->tree_widget))),
|
||||
"changed",
|
||||
G_CALLBACK (on_selection_changed_cb),
|
||||
window);
|
||||
|
||||
panel = gedit_window_get_side_panel (window);
|
||||
pixbuf = gedit_file_browser_utils_pixbuf_from_theme("system-file-manager",
|
||||
panel = pluma_window_get_side_panel (window);
|
||||
pixbuf = pluma_file_browser_utils_pixbuf_from_theme("system-file-manager",
|
||||
GTK_ICON_SIZE_MENU);
|
||||
|
||||
if (pixbuf) {
|
||||
@@ -737,7 +737,7 @@ impl_activate (GeditPlugin * plugin, GeditWindow * window)
|
||||
}
|
||||
|
||||
gtk_widget_show(image);
|
||||
gedit_panel_add_item (panel,
|
||||
pluma_panel_add_item (panel,
|
||||
GTK_WIDGET (data->tree_widget),
|
||||
_("File Browser"),
|
||||
image);
|
||||
@@ -753,12 +753,12 @@ impl_activate (GeditPlugin * plugin, GeditWindow * window)
|
||||
install_caja_prefs (data);
|
||||
|
||||
/* Connect signals to store the last visited location */
|
||||
g_signal_connect (gedit_file_browser_widget_get_browser_view (data->tree_widget),
|
||||
g_signal_connect (pluma_file_browser_widget_get_browser_view (data->tree_widget),
|
||||
"notify::model",
|
||||
G_CALLBACK (on_model_set_cb),
|
||||
window);
|
||||
|
||||
store = gedit_file_browser_widget_get_browser_store (data->tree_widget);
|
||||
store = pluma_file_browser_widget_get_browser_store (data->tree_widget);
|
||||
g_signal_connect (store,
|
||||
"notify::virtual-root",
|
||||
G_CALLBACK (on_virtual_root_changed_cb),
|
||||
@@ -780,22 +780,22 @@ impl_activate (GeditPlugin * plugin, GeditWindow * window)
|
||||
data);
|
||||
|
||||
/* Register messages on the bus */
|
||||
gedit_file_browser_messages_register (window, data->tree_widget);
|
||||
pluma_file_browser_messages_register (window, data->tree_widget);
|
||||
|
||||
impl_updateui (plugin, window);
|
||||
}
|
||||
|
||||
static void
|
||||
impl_deactivate (GeditPlugin * plugin, GeditWindow * window)
|
||||
impl_deactivate (PlumaPlugin * plugin, PlumaWindow * window)
|
||||
{
|
||||
GeditFileBrowserPluginData * data;
|
||||
GeditPanel * panel;
|
||||
PlumaFileBrowserPluginData * data;
|
||||
PlumaPanel * panel;
|
||||
MateConfClient *client;
|
||||
|
||||
data = get_plugin_data (window);
|
||||
|
||||
/* Unregister messages from the bus */
|
||||
gedit_file_browser_messages_unregister (window);
|
||||
pluma_file_browser_messages_unregister (window);
|
||||
|
||||
/* Disconnect signals */
|
||||
g_signal_handlers_disconnect_by_func (window,
|
||||
@@ -817,18 +817,18 @@ impl_deactivate (GeditPlugin * plugin, GeditWindow * window)
|
||||
g_object_unref (client);
|
||||
remove_popup_ui (window);
|
||||
|
||||
panel = gedit_window_get_side_panel (window);
|
||||
gedit_panel_remove_item (panel, GTK_WIDGET (data->tree_widget));
|
||||
panel = pluma_window_get_side_panel (window);
|
||||
pluma_panel_remove_item (panel, GTK_WIDGET (data->tree_widget));
|
||||
|
||||
g_free (data);
|
||||
g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
filetree_plugin_class_init (GeditFileBrowserPluginClass * klass)
|
||||
filetree_plugin_class_init (PlumaFileBrowserPluginClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GeditPluginClass * plugin_class = GEDIT_PLUGIN_CLASS (klass);
|
||||
PlumaPluginClass * plugin_class = PLUMA_PLUGIN_CLASS (klass);
|
||||
|
||||
object_class->finalize = filetree_plugin_finalize;
|
||||
|
||||
@@ -837,64 +837,64 @@ filetree_plugin_class_init (GeditFileBrowserPluginClass * klass)
|
||||
plugin_class->update_ui = impl_updateui;
|
||||
|
||||
g_type_class_add_private (object_class,
|
||||
sizeof (GeditFileBrowserPluginPrivate));
|
||||
sizeof (PlumaFileBrowserPluginPrivate));
|
||||
}
|
||||
|
||||
/* Callbacks */
|
||||
static void
|
||||
on_uri_activated_cb (GeditFileBrowserWidget * tree_widget,
|
||||
gchar const *uri, GeditWindow * window)
|
||||
on_uri_activated_cb (PlumaFileBrowserWidget * tree_widget,
|
||||
gchar const *uri, PlumaWindow * window)
|
||||
{
|
||||
gedit_commands_load_uri (window, uri, NULL, 0);
|
||||
pluma_commands_load_uri (window, uri, NULL, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
on_error_cb (GeditFileBrowserWidget * tree_widget,
|
||||
guint code, gchar const *message, GeditWindow * window)
|
||||
on_error_cb (PlumaFileBrowserWidget * tree_widget,
|
||||
guint code, gchar const *message, PlumaWindow * window)
|
||||
{
|
||||
gchar * title;
|
||||
GtkWidget * dlg;
|
||||
GeditFileBrowserPluginData * data;
|
||||
PlumaFileBrowserPluginData * data;
|
||||
|
||||
data = get_plugin_data (window);
|
||||
|
||||
/* Do not show the error when the root has been set automatically */
|
||||
if (data->auto_root && (code == GEDIT_FILE_BROWSER_ERROR_SET_ROOT ||
|
||||
code == GEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY))
|
||||
if (data->auto_root && (code == PLUMA_FILE_BROWSER_ERROR_SET_ROOT ||
|
||||
code == PLUMA_FILE_BROWSER_ERROR_LOAD_DIRECTORY))
|
||||
{
|
||||
/* Show bookmarks */
|
||||
gedit_file_browser_widget_show_bookmarks (data->tree_widget);
|
||||
pluma_file_browser_widget_show_bookmarks (data->tree_widget);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (code) {
|
||||
case GEDIT_FILE_BROWSER_ERROR_NEW_DIRECTORY:
|
||||
case PLUMA_FILE_BROWSER_ERROR_NEW_DIRECTORY:
|
||||
title =
|
||||
_("An error occurred while creating a new directory");
|
||||
break;
|
||||
case GEDIT_FILE_BROWSER_ERROR_NEW_FILE:
|
||||
case PLUMA_FILE_BROWSER_ERROR_NEW_FILE:
|
||||
title = _("An error occurred while creating a new file");
|
||||
break;
|
||||
case GEDIT_FILE_BROWSER_ERROR_RENAME:
|
||||
case PLUMA_FILE_BROWSER_ERROR_RENAME:
|
||||
title =
|
||||
_
|
||||
("An error occurred while renaming a file or directory");
|
||||
break;
|
||||
case GEDIT_FILE_BROWSER_ERROR_DELETE:
|
||||
case PLUMA_FILE_BROWSER_ERROR_DELETE:
|
||||
title =
|
||||
_
|
||||
("An error occurred while deleting a file or directory");
|
||||
break;
|
||||
case GEDIT_FILE_BROWSER_ERROR_OPEN_DIRECTORY:
|
||||
case PLUMA_FILE_BROWSER_ERROR_OPEN_DIRECTORY:
|
||||
title =
|
||||
_
|
||||
("An error occurred while opening a directory in the file manager");
|
||||
break;
|
||||
case GEDIT_FILE_BROWSER_ERROR_SET_ROOT:
|
||||
case PLUMA_FILE_BROWSER_ERROR_SET_ROOT:
|
||||
title =
|
||||
_("An error occurred while setting a root directory");
|
||||
break;
|
||||
case GEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY:
|
||||
case PLUMA_FILE_BROWSER_ERROR_LOAD_DIRECTORY:
|
||||
title =
|
||||
_("An error occurred while loading a directory");
|
||||
break;
|
||||
@@ -916,15 +916,15 @@ on_error_cb (GeditFileBrowserWidget * tree_widget,
|
||||
}
|
||||
|
||||
static void
|
||||
on_model_set_cb (GeditFileBrowserView * widget,
|
||||
on_model_set_cb (PlumaFileBrowserView * widget,
|
||||
GParamSpec *arg1,
|
||||
GeditWindow * window)
|
||||
PlumaWindow * window)
|
||||
{
|
||||
GeditFileBrowserPluginData * data = get_plugin_data (window);
|
||||
PlumaFileBrowserPluginData * data = get_plugin_data (window);
|
||||
GtkTreeModel * model;
|
||||
MateConfClient * client;
|
||||
|
||||
model = gtk_tree_view_get_model (GTK_TREE_VIEW (gedit_file_browser_widget_get_browser_view (data->tree_widget)));
|
||||
model = gtk_tree_view_get_model (GTK_TREE_VIEW (pluma_file_browser_widget_get_browser_view (data->tree_widget)));
|
||||
|
||||
if (model == NULL)
|
||||
return;
|
||||
@@ -932,38 +932,38 @@ on_model_set_cb (GeditFileBrowserView * widget,
|
||||
client = mateconf_client_get_default ();
|
||||
mateconf_client_set_bool (client,
|
||||
FILE_BROWSER_BASE_KEY "/on_load/tree_view",
|
||||
GEDIT_IS_FILE_BROWSER_STORE (model),
|
||||
PLUMA_IS_FILE_BROWSER_STORE (model),
|
||||
NULL);
|
||||
g_object_unref (client);
|
||||
}
|
||||
|
||||
static void
|
||||
on_filter_mode_changed_cb (GeditFileBrowserStore * model,
|
||||
on_filter_mode_changed_cb (PlumaFileBrowserStore * model,
|
||||
GParamSpec * param,
|
||||
GeditWindow * window)
|
||||
PlumaWindow * window)
|
||||
{
|
||||
MateConfClient * client;
|
||||
GeditFileBrowserStoreFilterMode mode;
|
||||
PlumaFileBrowserStoreFilterMode mode;
|
||||
|
||||
client = mateconf_client_get_default ();
|
||||
|
||||
if (!client)
|
||||
return;
|
||||
|
||||
mode = gedit_file_browser_store_get_filter_mode (model);
|
||||
mode = pluma_file_browser_store_get_filter_mode (model);
|
||||
|
||||
if ((mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) &&
|
||||
(mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY)) {
|
||||
if ((mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) &&
|
||||
(mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY)) {
|
||||
mateconf_client_set_string (client,
|
||||
FILE_BROWSER_BASE_KEY "/filter_mode",
|
||||
"hidden_and_binary",
|
||||
NULL);
|
||||
} else if (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) {
|
||||
} else if (mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) {
|
||||
mateconf_client_set_string (client,
|
||||
FILE_BROWSER_BASE_KEY "/filter_mode",
|
||||
"hidden",
|
||||
NULL);
|
||||
} else if (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY) {
|
||||
} else if (mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY) {
|
||||
mateconf_client_set_string (client,
|
||||
FILE_BROWSER_BASE_KEY "/filter_mode",
|
||||
"binary",
|
||||
@@ -980,30 +980,30 @@ on_filter_mode_changed_cb (GeditFileBrowserStore * model,
|
||||
}
|
||||
|
||||
static void
|
||||
on_rename_cb (GeditFileBrowserStore * store,
|
||||
on_rename_cb (PlumaFileBrowserStore * store,
|
||||
const gchar * olduri,
|
||||
const gchar * newuri,
|
||||
GeditWindow * window)
|
||||
PlumaWindow * window)
|
||||
{
|
||||
GeditApp * app;
|
||||
PlumaApp * app;
|
||||
GList * documents;
|
||||
GList * item;
|
||||
GeditDocument * doc;
|
||||
PlumaDocument * doc;
|
||||
GFile * docfile;
|
||||
GFile * oldfile;
|
||||
GFile * newfile;
|
||||
gchar * uri;
|
||||
|
||||
/* Find all documents and set its uri to newuri where it matches olduri */
|
||||
app = gedit_app_get_default ();
|
||||
documents = gedit_app_get_documents (app);
|
||||
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 = GEDIT_DOCUMENT (item->data);
|
||||
uri = gedit_document_get_uri (doc);
|
||||
doc = PLUMA_DOCUMENT (item->data);
|
||||
uri = pluma_document_get_uri (doc);
|
||||
|
||||
if (!uri)
|
||||
continue;
|
||||
@@ -1011,7 +1011,7 @@ on_rename_cb (GeditFileBrowserStore * store,
|
||||
docfile = g_file_new_for_uri (uri);
|
||||
|
||||
if (g_file_equal (docfile, oldfile)) {
|
||||
gedit_document_set_uri (doc, newuri);
|
||||
pluma_document_set_uri (doc, newuri);
|
||||
} else {
|
||||
gchar *relative;
|
||||
|
||||
@@ -1027,7 +1027,7 @@ on_rename_cb (GeditFileBrowserStore * store,
|
||||
docfile = g_file_get_child (newfile, relative);
|
||||
uri = g_file_get_uri (docfile);
|
||||
|
||||
gedit_document_set_uri (doc, uri);
|
||||
pluma_document_set_uri (doc, uri);
|
||||
}
|
||||
|
||||
g_free (relative);
|
||||
@@ -1044,9 +1044,9 @@ on_rename_cb (GeditFileBrowserStore * store,
|
||||
}
|
||||
|
||||
static void
|
||||
on_filter_pattern_changed_cb (GeditFileBrowserWidget * widget,
|
||||
on_filter_pattern_changed_cb (PlumaFileBrowserWidget * widget,
|
||||
GParamSpec * param,
|
||||
GeditWindow * window)
|
||||
PlumaWindow * window)
|
||||
{
|
||||
MateConfClient * client;
|
||||
gchar * pattern;
|
||||
@@ -1073,16 +1073,16 @@ on_filter_pattern_changed_cb (GeditFileBrowserWidget * widget,
|
||||
}
|
||||
|
||||
static void
|
||||
on_virtual_root_changed_cb (GeditFileBrowserStore * store,
|
||||
on_virtual_root_changed_cb (PlumaFileBrowserStore * store,
|
||||
GParamSpec * param,
|
||||
GeditWindow * window)
|
||||
PlumaWindow * window)
|
||||
{
|
||||
GeditFileBrowserPluginData * data = get_plugin_data (window);
|
||||
PlumaFileBrowserPluginData * data = get_plugin_data (window);
|
||||
gchar * root;
|
||||
gchar * virtual_root;
|
||||
MateConfClient * client;
|
||||
|
||||
root = gedit_file_browser_store_get_root (store);
|
||||
root = pluma_file_browser_store_get_root (store);
|
||||
|
||||
if (!root)
|
||||
return;
|
||||
@@ -1097,7 +1097,7 @@ on_virtual_root_changed_cb (GeditFileBrowserStore * store,
|
||||
root,
|
||||
NULL);
|
||||
|
||||
virtual_root = gedit_file_browser_store_get_virtual_root (store);
|
||||
virtual_root = pluma_file_browser_store_get_virtual_root (store);
|
||||
|
||||
if (!virtual_root) {
|
||||
/* Set virtual to same as root then */
|
||||
@@ -1122,9 +1122,9 @@ on_virtual_root_changed_cb (GeditFileBrowserStore * store,
|
||||
}
|
||||
|
||||
static void
|
||||
on_tab_added_cb (GeditWindow * window,
|
||||
GeditTab * tab,
|
||||
GeditFileBrowserPluginData * data)
|
||||
on_tab_added_cb (PlumaWindow * window,
|
||||
PlumaTab * tab,
|
||||
PlumaFileBrowserPluginData * data)
|
||||
{
|
||||
MateConfClient *client;
|
||||
gboolean open;
|
||||
@@ -1140,14 +1140,14 @@ on_tab_added_cb (GeditWindow * window,
|
||||
NULL);
|
||||
|
||||
if (open) {
|
||||
GeditDocument *doc;
|
||||
PlumaDocument *doc;
|
||||
gchar *uri;
|
||||
|
||||
doc = gedit_tab_get_document (tab);
|
||||
doc = pluma_tab_get_document (tab);
|
||||
|
||||
uri = gedit_document_get_uri (doc);
|
||||
uri = pluma_document_get_uri (doc);
|
||||
|
||||
if (uri != NULL && gedit_utils_uri_has_file_scheme (uri)) {
|
||||
if (uri != NULL && pluma_utils_uri_has_file_scheme (uri)) {
|
||||
prepare_auto_root (data);
|
||||
set_root_from_doc (data, doc);
|
||||
load_default = FALSE;
|
||||
@@ -1175,16 +1175,16 @@ get_filename_from_path (GtkTreeModel *model, GtkTreePath *path)
|
||||
|
||||
gtk_tree_model_get_iter (model, &iter, path);
|
||||
gtk_tree_model_get (model, &iter,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
|
||||
-1);
|
||||
|
||||
return gedit_file_browser_utils_uri_basename (uri);
|
||||
return pluma_file_browser_utils_uri_basename (uri);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_confirm_no_trash_cb (GeditFileBrowserWidget * widget,
|
||||
on_confirm_no_trash_cb (PlumaFileBrowserWidget * widget,
|
||||
GList * files,
|
||||
GeditWindow * window)
|
||||
PlumaWindow * window)
|
||||
{
|
||||
gchar *normal;
|
||||
gchar *message;
|
||||
@@ -1194,14 +1194,14 @@ on_confirm_no_trash_cb (GeditFileBrowserWidget * widget,
|
||||
message = _("Cannot move file to trash, do you\nwant to delete permanently?");
|
||||
|
||||
if (files->next == NULL) {
|
||||
normal = gedit_file_browser_utils_file_basename (G_FILE (files->data));
|
||||
normal = pluma_file_browser_utils_file_basename (G_FILE (files->data));
|
||||
secondary = g_strdup_printf (_("The file \"%s\" cannot be moved to the trash."), normal);
|
||||
g_free (normal);
|
||||
} else {
|
||||
secondary = g_strdup (_("The selected files cannot be moved to the trash."));
|
||||
}
|
||||
|
||||
result = gedit_file_browser_utils_confirmation_dialog (window,
|
||||
result = pluma_file_browser_utils_confirmation_dialog (window,
|
||||
GTK_MESSAGE_QUESTION,
|
||||
message,
|
||||
secondary,
|
||||
@@ -1213,16 +1213,16 @@ on_confirm_no_trash_cb (GeditFileBrowserWidget * widget,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_confirm_delete_cb (GeditFileBrowserWidget *widget,
|
||||
GeditFileBrowserStore *store,
|
||||
on_confirm_delete_cb (PlumaFileBrowserWidget *widget,
|
||||
PlumaFileBrowserStore *store,
|
||||
GList *paths,
|
||||
GeditWindow *window)
|
||||
PlumaWindow *window)
|
||||
{
|
||||
gchar *normal;
|
||||
gchar *message;
|
||||
gchar *secondary;
|
||||
gboolean result;
|
||||
GeditFileBrowserPluginData *data;
|
||||
PlumaFileBrowserPluginData *data;
|
||||
|
||||
data = get_plugin_data (window);
|
||||
|
||||
@@ -1239,7 +1239,7 @@ on_confirm_delete_cb (GeditFileBrowserWidget *widget,
|
||||
|
||||
secondary = _("If you delete an item, it is permanently lost.");
|
||||
|
||||
result = gedit_file_browser_utils_confirmation_dialog (window,
|
||||
result = pluma_file_browser_utils_confirmation_dialog (window,
|
||||
GTK_MESSAGE_QUESTION,
|
||||
message,
|
||||
secondary,
|
71
plugins/filebrowser/pluma-file-browser-plugin.h
Executable file
71
plugins/filebrowser/pluma-file-browser-plugin.h
Executable file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* pluma-file-browser-plugin.h - Pluma plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __PLUMA_FILE_BROWSER_PLUGIN_H__
|
||||
#define __PLUMA_FILE_BROWSER_PLUGIN_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <pluma/pluma-plugin.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
/*
|
||||
* Type checking and casting macros
|
||||
*/
|
||||
#define PLUMA_TYPE_FILE_BROWSER_PLUGIN (filetree_plugin_get_type ())
|
||||
#define PLUMA_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_FILE_BROWSER_PLUGIN, PlumaFileBrowserPlugin))
|
||||
#define PLUMA_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_FILE_BROWSER_PLUGIN, PlumaFileBrowserPluginClass))
|
||||
#define PLUMA_IS_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_FILE_BROWSER_PLUGIN))
|
||||
#define PLUMA_IS_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_FILE_BROWSER_PLUGIN))
|
||||
#define PLUMA_FILE_BROWSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_FILE_BROWSER_PLUGIN, PlumaFileBrowserPluginClass))
|
||||
|
||||
/* Private structure type */
|
||||
typedef struct _PlumaFileBrowserPluginPrivate PlumaFileBrowserPluginPrivate;
|
||||
typedef struct _PlumaFileBrowserPlugin PlumaFileBrowserPlugin;
|
||||
typedef struct _PlumaFileBrowserPluginClass PlumaFileBrowserPluginClass;
|
||||
|
||||
struct _PlumaFileBrowserPlugin
|
||||
{
|
||||
PlumaPlugin parent_instance;
|
||||
|
||||
/*< private > */
|
||||
PlumaFileBrowserPluginPrivate *priv;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct _PlumaFileBrowserPluginClass
|
||||
{
|
||||
PlumaPluginClass parent_class;
|
||||
};
|
||||
|
||||
/*
|
||||
* Public methods
|
||||
*/
|
||||
GType filetree_plugin_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* All the plugins must implement this function */
|
||||
G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule * module);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __PLUMA_FILE_BROWSER_PLUGIN_H__ */
|
||||
|
||||
// ex:ts=8:noet:
|
File diff suppressed because it is too large
Load Diff
200
plugins/filebrowser/pluma-file-browser-store.h
Executable file
200
plugins/filebrowser/pluma-file-browser-store.h
Executable file
@@ -0,0 +1,200 @@
|
||||
/*
|
||||
* pluma-file-browser-store.h - Pluma plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __PLUMA_FILE_BROWSER_STORE_H__
|
||||
#define __PLUMA_FILE_BROWSER_STORE_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define PLUMA_TYPE_FILE_BROWSER_STORE (pluma_file_browser_store_get_type ())
|
||||
#define PLUMA_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_STORE, PlumaFileBrowserStore))
|
||||
#define PLUMA_FILE_BROWSER_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_STORE, PlumaFileBrowserStore const))
|
||||
#define PLUMA_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLUMA_TYPE_FILE_BROWSER_STORE, PlumaFileBrowserStoreClass))
|
||||
#define PLUMA_IS_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUMA_TYPE_FILE_BROWSER_STORE))
|
||||
#define PLUMA_IS_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_FILE_BROWSER_STORE))
|
||||
#define PLUMA_FILE_BROWSER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_FILE_BROWSER_STORE, PlumaFileBrowserStoreClass))
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_ICON = 0,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_NAME,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_EMBLEM,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_NUM
|
||||
} PlumaFileBrowserStoreColumn;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PLUMA_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY = 1 << 0,
|
||||
PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN = 1 << 1,
|
||||
PLUMA_FILE_BROWSER_STORE_FLAG_IS_TEXT = 1 << 2,
|
||||
PLUMA_FILE_BROWSER_STORE_FLAG_LOADED = 1 << 3,
|
||||
PLUMA_FILE_BROWSER_STORE_FLAG_IS_FILTERED = 1 << 4,
|
||||
PLUMA_FILE_BROWSER_STORE_FLAG_IS_DUMMY = 1 << 5
|
||||
} PlumaFileBrowserStoreFlag;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PLUMA_FILE_BROWSER_STORE_RESULT_OK,
|
||||
PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE,
|
||||
PLUMA_FILE_BROWSER_STORE_RESULT_ERROR,
|
||||
PLUMA_FILE_BROWSER_STORE_RESULT_NO_TRASH,
|
||||
PLUMA_FILE_BROWSER_STORE_RESULT_MOUNTING,
|
||||
PLUMA_FILE_BROWSER_STORE_RESULT_NUM
|
||||
} PlumaFileBrowserStoreResult;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PLUMA_FILE_BROWSER_STORE_FILTER_MODE_NONE = 0,
|
||||
PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN = 1 << 0,
|
||||
PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY = 1 << 1
|
||||
} PlumaFileBrowserStoreFilterMode;
|
||||
|
||||
#define FILE_IS_DIR(flags) (flags & PLUMA_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY)
|
||||
#define FILE_IS_HIDDEN(flags) (flags & PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN)
|
||||
#define FILE_IS_TEXT(flags) (flags & PLUMA_FILE_BROWSER_STORE_FLAG_IS_TEXT)
|
||||
#define FILE_LOADED(flags) (flags & PLUMA_FILE_BROWSER_STORE_FLAG_LOADED)
|
||||
#define FILE_IS_FILTERED(flags) (flags & PLUMA_FILE_BROWSER_STORE_FLAG_IS_FILTERED)
|
||||
#define FILE_IS_DUMMY(flags) (flags & PLUMA_FILE_BROWSER_STORE_FLAG_IS_DUMMY)
|
||||
|
||||
typedef struct _PlumaFileBrowserStore PlumaFileBrowserStore;
|
||||
typedef struct _PlumaFileBrowserStoreClass PlumaFileBrowserStoreClass;
|
||||
typedef struct _PlumaFileBrowserStorePrivate PlumaFileBrowserStorePrivate;
|
||||
|
||||
typedef gboolean (*PlumaFileBrowserStoreFilterFunc) (PlumaFileBrowserStore
|
||||
* model,
|
||||
GtkTreeIter * iter,
|
||||
gpointer user_data);
|
||||
|
||||
struct _PlumaFileBrowserStore
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
PlumaFileBrowserStorePrivate *priv;
|
||||
};
|
||||
|
||||
struct _PlumaFileBrowserStoreClass {
|
||||
GObjectClass parent_class;
|
||||
|
||||
/* Signals */
|
||||
void (*begin_loading) (PlumaFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
void (*end_loading) (PlumaFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
void (*error) (PlumaFileBrowserStore * model,
|
||||
guint code,
|
||||
gchar * message);
|
||||
gboolean (*no_trash) (PlumaFileBrowserStore * model,
|
||||
GList * files);
|
||||
void (*rename) (PlumaFileBrowserStore * model,
|
||||
const gchar * olduri,
|
||||
const gchar * newuri);
|
||||
void (*begin_refresh) (PlumaFileBrowserStore * model);
|
||||
void (*end_refresh) (PlumaFileBrowserStore * model);
|
||||
void (*unload) (PlumaFileBrowserStore * model,
|
||||
const gchar * uri);
|
||||
};
|
||||
|
||||
GType pluma_file_browser_store_get_type (void) G_GNUC_CONST;
|
||||
GType pluma_file_browser_store_register_type (GTypeModule * module);
|
||||
|
||||
PlumaFileBrowserStore *pluma_file_browser_store_new (gchar const *root);
|
||||
|
||||
PlumaFileBrowserStoreResult
|
||||
pluma_file_browser_store_set_root_and_virtual_root (PlumaFileBrowserStore * model,
|
||||
gchar const *root,
|
||||
gchar const *virtual_root);
|
||||
PlumaFileBrowserStoreResult
|
||||
pluma_file_browser_store_set_root (PlumaFileBrowserStore * model,
|
||||
gchar const *root);
|
||||
PlumaFileBrowserStoreResult
|
||||
pluma_file_browser_store_set_virtual_root (PlumaFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
PlumaFileBrowserStoreResult
|
||||
pluma_file_browser_store_set_virtual_root_from_string (PlumaFileBrowserStore * model,
|
||||
gchar const *root);
|
||||
PlumaFileBrowserStoreResult
|
||||
pluma_file_browser_store_set_virtual_root_up (PlumaFileBrowserStore * model);
|
||||
PlumaFileBrowserStoreResult
|
||||
pluma_file_browser_store_set_virtual_root_top (PlumaFileBrowserStore * model);
|
||||
|
||||
gboolean
|
||||
pluma_file_browser_store_get_iter_virtual_root (PlumaFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
gboolean pluma_file_browser_store_get_iter_root (PlumaFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
gchar * pluma_file_browser_store_get_root (PlumaFileBrowserStore * model);
|
||||
gchar * pluma_file_browser_store_get_virtual_root (PlumaFileBrowserStore * model);
|
||||
|
||||
gboolean pluma_file_browser_store_iter_equal (PlumaFileBrowserStore * model,
|
||||
GtkTreeIter * iter1,
|
||||
GtkTreeIter * iter2);
|
||||
|
||||
void pluma_file_browser_store_set_value (PlumaFileBrowserStore * tree_model,
|
||||
GtkTreeIter * iter,
|
||||
gint column,
|
||||
GValue * value);
|
||||
|
||||
void _pluma_file_browser_store_iter_expanded (PlumaFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
void _pluma_file_browser_store_iter_collapsed (PlumaFileBrowserStore * model,
|
||||
GtkTreeIter * iter);
|
||||
|
||||
PlumaFileBrowserStoreFilterMode
|
||||
pluma_file_browser_store_get_filter_mode (PlumaFileBrowserStore * model);
|
||||
void pluma_file_browser_store_set_filter_mode (PlumaFileBrowserStore * model,
|
||||
PlumaFileBrowserStoreFilterMode mode);
|
||||
void pluma_file_browser_store_set_filter_func (PlumaFileBrowserStore * model,
|
||||
PlumaFileBrowserStoreFilterFunc func,
|
||||
gpointer user_data);
|
||||
void pluma_file_browser_store_refilter (PlumaFileBrowserStore * model);
|
||||
PlumaFileBrowserStoreFilterMode
|
||||
pluma_file_browser_store_filter_mode_get_default (void);
|
||||
|
||||
void pluma_file_browser_store_refresh (PlumaFileBrowserStore * model);
|
||||
gboolean pluma_file_browser_store_rename (PlumaFileBrowserStore * model,
|
||||
GtkTreeIter * iter,
|
||||
gchar const *new_name,
|
||||
GError ** error);
|
||||
PlumaFileBrowserStoreResult
|
||||
pluma_file_browser_store_delete (PlumaFileBrowserStore * model,
|
||||
GtkTreeIter * iter,
|
||||
gboolean trash);
|
||||
PlumaFileBrowserStoreResult
|
||||
pluma_file_browser_store_delete_all (PlumaFileBrowserStore * model,
|
||||
GList *rows,
|
||||
gboolean trash);
|
||||
|
||||
gboolean pluma_file_browser_store_new_file (PlumaFileBrowserStore * model,
|
||||
GtkTreeIter * parent,
|
||||
GtkTreeIter * iter);
|
||||
gboolean pluma_file_browser_store_new_directory (PlumaFileBrowserStore * model,
|
||||
GtkTreeIter * parent,
|
||||
GtkTreeIter * iter);
|
||||
|
||||
void pluma_file_browser_store_cancel_mount_operation (PlumaFileBrowserStore *store);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __PLUMA_FILE_BROWSER_STORE_H__ */
|
||||
|
||||
// ex:ts=8:noet:
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* gedit-file-bookmarks-store.c - Gedit plugin providing easy file access
|
||||
* pluma-file-bookmarks-store.c - Pluma plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
@@ -19,8 +19,8 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "gedit-file-browser-utils.h"
|
||||
#include <gedit/gedit-utils.h>
|
||||
#include "pluma-file-browser-utils.h"
|
||||
#include <pluma/pluma-utils.h>
|
||||
|
||||
static GdkPixbuf *
|
||||
process_icon_pixbuf (GdkPixbuf * pixbuf,
|
||||
@@ -50,7 +50,7 @@ process_icon_pixbuf (GdkPixbuf * pixbuf,
|
||||
}
|
||||
|
||||
GdkPixbuf *
|
||||
gedit_file_browser_utils_pixbuf_from_theme (gchar const * name,
|
||||
pluma_file_browser_utils_pixbuf_from_theme (gchar const * name,
|
||||
GtkIconSize size)
|
||||
{
|
||||
gint width;
|
||||
@@ -71,7 +71,7 @@ gedit_file_browser_utils_pixbuf_from_theme (gchar const * name,
|
||||
}
|
||||
|
||||
GdkPixbuf *
|
||||
gedit_file_browser_utils_pixbuf_from_icon (GIcon * icon,
|
||||
pluma_file_browser_utils_pixbuf_from_icon (GIcon * icon,
|
||||
GtkIconSize size)
|
||||
{
|
||||
GdkPixbuf * ret = NULL;
|
||||
@@ -100,7 +100,7 @@ gedit_file_browser_utils_pixbuf_from_icon (GIcon * icon,
|
||||
}
|
||||
|
||||
GdkPixbuf *
|
||||
gedit_file_browser_utils_pixbuf_from_file (GFile * file,
|
||||
pluma_file_browser_utils_pixbuf_from_file (GFile * file,
|
||||
GtkIconSize size)
|
||||
{
|
||||
GIcon * icon;
|
||||
@@ -118,7 +118,7 @@ gedit_file_browser_utils_pixbuf_from_file (GFile * file,
|
||||
|
||||
icon = g_file_info_get_icon (info);
|
||||
if (icon != NULL)
|
||||
ret = gedit_file_browser_utils_pixbuf_from_icon (icon, size);
|
||||
ret = pluma_file_browser_utils_pixbuf_from_icon (icon, size);
|
||||
|
||||
g_object_unref (info);
|
||||
|
||||
@@ -126,26 +126,26 @@ gedit_file_browser_utils_pixbuf_from_file (GFile * file,
|
||||
}
|
||||
|
||||
gchar *
|
||||
gedit_file_browser_utils_file_basename (GFile * file)
|
||||
pluma_file_browser_utils_file_basename (GFile * file)
|
||||
{
|
||||
gchar *uri;
|
||||
gchar *ret;
|
||||
|
||||
uri = g_file_get_uri (file);
|
||||
ret = gedit_file_browser_utils_uri_basename (uri);
|
||||
ret = pluma_file_browser_utils_uri_basename (uri);
|
||||
g_free (uri);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gedit_file_browser_utils_uri_basename (gchar const * uri)
|
||||
pluma_file_browser_utils_uri_basename (gchar const * uri)
|
||||
{
|
||||
return gedit_utils_basename_for_display (uri);
|
||||
return pluma_utils_basename_for_display (uri);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gedit_file_browser_utils_confirmation_dialog (GeditWindow * window,
|
||||
pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
|
||||
GtkMessageType type,
|
||||
gchar const *message,
|
||||
gchar const *secondary,
|
@@ -1,27 +1,27 @@
|
||||
#ifndef __GEDIT_FILE_BROWSER_UTILS_H__
|
||||
#define __GEDIT_FILE_BROWSER_UTILS_H__
|
||||
#ifndef __PLUMA_FILE_BROWSER_UTILS_H__
|
||||
#define __PLUMA_FILE_BROWSER_UTILS_H__
|
||||
|
||||
#include <gedit/gedit-window.h>
|
||||
#include <pluma/pluma-window.h>
|
||||
#include <gio/gio.h>
|
||||
|
||||
GdkPixbuf *gedit_file_browser_utils_pixbuf_from_theme (gchar const *name,
|
||||
GdkPixbuf *pluma_file_browser_utils_pixbuf_from_theme (gchar const *name,
|
||||
GtkIconSize size);
|
||||
|
||||
GdkPixbuf *gedit_file_browser_utils_pixbuf_from_icon (GIcon * icon,
|
||||
GdkPixbuf *pluma_file_browser_utils_pixbuf_from_icon (GIcon * icon,
|
||||
GtkIconSize size);
|
||||
GdkPixbuf *gedit_file_browser_utils_pixbuf_from_file (GFile * file,
|
||||
GdkPixbuf *pluma_file_browser_utils_pixbuf_from_file (GFile * file,
|
||||
GtkIconSize size);
|
||||
|
||||
gchar * gedit_file_browser_utils_file_basename (GFile * file);
|
||||
gchar * gedit_file_browser_utils_uri_basename (gchar const * uri);
|
||||
gchar * pluma_file_browser_utils_file_basename (GFile * file);
|
||||
gchar * pluma_file_browser_utils_uri_basename (gchar const * uri);
|
||||
|
||||
gboolean gedit_file_browser_utils_confirmation_dialog (GeditWindow * window,
|
||||
gboolean pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
|
||||
GtkMessageType type,
|
||||
gchar const *message,
|
||||
gchar const *secondary,
|
||||
gchar const * button_stock,
|
||||
gchar const * button_label);
|
||||
|
||||
#endif /* __GEDIT_FILE_BROWSER_UTILS_H__ */
|
||||
#endif /* __PLUMA_FILE_BROWSER_UTILS_H__ */
|
||||
|
||||
// ex:ts=8:noet:
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* gedit-file-browser-view.c - Gedit plugin providing easy file access
|
||||
* pluma-file-browser-view.c - Pluma plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
@@ -21,20 +21,20 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <gio/gio.h>
|
||||
#include <gedit/gedit-plugin.h>
|
||||
#include <pluma/pluma-plugin.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
#include "gedit-file-browser-store.h"
|
||||
#include "gedit-file-bookmarks-store.h"
|
||||
#include "gedit-file-browser-view.h"
|
||||
#include "gedit-file-browser-marshal.h"
|
||||
#include "gedit-file-browser-enum-types.h"
|
||||
#include "pluma-file-browser-store.h"
|
||||
#include "pluma-file-bookmarks-store.h"
|
||||
#include "pluma-file-browser-view.h"
|
||||
#include "pluma-file-browser-marshal.h"
|
||||
#include "pluma-file-browser-enum-types.h"
|
||||
|
||||
#define GEDIT_FILE_BROWSER_VIEW_GET_PRIVATE(object)( \
|
||||
#define PLUMA_FILE_BROWSER_VIEW_GET_PRIVATE(object)( \
|
||||
G_TYPE_INSTANCE_GET_PRIVATE((object), \
|
||||
GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserViewPrivate))
|
||||
PLUMA_TYPE_FILE_BROWSER_VIEW, PlumaFileBrowserViewPrivate))
|
||||
|
||||
struct _GeditFileBrowserViewPrivate
|
||||
struct _PlumaFileBrowserViewPrivate
|
||||
{
|
||||
GtkTreeViewColumn *column;
|
||||
GtkCellRenderer *pixbuf_renderer;
|
||||
@@ -46,7 +46,7 @@ struct _GeditFileBrowserViewPrivate
|
||||
GdkCursor *busy_cursor;
|
||||
|
||||
/* CLick policy */
|
||||
GeditFileBrowserViewClickPolicy click_policy;
|
||||
PlumaFileBrowserViewClickPolicy click_policy;
|
||||
GtkTreePath *double_click_path[2]; /* Both clicks in a double click need to be on the same row */
|
||||
GtkTreePath *hover_path;
|
||||
GdkCursor *hand_cursor;
|
||||
@@ -85,32 +85,32 @@ static const GtkTargetEntry drag_source_targets[] = {
|
||||
{ "text/uri-list", 0, 0 }
|
||||
};
|
||||
|
||||
GEDIT_PLUGIN_DEFINE_TYPE (GeditFileBrowserView, gedit_file_browser_view,
|
||||
PLUMA_PLUGIN_DEFINE_TYPE (PlumaFileBrowserView, pluma_file_browser_view,
|
||||
GTK_TYPE_TREE_VIEW)
|
||||
|
||||
static void on_cell_edited (GtkCellRendererText * cell,
|
||||
gchar * path,
|
||||
gchar * new_text,
|
||||
GeditFileBrowserView * tree_view);
|
||||
PlumaFileBrowserView * tree_view);
|
||||
|
||||
static void on_begin_refresh (GeditFileBrowserStore * model,
|
||||
GeditFileBrowserView * view);
|
||||
static void on_end_refresh (GeditFileBrowserStore * model,
|
||||
GeditFileBrowserView * view);
|
||||
static void on_begin_refresh (PlumaFileBrowserStore * model,
|
||||
PlumaFileBrowserView * view);
|
||||
static void on_end_refresh (PlumaFileBrowserStore * model,
|
||||
PlumaFileBrowserView * view);
|
||||
|
||||
static void on_unload (GeditFileBrowserStore * model,
|
||||
static void on_unload (PlumaFileBrowserStore * model,
|
||||
gchar const * uri,
|
||||
GeditFileBrowserView * view);
|
||||
PlumaFileBrowserView * view);
|
||||
|
||||
static void on_row_inserted (GeditFileBrowserStore * model,
|
||||
static void on_row_inserted (PlumaFileBrowserStore * model,
|
||||
GtkTreePath * path,
|
||||
GtkTreeIter * iter,
|
||||
GeditFileBrowserView * view);
|
||||
PlumaFileBrowserView * view);
|
||||
|
||||
static void
|
||||
gedit_file_browser_view_finalize (GObject * object)
|
||||
pluma_file_browser_view_finalize (GObject * object)
|
||||
{
|
||||
GeditFileBrowserView *obj = GEDIT_FILE_BROWSER_VIEW(object);
|
||||
PlumaFileBrowserView *obj = PLUMA_FILE_BROWSER_VIEW(object);
|
||||
|
||||
if (obj->priv->hand_cursor)
|
||||
gdk_cursor_unref(obj->priv->hand_cursor);
|
||||
@@ -126,12 +126,12 @@ gedit_file_browser_view_finalize (GObject * object)
|
||||
|
||||
gdk_cursor_unref (obj->priv->busy_cursor);
|
||||
|
||||
G_OBJECT_CLASS (gedit_file_browser_view_parent_class)->
|
||||
G_OBJECT_CLASS (pluma_file_browser_view_parent_class)->
|
||||
finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
add_expand_state (GeditFileBrowserView * view,
|
||||
add_expand_state (PlumaFileBrowserView * view,
|
||||
gchar const * uri)
|
||||
{
|
||||
GFile * file;
|
||||
@@ -148,7 +148,7 @@ add_expand_state (GeditFileBrowserView * view,
|
||||
}
|
||||
|
||||
static void
|
||||
remove_expand_state (GeditFileBrowserView * view,
|
||||
remove_expand_state (PlumaFileBrowserView * view,
|
||||
gchar const * uri)
|
||||
{
|
||||
GFile * file;
|
||||
@@ -169,20 +169,20 @@ row_expanded (GtkTreeView * tree_view,
|
||||
GtkTreeIter * iter,
|
||||
GtkTreePath * path)
|
||||
{
|
||||
GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (tree_view);
|
||||
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (tree_view);
|
||||
gchar * uri;
|
||||
|
||||
if (GTK_TREE_VIEW_CLASS (gedit_file_browser_view_parent_class)->row_expanded)
|
||||
GTK_TREE_VIEW_CLASS (gedit_file_browser_view_parent_class)->row_expanded (tree_view, iter, path);
|
||||
if (GTK_TREE_VIEW_CLASS (pluma_file_browser_view_parent_class)->row_expanded)
|
||||
GTK_TREE_VIEW_CLASS (pluma_file_browser_view_parent_class)->row_expanded (tree_view, iter, path);
|
||||
|
||||
if (!GEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
|
||||
if (!PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
|
||||
return;
|
||||
|
||||
if (view->priv->restore_expand_state)
|
||||
{
|
||||
gtk_tree_model_get (view->priv->model,
|
||||
iter,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
&uri,
|
||||
-1);
|
||||
|
||||
@@ -190,7 +190,7 @@ row_expanded (GtkTreeView * tree_view,
|
||||
g_free (uri);
|
||||
}
|
||||
|
||||
_gedit_file_browser_store_iter_expanded (GEDIT_FILE_BROWSER_STORE (view->priv->model),
|
||||
_pluma_file_browser_store_iter_expanded (PLUMA_FILE_BROWSER_STORE (view->priv->model),
|
||||
iter);
|
||||
}
|
||||
|
||||
@@ -199,20 +199,20 @@ row_collapsed (GtkTreeView * tree_view,
|
||||
GtkTreeIter * iter,
|
||||
GtkTreePath * path)
|
||||
{
|
||||
GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (tree_view);
|
||||
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (tree_view);
|
||||
gchar * uri;
|
||||
|
||||
if (GTK_TREE_VIEW_CLASS (gedit_file_browser_view_parent_class)->row_collapsed)
|
||||
GTK_TREE_VIEW_CLASS (gedit_file_browser_view_parent_class)->row_collapsed (tree_view, iter, path);
|
||||
if (GTK_TREE_VIEW_CLASS (pluma_file_browser_view_parent_class)->row_collapsed)
|
||||
GTK_TREE_VIEW_CLASS (pluma_file_browser_view_parent_class)->row_collapsed (tree_view, iter, path);
|
||||
|
||||
if (!GEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
|
||||
if (!PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
|
||||
return;
|
||||
|
||||
if (view->priv->restore_expand_state)
|
||||
{
|
||||
gtk_tree_model_get (view->priv->model,
|
||||
iter,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
&uri,
|
||||
-1);
|
||||
|
||||
@@ -220,7 +220,7 @@ row_collapsed (GtkTreeView * tree_view,
|
||||
g_free (uri);
|
||||
}
|
||||
|
||||
_gedit_file_browser_store_iter_collapsed (GEDIT_FILE_BROWSER_STORE (view->priv->model),
|
||||
_pluma_file_browser_store_iter_collapsed (PLUMA_FILE_BROWSER_STORE (view->priv->model),
|
||||
iter);
|
||||
}
|
||||
|
||||
@@ -228,25 +228,25 @@ static gboolean
|
||||
leave_notify_event (GtkWidget *widget,
|
||||
GdkEventCrossing *event)
|
||||
{
|
||||
GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget);
|
||||
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget);
|
||||
|
||||
if (view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
|
||||
if (view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
|
||||
view->priv->hover_path != NULL) {
|
||||
gtk_tree_path_free (view->priv->hover_path);
|
||||
view->priv->hover_path = NULL;
|
||||
}
|
||||
|
||||
// Chainup
|
||||
return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->leave_notify_event (widget, event);
|
||||
return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->leave_notify_event (widget, event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
enter_notify_event (GtkWidget *widget,
|
||||
GdkEventCrossing *event)
|
||||
{
|
||||
GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget);
|
||||
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget);
|
||||
|
||||
if (view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
|
||||
if (view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
|
||||
if (view->priv->hover_path != NULL)
|
||||
gtk_tree_path_free (view->priv->hover_path);
|
||||
|
||||
@@ -261,7 +261,7 @@ enter_notify_event (GtkWidget *widget,
|
||||
}
|
||||
|
||||
// Chainup
|
||||
return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->enter_notify_event (widget, event);
|
||||
return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->enter_notify_event (widget, event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -269,9 +269,9 @@ motion_notify_event (GtkWidget * widget,
|
||||
GdkEventMotion * event)
|
||||
{
|
||||
GtkTreePath *old_hover_path;
|
||||
GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget);
|
||||
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget);
|
||||
|
||||
if (view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
|
||||
if (view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
|
||||
old_hover_path = view->priv->hover_path;
|
||||
gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
|
||||
event->x, event->y,
|
||||
@@ -292,12 +292,12 @@ motion_notify_event (GtkWidget * widget,
|
||||
}
|
||||
|
||||
// Chainup
|
||||
return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->motion_notify_event (widget, event);
|
||||
return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->motion_notify_event (widget, event);
|
||||
}
|
||||
|
||||
static void
|
||||
set_click_policy_property (GeditFileBrowserView *obj,
|
||||
GeditFileBrowserViewClickPolicy click_policy)
|
||||
set_click_policy_property (PlumaFileBrowserView *obj,
|
||||
PlumaFileBrowserViewClickPolicy click_policy)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GdkDisplay *display;
|
||||
@@ -305,10 +305,10 @@ set_click_policy_property (GeditFileBrowserView *obj,
|
||||
|
||||
obj->priv->click_policy = click_policy;
|
||||
|
||||
if (click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
|
||||
if (click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
|
||||
if (obj->priv->hand_cursor == NULL)
|
||||
obj->priv->hand_cursor = gdk_cursor_new(GDK_HAND2);
|
||||
} else if (click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE) {
|
||||
} else if (click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE) {
|
||||
if (obj->priv->hover_path != NULL) {
|
||||
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (obj->priv->model),
|
||||
&iter, obj->priv->hover_path))
|
||||
@@ -337,21 +337,21 @@ set_click_policy_property (GeditFileBrowserView *obj,
|
||||
}
|
||||
|
||||
static void
|
||||
directory_activated (GeditFileBrowserView *view,
|
||||
directory_activated (PlumaFileBrowserView *view,
|
||||
GtkTreeIter *iter)
|
||||
{
|
||||
gedit_file_browser_store_set_virtual_root (GEDIT_FILE_BROWSER_STORE (view->priv->model), iter);
|
||||
pluma_file_browser_store_set_virtual_root (PLUMA_FILE_BROWSER_STORE (view->priv->model), iter);
|
||||
}
|
||||
|
||||
static void
|
||||
activate_selected_files (GeditFileBrowserView *view) {
|
||||
activate_selected_files (PlumaFileBrowserView *view) {
|
||||
GtkTreeView *tree_view = GTK_TREE_VIEW (view);
|
||||
GtkTreeSelection *selection = gtk_tree_view_get_selection (tree_view);
|
||||
GList *rows, *row;
|
||||
GtkTreePath *directory = NULL;
|
||||
GtkTreePath *path;
|
||||
GtkTreeIter iter;
|
||||
GeditFileBrowserStoreFlag flags;
|
||||
PlumaFileBrowserStoreFlag flags;
|
||||
|
||||
rows = gtk_tree_selection_get_selected_rows (selection, &view->priv->model);
|
||||
|
||||
@@ -362,7 +362,7 @@ activate_selected_files (GeditFileBrowserView *view) {
|
||||
if (!gtk_tree_model_get_iter (view->priv->model, &iter, path))
|
||||
continue;
|
||||
|
||||
gtk_tree_model_get (view->priv->model, &iter, GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1);
|
||||
gtk_tree_model_get (view->priv->model, &iter, PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1);
|
||||
|
||||
if (FILE_IS_DIR (flags)) {
|
||||
if (directory == NULL)
|
||||
@@ -383,7 +383,7 @@ activate_selected_files (GeditFileBrowserView *view) {
|
||||
}
|
||||
|
||||
static void
|
||||
activate_selected_bookmark (GeditFileBrowserView *view) {
|
||||
activate_selected_bookmark (PlumaFileBrowserView *view) {
|
||||
GtkTreeView *tree_view = GTK_TREE_VIEW (view);
|
||||
GtkTreeSelection *selection = gtk_tree_view_get_selection (tree_view);
|
||||
GtkTreeIter iter;
|
||||
@@ -393,26 +393,26 @@ activate_selected_bookmark (GeditFileBrowserView *view) {
|
||||
}
|
||||
|
||||
static void
|
||||
activate_selected_items (GeditFileBrowserView *view)
|
||||
activate_selected_items (PlumaFileBrowserView *view)
|
||||
{
|
||||
if (GEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
|
||||
if (PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
|
||||
activate_selected_files (view);
|
||||
else if (GEDIT_IS_FILE_BOOKMARKS_STORE (view->priv->model))
|
||||
else if (PLUMA_IS_FILE_BOOKMARKS_STORE (view->priv->model))
|
||||
activate_selected_bookmark (view);
|
||||
}
|
||||
|
||||
static void
|
||||
toggle_hidden_filter (GeditFileBrowserView *view)
|
||||
toggle_hidden_filter (PlumaFileBrowserView *view)
|
||||
{
|
||||
GeditFileBrowserStoreFilterMode mode;
|
||||
PlumaFileBrowserStoreFilterMode mode;
|
||||
|
||||
if (GEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
|
||||
if (PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
|
||||
{
|
||||
mode = gedit_file_browser_store_get_filter_mode
|
||||
(GEDIT_FILE_BROWSER_STORE (view->priv->model));
|
||||
mode ^= GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
|
||||
gedit_file_browser_store_set_filter_mode
|
||||
(GEDIT_FILE_BROWSER_STORE (view->priv->model), mode);
|
||||
mode = pluma_file_browser_store_get_filter_mode
|
||||
(PLUMA_FILE_BROWSER_STORE (view->priv->model));
|
||||
mode ^= PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
|
||||
pluma_file_browser_store_set_filter_mode
|
||||
(PLUMA_FILE_BROWSER_STORE (view->priv->model), mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,17 +426,17 @@ static void
|
||||
drag_begin (GtkWidget *widget,
|
||||
GdkDragContext *context)
|
||||
{
|
||||
GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget);
|
||||
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget);
|
||||
|
||||
view->priv->drag_button = 0;
|
||||
view->priv->drag_started = TRUE;
|
||||
|
||||
/* Chain up */
|
||||
GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->drag_begin (widget, context);
|
||||
GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->drag_begin (widget, context);
|
||||
}
|
||||
|
||||
static void
|
||||
did_not_drag (GeditFileBrowserView *view,
|
||||
did_not_drag (PlumaFileBrowserView *view,
|
||||
GdkEventButton *event)
|
||||
{
|
||||
GtkTreeView *tree_view;
|
||||
@@ -448,7 +448,7 @@ did_not_drag (GeditFileBrowserView *view,
|
||||
|
||||
if (gtk_tree_view_get_path_at_pos (tree_view, event->x, event->y,
|
||||
&path, NULL, NULL, NULL)) {
|
||||
if ((view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE)
|
||||
if ((view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE)
|
||||
&& !button_event_modifies_selection(event)
|
||||
&& (event->button == 1 || event->button == 2)) {
|
||||
/* Activate all selected items, and leave them selected */
|
||||
@@ -473,7 +473,7 @@ static gboolean
|
||||
button_release_event (GtkWidget *widget,
|
||||
GdkEventButton *event)
|
||||
{
|
||||
GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget);
|
||||
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget);
|
||||
|
||||
if (event->button == view->priv->drag_button) {
|
||||
view->priv->drag_button = 0;
|
||||
@@ -484,7 +484,7 @@ button_release_event (GtkWidget *widget,
|
||||
}
|
||||
|
||||
/* Chain up */
|
||||
return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->button_release_event (widget, event);
|
||||
return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->button_release_event (widget, event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -494,7 +494,7 @@ button_press_event (GtkWidget *widget,
|
||||
int double_click_time;
|
||||
static int click_count = 0;
|
||||
static guint32 last_click_time = 0;
|
||||
GeditFileBrowserView *view;
|
||||
PlumaFileBrowserView *view;
|
||||
GtkTreeView *tree_view;
|
||||
GtkTreeSelection *selection;
|
||||
GtkTreePath *path;
|
||||
@@ -503,10 +503,10 @@ button_press_event (GtkWidget *widget,
|
||||
gboolean on_expander;
|
||||
gboolean call_parent;
|
||||
gboolean selected;
|
||||
GtkWidgetClass *widget_parent = GTK_WIDGET_CLASS(gedit_file_browser_view_parent_class);
|
||||
GtkWidgetClass *widget_parent = GTK_WIDGET_CLASS(pluma_file_browser_view_parent_class);
|
||||
|
||||
tree_view = GTK_TREE_VIEW (widget);
|
||||
view = GEDIT_FILE_BROWSER_VIEW (widget);
|
||||
view = PLUMA_FILE_BROWSER_VIEW (widget);
|
||||
selection = gtk_tree_view_get_selection (tree_view);
|
||||
|
||||
/* Get double click time */
|
||||
@@ -523,7 +523,7 @@ button_press_event (GtkWidget *widget,
|
||||
last_click_time = event->time;
|
||||
|
||||
/* Ignore double click if we are in single click mode */
|
||||
if (view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
|
||||
if (view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
|
||||
click_count >= 2) {
|
||||
return TRUE;
|
||||
}
|
||||
@@ -576,7 +576,7 @@ button_press_event (GtkWidget *widget,
|
||||
|
||||
if (selected) {
|
||||
call_parent = on_expander || gtk_tree_selection_count_selected_rows (selection) == 1;
|
||||
view->priv->ignore_release = call_parent && view->priv->click_policy != GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE;
|
||||
view->priv->ignore_release = call_parent && view->priv->click_policy != PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE;
|
||||
} else if ((event->state & GDK_CONTROL_MASK) != 0) {
|
||||
call_parent = FALSE;
|
||||
gtk_tree_selection_select_path (selection, path);
|
||||
@@ -623,11 +623,11 @@ static gboolean
|
||||
key_press_event (GtkWidget *widget,
|
||||
GdkEventKey *event)
|
||||
{
|
||||
GeditFileBrowserView *view;
|
||||
PlumaFileBrowserView *view;
|
||||
guint modifiers;
|
||||
gboolean handled;
|
||||
|
||||
view = GEDIT_FILE_BROWSER_VIEW (widget);
|
||||
view = PLUMA_FILE_BROWSER_VIEW (widget);
|
||||
handled = FALSE;
|
||||
|
||||
modifiers = gtk_accelerator_get_default_mod_mask ();
|
||||
@@ -666,13 +666,13 @@ key_press_event (GtkWidget *widget,
|
||||
|
||||
/* Chain up */
|
||||
if (!handled)
|
||||
return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->key_press_event (widget, event);
|
||||
return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->key_press_event (widget, event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
fill_expand_state (GeditFileBrowserView * view, GtkTreeIter * iter)
|
||||
fill_expand_state (PlumaFileBrowserView * view, GtkTreeIter * iter)
|
||||
{
|
||||
GtkTreePath * path;
|
||||
GtkTreeIter child;
|
||||
@@ -687,7 +687,7 @@ fill_expand_state (GeditFileBrowserView * view, GtkTreeIter * iter)
|
||||
{
|
||||
gtk_tree_model_get (view->priv->model,
|
||||
iter,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
&uri,
|
||||
-1);
|
||||
|
||||
@@ -706,7 +706,7 @@ fill_expand_state (GeditFileBrowserView * view, GtkTreeIter * iter)
|
||||
}
|
||||
|
||||
static void
|
||||
uninstall_restore_signals (GeditFileBrowserView * tree_view,
|
||||
uninstall_restore_signals (PlumaFileBrowserView * tree_view,
|
||||
GtkTreeModel * model)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (model,
|
||||
@@ -727,7 +727,7 @@ uninstall_restore_signals (GeditFileBrowserView * tree_view,
|
||||
}
|
||||
|
||||
static void
|
||||
install_restore_signals (GeditFileBrowserView * tree_view,
|
||||
install_restore_signals (PlumaFileBrowserView * tree_view,
|
||||
GtkTreeModel * model)
|
||||
{
|
||||
g_signal_connect (model,
|
||||
@@ -752,7 +752,7 @@ install_restore_signals (GeditFileBrowserView * tree_view,
|
||||
}
|
||||
|
||||
static void
|
||||
set_restore_expand_state (GeditFileBrowserView * view,
|
||||
set_restore_expand_state (PlumaFileBrowserView * view,
|
||||
gboolean state)
|
||||
{
|
||||
if (state == view->priv->restore_expand_state)
|
||||
@@ -771,14 +771,14 @@ set_restore_expand_state (GeditFileBrowserView * view,
|
||||
g_object_unref,
|
||||
NULL);
|
||||
|
||||
if (view->priv->model && GEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
|
||||
if (view->priv->model && PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
|
||||
{
|
||||
fill_expand_state (view, NULL);
|
||||
|
||||
install_restore_signals (view, view->priv->model);
|
||||
}
|
||||
}
|
||||
else if (view->priv->model && GEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
|
||||
else if (view->priv->model && PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
|
||||
{
|
||||
uninstall_restore_signals (view, view->priv->model);
|
||||
}
|
||||
@@ -792,7 +792,7 @@ get_property (GObject *object,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GeditFileBrowserView *obj = GEDIT_FILE_BROWSER_VIEW (object);
|
||||
PlumaFileBrowserView *obj = PLUMA_FILE_BROWSER_VIEW (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@@ -814,7 +814,7 @@ set_property (GObject *object,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GeditFileBrowserView *obj = GEDIT_FILE_BROWSER_VIEW (object);
|
||||
PlumaFileBrowserView *obj = PLUMA_FILE_BROWSER_VIEW (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@@ -831,13 +831,13 @@ set_property (GObject *object,
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_file_browser_view_class_init (GeditFileBrowserViewClass * klass)
|
||||
pluma_file_browser_view_class_init (PlumaFileBrowserViewClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GtkTreeViewClass *tree_view_class = GTK_TREE_VIEW_CLASS (klass);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
object_class->finalize = gedit_file_browser_view_finalize;
|
||||
object_class->finalize = pluma_file_browser_view_finalize;
|
||||
object_class->get_property = get_property;
|
||||
object_class->set_property = set_property;
|
||||
|
||||
@@ -861,8 +861,8 @@ gedit_file_browser_view_class_init (GeditFileBrowserViewClass * klass)
|
||||
g_param_spec_enum ("click-policy",
|
||||
"Click Policy",
|
||||
"The click policy",
|
||||
GEDIT_TYPE_FILE_BROWSER_VIEW_CLICK_POLICY,
|
||||
GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE,
|
||||
PLUMA_TYPE_FILE_BROWSER_VIEW_CLICK_POLICY,
|
||||
PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_RESTORE_EXPAND_STATE,
|
||||
@@ -876,15 +876,15 @@ gedit_file_browser_view_class_init (GeditFileBrowserViewClass * klass)
|
||||
g_signal_new ("error",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GeditFileBrowserViewClass,
|
||||
G_STRUCT_OFFSET (PlumaFileBrowserViewClass,
|
||||
error), NULL, NULL,
|
||||
gedit_file_browser_marshal_VOID__UINT_STRING,
|
||||
pluma_file_browser_marshal_VOID__UINT_STRING,
|
||||
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING);
|
||||
signals[FILE_ACTIVATED] =
|
||||
g_signal_new ("file-activated",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GeditFileBrowserViewClass,
|
||||
G_STRUCT_OFFSET (PlumaFileBrowserViewClass,
|
||||
file_activated), NULL, NULL,
|
||||
g_cclosure_marshal_VOID__BOXED,
|
||||
G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER);
|
||||
@@ -892,7 +892,7 @@ gedit_file_browser_view_class_init (GeditFileBrowserViewClass * klass)
|
||||
g_signal_new ("directory-activated",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GeditFileBrowserViewClass,
|
||||
G_STRUCT_OFFSET (PlumaFileBrowserViewClass,
|
||||
directory_activated), NULL, NULL,
|
||||
g_cclosure_marshal_VOID__BOXED,
|
||||
G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER);
|
||||
@@ -900,19 +900,19 @@ gedit_file_browser_view_class_init (GeditFileBrowserViewClass * klass)
|
||||
g_signal_new ("bookmark-activated",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GeditFileBrowserViewClass,
|
||||
G_STRUCT_OFFSET (PlumaFileBrowserViewClass,
|
||||
bookmark_activated), NULL, NULL,
|
||||
g_cclosure_marshal_VOID__BOXED,
|
||||
G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER);
|
||||
|
||||
g_type_class_add_private (object_class,
|
||||
sizeof (GeditFileBrowserViewPrivate));
|
||||
sizeof (PlumaFileBrowserViewPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell,
|
||||
GtkTreeModel * tree_model, GtkTreeIter * iter,
|
||||
GeditFileBrowserView * obj)
|
||||
PlumaFileBrowserView * obj)
|
||||
{
|
||||
GtkTreePath *path;
|
||||
PangoUnderline underline = PANGO_UNDERLINE_NONE;
|
||||
@@ -920,13 +920,13 @@ cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell,
|
||||
|
||||
path = gtk_tree_model_get_path (tree_model, iter);
|
||||
|
||||
if (obj->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
|
||||
if (obj->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
|
||||
if (obj->priv->hover_path != NULL &&
|
||||
gtk_tree_path_compare (path, obj->priv->hover_path) == 0)
|
||||
underline = PANGO_UNDERLINE_SINGLE;
|
||||
}
|
||||
|
||||
if (GEDIT_IS_FILE_BROWSER_STORE (tree_model))
|
||||
if (PLUMA_IS_FILE_BROWSER_STORE (tree_model))
|
||||
{
|
||||
if (obj->priv->editable != NULL &&
|
||||
gtk_tree_row_reference_valid (obj->priv->editable))
|
||||
@@ -942,9 +942,9 @@ cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell,
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_file_browser_view_init (GeditFileBrowserView * obj)
|
||||
pluma_file_browser_view_init (PlumaFileBrowserView * obj)
|
||||
{
|
||||
obj->priv = GEDIT_FILE_BROWSER_VIEW_GET_PRIVATE (obj);
|
||||
obj->priv = PLUMA_FILE_BROWSER_VIEW_GET_PRIVATE (obj);
|
||||
|
||||
obj->priv->column = gtk_tree_view_column_new ();
|
||||
|
||||
@@ -955,7 +955,7 @@ gedit_file_browser_view_init (GeditFileBrowserView * obj)
|
||||
gtk_tree_view_column_add_attribute (obj->priv->column,
|
||||
obj->priv->pixbuf_renderer,
|
||||
"pixbuf",
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_ICON);
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_ICON);
|
||||
|
||||
obj->priv->text_renderer = gtk_cell_renderer_text_new ();
|
||||
gtk_tree_view_column_pack_start (obj->priv->column,
|
||||
@@ -963,7 +963,7 @@ gedit_file_browser_view_init (GeditFileBrowserView * obj)
|
||||
gtk_tree_view_column_add_attribute (obj->priv->column,
|
||||
obj->priv->text_renderer,
|
||||
"text",
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_NAME);
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_NAME);
|
||||
|
||||
g_signal_connect (obj->priv->text_renderer, "edited",
|
||||
G_CALLBACK (on_cell_edited), obj);
|
||||
@@ -988,25 +988,25 @@ bookmarks_separator_func (GtkTreeModel * model, GtkTreeIter * iter,
|
||||
guint flags;
|
||||
|
||||
gtk_tree_model_get (model, iter,
|
||||
GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
|
||||
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
|
||||
&flags, -1);
|
||||
|
||||
return (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR);
|
||||
return (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR);
|
||||
}
|
||||
|
||||
/* Public */
|
||||
GtkWidget *
|
||||
gedit_file_browser_view_new (void)
|
||||
pluma_file_browser_view_new (void)
|
||||
{
|
||||
GeditFileBrowserView *obj =
|
||||
GEDIT_FILE_BROWSER_VIEW (g_object_new
|
||||
(GEDIT_TYPE_FILE_BROWSER_VIEW, NULL));
|
||||
PlumaFileBrowserView *obj =
|
||||
PLUMA_FILE_BROWSER_VIEW (g_object_new
|
||||
(PLUMA_TYPE_FILE_BROWSER_VIEW, NULL));
|
||||
|
||||
return GTK_WIDGET (obj);
|
||||
}
|
||||
|
||||
void
|
||||
gedit_file_browser_view_set_model (GeditFileBrowserView * tree_view,
|
||||
pluma_file_browser_view_set_model (PlumaFileBrowserView * tree_view,
|
||||
GtkTreeModel * model)
|
||||
{
|
||||
GtkTreeSelection *selection;
|
||||
@@ -1016,7 +1016,7 @@ gedit_file_browser_view_set_model (GeditFileBrowserView * tree_view,
|
||||
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
|
||||
|
||||
if (GEDIT_IS_FILE_BOOKMARKS_STORE (model)) {
|
||||
if (PLUMA_IS_FILE_BOOKMARKS_STORE (model)) {
|
||||
gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
|
||||
gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW
|
||||
(tree_view),
|
||||
@@ -1052,7 +1052,7 @@ gedit_file_browser_view_set_model (GeditFileBrowserView * tree_view,
|
||||
tree_view->priv->hover_path = NULL;
|
||||
}
|
||||
|
||||
if (GEDIT_IS_FILE_BROWSER_STORE (tree_view->priv->model)) {
|
||||
if (PLUMA_IS_FILE_BROWSER_STORE (tree_view->priv->model)) {
|
||||
if (tree_view->priv->restore_expand_state)
|
||||
uninstall_restore_signals (tree_view,
|
||||
tree_view->priv->model);
|
||||
@@ -1063,20 +1063,20 @@ gedit_file_browser_view_set_model (GeditFileBrowserView * tree_view,
|
||||
}
|
||||
|
||||
void
|
||||
gedit_file_browser_view_start_rename (GeditFileBrowserView * tree_view,
|
||||
pluma_file_browser_view_start_rename (PlumaFileBrowserView * tree_view,
|
||||
GtkTreeIter * iter)
|
||||
{
|
||||
guint flags;
|
||||
GtkTreeRowReference *rowref;
|
||||
GtkTreePath *path;
|
||||
|
||||
g_return_if_fail (GEDIT_IS_FILE_BROWSER_VIEW (tree_view));
|
||||
g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE
|
||||
g_return_if_fail (PLUMA_IS_FILE_BROWSER_VIEW (tree_view));
|
||||
g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE
|
||||
(tree_view->priv->model));
|
||||
g_return_if_fail (iter != NULL);
|
||||
|
||||
gtk_tree_model_get (tree_view->priv->model, iter,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
|
||||
-1);
|
||||
|
||||
if (!(FILE_IS_DIR (flags) || !FILE_IS_DUMMY (flags)))
|
||||
@@ -1106,10 +1106,10 @@ gedit_file_browser_view_start_rename (GeditFileBrowserView * tree_view,
|
||||
}
|
||||
|
||||
void
|
||||
gedit_file_browser_view_set_click_policy (GeditFileBrowserView *tree_view,
|
||||
GeditFileBrowserViewClickPolicy policy)
|
||||
pluma_file_browser_view_set_click_policy (PlumaFileBrowserView *tree_view,
|
||||
PlumaFileBrowserViewClickPolicy policy)
|
||||
{
|
||||
g_return_if_fail (GEDIT_IS_FILE_BROWSER_VIEW (tree_view));
|
||||
g_return_if_fail (PLUMA_IS_FILE_BROWSER_VIEW (tree_view));
|
||||
|
||||
set_click_policy_property (tree_view, policy);
|
||||
|
||||
@@ -1117,10 +1117,10 @@ gedit_file_browser_view_set_click_policy (GeditFileBrowserView *tree_view,
|
||||
}
|
||||
|
||||
void
|
||||
gedit_file_browser_view_set_restore_expand_state (GeditFileBrowserView * tree_view,
|
||||
pluma_file_browser_view_set_restore_expand_state (PlumaFileBrowserView * tree_view,
|
||||
gboolean restore_expand_state)
|
||||
{
|
||||
g_return_if_fail (GEDIT_IS_FILE_BROWSER_VIEW (tree_view));
|
||||
g_return_if_fail (PLUMA_IS_FILE_BROWSER_VIEW (tree_view));
|
||||
|
||||
set_restore_expand_state (tree_view, restore_expand_state);
|
||||
g_object_notify (G_OBJECT (tree_view), "restore-expand-state");
|
||||
@@ -1129,7 +1129,7 @@ gedit_file_browser_view_set_restore_expand_state (GeditFileBrowserView * tree_vi
|
||||
/* Signal handlers */
|
||||
static void
|
||||
on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text,
|
||||
GeditFileBrowserView * tree_view)
|
||||
PlumaFileBrowserView * tree_view)
|
||||
{
|
||||
GtkTreePath * treepath;
|
||||
GtkTreeIter iter;
|
||||
@@ -1147,7 +1147,7 @@ on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text,
|
||||
gtk_tree_path_free (treepath);
|
||||
|
||||
if (ret) {
|
||||
if (gedit_file_browser_store_rename (GEDIT_FILE_BROWSER_STORE (tree_view->priv->model),
|
||||
if (pluma_file_browser_store_rename (PLUMA_FILE_BROWSER_STORE (tree_view->priv->model),
|
||||
&iter, new_text, &error)) {
|
||||
treepath = gtk_tree_model_get_path (GTK_TREE_MODEL (tree_view->priv->model), &iter);
|
||||
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (tree_view),
|
||||
@@ -1166,8 +1166,8 @@ on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text,
|
||||
}
|
||||
|
||||
static void
|
||||
on_begin_refresh (GeditFileBrowserStore * model,
|
||||
GeditFileBrowserView * view)
|
||||
on_begin_refresh (PlumaFileBrowserStore * model,
|
||||
PlumaFileBrowserView * view)
|
||||
{
|
||||
/* Store the refresh state, so we can handle unloading of nodes while
|
||||
refreshing properly */
|
||||
@@ -1175,8 +1175,8 @@ on_begin_refresh (GeditFileBrowserStore * model,
|
||||
}
|
||||
|
||||
static void
|
||||
on_end_refresh (GeditFileBrowserStore * model,
|
||||
GeditFileBrowserView * view)
|
||||
on_end_refresh (PlumaFileBrowserStore * model,
|
||||
PlumaFileBrowserView * view)
|
||||
{
|
||||
/* Store the refresh state, so we can handle unloading of nodes while
|
||||
refreshing properly */
|
||||
@@ -1184,9 +1184,9 @@ on_end_refresh (GeditFileBrowserStore * model,
|
||||
}
|
||||
|
||||
static void
|
||||
on_unload (GeditFileBrowserStore * model,
|
||||
on_unload (PlumaFileBrowserStore * model,
|
||||
gchar const * uri,
|
||||
GeditFileBrowserView * view)
|
||||
PlumaFileBrowserView * view)
|
||||
{
|
||||
/* Don't remove the expand state if we are refreshing */
|
||||
if (!view->priv->restore_expand_state || view->priv->is_refresh)
|
||||
@@ -1196,8 +1196,8 @@ on_unload (GeditFileBrowserStore * model,
|
||||
}
|
||||
|
||||
static void
|
||||
restore_expand_state (GeditFileBrowserView * view,
|
||||
GeditFileBrowserStore * model,
|
||||
restore_expand_state (PlumaFileBrowserView * view,
|
||||
PlumaFileBrowserStore * model,
|
||||
GtkTreeIter * iter)
|
||||
{
|
||||
gchar * uri;
|
||||
@@ -1206,7 +1206,7 @@ restore_expand_state (GeditFileBrowserView * view,
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (model),
|
||||
iter,
|
||||
GEDIT_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
|
||||
&uri,
|
||||
-1);
|
||||
|
||||
@@ -1230,10 +1230,10 @@ restore_expand_state (GeditFileBrowserView * view,
|
||||
}
|
||||
|
||||
static void
|
||||
on_row_inserted (GeditFileBrowserStore * model,
|
||||
on_row_inserted (PlumaFileBrowserStore * model,
|
||||
GtkTreePath * path,
|
||||
GtkTreeIter * iter,
|
||||
GeditFileBrowserView * view)
|
||||
PlumaFileBrowserView * view)
|
||||
{
|
||||
GtkTreeIter parent;
|
||||
GtkTreePath * copy;
|
84
plugins/filebrowser/pluma-file-browser-view.h
Executable file
84
plugins/filebrowser/pluma-file-browser-view.h
Executable file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* pluma-file-browser-view.h - Pluma plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __PLUMA_FILE_BROWSER_VIEW_H__
|
||||
#define __PLUMA_FILE_BROWSER_VIEW_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define PLUMA_TYPE_FILE_BROWSER_VIEW (pluma_file_browser_view_get_type ())
|
||||
#define PLUMA_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_VIEW, PlumaFileBrowserView))
|
||||
#define PLUMA_FILE_BROWSER_VIEW_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_VIEW, PlumaFileBrowserView const))
|
||||
#define PLUMA_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLUMA_TYPE_FILE_BROWSER_VIEW, PlumaFileBrowserViewClass))
|
||||
#define PLUMA_IS_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUMA_TYPE_FILE_BROWSER_VIEW))
|
||||
#define PLUMA_IS_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_FILE_BROWSER_VIEW))
|
||||
#define PLUMA_FILE_BROWSER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_FILE_BROWSER_VIEW, PlumaFileBrowserViewClass))
|
||||
|
||||
typedef struct _PlumaFileBrowserView PlumaFileBrowserView;
|
||||
typedef struct _PlumaFileBrowserViewClass PlumaFileBrowserViewClass;
|
||||
typedef struct _PlumaFileBrowserViewPrivate PlumaFileBrowserViewPrivate;
|
||||
|
||||
typedef enum {
|
||||
PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE,
|
||||
PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE
|
||||
} PlumaFileBrowserViewClickPolicy;
|
||||
|
||||
struct _PlumaFileBrowserView
|
||||
{
|
||||
GtkTreeView parent;
|
||||
|
||||
PlumaFileBrowserViewPrivate *priv;
|
||||
};
|
||||
|
||||
struct _PlumaFileBrowserViewClass
|
||||
{
|
||||
GtkTreeViewClass parent_class;
|
||||
|
||||
/* Signals */
|
||||
void (*error) (PlumaFileBrowserView * filetree,
|
||||
guint code,
|
||||
gchar const *message);
|
||||
void (*file_activated) (PlumaFileBrowserView * filetree,
|
||||
GtkTreeIter *iter);
|
||||
void (*directory_activated) (PlumaFileBrowserView * filetree,
|
||||
GtkTreeIter *iter);
|
||||
void (*bookmark_activated) (PlumaFileBrowserView * filetree,
|
||||
GtkTreeIter *iter);
|
||||
};
|
||||
|
||||
GType pluma_file_browser_view_get_type (void) G_GNUC_CONST;
|
||||
GType pluma_file_browser_view_register_type (GTypeModule * module);
|
||||
|
||||
GtkWidget *pluma_file_browser_view_new (void);
|
||||
void pluma_file_browser_view_set_model (PlumaFileBrowserView * tree_view,
|
||||
GtkTreeModel * model);
|
||||
void pluma_file_browser_view_start_rename (PlumaFileBrowserView * tree_view,
|
||||
GtkTreeIter * iter);
|
||||
void pluma_file_browser_view_set_click_policy (PlumaFileBrowserView * tree_view,
|
||||
PlumaFileBrowserViewClickPolicy policy);
|
||||
void pluma_file_browser_view_set_restore_expand_state (PlumaFileBrowserView * tree_view,
|
||||
gboolean restore_expand_state);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __PLUMA_FILE_BROWSER_VIEW_H__ */
|
||||
|
||||
// ex:ts=8:noet:
|
File diff suppressed because it is too large
Load Diff
121
plugins/filebrowser/pluma-file-browser-widget.h
Executable file
121
plugins/filebrowser/pluma-file-browser-widget.h
Executable file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* pluma-file-browser-widget.h - Pluma plugin providing easy file access
|
||||
* from the sidepanel
|
||||
*
|
||||
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __PLUMA_FILE_BROWSER_WIDGET_H__
|
||||
#define __PLUMA_FILE_BROWSER_WIDGET_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "pluma-file-browser-store.h"
|
||||
#include "pluma-file-bookmarks-store.h"
|
||||
#include "pluma-file-browser-view.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define PLUMA_TYPE_FILE_BROWSER_WIDGET (pluma_file_browser_widget_get_type ())
|
||||
#define PLUMA_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_WIDGET, PlumaFileBrowserWidget))
|
||||
#define PLUMA_FILE_BROWSER_WIDGET_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_WIDGET, PlumaFileBrowserWidget const))
|
||||
#define PLUMA_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLUMA_TYPE_FILE_BROWSER_WIDGET, PlumaFileBrowserWidgetClass))
|
||||
#define PLUMA_IS_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUMA_TYPE_FILE_BROWSER_WIDGET))
|
||||
#define PLUMA_IS_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_FILE_BROWSER_WIDGET))
|
||||
#define PLUMA_FILE_BROWSER_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_FILE_BROWSER_WIDGET, PlumaFileBrowserWidgetClass))
|
||||
|
||||
typedef struct _PlumaFileBrowserWidget PlumaFileBrowserWidget;
|
||||
typedef struct _PlumaFileBrowserWidgetClass PlumaFileBrowserWidgetClass;
|
||||
typedef struct _PlumaFileBrowserWidgetPrivate PlumaFileBrowserWidgetPrivate;
|
||||
|
||||
typedef
|
||||
gboolean (*PlumaFileBrowserWidgetFilterFunc) (PlumaFileBrowserWidget * obj,
|
||||
PlumaFileBrowserStore *
|
||||
model, GtkTreeIter * iter,
|
||||
gpointer user_data);
|
||||
|
||||
struct _PlumaFileBrowserWidget
|
||||
{
|
||||
GtkVBox parent;
|
||||
|
||||
PlumaFileBrowserWidgetPrivate *priv;
|
||||
};
|
||||
|
||||
struct _PlumaFileBrowserWidgetClass
|
||||
{
|
||||
GtkVBoxClass parent_class;
|
||||
|
||||
/* Signals */
|
||||
void (*uri_activated) (PlumaFileBrowserWidget * widget,
|
||||
gchar const *uri);
|
||||
void (*error) (PlumaFileBrowserWidget * widget,
|
||||
guint code,
|
||||
gchar const *message);
|
||||
gboolean (*confirm_delete) (PlumaFileBrowserWidget * widget,
|
||||
PlumaFileBrowserStore * model,
|
||||
GList *list);
|
||||
gboolean (*confirm_no_trash) (PlumaFileBrowserWidget * widget,
|
||||
GList *list);
|
||||
};
|
||||
|
||||
GType pluma_file_browser_widget_get_type (void) G_GNUC_CONST;
|
||||
GType pluma_file_browser_widget_register_type (GTypeModule * module);
|
||||
|
||||
GtkWidget *pluma_file_browser_widget_new (const gchar *data_dir);
|
||||
|
||||
void pluma_file_browser_widget_show_bookmarks (PlumaFileBrowserWidget * obj);
|
||||
void pluma_file_browser_widget_show_files (PlumaFileBrowserWidget * obj);
|
||||
|
||||
void pluma_file_browser_widget_set_root (PlumaFileBrowserWidget * obj,
|
||||
gchar const *root,
|
||||
gboolean virtual_root);
|
||||
void
|
||||
pluma_file_browser_widget_set_root_and_virtual_root (PlumaFileBrowserWidget * obj,
|
||||
gchar const *root,
|
||||
gchar const *virtual_root);
|
||||
|
||||
gboolean
|
||||
pluma_file_browser_widget_get_selected_directory (PlumaFileBrowserWidget * obj,
|
||||
GtkTreeIter * iter);
|
||||
|
||||
PlumaFileBrowserStore *
|
||||
pluma_file_browser_widget_get_browser_store (PlumaFileBrowserWidget * obj);
|
||||
PlumaFileBookmarksStore *
|
||||
pluma_file_browser_widget_get_bookmarks_store (PlumaFileBrowserWidget * obj);
|
||||
PlumaFileBrowserView *
|
||||
pluma_file_browser_widget_get_browser_view (PlumaFileBrowserWidget * obj);
|
||||
GtkWidget *
|
||||
pluma_file_browser_widget_get_filter_entry (PlumaFileBrowserWidget * obj);
|
||||
|
||||
GtkUIManager *
|
||||
pluma_file_browser_widget_get_ui_manager (PlumaFileBrowserWidget * obj);
|
||||
|
||||
gulong pluma_file_browser_widget_add_filter (PlumaFileBrowserWidget * obj,
|
||||
PlumaFileBrowserWidgetFilterFunc func,
|
||||
gpointer user_data,
|
||||
GDestroyNotify notify);
|
||||
void pluma_file_browser_widget_remove_filter (PlumaFileBrowserWidget * obj,
|
||||
gulong id);
|
||||
void pluma_file_browser_widget_set_filter_pattern (PlumaFileBrowserWidget * obj,
|
||||
gchar const *pattern);
|
||||
|
||||
void pluma_file_browser_widget_refresh (PlumaFileBrowserWidget * obj);
|
||||
void pluma_file_browser_widget_history_back (PlumaFileBrowserWidget * obj);
|
||||
void pluma_file_browser_widget_history_forward (PlumaFileBrowserWidget * obj);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __PLUMA_FILE_BROWSER_WIDGET_H__ */
|
||||
|
||||
// ex:ts=8:noet:
|
@@ -1,9 +1,9 @@
|
||||
<mateconfschemafile>
|
||||
<schemalist>
|
||||
<schema>
|
||||
<key>/schemas/apps/gedit-2/plugins/filebrowser/on_load/tree_view</key>
|
||||
<applyto>/apps/gedit-2/plugins/filebrowser/on_load/tree_view</applyto>
|
||||
<owner>gedit</owner>
|
||||
<key>/schemas/apps/pluma-2/plugins/filebrowser/on_load/tree_view</key>
|
||||
<applyto>/apps/pluma-2/plugins/filebrowser/on_load/tree_view</applyto>
|
||||
<owner>pluma</owner>
|
||||
<type>bool</type>
|
||||
<default>TRUE</default>
|
||||
<locale name="C">
|
||||
@@ -13,9 +13,9 @@
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/gedit-2/plugins/filebrowser/on_load/root</key>
|
||||
<applyto>/apps/gedit-2/plugins/filebrowser/on_load/root</applyto>
|
||||
<owner>gedit</owner>
|
||||
<key>/schemas/apps/pluma-2/plugins/filebrowser/on_load/root</key>
|
||||
<applyto>/apps/pluma-2/plugins/filebrowser/on_load/root</applyto>
|
||||
<owner>pluma</owner>
|
||||
<type>string</type>
|
||||
<default></default>
|
||||
<locale name="C">
|
||||
@@ -26,9 +26,9 @@
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/gedit-2/plugins/filebrowser/on_load/virtual_root</key>
|
||||
<applyto>/apps/gedit-2/plugins/filebrowser/on_load/virtual_root</applyto>
|
||||
<owner>gedit</owner>
|
||||
<key>/schemas/apps/pluma-2/plugins/filebrowser/on_load/virtual_root</key>
|
||||
<applyto>/apps/pluma-2/plugins/filebrowser/on_load/virtual_root</applyto>
|
||||
<owner>pluma</owner>
|
||||
<type>string</type>
|
||||
<default></default>
|
||||
<locale name="C">
|
||||
@@ -40,9 +40,9 @@
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/gedit-2/plugins/filebrowser/on_load/enable_remote</key>
|
||||
<applyto>/apps/gedit-2/plugins/filebrowser/on_load/enable_remote</applyto>
|
||||
<owner>gedit</owner>
|
||||
<key>/schemas/apps/pluma-2/plugins/filebrowser/on_load/enable_remote</key>
|
||||
<applyto>/apps/pluma-2/plugins/filebrowser/on_load/enable_remote</applyto>
|
||||
<owner>pluma</owner>
|
||||
<type>bool</type>
|
||||
<default>FALSE</default>
|
||||
<locale name="C">
|
||||
@@ -52,9 +52,9 @@
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/gedit-2/plugins/filebrowser/open_at_first_doc</key>
|
||||
<applyto>/apps/gedit-2/plugins/filebrowser/open_at_first_doc</applyto>
|
||||
<owner>gedit</owner>
|
||||
<key>/schemas/apps/pluma-2/plugins/filebrowser/open_at_first_doc</key>
|
||||
<applyto>/apps/pluma-2/plugins/filebrowser/open_at_first_doc</applyto>
|
||||
<owner>pluma</owner>
|
||||
<type>bool</type>
|
||||
<default>TRUE</default>
|
||||
<locale name="C">
|
||||
@@ -67,9 +67,9 @@
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/gedit-2/plugins/filebrowser/filter_mode</key>
|
||||
<applyto>/apps/gedit-2/plugins/filebrowser/filter_mode</applyto>
|
||||
<owner>gedit</owner>
|
||||
<key>/schemas/apps/pluma-2/plugins/filebrowser/filter_mode</key>
|
||||
<applyto>/apps/pluma-2/plugins/filebrowser/filter_mode</applyto>
|
||||
<owner>pluma</owner>
|
||||
<type>string</type>
|
||||
<default>hidden_and_binary</default>
|
||||
<locale name="C">
|
||||
@@ -82,9 +82,9 @@
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/gedit-2/plugins/filebrowser/filter_pattern</key>
|
||||
<applyto>/apps/gedit-2/plugins/filebrowser/filter_pattern</applyto>
|
||||
<owner>gedit</owner>
|
||||
<key>/schemas/apps/pluma-2/plugins/filebrowser/filter_pattern</key>
|
||||
<applyto>/apps/pluma-2/plugins/filebrowser/filter_pattern</applyto>
|
||||
<owner>pluma</owner>
|
||||
<type>string</type>
|
||||
<default></default>
|
||||
<locale name="C">
|
@@ -1,31 +1,31 @@
|
||||
# Modelines Plugin
|
||||
plugindir = $(GEDIT_PLUGINS_LIBS_DIR)
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir) \
|
||||
$(GEDIT_CFLAGS) \
|
||||
$(PLUMA_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(DISABLE_DEPRECATED_CFLAGS)
|
||||
|
||||
modelinesdir = $(GEDIT_PLUGINS_DATA_DIR)/modelines
|
||||
modelinesdir = $(PLUMA_PLUGINS_DATA_DIR)/modelines
|
||||
modelines_DATA = \
|
||||
language-mappings
|
||||
|
||||
plugin_LTLIBRARIES = libmodelines.la
|
||||
|
||||
libmodelines_la_SOURCES = \
|
||||
gedit-modeline-plugin.h \
|
||||
gedit-modeline-plugin.c \
|
||||
pluma-modeline-plugin.h \
|
||||
pluma-modeline-plugin.c \
|
||||
modeline-parser.h \
|
||||
modeline-parser.c
|
||||
|
||||
libmodelines_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
|
||||
libmodelines_la_LIBADD = $(GEDIT_LIBS)
|
||||
libmodelines_la_LIBADD = $(PLUMA_LIBS)
|
||||
|
||||
plugin_in_files = modelines.gedit-plugin.desktop.in
|
||||
%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
plugin_in_files = modelines.pluma-plugin.desktop.in
|
||||
%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
|
||||
plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin)
|
||||
plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin)
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(plugin_in_files) \
|
||||
|
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* gedit-modeline-plugin.h
|
||||
* Emacs, Kate and Vim-style modelines support for gedit.
|
||||
*
|
||||
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __GEDIT_MODELINE_PLUGIN_H__
|
||||
#define __GEDIT_MODELINE_PLUGIN_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <gedit/gedit-plugin.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GEDIT_TYPE_MODELINE_PLUGIN (gedit_modeline_plugin_get_type ())
|
||||
#define GEDIT_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_MODELINE_PLUGIN, GeditModelinePlugin))
|
||||
#define GEDIT_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_MODELINE_PLUGIN, GeditModelinePluginClass))
|
||||
#define GEDIT_IS_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_MODELINE_PLUGIN))
|
||||
#define GEDIT_IS_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_MODELINE_PLUGIN))
|
||||
#define GEDIT_MODELINE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_MODELINE_PLUGIN, GeditModelinePluginClass))
|
||||
|
||||
/* Private structure type */
|
||||
typedef GeditPluginClass GeditModelinePluginClass;
|
||||
typedef GeditPlugin GeditModelinePlugin;
|
||||
|
||||
GType gedit_modeline_plugin_get_type (void) G_GNUC_CONST;
|
||||
|
||||
G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GEDIT_MODELINE_PLUGIN_H__ */
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* modeline-parser.c
|
||||
* Emacs, Kate and Vim-style modelines support for gedit.
|
||||
* Emacs, Kate and Vim-style modelines support for pluma.
|
||||
*
|
||||
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
|
||||
*
|
||||
@@ -22,9 +22,9 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <gedit/gedit-language-manager.h>
|
||||
#include <gedit/gedit-prefs-manager.h>
|
||||
#include <gedit/gedit-debug.h>
|
||||
#include <pluma/pluma-language-manager.h>
|
||||
#include <pluma/pluma-prefs-manager.h>
|
||||
#include <pluma/pluma-debug.h>
|
||||
#include "modeline-parser.h"
|
||||
|
||||
#define MODELINES_LANGUAGE_MAPPINGS_FILE "language-mappings"
|
||||
@@ -32,7 +32,7 @@
|
||||
/* base dir to lookup configuration files */
|
||||
static gchar *modelines_data_dir;
|
||||
|
||||
/* Mappings: language name -> Gedit language ID */
|
||||
/* Mappings: language name -> Pluma language ID */
|
||||
static GHashTable *vim_languages;
|
||||
static GHashTable *emacs_languages;
|
||||
static GHashTable *kate_languages;
|
||||
@@ -112,7 +112,7 @@ load_language_mappings_group (GKeyFile *key_file, const gchar *group)
|
||||
|
||||
keys = g_key_file_get_keys (key_file, group, &length, NULL);
|
||||
|
||||
gedit_debug_message (DEBUG_PLUGINS,
|
||||
pluma_debug_message (DEBUG_PLUGINS,
|
||||
"%" G_GSIZE_FORMAT " mappings in group %s",
|
||||
length, group);
|
||||
|
||||
@@ -143,7 +143,7 @@ load_language_mappings (void)
|
||||
|
||||
if (g_key_file_load_from_file (mappings, fname, 0, &error))
|
||||
{
|
||||
gedit_debug_message (DEBUG_PLUGINS,
|
||||
pluma_debug_message (DEBUG_PLUGINS,
|
||||
"Loaded language mappings from %s",
|
||||
fname);
|
||||
|
||||
@@ -153,7 +153,7 @@ load_language_mappings (void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gedit_debug_message (DEBUG_PLUGINS,
|
||||
pluma_debug_message (DEBUG_PLUGINS,
|
||||
"Failed to loaded language mappings from %s: %s",
|
||||
fname, error->message);
|
||||
|
||||
@@ -395,7 +395,7 @@ parse_emacs_modeline (gchar *s,
|
||||
s++;
|
||||
}
|
||||
|
||||
gedit_debug_message (DEBUG_PLUGINS,
|
||||
pluma_debug_message (DEBUG_PLUGINS,
|
||||
"Emacs modeline bit: %s = %s",
|
||||
key->str, value->str);
|
||||
|
||||
@@ -493,7 +493,7 @@ parse_kate_modeline (gchar *s,
|
||||
s++;
|
||||
}
|
||||
|
||||
gedit_debug_message (DEBUG_PLUGINS,
|
||||
pluma_debug_message (DEBUG_PLUGINS,
|
||||
"Kate modeline bit: %s = %s",
|
||||
key->str, value->str);
|
||||
|
||||
@@ -582,21 +582,21 @@ parse_modeline (gchar *s,
|
||||
strncmp (s, "vi:", 3) == 0 ||
|
||||
strncmp (s, "vim:", 4) == 0))
|
||||
{
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Vim modeline on line %d", line_number);
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Vim modeline on line %d", line_number);
|
||||
|
||||
while (*s != ':') s++;
|
||||
s = parse_vim_modeline (s + 1, options);
|
||||
}
|
||||
else if (line_number <= 2 && strncmp (s, "-*-", 3) == 0)
|
||||
{
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Emacs modeline on line %d", line_number);
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Emacs modeline on line %d", line_number);
|
||||
|
||||
s = parse_emacs_modeline (s + 3, options);
|
||||
}
|
||||
else if ((line_number <= 10 || line_number > line_count - 10) &&
|
||||
strncmp (s, "kate:", 5) == 0)
|
||||
{
|
||||
gedit_debug_message (DEBUG_PLUGINS, "Kate modeline on line %d", line_number);
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Kate modeline on line %d", line_number);
|
||||
|
||||
s = parse_kate_modeline (s + 5, options);
|
||||
}
|
||||
@@ -744,7 +744,7 @@ modeline_parser_apply_modeline (GtkSourceView *view)
|
||||
GtkSourceLanguageManager *manager;
|
||||
GtkSourceLanguage *language;
|
||||
|
||||
manager = gedit_get_language_manager ();
|
||||
manager = pluma_get_language_manager ();
|
||||
language = gtk_source_language_manager_get_language
|
||||
(manager, options.language_id);
|
||||
|
||||
@@ -769,7 +769,7 @@ modeline_parser_apply_modeline (GtkSourceView *view)
|
||||
{
|
||||
gtk_source_view_set_insert_spaces_instead_of_tabs
|
||||
(view,
|
||||
gedit_prefs_manager_get_insert_spaces ());
|
||||
pluma_prefs_manager_get_insert_spaces ());
|
||||
}
|
||||
|
||||
if (has_option (&options, MODELINE_SET_TAB_WIDTH))
|
||||
@@ -779,7 +779,7 @@ modeline_parser_apply_modeline (GtkSourceView *view)
|
||||
else if (check_previous (view, previous, MODELINE_SET_TAB_WIDTH))
|
||||
{
|
||||
gtk_source_view_set_tab_width (view,
|
||||
gedit_prefs_manager_get_tabs_size ());
|
||||
pluma_prefs_manager_get_tabs_size ());
|
||||
}
|
||||
|
||||
if (has_option (&options, MODELINE_SET_INDENT_WIDTH))
|
||||
@@ -798,7 +798,7 @@ modeline_parser_apply_modeline (GtkSourceView *view)
|
||||
else if (check_previous (view, previous, MODELINE_SET_WRAP_MODE))
|
||||
{
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view),
|
||||
gedit_prefs_manager_get_wrap_mode ());
|
||||
pluma_prefs_manager_get_wrap_mode ());
|
||||
}
|
||||
|
||||
if (has_option (&options, MODELINE_SET_RIGHT_MARGIN_POSITION))
|
||||
@@ -808,7 +808,7 @@ modeline_parser_apply_modeline (GtkSourceView *view)
|
||||
else if (check_previous (view, previous, MODELINE_SET_RIGHT_MARGIN_POSITION))
|
||||
{
|
||||
gtk_source_view_set_right_margin_position (view,
|
||||
gedit_prefs_manager_get_right_margin_position ());
|
||||
pluma_prefs_manager_get_right_margin_position ());
|
||||
}
|
||||
|
||||
if (has_option (&options, MODELINE_SET_SHOW_RIGHT_MARGIN))
|
||||
@@ -818,7 +818,7 @@ modeline_parser_apply_modeline (GtkSourceView *view)
|
||||
else if (check_previous (view, previous, MODELINE_SET_SHOW_RIGHT_MARGIN))
|
||||
{
|
||||
gtk_source_view_set_show_right_margin (view,
|
||||
gedit_prefs_manager_get_display_right_margin ());
|
||||
pluma_prefs_manager_get_display_right_margin ());
|
||||
}
|
||||
|
||||
if (previous)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* modelie-parser.h
|
||||
* Emacs, Kate and Vim-style modelines support for gedit.
|
||||
* Emacs, Kate and Vim-style modelines support for pluma.
|
||||
*
|
||||
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
|
||||
*
|
||||
|
@@ -1,8 +1,8 @@
|
||||
[Gedit Plugin]
|
||||
[Pluma Plugin]
|
||||
Module=modelines
|
||||
IAge=2
|
||||
_Name=Modelines
|
||||
_Description=Emacs, Kate and Vim-style modelines support for gedit.
|
||||
_Description=Emacs, Kate and Vim-style modelines support for pluma.
|
||||
Authors=Steve Frécinaux <steve@istique.net>
|
||||
Copyright=Copyright © 2005 Steve Frécinaux
|
||||
Website=http://www.gedit.org
|
||||
Website=http://www.pluma.org
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* gedit-modeline-plugin.c
|
||||
* Emacs, Kate and Vim-style modelines support for gedit.
|
||||
* pluma-modeline-plugin.c
|
||||
* Emacs, Kate and Vim-style modelines support for pluma.
|
||||
*
|
||||
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
|
||||
*
|
||||
@@ -25,14 +25,14 @@
|
||||
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include <gmodule.h>
|
||||
#include "gedit-modeline-plugin.h"
|
||||
#include "pluma-modeline-plugin.h"
|
||||
#include "modeline-parser.h"
|
||||
|
||||
#include <gedit/gedit-debug.h>
|
||||
#include <gedit/gedit-utils.h>
|
||||
#include <pluma/pluma-debug.h>
|
||||
#include <pluma/pluma-utils.h>
|
||||
|
||||
#define WINDOW_DATA_KEY "GeditModelinePluginWindowData"
|
||||
#define DOCUMENT_DATA_KEY "GeditModelinePluginDocumentData"
|
||||
#define WINDOW_DATA_KEY "PlumaModelinePluginWindowData"
|
||||
#define DOCUMENT_DATA_KEY "PlumaModelinePluginDocumentData"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -46,12 +46,12 @@ typedef struct
|
||||
gulong document_saved_handler_id;
|
||||
} DocumentData;
|
||||
|
||||
static void gedit_modeline_plugin_activate (GeditPlugin *plugin, GeditWindow *window);
|
||||
static void gedit_modeline_plugin_deactivate (GeditPlugin *plugin, GeditWindow *window);
|
||||
static GObject *gedit_modeline_plugin_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_param);
|
||||
static void gedit_modeline_plugin_finalize (GObject *object);
|
||||
static void pluma_modeline_plugin_activate (PlumaPlugin *plugin, PlumaWindow *window);
|
||||
static void pluma_modeline_plugin_deactivate (PlumaPlugin *plugin, PlumaWindow *window);
|
||||
static GObject *pluma_modeline_plugin_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_param);
|
||||
static void pluma_modeline_plugin_finalize (GObject *object);
|
||||
|
||||
GEDIT_PLUGIN_REGISTER_TYPE(GeditModelinePlugin, gedit_modeline_plugin)
|
||||
PLUMA_PLUGIN_REGISTER_TYPE(PlumaModelinePlugin, pluma_modeline_plugin)
|
||||
|
||||
static void
|
||||
window_data_free (WindowData *wdata)
|
||||
@@ -66,31 +66,31 @@ document_data_free (DocumentData *ddata)
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_modeline_plugin_class_init (GeditModelinePluginClass *klass)
|
||||
pluma_modeline_plugin_class_init (PlumaModelinePluginClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass);
|
||||
PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass);
|
||||
|
||||
object_class->constructor = gedit_modeline_plugin_constructor;
|
||||
object_class->finalize = gedit_modeline_plugin_finalize;
|
||||
object_class->constructor = pluma_modeline_plugin_constructor;
|
||||
object_class->finalize = pluma_modeline_plugin_finalize;
|
||||
|
||||
plugin_class->activate = gedit_modeline_plugin_activate;
|
||||
plugin_class->deactivate = gedit_modeline_plugin_deactivate;
|
||||
plugin_class->activate = pluma_modeline_plugin_activate;
|
||||
plugin_class->deactivate = pluma_modeline_plugin_deactivate;
|
||||
}
|
||||
|
||||
static GObject *
|
||||
gedit_modeline_plugin_constructor (GType type,
|
||||
pluma_modeline_plugin_constructor (GType type,
|
||||
guint n_construct_properties,
|
||||
GObjectConstructParam *construct_param)
|
||||
{
|
||||
GObject *object;
|
||||
gchar *data_dir;
|
||||
|
||||
object = G_OBJECT_CLASS (gedit_modeline_plugin_parent_class)->constructor (type,
|
||||
object = G_OBJECT_CLASS (pluma_modeline_plugin_parent_class)->constructor (type,
|
||||
n_construct_properties,
|
||||
construct_param);
|
||||
|
||||
data_dir = gedit_plugin_get_data_dir (GEDIT_PLUGIN (object));
|
||||
data_dir = pluma_plugin_get_data_dir (PLUMA_PLUGIN (object));
|
||||
|
||||
modeline_parser_init (data_dir);
|
||||
|
||||
@@ -100,23 +100,23 @@ gedit_modeline_plugin_constructor (GType type,
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_modeline_plugin_init (GeditModelinePlugin *plugin)
|
||||
pluma_modeline_plugin_init (PlumaModelinePlugin *plugin)
|
||||
{
|
||||
gedit_debug_message (DEBUG_PLUGINS, "GeditModelinePlugin initializing");
|
||||
pluma_debug_message (DEBUG_PLUGINS, "PlumaModelinePlugin initializing");
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_modeline_plugin_finalize (GObject *object)
|
||||
pluma_modeline_plugin_finalize (GObject *object)
|
||||
{
|
||||
gedit_debug_message (DEBUG_PLUGINS, "GeditModelinePlugin finalizing");
|
||||
pluma_debug_message (DEBUG_PLUGINS, "PlumaModelinePlugin finalizing");
|
||||
|
||||
modeline_parser_shutdown ();
|
||||
|
||||
G_OBJECT_CLASS (gedit_modeline_plugin_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (pluma_modeline_plugin_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
on_document_loaded_or_saved (GeditDocument *document,
|
||||
on_document_loaded_or_saved (PlumaDocument *document,
|
||||
const GError *error,
|
||||
GtkSourceView *view)
|
||||
{
|
||||
@@ -124,7 +124,7 @@ on_document_loaded_or_saved (GeditDocument *document,
|
||||
}
|
||||
|
||||
static void
|
||||
connect_handlers (GeditView *view)
|
||||
connect_handlers (PlumaView *view)
|
||||
{
|
||||
DocumentData *data;
|
||||
GtkTextBuffer *doc;
|
||||
@@ -147,7 +147,7 @@ connect_handlers (GeditView *view)
|
||||
}
|
||||
|
||||
static void
|
||||
disconnect_handlers (GeditView *view)
|
||||
disconnect_handlers (PlumaView *view)
|
||||
{
|
||||
DocumentData *data;
|
||||
GtkTextBuffer *doc;
|
||||
@@ -170,35 +170,35 @@ disconnect_handlers (GeditView *view)
|
||||
}
|
||||
|
||||
static void
|
||||
on_window_tab_added (GeditWindow *window,
|
||||
GeditTab *tab,
|
||||
on_window_tab_added (PlumaWindow *window,
|
||||
PlumaTab *tab,
|
||||
gpointer user_data)
|
||||
{
|
||||
connect_handlers (gedit_tab_get_view (tab));
|
||||
connect_handlers (pluma_tab_get_view (tab));
|
||||
}
|
||||
|
||||
static void
|
||||
on_window_tab_removed (GeditWindow *window,
|
||||
GeditTab *tab,
|
||||
on_window_tab_removed (PlumaWindow *window,
|
||||
PlumaTab *tab,
|
||||
gpointer user_data)
|
||||
{
|
||||
disconnect_handlers (gedit_tab_get_view (tab));
|
||||
disconnect_handlers (pluma_tab_get_view (tab));
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_modeline_plugin_activate (GeditPlugin *plugin,
|
||||
GeditWindow *window)
|
||||
pluma_modeline_plugin_activate (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
WindowData *wdata;
|
||||
GList *views;
|
||||
GList *l;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
views = gedit_window_get_views (window);
|
||||
views = pluma_window_get_views (window);
|
||||
for (l = views; l != NULL; l = l->next)
|
||||
{
|
||||
connect_handlers (GEDIT_VIEW (l->data));
|
||||
connect_handlers (PLUMA_VIEW (l->data));
|
||||
modeline_parser_apply_modeline (GTK_SOURCE_VIEW (l->data));
|
||||
}
|
||||
g_list_free (views);
|
||||
@@ -218,14 +218,14 @@ gedit_modeline_plugin_activate (GeditPlugin *plugin,
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_modeline_plugin_deactivate (GeditPlugin *plugin,
|
||||
GeditWindow *window)
|
||||
pluma_modeline_plugin_deactivate (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
WindowData *wdata;
|
||||
GList *views;
|
||||
GList *l;
|
||||
|
||||
gedit_debug (DEBUG_PLUGINS);
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
wdata = g_object_steal_data (G_OBJECT (window), WINDOW_DATA_KEY);
|
||||
|
||||
@@ -234,11 +234,11 @@ gedit_modeline_plugin_deactivate (GeditPlugin *plugin,
|
||||
|
||||
window_data_free (wdata);
|
||||
|
||||
views = gedit_window_get_views (window);
|
||||
views = pluma_window_get_views (window);
|
||||
|
||||
for (l = views; l != NULL; l = l->next)
|
||||
{
|
||||
disconnect_handlers (GEDIT_VIEW (l->data));
|
||||
disconnect_handlers (PLUMA_VIEW (l->data));
|
||||
|
||||
modeline_parser_deactivate (GTK_SOURCE_VIEW (l->data));
|
||||
}
|
48
plugins/modelines/pluma-modeline-plugin.h
Executable file
48
plugins/modelines/pluma-modeline-plugin.h
Executable file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* pluma-modeline-plugin.h
|
||||
* Emacs, Kate and Vim-style modelines support for pluma.
|
||||
*
|
||||
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __PLUMA_MODELINE_PLUGIN_H__
|
||||
#define __PLUMA_MODELINE_PLUGIN_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <pluma/pluma-plugin.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define PLUMA_TYPE_MODELINE_PLUGIN (pluma_modeline_plugin_get_type ())
|
||||
#define PLUMA_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_MODELINE_PLUGIN, PlumaModelinePlugin))
|
||||
#define PLUMA_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_MODELINE_PLUGIN, PlumaModelinePluginClass))
|
||||
#define PLUMA_IS_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_MODELINE_PLUGIN))
|
||||
#define PLUMA_IS_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_MODELINE_PLUGIN))
|
||||
#define PLUMA_MODELINE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_MODELINE_PLUGIN, PlumaModelinePluginClass))
|
||||
|
||||
/* Private structure type */
|
||||
typedef PlumaPluginClass PlumaModelinePluginClass;
|
||||
typedef PlumaPlugin PlumaModelinePlugin;
|
||||
|
||||
GType pluma_modeline_plugin_get_type (void) G_GNUC_CONST;
|
||||
|
||||
G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule *module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __PLUMA_MODELINE_PLUGIN_H__ */
|
@@ -1,11 +1,11 @@
|
||||
# Python Console Plugin
|
||||
SUBDIRS = pythonconsole
|
||||
plugindir = $(GEDIT_PLUGINS_LIBS_DIR)
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
|
||||
|
||||
plugin_in_files = pythonconsole.gedit-plugin.desktop.in
|
||||
%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
plugin_in_files = pythonconsole.pluma-plugin.desktop.in
|
||||
%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
|
||||
plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin)
|
||||
plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin)
|
||||
|
||||
EXTRA_DIST = $(plugin_in_files)
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[Gedit Plugin]
|
||||
[Pluma Plugin]
|
||||
Loader=python
|
||||
Module=pythonconsole
|
||||
IAge=2
|
||||
@@ -7,4 +7,4 @@ _Description=Interactive Python console standing in the bottom panel
|
||||
Icon=mate-mime-text-x-python
|
||||
Authors=Steve Frécinaux <steve@istique.net>
|
||||
Copyright=Copyright © 2006 Steve Frécinaux
|
||||
Website=http://www.gedit.org
|
||||
Website=http://www.pluma.org
|
@@ -1,12 +1,12 @@
|
||||
# Python console plugin
|
||||
|
||||
plugindir = $(GEDIT_PLUGINS_LIBS_DIR)/pythonconsole
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)/pythonconsole
|
||||
plugin_PYTHON = \
|
||||
__init__.py \
|
||||
console.py \
|
||||
config.py
|
||||
|
||||
uidir = $(GEDIT_PLUGINS_DATA_DIR)/pythonconsole/ui
|
||||
uidir = $(PLUMA_PLUGINS_DATA_DIR)/pythonconsole/ui
|
||||
ui_DATA = config.ui
|
||||
|
||||
EXTRA_DIST = $(ui_DATA)
|
||||
|
@@ -21,11 +21,11 @@
|
||||
# Parts from "Interactive Python-GTK Console" (stolen from epiphany's console.py)
|
||||
# Copyright (C), 1998 James Henstridge <james@daa.com.au>
|
||||
# Copyright (C), 2005 Adam Hooper <adamh@densi.com>
|
||||
# Bits from gedit Python Console Plugin
|
||||
# Bits from pluma Python Console Plugin
|
||||
# Copyrignt (C), 2005 Raphaël Slinckx
|
||||
|
||||
import gtk
|
||||
import gedit
|
||||
import pluma
|
||||
|
||||
from console import PythonConsole
|
||||
from config import PythonConsoleConfigDialog
|
||||
@@ -33,14 +33,14 @@ from config import PythonConsoleConfig
|
||||
|
||||
PYTHON_ICON = 'mate-mime-text-x-python'
|
||||
|
||||
class PythonConsolePlugin(gedit.Plugin):
|
||||
class PythonConsolePlugin(pluma.Plugin):
|
||||
def __init__(self):
|
||||
gedit.Plugin.__init__(self)
|
||||
pluma.Plugin.__init__(self)
|
||||
self.dlg = None
|
||||
|
||||
def activate(self, window):
|
||||
console = PythonConsole(namespace = {'__builtins__' : __builtins__,
|
||||
'gedit' : gedit,
|
||||
'pluma' : pluma,
|
||||
'window' : window})
|
||||
console.eval('print "You can access the main window through ' \
|
||||
'\'window\' :\\n%s" % window', False)
|
||||
@@ -63,14 +63,14 @@ def create_configure_dialog(self):
|
||||
self.dlg = PythonConsoleConfigDialog(self.get_data_dir())
|
||||
|
||||
dialog = self.dlg.dialog()
|
||||
window = gedit.app_get_default().get_active_window()
|
||||
window = pluma.app_get_default().get_active_window()
|
||||
if window:
|
||||
dialog.set_transient_for(window)
|
||||
|
||||
return dialog
|
||||
|
||||
# Here we dynamically insert create_configure_dialog based on if configuration
|
||||
# is enabled. This has to be done like this because gedit checks if a plugin
|
||||
# is enabled. This has to be done like this because pluma checks if a plugin
|
||||
# is configurable solely on the fact that it has this member defined or not
|
||||
if PythonConsoleConfig.enabled():
|
||||
PythonConsolePlugin.create_configure_dialog = create_configure_dialog
|
||||
|
@@ -21,7 +21,7 @@
|
||||
# Parts from "Interactive Python-GTK Console" (stolen from epiphany's console.py)
|
||||
# Copyright (C), 1998 James Henstridge <james@daa.com.au>
|
||||
# Copyright (C), 2005 Adam Hooper <adamh@densi.com>
|
||||
# Bits from gedit Python Console Plugin
|
||||
# Bits from pluma Python Console Plugin
|
||||
# Copyrignt (C), 2005 Raphaël Slinckx
|
||||
|
||||
import os
|
||||
@@ -29,7 +29,7 @@ import gtk
|
||||
|
||||
__all__ = ('PythonConsoleConfig', 'PythonConsoleConfigDialog')
|
||||
|
||||
MATECONF_KEY_BASE = '/apps/gedit-2/plugins/pythonconsole'
|
||||
MATECONF_KEY_BASE = '/apps/pluma-2/plugins/pythonconsole'
|
||||
MATECONF_KEY_COMMAND_COLOR = MATECONF_KEY_BASE + '/command-color'
|
||||
MATECONF_KEY_ERROR_COLOR = MATECONF_KEY_BASE + '/error-color'
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
# Parts from "Interactive Python-GTK Console" (stolen from epiphany's console.py)
|
||||
# Copyright (C), 1998 James Henstridge <james@daa.com.au>
|
||||
# Copyright (C), 2005 Adam Hooper <adamh@densi.com>
|
||||
# Bits from gedit Python Console Plugin
|
||||
# Bits from pluma Python Console Plugin
|
||||
# Copyrignt (C), 2005 Raphaël Slinckx
|
||||
|
||||
import string
|
||||
|
@@ -1,11 +1,11 @@
|
||||
# Quick Open Plugin
|
||||
SUBDIRS = quickopen
|
||||
plugindir = $(GEDIT_PLUGINS_LIBS_DIR)
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
|
||||
|
||||
plugin_in_files = quickopen.gedit-plugin.desktop.in
|
||||
%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
plugin_in_files = quickopen.pluma-plugin.desktop.in
|
||||
%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
|
||||
plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin)
|
||||
plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin)
|
||||
|
||||
EXTRA_DIST = $(plugin_in_files)
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[Gedit Plugin]
|
||||
[Pluma Plugin]
|
||||
Loader=python
|
||||
Module=quickopen
|
||||
IAge=2
|
||||
@@ -7,4 +7,4 @@ _Description=Quickly open files
|
||||
Icon=gtk-open
|
||||
Authors=Jesse van den Kieboom <jessevdk@gnome.org>
|
||||
Copyright=Copyright © 2009 Jesse van den Kieboom
|
||||
Website=http://www.gedit.org
|
||||
Website=http://www.pluma.org
|
@@ -1,6 +1,6 @@
|
||||
# Quick Open Plugin
|
||||
|
||||
plugindir = $(GEDIT_PLUGINS_LIBS_DIR)/quickopen
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)/quickopen
|
||||
plugin_PYTHON = \
|
||||
__init__.py \
|
||||
popup.py \
|
||||
|
@@ -17,12 +17,12 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
import gedit
|
||||
import pluma
|
||||
from windowhelper import WindowHelper
|
||||
|
||||
class QuickOpenPlugin(gedit.Plugin):
|
||||
class QuickOpenPlugin(pluma.Plugin):
|
||||
def __init__(self):
|
||||
gedit.Plugin.__init__(self)
|
||||
pluma.Plugin.__init__(self)
|
||||
|
||||
self._popup_size = (450, 300)
|
||||
self._helpers = {}
|
||||
|
@@ -25,7 +25,7 @@ import gio
|
||||
import pango
|
||||
import glib
|
||||
import fnmatch
|
||||
import gedit
|
||||
import pluma
|
||||
import xml.sax.saxutils
|
||||
from virtualdirs import VirtualDirectory
|
||||
|
||||
@@ -418,7 +418,7 @@ class Popup(gtk.Dialog):
|
||||
uri = self._entry.get_text()
|
||||
gfile = None
|
||||
|
||||
if gedit.utils.uri_is_valid(uri):
|
||||
if pluma.utils.uri_is_valid(uri):
|
||||
gfile = gio.File(uri)
|
||||
elif os.path.isabs(uri):
|
||||
f = gio.File(uri)
|
||||
|
@@ -65,7 +65,7 @@ class RecentDocumentsDirectory(VirtualDirectory):
|
||||
added = 0
|
||||
|
||||
for item in items:
|
||||
if item.has_group('gedit'):
|
||||
if item.has_group('pluma'):
|
||||
self.append(gio.File(item.get_uri()))
|
||||
added += 1
|
||||
|
||||
|
@@ -17,11 +17,11 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
import gedit
|
||||
import pluma
|
||||
import gtk
|
||||
from popup import Popup
|
||||
import os
|
||||
import gedit.commands
|
||||
import pluma.commands
|
||||
import gio
|
||||
import glib
|
||||
from virtualdirs import RecentDocumentsDirectory
|
||||
@@ -64,7 +64,7 @@ class WindowHelper:
|
||||
|
||||
def _install_menu(self):
|
||||
manager = self._window.get_ui_manager()
|
||||
self._action_group = gtk.ActionGroup("GeditQuickOpenPluginActions")
|
||||
self._action_group = gtk.ActionGroup("PlumaQuickOpenPluginActions")
|
||||
self._action_group.add_actions([
|
||||
("QuickOpen", gtk.STOCK_OPEN, _("Quick open"),
|
||||
'<Ctrl><Alt>O', _("Quickly open documents"),
|
||||
@@ -88,7 +88,7 @@ class WindowHelper:
|
||||
paths.append(gfile.get_parent())
|
||||
|
||||
# File browser root directory
|
||||
if gedit.version[0] > 2 or (gedit.version[0] == 2 and (gedit.version[1] > 26 or (gedit.version[1] == 26 and gedit.version[2] >= 2))):
|
||||
if pluma.version[0] > 2 or (pluma.version[0] == 2 and (pluma.version[1] > 26 or (pluma.version[1] == 26 and pluma.version[2] >= 2))):
|
||||
bus = self._window.get_message_bus()
|
||||
|
||||
try:
|
||||
@@ -192,7 +192,7 @@ class WindowHelper:
|
||||
self._popup = None
|
||||
|
||||
def on_activated(self, gfile):
|
||||
gedit.commands.load_uri(self._window, gfile.get_uri(), None, -1)
|
||||
pluma.commands.load_uri(self._window, gfile.get_uri(), None, -1)
|
||||
return True
|
||||
|
||||
# ex:ts=8:et:
|
||||
|
@@ -1,11 +1,11 @@
|
||||
# Python snippets plugin
|
||||
SUBDIRS = snippets data
|
||||
plugindir = $(GEDIT_PLUGINS_LIBS_DIR)
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
|
||||
|
||||
plugin_in_files = snippets.gedit-plugin.desktop.in
|
||||
%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
plugin_in_files = snippets.pluma-plugin.desktop.in
|
||||
%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
|
||||
plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin)
|
||||
plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin)
|
||||
|
||||
EXTRA_DIST = $(plugin_in_files)
|
||||
|
||||
|
@@ -26,7 +26,7 @@ snippets_DATA = \
|
||||
xml.xml \
|
||||
xslt.xml
|
||||
|
||||
snippetsdir = $(GEDIT_PLUGINS_DATA_DIR)/snippets
|
||||
snippetsdir = $(PLUMA_PLUGINS_DATA_DIR)/snippets
|
||||
|
||||
EXTRA_DIST = $(snippets_DATA)
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<snippets language="C">
|
||||
<snippet id="gpl">
|
||||
<text><![CDATA[/*
|
||||
* ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
|
||||
* ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
|
||||
* This file is part of ${2:<program name>}
|
||||
*
|
||||
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:
|
||||
@@ -34,7 +34,7 @@ $0]]></text>
|
||||
</snippet>
|
||||
<snippet id="lgpl">
|
||||
<text><![CDATA[/*
|
||||
* ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
|
||||
* ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
|
||||
* This file is part of ${2:<library name>}
|
||||
*
|
||||
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:
|
||||
|
@@ -34,7 +34,7 @@ $0]]></text>
|
||||
</snippet>
|
||||
<snippet id="gpl">
|
||||
<text><![CDATA[/*
|
||||
* ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
|
||||
* ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
|
||||
* This file is part of ${2:<program name>}
|
||||
*
|
||||
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:
|
||||
@@ -66,7 +66,7 @@ $0]]></text>
|
||||
</snippet>
|
||||
<snippet id="lgpl">
|
||||
<text><![CDATA[/*
|
||||
* ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
|
||||
* ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
|
||||
* This file is part of ${2:<library name>}
|
||||
*
|
||||
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:
|
||||
|
@@ -105,7 +105,7 @@ $0]]></text>
|
||||
</snippet>
|
||||
<snippet id="gpl">
|
||||
<text><![CDATA[/*
|
||||
* ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
|
||||
* ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
|
||||
* This file is part of ${2:<program name>}
|
||||
*
|
||||
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:
|
||||
@@ -137,7 +137,7 @@ except KeyError:
|
||||
</snippet>
|
||||
<snippet id="lgpl">
|
||||
<text><![CDATA[/*
|
||||
* ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
|
||||
* ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
|
||||
* This file is part of ${2:<library name>}
|
||||
*
|
||||
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:
|
||||
|
@@ -34,13 +34,13 @@
|
||||
<accelerator/>
|
||||
</snippet>
|
||||
<snippet id="appwrap">
|
||||
<text><![CDATA[<application>$GEDIT_SELECTED_TEXT</application>]]></text>
|
||||
<text><![CDATA[<application>$PLUMA_SELECTED_TEXT</application>]]></text>
|
||||
<tag>application</tag>
|
||||
<description>application tag</description>
|
||||
<accelerator/>
|
||||
</snippet>
|
||||
<snippet id="enclose">
|
||||
<text><![CDATA[<${1}>$GEDIT_SELECTED_TEXT</${1}>]]></text>
|
||||
<text><![CDATA[<${1}>$PLUMA_SELECTED_TEXT</${1}>]]></text>
|
||||
<tag>enclose</tag>
|
||||
<description>enclose selected text</description>
|
||||
<accelerator/>
|
||||
|
@@ -54,14 +54,14 @@ $0]]></text>
|
||||
<description>Date</description>
|
||||
</snippet>
|
||||
<snippet id="ref">
|
||||
<text><![CDATA[<a href="${1:http://somesite.com/}">${2:$GEDIT_SELECTED_TEXT}</a>
|
||||
<text><![CDATA[<a href="${1:http://somesite.com/}">${2:$PLUMA_SELECTED_TEXT}</a>
|
||||
]]></text>
|
||||
<accelerator><![CDATA[<Shift><Alt>l]]></accelerator>
|
||||
<description>Wrap Selection as Link</description>
|
||||
<tag>ref</tag>
|
||||
</snippet>
|
||||
<snippet id="open/close">
|
||||
<text><![CDATA[<${1:p}>$GEDIT_SELECTED_TEXT</${1}>]]></text>
|
||||
<text><![CDATA[<${1:p}>$PLUMA_SELECTED_TEXT</${1}>]]></text>
|
||||
<accelerator><![CDATA[<Shift><Alt>w]]></accelerator>
|
||||
<description>Wrap Selection in Open/Close Tag</description>
|
||||
</snippet>
|
||||
@@ -96,7 +96,7 @@ $0]]></text>
|
||||
</snippet>
|
||||
<snippet id="div">
|
||||
<text><![CDATA[<div ${1}>
|
||||
${0:$GEDIT_SELECTED_TEXT}
|
||||
${0:$PLUMA_SELECTED_TEXT}
|
||||
</div>]]></text>
|
||||
<description>Div</description>
|
||||
<tag>div</tag>
|
||||
@@ -117,7 +117,7 @@ $0]]></text>
|
||||
<tag>form</tag>
|
||||
</snippet>
|
||||
<snippet id="h">
|
||||
<text><![CDATA[<h${1:1} id="${2}">${3:$GEDIT_SELECTED_TEXT}</h${1}>
|
||||
<text><![CDATA[<h${1:1} id="${2}">${3:$PLUMA_SELECTED_TEXT}</h${1}>
|
||||
$0]]></text>
|
||||
<description>Heading</description>
|
||||
<tag>h</tag>
|
||||
|
@@ -69,7 +69,7 @@ $0
|
||||
</snippet>
|
||||
<snippet id="try/catch">
|
||||
<text><![CDATA[try {
|
||||
$GEDIT_SELECTED_TEXT
|
||||
$PLUMA_SELECTED_TEXT
|
||||
}
|
||||
catch (Exception e) {
|
||||
${1:e.printStackTrace();}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
lang_DATA = \
|
||||
snippets.lang
|
||||
|
||||
langdir = $(GEDIT_PLUGINS_DATA_DIR)/snippets/lang
|
||||
langdir = $(PLUMA_PLUGINS_DATA_DIR)/snippets/lang
|
||||
|
||||
EXTRA_DIST = $(lang_DATA)
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<snippets language="LaTeX">
|
||||
<snippet id="command">
|
||||
<text><![CDATA[{\\${1:bf} $GEDIT_SELECTED_TEXT}]]></text>
|
||||
<text><![CDATA[{\\${1:bf} $PLUMA_SELECTED_TEXT}]]></text>
|
||||
<accelerator><![CDATA[<Shift><Alt>w]]></accelerator>
|
||||
<description>Wrap Selection in Command</description>
|
||||
</snippet>
|
||||
|
@@ -74,12 +74,12 @@ $0]]></text>
|
||||
<description>while loop</description>
|
||||
</snippet>
|
||||
<snippet id="insert">
|
||||
<text><![CDATA["${1:$GEDIT_SELECTED_TEXT}"]]></text>
|
||||
<text><![CDATA["${1:$PLUMA_SELECTED_TEXT}"]]></text>
|
||||
<accelerator><![CDATA[<Control>2]]></accelerator>
|
||||
<description>Inside String: Insert "…"</description>
|
||||
</snippet>
|
||||
<snippet id="insert-1">
|
||||
<text><![CDATA['${1:$GEDIT_SELECTED_TEXT}']]></text>
|
||||
<text><![CDATA['${1:$PLUMA_SELECTED_TEXT}']]></text>
|
||||
<accelerator><![CDATA[<Control>apostrophe]]></accelerator>
|
||||
<description>Inside String: Insert '…'</description>
|
||||
</snippet>
|
||||
|
@@ -26,73 +26,73 @@
|
||||
<tag>regex</tag>
|
||||
</snippet>
|
||||
<snippet id="$-CURRENT_DOCUMENT_PATH">
|
||||
<text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_PATH]]></text>
|
||||
<description>Gedit Current Document Path Variable</description>
|
||||
<text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_PATH]]></text>
|
||||
<description>Pluma Current Document Path Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
<snippet id="$-CURRENT_DOCUMENT_NAME">
|
||||
<text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_NAME]]></text>
|
||||
<description>Gedit Current Document Name Variable</description>
|
||||
<text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_NAME]]></text>
|
||||
<description>Pluma Current Document Name Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
<snippet id="$-CURRENT_DOCUMENT_URI">
|
||||
<text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_URI]]></text>
|
||||
<description>Gedit Current Document Uri Variable</description>
|
||||
<text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_URI]]></text>
|
||||
<description>Pluma Current Document Uri Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
<snippet id="$-CURRENT_DOCUMENT_SCHEME">
|
||||
<text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_SCHEME]]></text>
|
||||
<description>Gedit Current Document Scheme Variable</description>
|
||||
<text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_SCHEME]]></text>
|
||||
<description>Pluma Current Document Scheme Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
<snippet id="$-CURRENT_DOCUMENT_TYPE">
|
||||
<text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_TYPE]]></text>
|
||||
<description>Gedit Current Document Type Variable</description>
|
||||
<text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_TYPE]]></text>
|
||||
<description>Pluma Current Document Type Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
<snippet id="$-DOCUMENTS_URI">
|
||||
<text><![CDATA[\$GEDIT_DOCUMENTS_URI]]></text>
|
||||
<description>Gedit Documents Uri Variable</description>
|
||||
<text><![CDATA[\$PLUMA_DOCUMENTS_URI]]></text>
|
||||
<description>Pluma Documents Uri Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
<snippet id="$-DOCUMENTS_PATH">
|
||||
<text><![CDATA[\$GEDIT_DOCUMENTS_PATH]]></text>
|
||||
<description>Gedit Documents Path Variable</description>
|
||||
<text><![CDATA[\$PLUMA_DOCUMENTS_PATH]]></text>
|
||||
<description>Pluma Documents Path Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
<snippet id="$-SELECTED_TEXT">
|
||||
<text><![CDATA[\$GEDIT_SELECTED_TEXT]]></text>
|
||||
<description>Gedit Selected Text Variable</description>
|
||||
<text><![CDATA[\$PLUMA_SELECTED_TEXT]]></text>
|
||||
<description>Pluma Selected Text Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
<snippet id="$-CURRENT_WORD">
|
||||
<text><![CDATA[\$GEDIT_CURRENT_WORD]]></text>
|
||||
<description>Gedit Current Word Variable</description>
|
||||
<text><![CDATA[\$PLUMA_CURRENT_WORD]]></text>
|
||||
<description>Pluma Current Word Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
<snippet id="$-CURRENT_LINE">
|
||||
<text><![CDATA[\$GEDIT_CURRENT_LINE]]></text>
|
||||
<description>Gedit Current Line Variable</description>
|
||||
<text><![CDATA[\$PLUMA_CURRENT_LINE]]></text>
|
||||
<description>Pluma Current Line Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
<snippet id="$-CURRENT_LINE_NUMBER">
|
||||
<text><![CDATA[\$GEDIT_CURRENT_LINE_NUMBER]]></text>
|
||||
<description>Gedit Current Line Number Variable</description>
|
||||
<text><![CDATA[\$PLUMA_CURRENT_LINE_NUMBER]]></text>
|
||||
<description>Pluma Current Line Number Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
<snippet id="$-DROP_FILENAME">
|
||||
<text><![CDATA[\$GEDIT_DROP_FILENAME]]></text>
|
||||
<description>Gedit Drop Filename Variable</description>
|
||||
<text><![CDATA[\$PLUMA_DROP_FILENAME]]></text>
|
||||
<description>Pluma Drop Filename Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
<snippet id="$-DROP_REL_FILENAME">
|
||||
<text><![CDATA[\$GEDIT_DROP_REL_FILENAME]]></text>
|
||||
<description>Gedit Drop Relative Filename Variable</description>
|
||||
<text><![CDATA[\$PLUMA_DROP_REL_FILENAME]]></text>
|
||||
<description>Pluma Drop Relative Filename Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
<snippet id="$-DROP_MIME_TYPE">
|
||||
<text><![CDATA[\$GEDIT_DROP_MIME_TYPE]]></text>
|
||||
<description>Gedit Drop Mime Type Variable</description>
|
||||
<text><![CDATA[\$PLUMA_DROP_MIME_TYPE]]></text>
|
||||
<description>Pluma Drop Mime Type Variable</description>
|
||||
<tag>$</tag>
|
||||
</snippet>
|
||||
</snippets>
|
||||
|
@@ -103,13 +103,13 @@ $0]]></text>
|
||||
<tag>attr</tag>
|
||||
</snippet>
|
||||
<snippet id="text">
|
||||
<text><![CDATA[<xsl:text>${1:$GEDIT_SELECTED_TEXT}</xsl:text>
|
||||
<text><![CDATA[<xsl:text>${1:$PLUMA_SELECTED_TEXT}</xsl:text>
|
||||
]]></text>
|
||||
<description>Text</description>
|
||||
<tag>text</tag>
|
||||
</snippet>
|
||||
<snippet id="comment">
|
||||
<text><![CDATA[<xsl:comment>${1:$GEDIT_SELECTED_TEXT}</xsl:comment>
|
||||
<text><![CDATA[<xsl:comment>${1:$PLUMA_SELECTED_TEXT}</xsl:comment>
|
||||
]]></text>
|
||||
<description>Comment</description>
|
||||
<tag>comment</tag>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user