Commit 8956ba81 authored by Philippe Rouquier's avatar Philippe Rouquier

Provide a nautilus extension (based on existing nautilus-cd-burner)

	* Makefile.am:
	* configure.in:
	* nautilus/Makefile.am:
	* nautilus/nautilus-burn-bar.c (nautilus_burn_bar_get_button),
	(nautilus_burn_bar_set_property), (nautilus_burn_bar_get_property),
	(nautilus_burn_bar_class_init), (button_clicked_cb),
	(nautilus_burn_bar_init), (nautilus_burn_bar_finalize),
	(nautilus_burn_bar_new):
	* nautilus/nautilus-burn-bar.h:
	* nautilus/nautilus-burn-extension.c (debug_init), (debug_print),
	(launch_process), (launch_brasero_on_window), (write_activate_cb),
	(uri_to_path), (write_iso_activate_cb), (copy_disc_activate_cb),
	(get_hal_context), (volume_is_blank), (drive_get_first_volume),
	(drive_is_cd_device), (nautilus_burn_get_file_items),
	(nautilus_burn_get_background_items),
	(nautilus_burn_get_toolbar_items),
	(nautilus_burn_menu_provider_iface_init), (bar_activated_cb),
	(dir_is_empty), (destroyed_callback), (sense_widget),
	(nautilus_burn_get_location_widget),
	(nautilus_burn_location_widget_provider_iface_init),
	(update_widget_sensitivity), (update_empty_idle),
	(queue_update_empty), (burn_monitor_cb), (start_monitor),
	(nautilus_burn_instance_init), (nautilus_burn_finalize),
	(nautilus_burn_class_init), (nautilus_burn_get_type),
	(nautilus_burn_register_type), (nautilus_module_initialize),
	(nautilus_module_shutdown), (nautilus_module_list_types):
	* src/Makefile.am:
	* src/main.c (brasero_app_parse_options):

