renaming from gedit to pluma
This commit is contained in:
@@ -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">
|
Reference in New Issue
Block a user