svn path=/trunk/; revision=1462
parent 3ec3db5c
2008-11-03 Philippe Rouquier <ykw@localhost.localdomain>
Provide a nautilus extension (based on existing nautilus-cd-burner)
* Makefile.am:
* configure.in:
* nautilus/Makefile.am:
* nautilus/nautilus-burn-bar.c (nautilus_burn_bar_get_button),
(nautilus_burn_bar_set_property), (nautilus_burn_bar_get_property),
(nautilus_burn_bar_class_init), (button_clicked_cb),
(nautilus_burn_bar_init), (nautilus_burn_bar_finalize),
(nautilus_burn_bar_new):
* nautilus/nautilus-burn-bar.h:
* nautilus/nautilus-burn-extension.c (debug_init), (debug_print),
(launch_process), (launch_brasero_on_window), (write_activate_cb),
(uri_to_path), (write_iso_activate_cb), (copy_disc_activate_cb),
(get_hal_context), (volume_is_blank), (drive_get_first_volume),
(drive_is_cd_device), (nautilus_burn_get_file_items),
(nautilus_burn_get_background_items),
(nautilus_burn_get_toolbar_items),
(nautilus_burn_menu_provider_iface_init), (bar_activated_cb),
(dir_is_empty), (destroyed_callback), (sense_widget),
(nautilus_burn_get_location_widget),
(nautilus_burn_location_widget_provider_iface_init),
(update_widget_sensitivity), (update_empty_idle),
(queue_update_empty), (burn_monitor_cb), (start_monitor),
(nautilus_burn_instance_init), (nautilus_burn_finalize),
(nautilus_burn_class_init), (nautilus_burn_get_type),
(nautilus_burn_register_type), (nautilus_module_initialize),
(nautilus_module_shutdown), (nautilus_module_list_types):
* src/Makefile.am:
* src/main.c (brasero_app_parse_options):
2008-11-03 Philippe Rouquier <ykw@localhost.localdomain>
Fix #558852 – translation issues
......
......@@ -5,6 +5,10 @@ if BUILD_GNOME2
SUBDIRS += help
endif
if BUILD_NAUTILUS
SUBDIRS += nautilus
endif
braserodocdir = ${prefix}/docs/brasero
......
......@@ -112,13 +112,11 @@ PKG_CHECK_MODULES(BRASERO_GSTREAMER, \
gstreamer-0.10 >= $GSTREAMER_REQUIRED \
gstreamer-plugins-base-0.10 >= $GSTREAMER_BASE_REQUIRED)
BRASERO_GSTREAMER_LIBS="$BRASERO_GSTREAMER_LIBS -lgstpbutils-0.10"
AC_SUBST(BRASERO_GSTREAMER_CFLAGS)
AC_SUBST(BRASERO_GSTREAMER_LIBS)
BRASERO_GSTREAMER_CFLAGS="$BRASERO_GSTREAMER_CFLAGS $CFLAGS"
BRASERO_GSTREAMER_LIBS="$BRASERO_GSTREAMER_LIBS $LDFLAGS"
BRASERO_GSTREAMER_LIBS="$BRASERO_GSTREAMER_LIBS $LDFLAGS -lgstpbutils-0.10"
dnl ** used by brasero and one plugin
PKG_CHECK_MODULES(BRASERO_GIO, \
......@@ -152,17 +150,21 @@ BRASERO_BASE_CFLAGS="$BRASERO_BASE_CFLAGS $BRASERO_GIO_CFLAGS $CFLAGS"
BRASERO_BASE_LIBS="$BRASERO_BASE_LIBS $LDFLAGS"
dnl ** used only by brasero app itself ***
PKG_CHECK_MODULES(BRASERO, \
PKG_CHECK_MODULES(BRASERO_UI, \
hal >= $HAL_REQUIRED \
gmodule-2.0 >= $GMODULE_REQUIRED \
gdk-2.0 >= $GDK_REQUIRED \
gtk+-2.0 >= $GTK_REQUIRED \
dbus-glib-1 >= $DBUS_REQUIRED)
AC_SUBST(BRASERO_UI_CFLAGS)
AC_SUBST(BRASERO_UI_LIBS)
BRASERO_CFLAGS="$BRASERO_BASE_CFLAGS $BRASERO_UI_CFLAGS $BRASERO_GSTREAMER_CFLAGS $BRASERO_GIO_CFLAGS $BRASERO_CFLAGS $CFLAGS"
BRASERO_LIBS="$BRASERO_BASE_LIBS $BRASERO_UI_LIBS $BRASERO_GSTREAMER_LIBS $BRASERO_GIO_LIBS $BRASERO_LIBS $BRASERO_SCSI_LIBS $LDFLAGS"
AC_SUBST(BRASERO_CFLAGS)
AC_SUBST(BRASERO_LIBS)
BRASERO_CFLAGS="$BRASERO_BASE_CFLAGS $BRASERO_GSTREAMER_CFLAGS $BRASERO_GIO_CFLAGS $BRASERO_CFLAGS $CFLAGS"
BRASERO_LIBS="$BRASERO_BASE_LIBS $BRASERO_GSTREAMER_LIBS $BRASERO_GIO_LIBS $BRASERO_LIBS $BRASERO_SCSI_LIBS $LDFLAGS"
dnl ********** GNOME2 ******************************
LIBGNOME_REQUIRED=2.10.0
......@@ -187,6 +189,34 @@ fi
AM_CONDITIONAL(BUILD_GNOME2, test x"$build_gnome2" = "xyes")
dnl ****************Nautilus**********************************
EEL_REQUIRED=2.13.3
NAUTILUS_REQUIRED=2.22.2
AC_ARG_ENABLE(nautilus,
[ --enable-nautilus Build Nautilus extension [[default = yes]]],,
[enable_nautilus="yes"])
if test x"$enable_nautilus" = "xyes"; then
PKG_CHECK_MODULES(NAUTILUS_EXTENSION,
libnautilus-extension >= $NAUTILUS_REQUIRED \
eel-2.0 >= $EEL_REQUIRED,
build_nautilus=yes,
build_nautilus=no)
else
build_nautilus="no"
fi
if test x"$build_nautilus" = "xyes"; then
NAUTILUS_EXTENSION_CFLAGS="$BRASERO_BASE_CFLAGS $BRASERO_UI_CFLAGS $NAUTILUS_EXTENSION_CFLAGS"
BRASERO_LIBS="$BRASERO_BASE_LIBS $BRASERO_UI_LIBS $NAUTILUS_EXTENSION_LIBS"
NAUTILUSDIR=`pkg-config --variable=extensiondir libnautilus-extension`
AC_SUBST(NAUTILUSDIR)
AM_GLIB_DEFINE_LOCALEDIR([GNOMELOCALEDIR])
fi
AM_CONDITIONAL(BUILD_NAUTILUS, test x"$build_nautilus" = "xyes")
dnl ****************check for libburn (optional)**************
LIBBURN_REQUIRED=0.4.0
LIBISOFS_REQUIRED=0.6.4
......@@ -373,6 +403,7 @@ data/brasero-open-project.desktop.in
data/brasero-copy-medium.desktop.in
data/icons/Makefile
help/Makefile
nautilus/Makefile
src/plugins/Makefile
src/plugins/cdrdao/Makefile
src/plugins/cdrkit/Makefile
......@@ -399,6 +430,7 @@ dnl Build libnotify support : ${build_libnotify}
echo "Version: $BRASERO_VERSION
Update caches: ${enable_caches}
Build with GNOME2 : ${build_gnome2}
Build Nautilus extension : ${build_nautilus}
Build inotify: ${enable_inotify}
Build search pane : ${build_beagle}
Build playlist pane : ${build_totem}
......
module_flags = -avoid-version -module
INCLUDES = \
$(NAUTILUS_EXTENSION_CFLAGS) \
$(WERROR) \
-D_FILE_OFFSET_BITS=64 \
-D_GNU_SOURCE \
-D_LARGEFILE64_SOURCE \
-D_REENTRANT \
-D_POSIX_PTHREAD_SEMANTICS \
-DPREFIX=\"$(prefix)\" \
-DBINDIR=\""$(bindir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DSHAREDIR=\""$(datadir)"\" \
-DDATADIR=\""$(datadir)/brasero"\"
CLEANFILES = \
$(NULL)
DISTCLEANFILES = \
$(NULL)
### Nautilus Extension
nautilus_extensiondir = $(NAUTILUSDIR)
nautilus_extension_LTLIBRARIES = libnautilus-burn-extension.la
libnautilus_burn_extension_la_SOURCES = \
nautilus-burn-bar.c \
nautilus-burn-bar.h \
nautilus-burn-extension.c \
$(NULL)
libnautilus_burn_extension_la_LIBADD = $(NAUTILUS_EXTENSION_LIBS)
libnautilus_burn_extension_la_LDFLAGS = $(module_flags)
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2005 William Jon McCann <mccann@jhu.edu>
*
* 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 of the License, 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.
*
* Authors: William Jon McCann <mccann@jhu.edu>
*
*/
#include "config.h"
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include "nautilus-burn-bar.h"
static void nautilus_burn_bar_finalize (GObject *object);
#define NAUTILUS_BURN_BAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NAUTILUS_TYPE_BURN_BAR, NautilusBurnBarPrivate))
struct NautilusBurnBarPrivate
{
GtkTooltips *tooltips;
GtkWidget *button;
};
enum {
ACTIVATE,
LAST_SIGNAL
};
static guint signals [LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (NautilusBurnBar, nautilus_burn_bar, GTK_TYPE_HBOX)
GtkWidget *
nautilus_burn_bar_get_button (NautilusBurnBar *bar)
{
GtkWidget *button;
g_return_val_if_fail (bar != NULL, NULL);
button = bar->priv->button;
return button;
}
static void
nautilus_burn_bar_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
NautilusBurnBar *self;
self = NAUTILUS_BURN_BAR (object);
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
nautilus_burn_bar_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
NautilusBurnBar *self;
self = NAUTILUS_BURN_BAR (object);
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
nautilus_burn_bar_class_init (NautilusBurnBarClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = nautilus_burn_bar_finalize;
object_class->get_property = nautilus_burn_bar_get_property;
object_class->set_property = nautilus_burn_bar_set_property;
g_type_class_add_private (klass, sizeof (NautilusBurnBarPrivate));
signals [ACTIVATE] = g_signal_new ("activate",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusBurnBarClass, activate),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
static void
button_clicked_cb (GtkWidget *button,
NautilusBurnBar *bar)
{
g_signal_emit (bar, signals [ACTIVATE], 0);
}
static void
nautilus_burn_bar_init (NautilusBurnBar *bar)
{
GtkWidget *label;
GtkWidget *hbox;
bar->priv = NAUTILUS_BURN_BAR_GET_PRIVATE (bar);
bar->priv->tooltips = gtk_tooltips_new ();
g_object_ref (bar->priv->tooltips);
gtk_object_sink (GTK_OBJECT (bar->priv->tooltips));
hbox = GTK_WIDGET (bar);
label = gtk_label_new (_("CD/DVD Creator Folder"));
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
bar->priv->button = gtk_button_new_with_label (_("Write to Disc"));
gtk_widget_show (bar->priv->button);
gtk_box_pack_end (GTK_BOX (hbox), bar->priv->button, FALSE, FALSE, 0);
g_signal_connect (bar->priv->button, "clicked",
G_CALLBACK (button_clicked_cb),
bar);
gtk_tooltips_set_tip (GTK_TOOLTIPS (bar->priv->tooltips),
bar->priv->button,
_("Write contents to a CD or DVD disc"),
NULL);
}
static void
nautilus_burn_bar_finalize (GObject *object)
{
NautilusBurnBar *bar;
g_return_if_fail (object != NULL);
g_return_if_fail (NAUTILUS_IS_BURN_BAR (object));
bar = NAUTILUS_BURN_BAR (object);
g_return_if_fail (bar->priv != NULL);
if (bar->priv->tooltips != NULL) {
g_object_unref (bar->priv->tooltips);
}
G_OBJECT_CLASS (nautilus_burn_bar_parent_class)->finalize (object);
}
GtkWidget *
nautilus_burn_bar_new (void)
{
GObject *result;
result = g_object_new (NAUTILUS_TYPE_BURN_BAR,
NULL);
return GTK_WIDGET (result);
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2005 William Jon McCann <mccann@jhu.edu>
*
* 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 of the License, 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.
*
* Authors: William Jon McCann <mccann@jhu.edu>
*
*/
#ifndef __NAUTILUS_BURN_BAR_H
#define __NAUTILUS_BURN_BAR_H
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define NAUTILUS_TYPE_BURN_BAR (nautilus_burn_bar_get_type ())
#define NAUTILUS_BURN_BAR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NAUTILUS_TYPE_BURN_BAR, NautilusBurnBar))
#define NAUTILUS_BURN_BAR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NAUTILUS_TYPE_BURN_BAR, NautilusBurnBarClass))
#define NAUTILUS_IS_BURN_BAR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NAUTILUS_TYPE_BURN_BAR))
#define NAUTILUS_IS_BURN_BAR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NAUTILUS_TYPE_BURN_BAR))
#define NAUTILUS_BURN_BAR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NAUTILUS_TYPE_BURN_BAR, NautilusBurnBarClass))
typedef struct NautilusBurnBarPrivate NautilusBurnBarPrivate;
typedef struct
{
GtkHBox box;
NautilusBurnBarPrivate *priv;
} NautilusBurnBar;
typedef struct
{
GtkHBoxClass parent_class;
void (* activate) (NautilusBurnBar *bar);
} NautilusBurnBarClass;
GType nautilus_burn_bar_get_type (void);
GtkWidget *nautilus_burn_bar_new (void);
GtkWidget *nautilus_burn_bar_get_button (NautilusBurnBar *bar);
G_END_DECLS
#endif /* __GS_BURN_BAR_H */
This diff is collapsed.
......@@ -302,5 +302,5 @@ brasero_SOURCES += scsi-uscsi.c
endif
brasero_LDADD = \
$(BRASERO_LIBS) $(BRASERO_LIBXML_LIBS)
$(BRASERO_LIBS) $(BRASERO_GSTREAMER_LIBS) $(BRASERO_LIBXML_LIBS)
......@@ -111,8 +111,8 @@ static const GOptionEntry options [] = {
NULL },
{ "ncb", 'n', 0, G_OPTION_ARG_NONE, &open_ncb,
N_("Open a data project with the contents of nautilus-cd-burner"),
NULL },
N_("Burn the contents of burn:// URI"),
NULL },
{ "debug", 'g', 0, G_OPTION_ARG_NONE, &debug,
N_("Display debug statements on stdout"),
......@@ -260,7 +260,7 @@ brasero_app_parse_options (BraseroApp *app)
list = g_slist_prepend (NULL, "burn:///");
/* in this case we can also add the files */
/* in this case we can also add the files from the command line */
for (iter = files; iter && *iter; iter ++) {
GFile *file;
gchar *uri;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment