[brasero] Have brasero use GSettings instead of GConf It also refactors the code in several places.
- From: Philippe Rouquier <philippr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [brasero] Have brasero use GSettings instead of GConf It also refactors the code in several places.
- Date: Sat, 19 Jun 2010 18:31:51 +0000 (UTC)
commit 80d2acac12966b40747faef675cc824eb1dab4f5
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Sat Jun 19 22:30:04 2010 +0200
Have brasero use GSettings instead of GConf
It also refactors the code in several places.
configure.in | 19 +-
data/Makefile.am | 54 +---
data/brasero.convert | 15 +
data/brasero.schemas.in | 146 ---------
data/mime/Makefile.am | 32 ++
data/{ => mime}/brasero.xml.in | 0
data/org.gnome.brasero.gschema.xml.in | 107 +++++++
libbrasero-burn.pc.in | 1 -
libbrasero-burn/Makefile.am | 6 +-
libbrasero-burn/brasero-caps-burn.c | 22 --
libbrasero-burn/brasero-data-project.c | 2 -
libbrasero-burn/brasero-data-vfs.c | 107 ++-----
libbrasero-burn/brasero-data-vfs.h | 8 +-
libbrasero-burn/brasero-dest-selection.c | 5 +-
libbrasero-burn/brasero-drive-properties.c | 1 -
libbrasero-burn/brasero-drive-properties.h | 5 +
libbrasero-burn/brasero-plugin-information.h | 6 +-
libbrasero-burn/brasero-plugin-registration.h | 1 +
libbrasero-burn/brasero-session-cfg.c | 328 ++-------------------
libbrasero-burn/brasero-session-cfg.h | 5 -
libbrasero-burn/brasero-session.c | 173 ++++++++----
libbrasero-burn/brasero-session.h | 1 -
libbrasero-burn/brasero-src-image.c | 79 +++---
libbrasero-burn/burn-basics.c | 16 -
libbrasero-burn/burn-caps.c | 15 +-
libbrasero-burn/burn-plugin-manager.c | 277 +++++++-----------
libbrasero-burn/burn-plugin.c | 138 +++------
libbrasero-media.pc.in | 1 -
nautilus/Makefile.am | 9 +-
nautilus/nautilus-burn-extension.c | 45 ++-
plugins/audio2cue/burn-audio2cue.c | 1 +
plugins/cdrdao/Makefile.am | 5 +-
plugins/cdrdao/burn-cdrdao.c | 20 +-
plugins/cdrkit/Makefile.am | 5 +-
plugins/cdrkit/burn-genisoimage.c | 1 +
plugins/cdrkit/burn-readom.c | 1 +
plugins/cdrkit/burn-wodim.c | 27 +-
plugins/cdrtools/Makefile.am | 5 +-
plugins/cdrtools/burn-cdda2wav.c | 1 +
plugins/cdrtools/burn-cdrecord.c | 27 +-
plugins/cdrtools/burn-mkisofs.c | 1 +
plugins/cdrtools/burn-readcd.c | 1 +
plugins/checksum/Makefile.am | 7 +-
plugins/checksum/burn-checksum-files.c | 17 +-
plugins/checksum/burn-checksum-image.c | 16 +-
plugins/dvdauthor/burn-dvdauthor.c | 1 +
plugins/dvdcss/burn-dvdcss.c | 1 +
plugins/growisofs/Makefile.am | 5 +-
plugins/growisofs/burn-dvd-rw-format.c | 3 +-
plugins/growisofs/burn-growisofs.c | 35 +--
plugins/libburnia/burn-libburn.c | 1 +
plugins/libburnia/burn-libisofs.c | 1 +
plugins/local-track/burn-local-image.c | 1 +
plugins/local-track/burn-uri.c | 1 +
plugins/transcode/burn-normalize.c | 3 +-
plugins/transcode/burn-transcode.c | 1 +
plugins/transcode/burn-vob.c | 1 +
plugins/vcdimager/burn-vcdimager.c | 1 +
po/POTFILES.in | 4 +-
src/Makefile.am | 6 +-
src/brasero-app.c | 29 ++-
src/brasero-app.h | 4 -
src/brasero-drive-settings.c | 392 +++++++++++++++++++++++++
src/brasero-drive-settings.h | 63 ++++
src/brasero-filter-option.c | 154 +---------
src/brasero-plugin-manager-ui.c | 17 +-
src/brasero-plugin-option.c | 216 +++-----------
src/brasero-plugin-option.h | 3 -
src/brasero-project-name.c | 3 +-
src/brasero-project.c | 16 +-
src/brasero-project.h | 3 -
src/main.c | 14 +-
72 files changed, 1234 insertions(+), 1504 deletions(-)
---
diff --git a/configure.in b/configure.in
index cd57271..2b927c1 100644
--- a/configure.in
+++ b/configure.in
@@ -50,6 +50,8 @@ LT_INIT
AM_MAINTAINER_MODE
+dnl **************** Support GSettings *************************
+GLIB_GSETTINGS
dnl **************** documentation *****************************
GNOME_DOC_INIT
@@ -139,10 +141,10 @@ GLIB_REQUIRED=2.22.0
GTHREAD_REQUIRED=2.6.0
GMODULE_REQUIRED=2.6.0
GMODULE_EXPORT_REQUIRED=2.6.0
-GIO_REQUIRED=2.22.0
+GIO_REQUIRED=2.25.0
GDK_REQUIRED=2.6.0
GTK_REQUIRED=2.19.7
-GCONF_REQUIRED=2.0.0
+GCONF_REQUIRED=2.31.1
GSTREAMER_REQUIRED=0.10.15
GSTREAMER_BASE_REQUIRED=0.10.0
LIBXML2_REQUIRED=2.6.0
@@ -597,18 +599,6 @@ else
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale", [Location of package locale files])
fi
-dnl ***** GCONF *************************
-
-AC_ARG_ENABLE(schemas-install,AS_HELP_STRING([--disable-schemas-install],[Disable installation of the gconf schemas]))
-
-AM_CONDITIONAL(SCHEMAS_INSTALL, test x$enable_schemas_install != xno)
-
-AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
-if test x"$GCONFTOOL" = "xno"; then
- AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
-fi
-AM_GCONF_SOURCE_2
-
dnl ****** END ***********************
AC_CONFIG_FILES([
@@ -624,6 +614,7 @@ docs/reference/libbrasero-burn/version.xml
data/Makefile
data/brasero.desktop.in
data/icons/Makefile
+data/mime/Makefile
help/Makefile
nautilus/Makefile
nautilus/brasero-nautilus.desktop.in
diff --git a/data/Makefile.am b/data/Makefile.am
index 7ab1406..788e799 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,47 +1,27 @@
-SUBDIRS = icons
+SUBDIRS = icons mime
- INTLTOOL_SCHEMAS_RULE@
+convertdir=$(datadir)/GConf/gsettings
+convert_DATA=brasero.convert
-schemasdir = @GCONF_SCHEMA_FILE_DIR@
-schemas_in_files = brasero.schemas.in
-schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
-
-
- INTLTOOL_DESKTOP_RULE@
+gsettings_SCHEMAS = org.gnome.brasero.gschema.xml
+ INTLTOOL_XML_NOMERGE_RULE@
+ GSETTINGS_RULES@
desktopdir=$(datadir)/applications
desktop_in_files = brasero.desktop.in
-
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
- INTLTOOL_XML_RULE@
-
-MIMEFILES = brasero.xml.in
-mimedir = $(datadir)/mime/packages
-mime_DATA = brasero.xml
-
+ INTLTOOL_DESKTOP_RULE@
IMAGES= logo.png
CLEANFILES = $(desktop_DATA) \
- $(mime_DATA) \
$(schemas_DATA)
-EXTRA_DIST = brasero.xml \
- $(desktop_in_files) \
- $(schemas_in_files) \
- $(MIMEFILES) \
- $(IMAGES)
-braserodistpixdir = $(datadir)/brasero/
-braserodistpix_DATA = $(IMAGES)
-
-UPDATE_MIME = \
- if [ -f $(DESTDIR)$(datadir)/mime/packages/freedesktop.org.xml ] ; then \
- if which update-mime-database>/dev/null 2>&1; then \
- update-mime-database $(DESTDIR)$(datadir)/mime; \
- fi \
- fi
+EXTRA_DIST = $(desktop_in_files) \
+ $(gsettings_SCHEMAS) \
+ $(convert_DATA)
UPDATE_DESKTOP = \
if [ -f $(DESTDIR)$(datadir)/applications/defaults.list ] ; then \
@@ -50,21 +30,8 @@ UPDATE_DESKTOP = \
fi \
fi
-if GCONF_SCHEMAS_INSTALL
-# don't do this if we are building in eg. rpm
-install-data-local: $(schemas_DATA)
- if test -z "$(DESTDIR)" ; then \
- for p in $(schemas_DATA) ; do \
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/data/$$p ; \
- done \
- fi
-else
-install-data-local:
-endif
-
install-data-hook:
if UPDATE_CACHES
- $(UPDATE_MIME)
$(UPDATE_DESKTOP)
else
@true
@@ -72,7 +39,6 @@ endif
uninstall-hook:
if UPDATE_CACHES
- $(UPDATE_MIME)
$(UPDATE_DESKTOP)
else
@true
diff --git a/data/brasero.convert b/data/brasero.convert
new file mode 100644
index 0000000..54734ce
--- /dev/null
+++ b/data/brasero.convert
@@ -0,0 +1,15 @@
+[org.gnome.brasero.config]
+tmpdir=/apps/brasero/drives/tmpdir
+dao-flag=/apps/brasero/config/dao_flag
+immed-flag=/apps/brasero/config/immed_flag
+minbuf-value=/apps/brasero/config/minbug_value
+raw-flag=/apps/brasero/config/raw_flag
+checksum-files=/apps/brasero/config/checksum_files
+checksum-image=/apps/brasero/config/checksum_image
+
+[org.gnome.brasero.filter]
+broken-sym=/apps/brasero/filter/broken_sym
+replace-sym=/apps/brasero/filter/replace_sym
+
+[org.gnome.brasero.display]
+iso-folder=/apps/brasero/display/iso_folder
\ No newline at end of file
diff --git a/data/mime/Makefile.am b/data/mime/Makefile.am
new file mode 100644
index 0000000..09e1179
--- /dev/null
+++ b/data/mime/Makefile.am
@@ -0,0 +1,32 @@
+MIMEFILES = brasero.xml.in
+mimedir = $(datadir)/mime/packages
+mime_DATA = brasero.xml
+
+ INTLTOOL_XML_RULE@
+
+CLEANFILES = $(mime_DATA)
+
+EXTRA_DIST = $(MIMEFILES)
+
+UPDATE_MIME = \
+ if [ -f $(DESTDIR)$(datadir)/mime/packages/freedesktop.org.xml ] ; then \
+ if which update-mime-database>/dev/null 2>&1; then \
+ update-mime-database $(DESTDIR)$(datadir)/mime; \
+ fi \
+ fi
+
+install-data-hook:
+if UPDATE_CACHES
+ $(UPDATE_MIME)
+else
+ @true
+endif
+
+uninstall-hook:
+if UPDATE_CACHES
+ $(UPDATE_MIME)
+else
+ @true
+endif
+
+-include $(top_srcdir)/git.mk
diff --git a/data/brasero.xml.in b/data/mime/brasero.xml.in
similarity index 100%
rename from data/brasero.xml.in
rename to data/mime/brasero.xml.in
diff --git a/data/org.gnome.brasero.gschema.xml.in b/data/org.gnome.brasero.gschema.xml.in
new file mode 100644
index 0000000..deef8d9
--- /dev/null
+++ b/data/org.gnome.brasero.gschema.xml.in
@@ -0,0 +1,107 @@
+<schemalist>
+ <schema id="org.gnome.brasero" path="/apps/brasero/">
+ <key name="nautilus-extension-debug" type="b">
+ <default>false</default>
+ <_summary>Should Nautilus extension output debug statements</_summary>
+ <_description>Should Nautilus extension output debug statements. The value should be set to true if it should.</_description>
+ </key>
+ <child name="config" schema="org.gnome.brasero.config"/>
+ <child name="display" schema="org.gnome.brasero.display"/>
+ <child name="filter" schema="org.gnome.brasero.filter"/>
+ </schema>
+ <schema id="org.gnome.brasero.config" path="/apps/brasero/config/">
+ <key name="checksum-image" type="i">
+ <default>0</default>
+ <_summary>The type of checksum used for images</_summary>
+ <_description>Set to 0 for MD5, 1 for SHA1 and 2 for SHA256</_description>
+ </key>
+ <key name="checksum-files" type="i">
+ <default>0</default>
+ <_summary>The type of checksum used for files</_summary>
+ <_description>Set to 0 for MD5, 1 for SHA1 and 2 for SHA256</_description>
+ </key>
+ <key name="tmpdir" type="s">
+ <default>''</default>
+ <_summary>Directory to use for temporary files</_summary>
+ <_description>Contains the path to the directory where brasero should store temporary files. If that value is empty, the default directory set for glib will be used.</_description>
+ </key>
+ <key name="engine-group" type="s">
+ <default>''</default>
+ <_summary>Favourite burn engine</_summary>
+ <_description>Contains the name of the favourite burn engine suite installed. It will be used if possible.</_description>
+ </key>
+ <key name="plugins" type="as">
+ <default>[]</default>
+ <_summary>White list of additional plugins to use</_summary>
+ <_description>Contains the list of additional plugins Brasero will use to burn discs. If set to NULL, Brasero will load them all.</_description>
+ </key>
+ <key name="immed-flag" type="b">
+ <default>false</default>
+ <_summary>Enable the "-immed" flag with cdrecord</_summary>
+ <_description>Whether to use the "-immed" flag with cdrecord. Use with caution (set to true) as it's only a workaround for some drives/setups.</_description>
+ </key>
+ <key name="dao-flag" type="b">
+ <default>false</default>
+ <_summary>Whether to use the "-use-the-force-luke=dao" flag with growisofs</_summary>
+ <_description>Whether to use the "-use-the-force-luke=dao" flag with growisofs. Set to false, brasero won't use it; it may be a workaround for some drives/setups.</_description>
+ </key>
+ <key name="minbuf-value" type="i">
+ <default>0</default>
+ <_summary>Used in conjunction with the "-immed" flag with cdrecord</_summary>
+ <_description>Used in conjunction with the "-immed" flag with cdrecord.</_description>
+ </key>
+ <key name="raw-flag" type="b">
+ <default>false</default>
+ <_summary>Whether to use the "--driver generic-mmc-raw" flag with cdrdao</_summary>
+ <_description>Whether to use the "--driver generic-mmc-raw" flag with cdrdao. Set to True, brasero will use it; it may be a workaround for some drives/setups.</_description>
+ </key>
+ </schema>
+ <schema id="org.gnome.brasero.display" path="/apps/brasero/display/">
+ <key name="iso-folder" type="s">
+ <default>''</default>
+ <_summary>The last browsed folder while looking for images to burn</_summary>
+ <_description>Contains the absolute path of the directory that was last browsed for images to burn</_description>
+ </key>
+ <key name="viewer" type="b">
+ <default>true</default>
+ <_summary>Enable file preview</_summary>
+ <_description>Whether to display file preview. Set to true to use it.</_description>
+ </key>
+ </schema>
+ <schema id="org.gnome.brasero.filter" path="/apps/brasero/filter/">
+ <key name="hidden" type="b">
+ <default>true</default>
+ <_summary>Should brasero filter hidden files</_summary>
+ <_description>Should brasero filter hidden files. Set to true, brasero will filter hidden files.</_description>
+ </key>
+ <key name="replace-sym" type="b">
+ <default>true</default>
+ <_summary>Replace symbolic links by their targets</_summary>
+ <_description>Should brasero replace symbolic links by their target files in the project. Set to true, brasero will replace symbolic links.</_description>
+ </key>
+ <key name="broken-sym" type="b">
+ <default>true</default>
+ <_summary>Should brasero filter broken symbolic links</_summary>
+ <_description>Should brasero filter broken symbolic links. Set to true, brasero will filter broken symbolic links.</_description>
+ </key>
+ </schema>
+ <schema id="org.gnome.brasero.plugins">
+ <key name="priority" type="i">
+ <default>0</default>
+ <_summary>The priority value for the plugin</_summary>
+ <_description>When several plugins are available for the same task, this value is used to determine which plugin should be given priority. 0 means the plugin's native priority is used. A positive value overrides the plugin's native priority. A negative value disables the plugin.</_description>
+ </key>
+ </schema>
+ <schema id="org.gnome.brasero.drives">
+ <key name="flags" type="i">
+ <default>1</default>
+ <_summary>Burning flags to be used</_summary>
+ <_description>This value represents the burning flags that were used in such a context the last time.</_description>
+ </key>
+ <key name="speed" type="i">
+ <default>0</default>
+ <_summary>The speed to be used</_summary>
+ <_description>This value represents the speed that was used in such a context the last time.</_description>
+ </key>
+ </schema>
+</schemalist>
\ No newline at end of file
diff --git a/libbrasero-burn.pc.in b/libbrasero-burn.pc.in
index 353928a..01253d9 100644
--- a/libbrasero-burn.pc.in
+++ b/libbrasero-burn.pc.in
@@ -2,7 +2,6 @@ prefix= prefix@
exec_prefix= exec_prefix@
libdir= libdir@
includedir= includedir@
-gconf_serverdir= libexecdir@
Name: libbrasero-burn
diff --git a/libbrasero-burn/Makefile.am b/libbrasero-burn/Makefile.am
index 69c683a..155ad3a 100644
--- a/libbrasero-burn/Makefile.am
+++ b/libbrasero-burn/Makefile.am
@@ -13,7 +13,6 @@ INCLUDES = \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED) \
$(BRASERO_GMODULE_CFLAGS) \
- $(BRASERO_GCONF_CFLAGS) \
$(BRASERO_GLIB_CFLAGS) \
$(BRASERO_GIO_CFLAGS) \
$(BRASERO_GTK_CFLAGS) \
@@ -62,12 +61,11 @@ libbrasero_burn_la_LIBADD = \
../libbrasero-media/libbrasero-media.la \
../libbrasero-utils/libbrasero-utils.la \
$(BRASERO_GLIB_LIBS) \
- $(BRASERO_GTHREAD_LIBS) \
+ $(BRASERO_GTHREAD_LIBS) \
$(BRASERO_GMODULE_LIBS) \
$(BRASERO_GIO_LIBS) \
- $(BRASERO_GCONF_LIBS) \
$(BRASERO_GTK_LIBS) \
- $(BRASERO_GSTREAMER_LIBS) \
+ $(BRASERO_GSTREAMER_LIBS) \
$(BRASERO_DBUS_LIBS) \
$(BRASERO_CANBERRA_LIBS)
diff --git a/libbrasero-burn/brasero-caps-burn.c b/libbrasero-burn/brasero-caps-burn.c
index e7a8c9f..5f6233d 100644
--- a/libbrasero-burn/brasero-caps-burn.c
+++ b/libbrasero-burn/brasero-caps-burn.c
@@ -75,28 +75,6 @@ brasero_burn_caps_job_error_cb (BraseroJob *job,
BraseroBurnError error,
BraseroBurnCaps *caps)
{
-#if 0
- GError *error = NULL;
- GConfClient *client;
-
- /* This was originally to fix a bug in fedora 5 that prevents from
- * sending SCSI commands as a normal user through cdrdao. There is a
- * fallback fortunately with cdrecord and raw images but no on_the_fly
- * burning.
- * That could be used as a hook to know how a job runs and give a
- * "penalty" to job types being too often faulty. There could also be
- * a dialog to ask the user if he wants to use another backend.
- */
-
- /* set it in GConf to remember that next time */
- client = gconf_client_get_default ();
- gconf_client_set_bool (client, GCONF_KEY_CDRDAO_DISABLED, TRUE, &error);
- if (error) {
- g_warning ("Can't write with GConf: %s", error->message);
- g_error_free (error);
- }
- g_object_unref (client);
-#endif
return BRASERO_BURN_ERR;
}
diff --git a/libbrasero-burn/brasero-data-project.c b/libbrasero-burn/brasero-data-project.c
index 5084ad9..2e589c4 100644
--- a/libbrasero-burn/brasero-data-project.c
+++ b/libbrasero-burn/brasero-data-project.c
@@ -42,8 +42,6 @@
#include <gio/gio.h>
-#include <gconf/gconf-client.h>
-
#include "brasero-units.h"
#include "brasero-data-project.h"
diff --git a/libbrasero-burn/brasero-data-vfs.c b/libbrasero-burn/brasero-data-vfs.c
index 29564c0..1962236 100644
--- a/libbrasero-burn/brasero-data-vfs.c
+++ b/libbrasero-burn/brasero-data-vfs.c
@@ -37,8 +37,6 @@
#include <glib.h>
#include <glib/gi18n-lib.h>
-#include <gconf/gconf-client.h>
-
#include "brasero-misc.h"
#include "brasero-data-vfs.h"
@@ -66,6 +64,8 @@ struct _BraseroDataVFSPrivate
BraseroIOJobBase *load_uri;
BraseroIOJobBase *load_contents;
+ GSettings *settings;
+
guint replace_sym:1;
guint filter_hidden:1;
guint filter_broken_sym:1;
@@ -414,7 +414,7 @@ brasero_data_vfs_directory_load_result (GObject *owner,
&& !g_file_info_get_symlink_target (info)) {
/* See if this file is already in restored or if we should filter */
if (priv->filter_broken_sym
- && !brasero_filtered_uri_lookup_restored (priv->filtered, uri)) {
+ && !brasero_filtered_uri_lookup_restored (priv->filtered, uri)) {
brasero_filtered_uri_filter (priv->filtered,
uri,
BRASERO_FILTER_BROKEN_SYM);
@@ -1030,63 +1030,25 @@ brasero_data_vfs_reset (BraseroDataProject *project,
}
static void
-brasero_data_vfs_filter_hidden_changed (GConfClient *client,
- guint cxn,
- GConfEntry *entry,
- gpointer data)
-{
- BraseroDataVFSPrivate *priv;
- GConfValue *value;
-
- priv = BRASERO_DATA_VFS_PRIVATE (data);
-
- value = gconf_entry_get_value (entry);
- if (value->type != GCONF_VALUE_BOOL)
- return;
-
- priv->filter_hidden = gconf_value_get_bool (value);
-}
-
-static void
-brasero_data_vfs_filter_broken_sym_changed (GConfClient *client,
- guint cxn,
- GConfEntry *entry,
- gpointer data)
+brasero_data_vfs_settings_changed (GSettings *settings,
+ const gchar *key,
+ BraseroDataVFS *self)
{
BraseroDataVFSPrivate *priv;
- GConfValue *value;
-
- priv = BRASERO_DATA_VFS_PRIVATE (data);
- value = gconf_entry_get_value (entry);
- if (value->type != GCONF_VALUE_BOOL)
- return;
-
- priv->filter_broken_sym = gconf_value_get_bool (value);
-}
-
-static void
-brasero_data_vfs_replace_sym_changed (GConfClient *client,
- guint cxn,
- GConfEntry *entry,
- gpointer data)
-{
- BraseroDataVFSPrivate *priv;
- GConfValue *value;
-
- priv = BRASERO_DATA_VFS_PRIVATE (data);
-
- value = gconf_entry_get_value (entry);
- if (value->type != GCONF_VALUE_BOOL)
- return;
+ priv = BRASERO_DATA_VFS_PRIVATE (self);
- priv->replace_sym = gconf_value_get_bool (value);
+ if (g_strcmp0 (key, BRASERO_PROPS_FILTER_REPLACE_SYMLINK))
+ priv->replace_sym = g_settings_get_boolean (settings, BRASERO_PROPS_FILTER_REPLACE_SYMLINK);
+ if (g_strcmp0 (key, BRASERO_PROPS_FILTER_BROKEN))
+ priv->filter_broken_sym = g_settings_get_boolean (settings, BRASERO_PROPS_FILTER_BROKEN);
+ if (g_strcmp0 (key, BRASERO_PROPS_FILTER_HIDDEN))
+ priv->filter_hidden = g_settings_get_boolean (settings, BRASERO_PROPS_FILTER_HIDDEN);
}
static void
brasero_data_vfs_init (BraseroDataVFS *object)
{
- GConfClient *client;
BraseroDataVFSPrivate *priv;
priv = BRASERO_DATA_VFS_PRIVATE (object);
@@ -1094,36 +1056,14 @@ brasero_data_vfs_init (BraseroDataVFS *object)
priv->filtered = brasero_filtered_uri_new ();
/* load the fitering rules */
- client = gconf_client_get_default ();
- priv->replace_sym = gconf_client_get_bool (client,
- BRASERO_REPLACE_SYMLINK_KEY,
- NULL);
- priv->filter_hidden = gconf_client_get_bool (client,
- BRASERO_FILTER_HIDDEN_KEY,
- NULL);
- priv->filter_broken_sym = gconf_client_get_bool (client,
- BRASERO_FILTER_BROKEN_SYM_KEY,
- NULL);
-
- gconf_client_notify_add (client,
- BRASERO_FILTER_HIDDEN_KEY,
- brasero_data_vfs_filter_hidden_changed,
- object,
- NULL,
- NULL);
- gconf_client_notify_add (client,
- BRASERO_FILTER_BROKEN_SYM_KEY,
- brasero_data_vfs_filter_broken_sym_changed,
- object,
- NULL,
- NULL);
- gconf_client_notify_add (client,
- BRASERO_REPLACE_SYMLINK_KEY,
- brasero_data_vfs_replace_sym_changed,
- object,
- NULL,
- NULL);
- g_object_unref (client);
+ priv->settings = g_settings_new (BRASERO_SCHEMA_FILTER);
+ priv->replace_sym = g_settings_get_boolean (priv->settings, BRASERO_PROPS_FILTER_REPLACE_SYMLINK);
+ priv->filter_broken_sym = g_settings_get_boolean (priv->settings, BRASERO_PROPS_FILTER_BROKEN);
+ priv->filter_hidden = g_settings_get_boolean (priv->settings, BRASERO_PROPS_FILTER_HIDDEN);
+ g_signal_connect (priv->settings,
+ "changed",
+ G_CALLBACK (brasero_data_vfs_settings_changed),
+ object);
/* create the hash tables */
priv->loading = g_hash_table_new (g_str_hash, g_str_equal);
@@ -1154,6 +1094,11 @@ brasero_data_vfs_finalize (GObject *object)
priv->filtered = NULL;
}
+ if (priv->settings) {
+ g_object_unref (priv->settings);
+ priv->settings = NULL;
+ }
+
G_OBJECT_CLASS (brasero_data_vfs_parent_class)->finalize (object);
}
diff --git a/libbrasero-burn/brasero-data-vfs.h b/libbrasero-burn/brasero-data-vfs.h
index 1926986..0bd9fd4 100644
--- a/libbrasero-burn/brasero-data-vfs.h
+++ b/libbrasero-burn/brasero-data-vfs.h
@@ -39,10 +39,10 @@
G_BEGIN_DECLS
-#define BRASERO_FILTER_HIDDEN_KEY "/apps/brasero/filter/hidden"
-#define BRASERO_FILTER_BROKEN_SYM_KEY "/apps/brasero/filter/broken_sym"
-#define BRASERO_REPLACE_SYMLINK_KEY "/apps/brasero/filter/replace_sym"
-
+#define BRASERO_SCHEMA_FILTER "org.gnome.brasero.filter"
+#define BRASERO_PROPS_FILTER_HIDDEN "hidden"
+#define BRASERO_PROPS_FILTER_BROKEN "broken-sym"
+#define BRASERO_PROPS_FILTER_REPLACE_SYMLINK "replace-sym"
#define BRASERO_TYPE_DATA_VFS (brasero_data_vfs_get_type ())
#define BRASERO_DATA_VFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BRASERO_TYPE_DATA_VFS, BraseroDataVFS))
diff --git a/libbrasero-burn/brasero-dest-selection.c b/libbrasero-burn/brasero-dest-selection.c
index 99d20d8..68739db 100644
--- a/libbrasero-burn/brasero-dest-selection.c
+++ b/libbrasero-burn/brasero-dest-selection.c
@@ -40,8 +40,6 @@
#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
-
#include "burn-basics.h"
#include "burn-plugin-manager.h"
#include "brasero-medium-selection-priv.h"
@@ -147,6 +145,7 @@ brasero_dest_selection_output_changed (BraseroSessionCfg *session,
static void
brasero_dest_selection_flags_changed (BraseroBurnSession *session,
+ GParamSpec *pspec,
BraseroDestSelection *self)
{
BraseroDestSelectionPrivate *priv;
@@ -481,7 +480,7 @@ brasero_dest_selection_set_session (BraseroDestSelection *selection,
G_CALLBACK (brasero_dest_selection_output_changed),
selection);
g_signal_connect (session,
- "flags-changed",
+ "notify::flags",
G_CALLBACK (brasero_dest_selection_flags_changed),
selection);
diff --git a/libbrasero-burn/brasero-drive-properties.c b/libbrasero-burn/brasero-drive-properties.c
index 606e5d7..8afc62d 100644
--- a/libbrasero-burn/brasero-drive-properties.c
+++ b/libbrasero-burn/brasero-drive-properties.c
@@ -49,7 +49,6 @@
#include "burn-basics.h"
#include "burn-debug.h"
-#include "brasero-session-cfg.h"
#include "brasero-drive-properties.h"
typedef struct _BraseroDrivePropertiesPrivate BraseroDrivePropertiesPrivate;
diff --git a/libbrasero-burn/brasero-drive-properties.h b/libbrasero-burn/brasero-drive-properties.h
index beda990..1f3b572 100644
--- a/libbrasero-burn/brasero-drive-properties.h
+++ b/libbrasero-burn/brasero-drive-properties.h
@@ -40,6 +40,11 @@
G_BEGIN_DECLS
+#define BRASERO_DRIVE_PROPERTIES_FLAGS (BRASERO_BURN_FLAG_DUMMY| \
+ BRASERO_BURN_FLAG_MULTI| \
+ BRASERO_BURN_FLAG_BURNPROOF| \
+ BRASERO_BURN_FLAG_NO_TMP_FILES)
+
#define BRASERO_TYPE_DRIVE_PROPERTIES (brasero_drive_properties_get_type ())
#define BRASERO_DRIVE_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BRASERO_TYPE_DRIVE_PROPERTIES, BraseroDriveProperties))
#define BRASERO_DRIVE_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BRASERO_TYPE_DRIVE_PROPERTIES, BraseroDrivePropertiesClass))
diff --git a/libbrasero-burn/brasero-plugin-information.h b/libbrasero-burn/brasero-plugin-information.h
index 5b1bbdb..232db69 100644
--- a/libbrasero-burn/brasero-plugin-information.h
+++ b/libbrasero-burn/brasero-plugin-information.h
@@ -50,6 +50,9 @@ const gchar *
brasero_plugin_get_name (BraseroPlugin *plugin);
const gchar *
+brasero_plugin_get_display_name (BraseroPlugin *plugin);
+
+const gchar *
brasero_plugin_get_author (BraseroPlugin *plugin);
guint
@@ -67,9 +70,6 @@ brasero_plugin_get_description (BraseroPlugin *plugin);
const gchar *
brasero_plugin_get_icon_name (BraseroPlugin *plugin);
-gchar *
-brasero_plugin_get_gconf_priority_key (BraseroPlugin *plugin);
-
typedef struct _BraseroPluginError BraseroPluginError;
struct _BraseroPluginError {
BraseroPluginErrorType type;
diff --git a/libbrasero-burn/brasero-plugin-registration.h b/libbrasero-burn/brasero-plugin-registration.h
index 3f49e43..2d3719d 100644
--- a/libbrasero-burn/brasero-plugin-registration.h
+++ b/libbrasero-burn/brasero-plugin-registration.h
@@ -68,6 +68,7 @@ GType brasero_plugin_register_caps (BraseroPlugin *plugin, gchar **error);
void
brasero_plugin_define (BraseroPlugin *plugin,
const gchar *name,
+ const gchar *display_name,
const gchar *description,
const gchar *author,
guint priority);
diff --git a/libbrasero-burn/brasero-session-cfg.c b/libbrasero-burn/brasero-session-cfg.c
index ebf7cc8..eaa902d 100644
--- a/libbrasero-burn/brasero-session-cfg.c
+++ b/libbrasero-burn/brasero-session-cfg.c
@@ -38,8 +38,6 @@
#include <glib-object.h>
#include <glib/gi18n-lib.h>
-#include <gconf/gconf-client.h>
-
#include "burn-basics.h"
#include "burn-debug.h"
#include "burn-plugin-manager.h"
@@ -55,6 +53,7 @@
#include "brasero-burn-lib.h"
#include "brasero-session-helper.h"
+
/**
* SECTION:brasero-session-cfg
* @short_description: Configure automatically a #BraseroBurnSession object
@@ -78,8 +77,6 @@ struct _BraseroSessionCfgPrivate
guint CD_TEXT_modified:1;
guint configuring:1;
guint disabled:1;
-
- guint inhibit_flag_sig:1;
};
#define BRASERO_SESSION_CFG_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_SESSION_CFG, BraseroSessionCfgPrivate))
@@ -96,9 +93,6 @@ static guint session_cfg_signals [LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (BraseroSessionCfg, brasero_session_cfg, BRASERO_TYPE_SESSION_SPAN);
-#define BRASERO_DEST_SAVED_FLAGS (BRASERO_DRIVE_PROPERTIES_FLAGS|BRASERO_BURN_FLAG_MULTI)
-#define BRASERO_DRIVE_PROPERTIES_KEY "/apps/brasero/drives"
-
/**
* This is to handle tags (and more particularly video ones)
*/
@@ -368,84 +362,6 @@ brasero_session_cfg_get_output_format (BraseroBurnSession *session)
}
/**
- * Get a key to save parameters through GConf
- */
-
-static gchar *
-brasero_session_cfg_get_gconf_key (BraseroSessionCfg *self,
- BraseroMedium *medium,
- const gchar *property)
-{
- BraseroTrackType *type;
- BraseroDrive *drive;
- gchar *display_name;
- gchar *key = NULL;
- gchar *disc_type;
-
- if (brasero_medium_get_status (medium) == BRASERO_MEDIUM_NONE)
- return NULL;
-
- drive = brasero_medium_get_drive (medium);
-
- /* make sure display_name doesn't contain any forbidden characters */
- if (!brasero_drive_is_fake (drive)) {
- gchar *tmp;
-
- tmp = brasero_drive_get_display_name (drive);
- display_name = gconf_escape_key (tmp, -1);
- g_free (tmp);
- }
- else
- display_name = g_strdup ("File");
-
- display_name = display_name ? display_name : g_strdup ("");
-
- disc_type = gconf_escape_key (brasero_medium_get_type_string (medium), -1);
- if (!disc_type) {
- g_free (display_name);
- return NULL;
- }
-
- type = brasero_track_type_new ();
- brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (self), type);
- if (brasero_track_type_get_has_medium (type))
- key = g_strdup_printf ("%s/%s/disc_%s/%s",
- BRASERO_DRIVE_PROPERTIES_KEY,
- display_name,
- disc_type,
- property);
- else if (brasero_track_type_get_has_data (type))
- key = g_strdup_printf ("%s/%s/data_%s/%s",
- BRASERO_DRIVE_PROPERTIES_KEY,
- display_name,
- disc_type,
- property);
- else if (brasero_track_type_get_has_image (type))
- key = g_strdup_printf ("%s/%s/image_%s/%s",
- BRASERO_DRIVE_PROPERTIES_KEY,
- display_name,
- disc_type,
- property);
- else if (brasero_track_type_get_has_stream (type))
- key = g_strdup_printf ("%s/%s/audio_%s/%s",
- BRASERO_DRIVE_PROPERTIES_KEY,
- display_name,
- disc_type,
- property);
- else
- key = g_strdup_printf ("%s/%s/none_%s/%s",
- BRASERO_DRIVE_PROPERTIES_KEY,
- display_name,
- disc_type,
- property);
-
- brasero_track_type_free (type);
- g_free (display_name);
- g_free (disc_type);
- return key;
-}
-
-/**
* brasero_session_cfg_get_error:
* @cfg: a #BraseroSessionCfg
*
@@ -504,59 +420,6 @@ brasero_session_cfg_enable (BraseroSessionCfg *self)
}
static void
-brasero_session_cfg_save_drive_flags (BraseroSessionCfg *self,
- BraseroMedium *medium)
-{
- BraseroSessionCfgPrivate *priv;
- BraseroBurnFlag flags;
- GConfClient *client;
- gchar *key;
-
- priv = BRASERO_SESSION_CFG_PRIVATE (self);
-
- client = gconf_client_get_default ();
- key = brasero_session_cfg_get_gconf_key (self, medium, "flags");
- if (!key) {
- g_object_unref (client);
- return;
- }
-
- flags = gconf_client_get_int (client, key, NULL);
- flags &= ~BRASERO_DEST_SAVED_FLAGS;
- flags |= (brasero_burn_session_get_flags (BRASERO_BURN_SESSION (self)) & BRASERO_DEST_SAVED_FLAGS);
- gconf_client_set_int (client, key, flags, NULL);
- g_free (key);
-}
-
-static void
-brasero_session_cfg_save_drive_properties (BraseroSessionCfg *self,
- BraseroMedium *medium)
-{
- BraseroSessionCfgPrivate *priv;
- GConfClient *client;
- guint64 rate;
- gchar *key;
-
- priv = BRASERO_SESSION_CFG_PRIVATE (self);
-
- brasero_session_cfg_save_drive_flags (self, medium);
-
- client = gconf_client_get_default ();
-
- rate = brasero_burn_session_get_rate (BRASERO_BURN_SESSION (self));
- key = brasero_session_cfg_get_gconf_key (self, medium, "speed");
- if (!key) {
- g_object_unref (client);
- return;
- }
-
- gconf_client_set_int (client, key, rate / 1000, NULL);
- g_free (key);
-
- g_object_unref (client);
-}
-
-static void
brasero_session_cfg_set_drive_properties_default_flags (BraseroSessionCfg *self)
{
BraseroMedia media;
@@ -687,7 +550,7 @@ brasero_session_cfg_set_drive_properties_flags (BraseroSessionCfg *self,
media = brasero_medium_get_status (medium);
/* This prevents signals to be emitted while (re-) adding them one by one */
- priv->inhibit_flag_sig = TRUE;
+ g_object_freeze_notify (G_OBJECT (self));
brasero_burn_session_set_flags (BRASERO_BURN_SESSION (self), BRASERO_BURN_FLAG_NONE);
@@ -699,7 +562,7 @@ brasero_session_cfg_set_drive_properties_flags (BraseroSessionCfg *self,
if (result != BRASERO_BURN_OK) {
brasero_burn_session_set_flags (BRASERO_BURN_SESSION (self), original_flags | flags);
- priv->inhibit_flag_sig = FALSE;
+ g_object_thaw_notify (G_OBJECT (self));
return;
}
@@ -752,11 +615,7 @@ brasero_session_cfg_set_drive_properties_flags (BraseroSessionCfg *self,
brasero_session_cfg_set_drive_properties_default_flags (self);
- /* allow flag changed signal again */
- priv->inhibit_flag_sig = FALSE;
-
- /* These are always supported and better be set.
- * Set them now to trigger the "flags-changed" signal */
+ /* These are always supported and better be set. */
brasero_burn_session_add_flag (BRASERO_BURN_SESSION (self),
BRASERO_BURN_FLAG_CHECK_SIZE|
BRASERO_BURN_FLAG_NOGRACE);
@@ -768,8 +627,8 @@ brasero_session_cfg_set_drive_properties_flags (BraseroSessionCfg *self,
brasero_burn_session_add_flag (BRASERO_BURN_SESSION (self),
BRASERO_BURN_FLAG_EJECT);
- /* Always save flags */
- brasero_session_cfg_save_drive_flags (self, medium);
+ /* allow notify::flags signal again */
+ g_object_thaw_notify (G_OBJECT (self));
}
static void
@@ -791,105 +650,6 @@ brasero_session_cfg_rm_drive_properties_flags (BraseroSessionCfg *self,
}
static void
-brasero_session_cfg_set_drive_properties (BraseroSessionCfg *self)
-{
- BraseroSessionCfgPrivate *priv;
- BraseroTrackType *source;
- BraseroBurnFlag flags;
- BraseroMedium *medium;
- BraseroDrive *drive;
- GConfClient *client;
- GConfValue *value;
- guint64 rate;
- gchar *path;
- gchar *key;
-
- priv = BRASERO_SESSION_CFG_PRIVATE (self);
-
- BRASERO_BURN_LOG ("Restoring session properties");
-
- /* The next two must work as they were checked earlier */
- drive = brasero_burn_session_get_burner (BRASERO_BURN_SESSION (self));
- medium = brasero_drive_get_medium (drive);
- if (!medium || brasero_medium_get_status (medium) == BRASERO_MEDIUM_NONE) {
- BRASERO_BURN_LOG ("No media");
- return;
- }
-
- /* Update/set the rate */
- client = gconf_client_get_default ();
-
- key = brasero_session_cfg_get_gconf_key (self, medium, "speed");
- value = gconf_client_get_without_default (client, key, NULL);
- g_free (key);
-
- if (value) {
- rate = gconf_value_get_int (value) * 1000;
- gconf_value_free (value);
- }
- else
- rate = brasero_medium_get_max_write_speed (medium);
-
- brasero_burn_session_set_rate (BRASERO_BURN_SESSION (self), rate);
-
- /* Set temporary directory
- * NOTE: BraseroBurnSession can cope with NULL path */
- key = g_strdup_printf ("%s/tmpdir", BRASERO_DRIVE_PROPERTIES_KEY);
- path = gconf_client_get_string (client, key, NULL);
- g_free (key);
-
- brasero_burn_session_set_tmpdir (BRASERO_BURN_SESSION (self), path);
- g_free (path);
-
- /* Do the same with the flags.
- * NOTE: we only save/load PROPERTIES_FLAGS */
- key = brasero_session_cfg_get_gconf_key (self, medium, "flags");
- if (!key) {
- g_object_unref (client);
- return;
- }
-
- value = gconf_client_get_without_default (client, key, NULL);
- g_free (key);
-
- g_object_unref (client);
-
- source = brasero_track_type_new ();
- brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (self), source);
- if (brasero_burn_session_same_src_dest_drive (BRASERO_BURN_SESSION (self))) {
- /* Special case */
- if (value) {
- flags = gconf_value_get_int (value) & BRASERO_DEST_SAVED_FLAGS;
- gconf_value_free (value);
- }
- else
- flags = BRASERO_BURN_FLAG_EJECT|
- BRASERO_BURN_FLAG_BURNPROOF;
-
- flags |= BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE|
- BRASERO_BURN_FLAG_FAST_BLANK;
- }
- else if (!value) {
- /* Set sound defaults. */
- flags = BRASERO_BURN_FLAG_EJECT|
- BRASERO_BURN_FLAG_BURNPROOF;
-
- if (brasero_track_type_get_has_data (source)
- || brasero_track_type_get_has_medium (source)
- || brasero_track_type_get_has_image (source))
- flags |= BRASERO_BURN_FLAG_NO_TMP_FILES;
- }
- else {
- /* set the saved flags */
- flags = gconf_value_get_int (value) & BRASERO_DEST_SAVED_FLAGS;
- gconf_value_free (value);
- }
- brasero_track_type_free (source);
-
- brasero_session_cfg_add_drive_properties_flags (self, flags);
-}
-
-static void
brasero_session_cfg_check_drive_settings (BraseroSessionCfg *self)
{
BraseroSessionCfgPrivate *priv;
@@ -1275,7 +1035,7 @@ brasero_session_cfg_update (BraseroSessionCfg *self)
/* Special case for video projects */
if (brasero_track_type_get_has_stream (source)
- && BRASERO_STREAM_FORMAT_HAS_VIDEO (brasero_track_type_get_stream_format (source))) {
+ && BRASERO_STREAM_FORMAT_HAS_VIDEO (brasero_track_type_get_stream_format (source))) {
/* Only set if it was not already set */
if (brasero_burn_session_tag_lookup (BRASERO_BURN_SESSION (self), BRASERO_VCD_TYPE, NULL) != BRASERO_BURN_OK)
brasero_burn_session_tag_add_int (BRASERO_BURN_SESSION (self),
@@ -1353,14 +1113,12 @@ brasero_session_cfg_track_added (BraseroBurnSession *session,
G_CALLBACK (brasero_session_cfg_session_loaded),
session);
- /* when that happens it's mostly because a medium source changed, or
- * a new image was set.
- * - reload saved flags
- * - check if all flags are thereafter supported
+ /* A track was added:
+ * - check if all flags are supported
* - check available formats for path
* - set one path */
+ brasero_session_cfg_check_drive_settings (BRASERO_SESSION_CFG (session));
brasero_session_cfg_update (BRASERO_SESSION_CFG (session));
- brasero_session_cfg_set_drive_properties (BRASERO_SESSION_CFG (session));
}
static void
@@ -1379,15 +1137,10 @@ brasero_session_cfg_track_removed (BraseroBurnSession *session,
brasero_session_cfg_session_loaded,
session);
- /* when that happens it's mostly because a medium source changed, or
- * a new image was set.
- * - reload saved flags
- * - check if all flags are thereafter supported
- * - check available formats for path
- * - set one path
- */
+ /* If there were several tracks and at least one remained there is no
+ * use checking flags since the source type has not changed anyway.
+ * If there is no more track, there is no use checking flags anyway. */
brasero_session_cfg_update (BRASERO_SESSION_CFG (session));
- brasero_session_cfg_set_drive_properties (BRASERO_SESSION_CFG (session));
}
static void
@@ -1402,13 +1155,11 @@ brasero_session_cfg_track_changed (BraseroBurnSession *session,
/* when that happens it's mostly because a medium source changed, or
* a new image was set.
- * - reload saved flags
- * - check if all flags are thereafter supported
+ * - check if all flags are supported
* - check available formats for path
- * - set one path
- */
+ * - set one path if need be */
+ brasero_session_cfg_check_drive_settings (BRASERO_SESSION_CFG (session));
brasero_session_cfg_update (BRASERO_SESSION_CFG (session));
- brasero_session_cfg_set_drive_properties (BRASERO_SESSION_CFG (session));
}
static void
@@ -1453,18 +1204,13 @@ brasero_session_cfg_output_changed (BraseroBurnSession *session,
BRASERO_AUDIO_FORMAT_AC3);
}
}
-
brasero_track_type_free (type);
- brasero_session_cfg_save_drive_properties (BRASERO_SESSION_CFG (session),
- former);
-
/* In this case need to :
- * - load flags
- * - check if all flags are thereafter supported
+ * - check if all flags are supported
* - for images, set a path if it wasn't already set */
+ brasero_session_cfg_check_drive_settings (BRASERO_SESSION_CFG (session));
brasero_session_cfg_update (BRASERO_SESSION_CFG (session));
- brasero_session_cfg_set_drive_properties (BRASERO_SESSION_CFG (session));
}
static void
@@ -1478,27 +1224,11 @@ brasero_session_cfg_caps_changed (BraseroPluginManager *manager,
return;
/* In this case we need to check if:
- * - new flags are supported or not supported anymore
- * - new image types as input/output are supported
- * - if the current set of flags/input/output still works */
- brasero_session_cfg_update (self);
+ * - flags are supported or not supported anymore
+ * - image types as input/output are supported
+ * - if the current set of input/output still works */
brasero_session_cfg_check_drive_settings (self);
-}
-
-static void
-brasero_session_cfg_flags_changed (BraseroBurnSession *session)
-{
- BraseroSessionCfgPrivate *priv;
-
- priv = BRASERO_SESSION_CFG_PRIVATE (session);
- if (priv->disabled)
- return;
-
- /* when we update the flags we don't want a
- * whole series of "flags-changed" emitted.
- * so make sure there is just one at the end */
- if (priv->inhibit_flag_sig)
- g_signal_stop_emission_by_name (session, "flags-changed");
+ brasero_session_cfg_update (self);
}
/**
@@ -1542,7 +1272,6 @@ brasero_session_cfg_remove_flags (BraseroSessionCfg *self,
BraseroBurnFlag flags)
{
BraseroSessionCfgPrivate *priv;
- BraseroDrive *drive;
priv = BRASERO_SESSION_CFG_PRIVATE (self);
@@ -1553,12 +1282,6 @@ brasero_session_cfg_remove_flags (BraseroSessionCfg *self,
* Example: After the removal of MULTI, FAST_BLANK
* becomes available again for DVDRW sequential */
brasero_session_cfg_set_drive_properties_default_flags (self);
-
- /* Always save flags */
- drive = brasero_burn_session_get_burner (BRASERO_BURN_SESSION (self));
- if (drive && brasero_drive_get_medium (drive))
- brasero_session_cfg_save_drive_flags (self, brasero_drive_get_medium (drive));
-
brasero_session_cfg_update (self);
}
@@ -1624,16 +1347,10 @@ brasero_session_cfg_finalize (GObject *object)
{
BraseroPluginManager *manager;
BraseroSessionCfgPrivate *priv;
- BraseroDrive *drive;
GSList *tracks;
priv = BRASERO_SESSION_CFG_PRIVATE (object);
- drive = brasero_burn_session_get_burner (BRASERO_BURN_SESSION (object));
- if (drive && brasero_drive_get_medium (drive))
- brasero_session_cfg_save_drive_properties (BRASERO_SESSION_CFG (object),
- brasero_drive_get_medium (drive));
-
tracks = brasero_burn_session_get_tracks (BRASERO_BURN_SESSION (object));
for (; tracks; tracks = tracks->next) {
BraseroTrack *track;
@@ -1670,7 +1387,6 @@ brasero_session_cfg_class_init (BraseroSessionCfgClass *klass)
session_class->track_removed = brasero_session_cfg_track_removed;
session_class->track_changed = brasero_session_cfg_track_changed;
session_class->output_changed = brasero_session_cfg_output_changed;
- session_class->flags_changed = brasero_session_cfg_flags_changed;
session_class->tag_changed = brasero_session_cfg_tag_changed;
session_cfg_signals [WRONG_EXTENSION_SIGNAL] =
diff --git a/libbrasero-burn/brasero-session-cfg.h b/libbrasero-burn/brasero-session-cfg.h
index 606cf76..a788d6f 100644
--- a/libbrasero-burn/brasero-session-cfg.h
+++ b/libbrasero-burn/brasero-session-cfg.h
@@ -60,11 +60,6 @@ struct _BraseroSessionCfg
GType brasero_session_cfg_get_type (void) G_GNUC_CONST;
-#define BRASERO_DRIVE_PROPERTIES_FLAGS (BRASERO_BURN_FLAG_DUMMY| \
- BRASERO_BURN_FLAG_MULTI| \
- BRASERO_BURN_FLAG_BURNPROOF| \
- BRASERO_BURN_FLAG_NO_TMP_FILES)
-
/**
* This is for the signal sent to tell whether or not session is valid
*/
diff --git a/libbrasero-burn/brasero-session.c b/libbrasero-burn/brasero-session.c
index 479adb0..21e5993 100644
--- a/libbrasero-burn/brasero-session.c
+++ b/libbrasero-burn/brasero-session.c
@@ -43,8 +43,6 @@
#include <glib/gstdio.h>
#include <glib/gi18n-lib.h>
-#include <gconf/gconf-client.h>
-
#include "brasero-session.h"
#include "brasero-session-helper.h"
@@ -127,7 +125,6 @@ typedef struct _BraseroBurnSessionPrivate BraseroBurnSessionPrivate;
typedef enum {
TAG_CHANGED_SIGNAL,
- FLAGS_CHANGED_SIGNAL,
TRACK_ADDED_SIGNAL,
TRACK_REMOVED_SIGNAL,
TRACK_CHANGED_SIGNAL,
@@ -136,9 +133,15 @@ typedef enum {
} BraseroBurnSessionSignalType;
static guint brasero_burn_session_signals [LAST_SIGNAL] = { 0 };
-static GObjectClass *parent_class = NULL;
-#define BRASERO_TEMPORARY_DIRECTORY_KEY "/apps/brasero/drives/tmpdir"
+enum {
+ PROP_0,
+ PROP_TMPDIR,
+ PROP_RATE,
+ PROP_FLAGS
+};
+
+static GObjectClass *parent_class = NULL;
static void
brasero_session_settings_clean (BraseroSessionSetting *settings)
@@ -356,7 +359,7 @@ brasero_burn_session_add_track (BraseroBurnSession *self,
}
/* if there is already a track, then we replace it on condition that it
- * has the same type and it's not AUDIO (only one allowed to have many) */
+ * is not AUDIO (only one type allowed to have several tracks) */
if (!BRASERO_IS_TRACK_STREAM (new_track)
|| !BRASERO_IS_TRACK_STREAM (priv->tracks->data))
brasero_burn_session_free_tracks (self);
@@ -807,6 +810,7 @@ brasero_burn_session_set_rate (BraseroBurnSession *self,
return BRASERO_BURN_ERR;
priv->settings->rate = rate;
+ g_object_notify (G_OBJECT (self), "speed");
return BRASERO_BURN_OK;
}
@@ -1184,7 +1188,6 @@ brasero_burn_session_set_tmpdir (BraseroBurnSession *self,
const gchar *path)
{
BraseroBurnSessionPrivate *priv;
- GConfClient *client;
g_return_val_if_fail (BRASERO_IS_BURN_SESSION (self), BRASERO_BURN_ERR);
@@ -1193,17 +1196,19 @@ brasero_burn_session_set_tmpdir (BraseroBurnSession *self,
if (!g_strcmp0 (priv->tmpdir, path))
return BRASERO_BURN_OK;
- if (priv->tmpdir)
+ if (!path) {
g_free (priv->tmpdir);
-
- if (path)
- priv->tmpdir = g_strdup (path);
- else
priv->tmpdir = NULL;
+ g_object_notify (G_OBJECT (self), "tmpdir");
+ return BRASERO_BURN_OK;
+ }
+
+ if (!g_str_has_prefix (path, G_DIR_SEPARATOR_S))
+ return BRASERO_BURN_ERR;
- client = gconf_client_get_default ();
- gconf_client_set_string (client, BRASERO_TEMPORARY_DIRECTORY_KEY, priv->tmpdir, NULL);
- g_object_unref (client);
+ g_free (priv->tmpdir);
+ priv->tmpdir = g_strdup (path);
+ g_object_notify (G_OBJECT (self), "tmpdir");
return BRASERO_BURN_OK;
}
@@ -1488,9 +1493,7 @@ brasero_burn_session_set_flags (BraseroBurnSession *self,
return;
priv->settings->flags = flags;
- g_signal_emit (self,
- brasero_burn_session_signals [FLAGS_CHANGED_SIGNAL],
- 0);
+ g_object_notify (G_OBJECT (self), "flags");
}
/**
@@ -1515,9 +1518,7 @@ brasero_burn_session_add_flag (BraseroBurnSession *self,
return;
priv->settings->flags |= flag;
- g_signal_emit (self,
- brasero_burn_session_signals [FLAGS_CHANGED_SIGNAL],
- 0);
+ g_object_notify (G_OBJECT (self), "flags");
}
/**
@@ -1542,9 +1543,7 @@ brasero_burn_session_remove_flag (BraseroBurnSession *self,
return;
priv->settings->flags &= ~flag;
- g_signal_emit (self,
- brasero_burn_session_signals [FLAGS_CHANGED_SIGNAL],
- 0);
+ g_object_notify (G_OBJECT (self), "flags");
}
/**
@@ -2386,7 +2385,6 @@ static void
brasero_burn_session_finalize (GObject *object)
{
BraseroBurnSessionPrivate *priv;
- GConfClient *client;
GSList *iter;
BRASERO_BURN_LOG ("Cleaning session");
@@ -2437,10 +2435,6 @@ brasero_burn_session_finalize (GObject *object)
priv->pile_settings = NULL;
}
- client = gconf_client_get_default ();
- gconf_client_set_string (client, BRASERO_TEMPORARY_DIRECTORY_KEY, priv->tmpdir, NULL);
- g_object_unref (client);
-
if (priv->tmpdir) {
g_free (priv->tmpdir);
priv->tmpdir = NULL;
@@ -2477,14 +2471,72 @@ static void
brasero_burn_session_init (BraseroBurnSession *obj)
{
BraseroBurnSessionPrivate *priv;
- GConfClient *client;
priv = BRASERO_BURN_SESSION_PRIVATE (obj);
priv->session = -1;
+}
+
+static void
+brasero_burn_session_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ BraseroBurnSessionPrivate *priv;
- client = gconf_client_get_default ();
- priv->tmpdir = gconf_client_get_string (client, BRASERO_TEMPORARY_DIRECTORY_KEY, NULL);
- g_object_unref (client);
+ g_return_if_fail (BRASERO_IS_BURN_SESSION (object));
+
+ priv = BRASERO_BURN_SESSION_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_TMPDIR:
+ brasero_burn_session_set_tmpdir (BRASERO_BURN_SESSION (object),
+ g_value_get_string (value));
+ break;
+ case PROP_RATE:
+ brasero_burn_session_set_rate (BRASERO_BURN_SESSION (object),
+ g_value_get_int64 (value));
+ break;
+ case PROP_FLAGS:
+ brasero_burn_session_set_flags (BRASERO_BURN_SESSION (object),
+ g_value_get_int (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+brasero_burn_session_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ BraseroBurnSessionPrivate *priv;
+
+ g_return_if_fail (BRASERO_IS_BURN_SESSION (object));
+
+ priv = BRASERO_BURN_SESSION_PRIVATE (object);
+
+ /* Here we do not call the accessors functions to honour the 0/NULL value
+ * which means use system default. */
+ switch (prop_id)
+ {
+ case PROP_TMPDIR:
+ g_value_set_string (value, priv->tmpdir);
+ break;
+ case PROP_RATE:
+ g_value_set_int64 (value, priv->settings->rate);
+ break;
+ case PROP_FLAGS:
+ g_value_set_int (value, priv->settings->flags);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
}
static void
@@ -2495,7 +2547,10 @@ brasero_burn_session_class_init (BraseroBurnSessionClass *klass)
g_type_class_add_private (klass, sizeof (BraseroBurnSessionPrivate));
parent_class = g_type_class_peek_parent(klass);
+
object_class->finalize = brasero_burn_session_finalize;
+ object_class->set_property = brasero_burn_session_set_property;
+ object_class->get_property = brasero_burn_session_get_property;
klass->get_output_path = brasero_burn_session_get_output_path_real;
klass->get_output_format = brasero_burn_session_get_output_format_real;
@@ -2512,7 +2567,7 @@ brasero_burn_session_class_init (BraseroBurnSessionClass *klass)
brasero_burn_session_signals [OUTPUT_CHANGED_SIGNAL] =
g_signal_new ("output_changed",
BRASERO_TYPE_BURN_SESSION,
- G_SIGNAL_RUN_FIRST,
+ G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (BraseroBurnSessionClass, output_changed),
NULL,
NULL,
@@ -2532,7 +2587,7 @@ brasero_burn_session_class_init (BraseroBurnSessionClass *klass)
brasero_burn_session_signals [TRACK_ADDED_SIGNAL] =
g_signal_new ("track_added",
BRASERO_TYPE_BURN_SESSION,
- G_SIGNAL_RUN_FIRST,
+ G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (BraseroBurnSessionClass, track_added),
NULL,
NULL,
@@ -2553,7 +2608,7 @@ brasero_burn_session_class_init (BraseroBurnSessionClass *klass)
brasero_burn_session_signals [TRACK_REMOVED_SIGNAL] =
g_signal_new ("track_removed",
BRASERO_TYPE_BURN_SESSION,
- G_SIGNAL_RUN_FIRST,
+ G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (BraseroBurnSessionClass, track_removed),
NULL,
NULL,
@@ -2574,7 +2629,7 @@ brasero_burn_session_class_init (BraseroBurnSessionClass *klass)
brasero_burn_session_signals [TRACK_CHANGED_SIGNAL] =
g_signal_new ("track_changed",
BRASERO_TYPE_BURN_SESSION,
- G_SIGNAL_RUN_FIRST,
+ G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (BraseroBurnSessionClass, track_changed),
NULL,
NULL,
@@ -2584,24 +2639,6 @@ brasero_burn_session_class_init (BraseroBurnSessionClass *klass)
BRASERO_TYPE_TRACK);
/**
- * BraseroBurnSession::flags-changed:
- * @session: the object which received the signal
- *
- * This signal gets emitted when the flags changed for @session.
- *
- */
- brasero_burn_session_signals [FLAGS_CHANGED_SIGNAL] =
- g_signal_new ("flags_changed",
- BRASERO_TYPE_BURN_SESSION,
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (BraseroBurnSessionClass, flags_changed),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-
- /**
* BraseroBurnSession::tag-changed:
* @session: the object which received the signal
*
@@ -2620,6 +2657,32 @@ brasero_burn_session_class_init (BraseroBurnSessionClass *klass)
G_TYPE_NONE,
1,
G_TYPE_STRING);
+
+ g_object_class_install_property (object_class,
+ PROP_TMPDIR,
+ g_param_spec_string ("tmpdir",
+ "Temporary directory",
+ "The path to the temporary directory",
+ NULL,
+ G_PARAM_READABLE|G_PARAM_WRITABLE));
+ g_object_class_install_property (object_class,
+ PROP_RATE,
+ g_param_spec_int64 ("speed",
+ "Burning speed",
+ "The speed at which a disc should be burned",
+ 0,
+ G_MAXINT64,
+ 0,
+ G_PARAM_READABLE|G_PARAM_WRITABLE));
+ g_object_class_install_property (object_class,
+ PROP_FLAGS,
+ g_param_spec_int ("flags",
+ "Burning flags",
+ "The flags that will be used to burn",
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE|G_PARAM_WRITABLE));
}
/**
diff --git a/libbrasero-burn/brasero-session.h b/libbrasero-burn/brasero-session.h
index 5db9d5d..44819a1 100644
--- a/libbrasero-burn/brasero-session.h
+++ b/libbrasero-burn/brasero-session.h
@@ -70,7 +70,6 @@ struct _BraseroBurnSessionClass {
BraseroImageFormat (*get_output_format) (BraseroBurnSession *session);
/** Signals **/
- void (*flags_changed) (BraseroBurnSession *session);
void (*tag_changed) (BraseroBurnSession *session,
const gchar *tag);
void (*track_added) (BraseroBurnSession *session,
diff --git a/libbrasero-burn/brasero-src-image.c b/libbrasero-burn/brasero-src-image.c
index b7d4d8a..35821cf 100644
--- a/libbrasero-burn/brasero-src-image.c
+++ b/libbrasero-burn/brasero-src-image.c
@@ -40,8 +40,6 @@
#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
-
#include "burn-basics.h"
#include "brasero-drive.h"
@@ -67,6 +65,8 @@ struct _BraseroSrcImagePrivate
GtkWidget *format;
GtkWidget *label;
GtkWidget *file;
+
+ GSettings *settings;
};
#define BRASERO_SRC_IMAGE_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_SRC_IMAGE, BraseroSrcImagePrivate))
@@ -78,7 +78,8 @@ enum {
PROP_SESSION
};
-#define BRASERO_KEY_ISO_DIRECTORY "/apps/brasero/display/iso_folder"
+#define BRASERO_SCHEMA_DISPLAY "org.gnome.brasero.display"
+#define BRASERO_PROPS_ISO_DIRECTORY "iso-folder"
static const gchar *mimes [] = { "application/x-cd-image",
"application/x-cue",
@@ -290,28 +291,29 @@ brasero_src_image_check_parent_directory_cb (GObject *object,
gpointer data)
{
BraseroSrcImagePrivate *priv;
- GConfClient *client;
+ GError *error = NULL;
GFileInfo *info;
priv = BRASERO_SRC_IMAGE_PRIVATE (data);
- info = g_file_query_info_finish (G_FILE (object), result, NULL);
- if (!info)
+ info = g_file_query_info_finish (G_FILE (object), result, &error);
+ if (!info) {
+ g_error_free (error);
return;
+ }
- if (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY)
+ if (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY) {
+ g_object_unref (info);
return;
+ }
+ g_object_unref (info);
g_free (priv->folder);
- priv->folder = g_file_get_uri (G_FILE (object));
-
- client = gconf_client_get_default ();
- gconf_client_set_string (client,
- BRASERO_KEY_ISO_DIRECTORY,
- priv->folder? priv->folder:"",
- NULL);
- g_object_unref (client);
+ priv->folder = g_file_get_path (G_FILE (object));
+ g_settings_set_string (priv->settings,
+ BRASERO_PROPS_ISO_DIRECTORY,
+ priv->folder? priv->folder:"");
}
static void
@@ -335,6 +337,7 @@ brasero_src_image_changed (BraseroSrcImage *dialog)
parent = g_file_get_parent (file);
g_object_unref (file);
+ g_cancellable_reset (priv->cancel);
g_file_query_info_async (parent,
G_FILE_ATTRIBUTE_STANDARD_TYPE,
G_FILE_QUERY_INFO_NONE,
@@ -422,13 +425,13 @@ brasero_src_image_clicked (GtkButton *button)
uri = brasero_src_image_get_current_uri (BRASERO_SRC_IMAGE (button));
if (uri) {
if (!gtk_file_chooser_select_uri (GTK_FILE_CHOOSER (priv->file), uri))
- if (!gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (priv->file), priv->folder))
+ if (!gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (priv->file), priv->folder))
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (priv->file), g_get_home_dir ());
g_free (uri);
}
else if (priv->folder) {
- if (!gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (priv->file), priv->folder))
+ if (!gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (priv->file), priv->folder))
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (priv->file), g_get_home_dir ());
}
else {
@@ -491,30 +494,22 @@ brasero_src_image_set_parent_directory (GObject *object,
gpointer data)
{
BraseroSrcImagePrivate *priv;
- GConfClient *client;
GFileInfo *info;
priv = BRASERO_SRC_IMAGE_PRIVATE (data);
info = g_file_query_info_finish (G_FILE (object), result, NULL);
- if (!info)
- goto update_gconf;
-
- if (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY)
- goto update_gconf;
-
- g_free (priv->folder);
- priv->folder = g_file_get_uri (G_FILE (object));
-
-update_gconf:
-
- client = gconf_client_get_default ();
- gconf_client_set_string (client,
- BRASERO_KEY_ISO_DIRECTORY,
- priv->folder? priv->folder:"",
- NULL);
- g_object_unref (client);
+ if (info) {
+ if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) {
+ g_free (priv->folder);
+ priv->folder = g_file_get_path (G_FILE (object));
+ }
+ g_object_unref (info);
+ }
+ g_settings_set_string (priv->settings,
+ BRASERO_PROPS_ISO_DIRECTORY,
+ priv->folder? priv->folder:"");
g_object_unref (data);
}
@@ -522,7 +517,6 @@ static void
brasero_src_image_init (BraseroSrcImage *object)
{
BraseroSrcImagePrivate *priv;
- GConfClient *client;
GtkWidget *image;
GtkWidget *label;
GtkWidget *box;
@@ -536,15 +530,15 @@ brasero_src_image_init (BraseroSrcImage *object)
/* Set the parent folder to be used in gtkfilechooser. This has to be
* done now not to delay its creation when it's needed and we need to
* know if the location that was saved is still valid */
- client = gconf_client_get_default ();
- uri = gconf_client_get_string (client, BRASERO_KEY_ISO_DIRECTORY, NULL);
- g_object_unref (client);
+ priv->settings = g_settings_new (BRASERO_SCHEMA_DISPLAY);
+ uri = g_settings_get_string (priv->settings, BRASERO_PROPS_ISO_DIRECTORY);
- if (uri && uri [0] != '\0') {
+ if (uri && g_str_has_prefix (uri, G_DIR_SEPARATOR_S)) {
GFile *file;
/* Make sure it's still a valid parent folder */
file = g_file_new_for_commandline_arg (uri);
+ g_cancellable_reset (priv->cancel);
g_file_query_info_async (file,
G_FILE_ATTRIBUTE_STANDARD_TYPE,
G_FILE_QUERY_INFO_NONE,
@@ -608,6 +602,11 @@ brasero_src_image_finalize (GObject *object)
priv->folder = NULL;
}
+ if (priv->settings) {
+ g_object_unref (priv->settings);
+ priv->settings = NULL;
+ }
+
G_OBJECT_CLASS (brasero_src_image_parent_class)->finalize (object);
}
diff --git a/libbrasero-burn/burn-basics.c b/libbrasero-burn/burn-basics.c
index 57bca2e..2bfe7fd 100644
--- a/libbrasero-burn/burn-basics.c
+++ b/libbrasero-burn/burn-basics.c
@@ -37,8 +37,6 @@
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
-#include <gconf/gconf-client.h>
-
#include <gst/gst.h>
#include <gst/pbutils/pbutils.h>
@@ -225,8 +223,6 @@ gboolean
brasero_burn_library_start (int *argc,
char **argv [])
{
- GConfClient *client;
-
BRASERO_BURN_LOG ("Initializing Brasero-burn %i.%i.%i",
BRASERO_MAJOR_VERSION,
BRASERO_MINOR_VERSION,
@@ -253,13 +249,6 @@ brasero_burn_library_start (int *argc,
/* This is for missing codec automatic install */
gst_pb_utils_init ();
- /* preload some gconf keys */
- client = gconf_client_get_default ();
- gconf_client_add_dir (client,
- "/apps/brasero",
- GCONF_CLIENT_PRELOAD_NONE,
- NULL);
-
/* initialize the media library */
brasero_media_library_start ();
@@ -316,8 +305,6 @@ brasero_burn_library_get_plugins_list (void)
void
brasero_burn_library_stop (void)
{
- GConfClient *client;
-
if (plugin_manager) {
g_object_unref (plugin_manager);
plugin_manager = NULL;
@@ -335,9 +322,6 @@ brasero_burn_library_stop (void)
/* Cleanup the io thing */
brasero_io_shutdown ();
-
- client = gconf_client_get_default ();
- gconf_client_remove_dir (client, "/apps/brasero", NULL);
}
/**
diff --git a/libbrasero-burn/burn-caps.c b/libbrasero-burn/burn-caps.c
index 50e5f3f..1756437 100644
--- a/libbrasero-burn/burn-caps.c
+++ b/libbrasero-burn/burn-caps.c
@@ -38,8 +38,6 @@
#include <glib-object.h>
#include <glib/gi18n.h>
-#include <gconf/gconf-client.h>
-
#include "brasero-media-private.h"
#include "burn-basics.h"
@@ -53,7 +51,8 @@
#include "burn-caps.h"
#include "brasero-track-type-private.h"
-#define BRASERO_ENGINE_GROUP_KEY "/apps/brasero/config/engine-group"
+#define BRASERO_ENGINE_GROUP_KEY "engine-group"
+#define BRASERO_SCHEMA_CONFIG "org.gnome.brasero.config"
G_DEFINE_TYPE (BraseroBurnCaps, brasero_burn_caps, G_TYPE_OBJECT);
@@ -313,13 +312,11 @@ brasero_burn_caps_class_init (BraseroBurnCapsClass *klass)
static void
brasero_burn_caps_init (BraseroBurnCaps *obj)
{
- GConfClient *client;
+ GSettings *settings;
obj->priv = g_new0 (BraseroBurnCapsPrivate, 1);
- client = gconf_client_get_default ();
- obj->priv->group_str = gconf_client_get_string (client,
- BRASERO_ENGINE_GROUP_KEY,
- NULL);
- g_object_unref (client);
+ settings = g_settings_new (BRASERO_SCHEMA_CONFIG);
+ obj->priv->group_str = g_settings_get_string (settings, BRASERO_ENGINE_GROUP_KEY);
+ g_object_unref (settings);
}
diff --git a/libbrasero-burn/burn-plugin-manager.c b/libbrasero-burn/burn-plugin-manager.c
index 2124008..38eb50a 100644
--- a/libbrasero-burn/burn-plugin-manager.c
+++ b/libbrasero-burn/burn-plugin-manager.c
@@ -39,8 +39,6 @@
#include <gmodule.h>
#include <glib/gi18n.h>
-#include <gconf/gconf-client.h>
-
#include "burn-basics.h"
#include "burn-debug.h"
#include "brasero-track.h"
@@ -65,7 +63,7 @@ static BraseroPluginManager *default_manager = NULL;
typedef struct _BraseroPluginManagerPrivate BraseroPluginManagerPrivate;
struct _BraseroPluginManagerPrivate {
GSList *plugins;
- guint notification;
+ GSettings *settings;
};
#define BRASERO_PLUGIN_MANAGER_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_PLUGIN_MANAGER, BraseroPluginManagerPrivate))
@@ -79,13 +77,8 @@ enum
};
static guint caps_signals [LAST_SIGNAL] = { 0 };
-static void
-brasero_plugin_manager_set_plugins_state (BraseroPluginManager *self);
-
-static void
-brasero_plugin_manager_plugin_state_changed (BraseroPlugin *plugin,
- gboolean active,
- BraseroPluginManager *self);
+#define BRASERO_SCHEMA_CONFIG "org.gnome.brasero.config"
+#define BRASERO_PROPS_PLUGINS_KEY "plugins"
static GObjectClass* parent_class = NULL;
@@ -110,103 +103,125 @@ brasero_plugin_manager_get_plugins_list (BraseroPluginManager *self)
}
static void
-brasero_plugin_manager_plugins_list_changed_cb (GConfClient *client,
- guint id,
- GConfEntry *entry,
- gpointer user_data)
+brasero_plugin_manager_plugin_state_changed (BraseroPlugin *plugin,
+ gboolean active,
+ BraseroPluginManager *self)
{
- brasero_plugin_manager_set_plugins_state (BRASERO_PLUGIN_MANAGER (user_data));
-}
+ BraseroPluginManagerPrivate *priv;
+ GPtrArray *array;
+ GSList *iter;
-static gint
-brasero_plugin_strcmp (gconstpointer a, gconstpointer b)
-{
- if (!a) {
- if (!b)
- return 0;
+ priv = BRASERO_PLUGIN_MANAGER_PRIVATE (self);
+
+ /* build a list of all active plugins */
+ array = g_ptr_array_new ();
+ for (iter = priv->plugins; iter; iter = iter->next) {
+ BraseroPlugin *plugin;
+ const gchar *name;
+
+ plugin = iter->data;
+
+ if (brasero_plugin_get_gtype (plugin) == G_TYPE_NONE)
+ continue;
+
+ if (!brasero_plugin_get_active (plugin, 0))
+ continue;
- return -1;
+ if (brasero_plugin_can_burn (plugin) == BRASERO_BURN_OK
+ || brasero_plugin_can_convert (plugin) == BRASERO_BURN_OK
+ || brasero_plugin_can_image (plugin) == BRASERO_BURN_OK)
+ continue;
+
+ name = brasero_plugin_get_name (plugin);
+ if (name)
+ g_ptr_array_add (array, (gchar *) name);
}
- if (!b)
- return 1;
+ if (array->len) {
+ g_ptr_array_add (array, NULL);
+ g_settings_set_strv (priv->settings,
+ BRASERO_PROPS_PLUGINS_KEY,
+ (const gchar * const *) array->pdata);
+ }
+ else {
+ gchar *none = "none";
- return strcmp (a, b);
+ g_ptr_array_add (array, none);
+ g_ptr_array_add (array, NULL);
+ g_settings_set_strv (priv->settings,
+ BRASERO_PROPS_PLUGINS_KEY,
+ (const gchar * const *) array->pdata);
+ }
+ g_ptr_array_free (array, TRUE);
+
+ /* tell the rest of the world */
+ g_signal_emit (self,
+ caps_signals [CAPS_CHANGED_SIGNAL],
+ 0);
}
static void
brasero_plugin_manager_set_plugins_state (BraseroPluginManager *self)
{
GSList *iter;
- GConfClient *client;
- GSList *names = NULL;
- GError *error = NULL;
+ int name_num;
+ gchar **names = NULL;
BraseroPluginManagerPrivate *priv;
priv = BRASERO_PLUGIN_MANAGER_PRIVATE (self);
/* get the list of user requested plugins. while at it we add a watch
* on the key so as to be warned whenever the user changes prefs. */
- client = gconf_client_get_default ();
-
- if (priv->notification) {
- gconf_client_notify_remove (client, priv->notification);
- priv->notification = 0;
- }
-
BRASERO_BURN_LOG ("Getting list of plugins to be loaded");
- names = gconf_client_get_list (client,
- BRASERO_PLUGIN_KEY,
- GCONF_VALUE_STRING,
- &error);
-
- if (error) {
- BRASERO_BURN_LOG ("Plugin list not set");
-
- /* couldn't get the key, maybe first launch so load everything
- * in the plugin directory */
- g_error_free (error);
- error = NULL;
- }
-
- if (!names) {
- BRASERO_BURN_LOG ("Setting all plugins active");
-
- /* if names is NULL then accept all plugins */
- for (iter = priv->plugins; iter; iter = iter->next) {
- BraseroPlugin *plugin;
-
- plugin = iter->data;
-
- /* Skip plugins with a problem */
- if (brasero_plugin_get_gtype (plugin) == G_TYPE_NONE)
- continue;
-
- brasero_plugin_set_active (plugin, TRUE);
- }
-
- goto end;
- }
+ names = g_settings_get_strv (priv->settings, BRASERO_PROPS_PLUGINS_KEY);
+ name_num = g_strv_length (names);
for (iter = priv->plugins; iter; iter = iter->next) {
- GSList *node;
+ gboolean active;
BraseroPlugin *plugin;
plugin = iter->data;
if (brasero_plugin_get_compulsory (plugin)) {
+ g_signal_handlers_block_matched (plugin,
+ G_SIGNAL_MATCH_FUNC,
+ 0,
+ 0,
+ 0,
+ brasero_plugin_manager_plugin_state_changed,
+ NULL);
brasero_plugin_set_active (plugin, TRUE);
+ g_signal_handlers_unblock_matched (plugin,
+ G_SIGNAL_MATCH_FUNC,
+ 0,
+ 0,
+ 0,
+ brasero_plugin_manager_plugin_state_changed,
+ NULL);
BRASERO_BURN_LOG ("Plugin set to active. %s is %s",
brasero_plugin_get_name (plugin),
brasero_plugin_get_active (plugin, 0)? "active":"inactive");
continue;
}
- /* See if this plugin is in the names list. If not,
- * de-activate it. */
- node = g_slist_find_custom (names,
- brasero_plugin_get_name (plugin),
- brasero_plugin_strcmp);
+ /* See if this plugin is in the names list. If not, de-activate it. */
+ if (name_num) {
+ int i;
+
+ active = FALSE;
+ for (i = 0; i < name_num; i++) {
+ /* This allows to be able to support the old way
+ * brasero had to save which plugins should be
+ * used */
+ if (!g_strcmp0 (brasero_plugin_get_name (plugin), names [i])
+ || !g_strcmp0 (brasero_plugin_get_display_name (plugin), names [i])) {
+ active = TRUE;
+ break;
+ }
+ }
+ }
+ else
+ active = TRUE;
/* we don't want to receive a signal from this plugin if its
* active state changes */
@@ -217,9 +232,7 @@ brasero_plugin_manager_set_plugins_state (BraseroPluginManager *self)
0,
brasero_plugin_manager_plugin_state_changed,
NULL);
-
- brasero_plugin_set_active (plugin, node != NULL);
-
+ brasero_plugin_set_active (plugin, active);
g_signal_handlers_unblock_matched (plugin,
G_SIGNAL_MATCH_FUNC,
0,
@@ -232,100 +245,15 @@ brasero_plugin_manager_set_plugins_state (BraseroPluginManager *self)
brasero_plugin_get_name (plugin),
brasero_plugin_get_active (plugin, 0)? "active":"inactive");
}
-
- g_slist_foreach (names, (GFunc) g_free, NULL);
- g_slist_free (names);
-
-end:
-
- BRASERO_BURN_LOG ("Watching GConf plugin key");
- priv->notification = gconf_client_notify_add (client,
- BRASERO_PLUGIN_KEY,
- brasero_plugin_manager_plugins_list_changed_cb,
- self,
- NULL,
- NULL);
- g_object_unref (client);
+ g_strfreev (names);
}
static void
-brasero_plugin_manager_plugin_state_changed (BraseroPlugin *plugin,
- gboolean active,
- BraseroPluginManager *self)
+brasero_plugin_manager_plugin_list_changed_cb (GSettings *settings,
+ const gchar *key,
+ gpointer user_data)
{
- BraseroPluginManagerPrivate *priv;
- GError *error = NULL;
- GConfClient *client;
- GSList *list = NULL;
- gboolean res;
- GSList *iter;
-
- priv = BRASERO_PLUGIN_MANAGER_PRIVATE (self);
-
- /* build a list of all active plugins */
- for (iter = priv->plugins; iter; iter = iter->next) {
- BraseroPlugin *plugin;
- const gchar *name;
-
- plugin = iter->data;
-
- if (brasero_plugin_get_gtype (plugin) == G_TYPE_NONE)
- continue;
-
- if (!brasero_plugin_get_active (plugin, 0))
- continue;
-
- if (brasero_plugin_can_burn (plugin) == BRASERO_BURN_OK
- || brasero_plugin_can_convert (plugin) == BRASERO_BURN_OK
- || brasero_plugin_can_image (plugin) == BRASERO_BURN_OK)
- continue;
-
- name = brasero_plugin_get_name (plugin);
- if (name)
- list = g_slist_prepend (list, (gchar *) name);
- }
-
- client = gconf_client_get_default ();
- if (priv->notification) {
- gconf_client_notify_remove (client, priv->notification);
- priv->notification = 0;
- }
-
- if (list)
- res = gconf_client_set_list (client,
- BRASERO_PLUGIN_KEY,
- GCONF_VALUE_STRING,
- list,
- &error);
- else {
- gchar *none = "none";
-
- list = g_slist_prepend (list, none);
- res = gconf_client_set_list (client,
- BRASERO_PLUGIN_KEY,
- GCONF_VALUE_STRING,
- list,
- &error);
- }
-
- if (!res)
- BRASERO_BURN_LOG ("Error saving list of active plugins: %s",
- error ? error->message:"no message");
-
- BRASERO_BURN_LOG ("Watching GConf plugin key");
- priv->notification = gconf_client_notify_add (client,
- BRASERO_PLUGIN_KEY,
- brasero_plugin_manager_plugins_list_changed_cb,
- self,
- NULL,
- NULL);
- g_object_unref (client);
- g_slist_free (list);
-
- /* tell the rest of the world */
- g_signal_emit (self,
- caps_signals [CAPS_CHANGED_SIGNAL],
- 0);
+ brasero_plugin_manager_set_plugins_state (BRASERO_PLUGIN_MANAGER (user_data));
}
#if 0
@@ -436,6 +364,12 @@ brasero_plugin_manager_init (BraseroPluginManager *self)
priv = BRASERO_PLUGIN_MANAGER_PRIVATE (self);
+ priv->settings = g_settings_new (BRASERO_SCHEMA_CONFIG);
+ g_signal_connect (priv->settings,
+ "changed",
+ G_CALLBACK (brasero_plugin_manager_plugin_list_changed_cb),
+ self);
+
/* open the plugin directory */
BRASERO_BURN_LOG ("opening plugin directory %s", BRASERO_PLUGIN_DIRECTORY);
directory = g_dir_open (BRASERO_PLUGIN_DIRECTORY, 0, &error);
@@ -514,12 +448,9 @@ brasero_plugin_manager_finalize (GObject *object)
priv = BRASERO_PLUGIN_MANAGER_PRIVATE (object);
- if (priv->notification) {
- GConfClient *client;
-
- client = gconf_client_get_default ();
- gconf_client_notify_remove (client, priv->notification);
- priv->notification = 0;
+ if (priv->settings) {
+ g_object_unref (priv->settings);
+ priv->settings = NULL;
}
if (priv->plugins) {
diff --git a/libbrasero-burn/burn-plugin.c b/libbrasero-burn/burn-plugin.c
index a6d5012..1efadfc 100644
--- a/libbrasero-burn/burn-plugin.c
+++ b/libbrasero-burn/burn-plugin.c
@@ -41,8 +41,6 @@
#include <gst/gst.h>
-#include <gconf/gconf-client.h>
-
#include "brasero-media-private.h"
#include "brasero-media.h"
@@ -55,7 +53,8 @@
#include "brasero-plugin-registration.h"
#include "burn-caps.h"
-#define BRASERO_PLUGIN_PRIORITY_KEY "/apps/brasero/config/priority"
+#define BRASERO_SCHEMA_PLUGINS "org.gnome.brasero.plugins"
+#define BRASERO_PROPS_PRIORITY_KEY "priority"
typedef struct _BraseroPluginFlagPair BraseroPluginFlagPair;
@@ -91,6 +90,8 @@ struct _BraseroPluginConfOption {
typedef struct _BraseroPluginPrivate BraseroPluginPrivate;
struct _BraseroPluginPrivate
{
+ GSettings *settings;
+
gboolean active;
guint group;
@@ -103,6 +104,7 @@ struct _BraseroPluginPrivate
GModule *handle;
gchar *name;
+ gchar *display_name;
gchar *author;
gchar *description;
gchar *copyright;
@@ -559,47 +561,11 @@ brasero_plugin_conf_option_choice_get (BraseroPluginConfOption *option)
* Used to set the caps of plugin
*/
-gchar *
-brasero_plugin_get_gconf_priority_key (BraseroPlugin *self)
-{
- BraseroPluginPrivate *priv;
- gchar *priority_path;
- gchar *gconf_name;
-
- gint type = 3;
- BraseroBurnCaps *caps;
- gchar *category [] = { "burn",
- "image",
- "convert",
- "misc" };
-
- priv = BRASERO_PLUGIN_PRIVATE (self);
-
- caps = brasero_burn_caps_get_default ();
-
- /* make sure the name used has characters usable by GConf */
- if (brasero_plugin_can_burn (self) == BRASERO_BURN_OK)
- type = 0;
- else if (brasero_plugin_can_image (self) == BRASERO_BURN_OK)
- type = 1;
- else if (brasero_plugin_can_convert (self) == BRASERO_BURN_OK)
- type = 2;
-
- gconf_name = gconf_escape_key (priv->name, -1);
- priority_path = g_strdup_printf ("%s/%s-%s",
- BRASERO_PLUGIN_PRIORITY_KEY,
- gconf_name,
- category [type]);
- g_free (gconf_name);
- g_object_unref (caps);
-
- return priority_path;
-}
-
void
brasero_plugin_define (BraseroPlugin *self,
const gchar *name,
- const gchar *description,
+ const gchar *display_name,
+ const gchar *description,
const gchar *author,
guint priority)
{
@@ -610,6 +576,7 @@ brasero_plugin_define (BraseroPlugin *self,
brasero_plugin_cleanup_definition (self);
priv->name = g_strdup (name);
+ priv->display_name = g_strdup (display_name);
priv->author = g_strdup (author);
priv->description = g_strdup (description);
priv->priority_original = priority;
@@ -1066,6 +1033,16 @@ brasero_plugin_get_name (BraseroPlugin *plugin)
}
const gchar *
+brasero_plugin_get_display_name (BraseroPlugin *plugin)
+{
+ BraseroPluginPrivate *priv;
+
+ priv = BRASERO_PLUGIN_PRIVATE (plugin);
+ return priv->display_name ? priv->display_name:priv->name;
+
+}
+
+const gchar *
brasero_plugin_get_author (BraseroPlugin *plugin)
{
BraseroPluginPrivate *priv;
@@ -1198,26 +1175,17 @@ brasero_plugin_load (GTypeModule *module)
}
static void
-brasero_plugin_priority_changed (GConfClient *client,
- guint cxn,
- GConfEntry *entry,
- gpointer data)
+brasero_plugin_priority_changed (GSettings *settings,
+ const gchar *key,
+ BraseroPlugin *self)
{
BraseroPluginPrivate *priv;
- BraseroPlugin *self;
gboolean is_active;
- GConfValue *value;
- self = BRASERO_PLUGIN (data);
priv = BRASERO_PLUGIN_PRIVATE (self);
- value = gconf_entry_get_value (entry);
- if (!value)
- priv->priority = 0;
- else if (value->type != GCONF_VALUE_INT)
- return;
- else
- priv->priority = gconf_value_get_int (value);
+ /* At the moment it can only be the priority key */
+ priv->priority = g_settings_get_int (settings, BRASERO_PROPS_PRIORITY_KEY);
is_active = brasero_plugin_get_active (self, FALSE);
@@ -1277,10 +1245,7 @@ static void
brasero_plugin_init_real (BraseroPlugin *object)
{
GModule *handle;
- GConfValue *value;
- gint priority_gconf;
- GConfClient *client;
- gchar *priority_path;
+ gchar *settings_path;
BraseroPluginPrivate *priv;
BraseroPluginRegisterType function = NULL;
@@ -1309,36 +1274,24 @@ brasero_plugin_init_real (BraseroPlugin *object)
}
/* now see if we need to override the hardcoded priority of the plugin */
- client = gconf_client_get_default ();
- priority_path = brasero_plugin_get_gconf_priority_key (object);
-
- /* get the gconf priority */
- value = gconf_client_get (client, priority_path, NULL);
- if (value) {
- priority_gconf = gconf_value_get_int (value);
- priv->priority = priority_gconf;
- gconf_value_free (value);
- }
- else {
- /* set a default for an advanced user to modify */
- BRASERO_BURN_LOG ("Creating default priority key %s", priority_path);
- gconf_client_set_int (client,
- priority_path,
- 0,
- NULL);
- }
+ settings_path = g_strconcat ("/apps/brasero/plugins/",
+ priv->name,
+ G_DIR_SEPARATOR_S,
+ NULL);
+ priv->settings = g_settings_new_with_path (BRASERO_SCHEMA_PLUGINS,
+ settings_path);
+ g_free (settings_path);
+
+ priv->priority = g_settings_get_int (priv->settings, BRASERO_PROPS_PRIORITY_KEY);
- /* get notifications when priority changes */
- priv->notify_priority = gconf_client_notify_add (client,
- priority_path,
- brasero_plugin_priority_changed,
- object,
- NULL,
- NULL);
+ /* Make sure a key is created for each plugin */
+ if (!priv->priority)
+ g_settings_set_int (priv->settings, BRASERO_PROPS_PRIORITY_KEY, 0);
- /* No need to emit notify:: here */
- g_free (priority_path);
- g_object_unref (client);
+ g_signal_connect (priv->settings,
+ "changed",
+ G_CALLBACK (brasero_plugin_priority_changed),
+ object);
/* Check if it can operate */
brasero_plugin_check_plugin_ready (object);
@@ -1370,6 +1323,7 @@ brasero_plugin_finalize (GObject *object)
}
g_free (priv->name);
+ g_free (priv->display_name);
g_free (priv->author);
g_free (priv->description);
@@ -1379,13 +1333,9 @@ brasero_plugin_finalize (GObject *object)
g_slist_foreach (priv->blank_flags, (GFunc) g_free, NULL);
g_slist_free (priv->blank_flags);
- if (priv->notify_priority) {
- GConfClient *client;
-
- client = gconf_client_get_default ();
- gconf_client_notify_remove (client, priv->notify_priority);
- priv->notify_priority = 0;
- g_object_unref (client);
+ if (priv->settings) {
+ g_object_unref (priv->settings);
+ priv->settings = NULL;
}
if (priv->errors) {
diff --git a/libbrasero-media.pc.in b/libbrasero-media.pc.in
index 3da76c6..dd272bf 100644
--- a/libbrasero-media.pc.in
+++ b/libbrasero-media.pc.in
@@ -2,7 +2,6 @@ prefix= prefix@
exec_prefix= exec_prefix@
libdir= libdir@
includedir= includedir@
-gconf_serverdir= libexecdir@
Name: libbrasero-media
diff --git a/nautilus/Makefile.am b/nautilus/Makefile.am
index 657ed6e..4a11915 100644
--- a/nautilus/Makefile.am
+++ b/nautilus/Makefile.am
@@ -9,7 +9,6 @@ INCLUDES = \
-I$(top_builddir)/libbrasero-burn/ \
-I$(top_srcdir)/src/ \
-I$(top_builddir)/src/ \
- $(BRASERO_GCONF_CFLAGS) \
$(NAUTILUS_EXTENSION_CFLAGS) \
$(WARN_CFLAGS) \
$(WERROR) \
@@ -44,12 +43,12 @@ libnautilus_brasero_extension_la_SOURCES = \
nautilus-burn-bar.c \
nautilus-burn-bar.h \
nautilus-burn-extension.c \
- $(NULL) \
- ../src/brasero-project-name.c \
- ../src/brasero-project-name.h
+ $(top_srcdir)/src/brasero-project-name.c \
+ $(top_srcdir)/src/brasero-project-name.h \
+ $(top_srcdir)/src/brasero-drive-settings.h \
+ $(top_srcdir)/src/brasero-drive-settings.c
libnautilus_brasero_extension_la_LIBADD = \
- $(BRASERO_GCONF_CFLAGS) \
$(NAUTILUS_EXTENSION_LIBS) \
../libbrasero-utils/libbrasero-utils.la \
../libbrasero-media/libbrasero-media.la \
diff --git a/nautilus/nautilus-burn-extension.c b/nautilus/nautilus-burn-extension.c
index ae4a072..5514504 100644
--- a/nautilus/nautilus-burn-extension.c
+++ b/nautilus/nautilus-burn-extension.c
@@ -30,8 +30,6 @@
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
-
#include <libnautilus-extension/nautilus-menu-provider.h>
#include <libnautilus-extension/nautilus-location-widget-provider.h>
@@ -60,6 +58,7 @@
#include "brasero-project-name.h"
#include "brasero-misc.h"
+#include "brasero-drive-settings.h"
#include "brasero-media-private.h"
#include "burn-debug.h"
@@ -104,21 +103,25 @@ static GObjectClass *parent_class;
//#define DEBUG_PRINT(format_MACRO,...) g_print (format_MACRO, ##__VA_ARGS__);
#define DEBUG_PRINT(format_MACRO,...)
+#define BRASERO_SCHEMA "org.gnome.brasero"
+#define BRASERO_PROPS_NAUTILUS_EXT_DEBUG "nautilus-extension-debug"
+
/* do not call brasero_*_start() at nautilus startup, they are very expensive;
* lazily initialize those instead */
static void
-ensure_initialized()
+ensure_initialized ()
{
static gboolean initialized = FALSE;
- GConfClient *client;
if (!initialized) {
- client = gconf_client_get_default ();
- if (gconf_client_get_bool (client, "/apps/brasero/nautilus-extension-debug", NULL)) {
- brasero_media_library_set_debug (TRUE);
- brasero_burn_library_set_debug (TRUE);
+ GSettings *settings;
+
+ settings = g_settings_new (BRASERO_SCHEMA);
+ if (g_settings_get_boolean (settings, BRASERO_PROPS_NAUTILUS_EXT_DEBUG)) {
+ brasero_media_library_set_debug (TRUE);
+ brasero_burn_library_set_debug (TRUE);
}
- g_object_unref (client);
+ g_object_unref (settings);
brasero_media_library_start ();
brasero_burn_library_start (NULL, NULL);
@@ -134,9 +137,16 @@ launch_brasero_on_window_session (BraseroSessionCfg *session,
GtkWidget *options,
GtkWindow *window)
{
+ gboolean success;
+ GtkResponseType result;
const gchar *icon_name;
GtkWidget *dialog;
- GtkResponseType result;
+ BraseroDriveSettings *settings;
+
+ /* Set saved temporary directory for the session.
+ * NOTE: BraseroBurnSession can cope with NULL path */
+ settings = brasero_drive_settings_new ();
+ brasero_drive_settings_set_session (settings, BRASERO_BURN_SESSION (session));
/* Get the icon for the window */
if (window)
@@ -146,7 +156,6 @@ launch_brasero_on_window_session (BraseroSessionCfg *session,
/* run option dialog */
dialog = brasero_burn_options_new (session);
-
gtk_window_set_icon_name (GTK_WINDOW (dialog), icon_name);
if (dialog_title)
@@ -160,8 +169,10 @@ launch_brasero_on_window_session (BraseroSessionCfg *session,
gtk_widget_destroy (dialog);
if (result != GTK_RESPONSE_OK
- && result != GTK_RESPONSE_ACCEPT)
+ && result != GTK_RESPONSE_ACCEPT) {
+ g_object_unref (settings);
return;
+ }
/* now run burn dialog */
dialog = brasero_burn_dialog_new ();
@@ -177,13 +188,15 @@ launch_brasero_on_window_session (BraseroSessionCfg *session,
gtk_window_present (GTK_WINDOW (dialog));
if (result == GTK_RESPONSE_OK)
- brasero_burn_dialog_run (BRASERO_BURN_DIALOG (dialog),
- BRASERO_BURN_SESSION (session));
+ success = brasero_burn_dialog_run (BRASERO_BURN_DIALOG (dialog),
+ BRASERO_BURN_SESSION (session));
else
- brasero_burn_dialog_run_multi (BRASERO_BURN_DIALOG (dialog),
- BRASERO_BURN_SESSION (session));
+ success = brasero_burn_dialog_run_multi (BRASERO_BURN_DIALOG (dialog),
+ BRASERO_BURN_SESSION (session));
gtk_widget_destroy (dialog);
+
+ g_object_unref (settings);
}
static gboolean
diff --git a/plugins/audio2cue/burn-audio2cue.c b/plugins/audio2cue/burn-audio2cue.c
index d5cca3f..d601053 100644
--- a/plugins/audio2cue/burn-audio2cue.c
+++ b/plugins/audio2cue/burn-audio2cue.c
@@ -719,6 +719,7 @@ brasero_audio2cue_export_caps (BraseroPlugin *plugin)
brasero_plugin_define (plugin,
"audio2cue",
+ NULL,
_("Generates .cue files from audio"),
"Philippe Rouquier",
0);
diff --git a/plugins/cdrdao/Makefile.am b/plugins/cdrdao/Makefile.am
index 2c517fd..5d37fbb 100644
--- a/plugins/cdrdao/Makefile.am
+++ b/plugins/cdrdao/Makefile.am
@@ -12,14 +12,13 @@ INCLUDES = \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED) \
- $(BRASERO_GLIB_CFLAGS) \
- $(BRASERO_GCONF_CFLAGS)
+ $(BRASERO_GLIB_CFLAGS)
#cdrdao
cdrdaodir = $(libdir)/brasero/plugins
cdrdao_LTLIBRARIES = libbrasero-cdrdao.la
libbrasero_cdrdao_la_SOURCES = burn-cdrdao.c
-libbrasero_cdrdao_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GCONF_LIBS) ../../libbrasero-media/libbrasero-media.la ../../libbrasero-burn/libbrasero-burn.la
+libbrasero_cdrdao_la_LIBADD = $(BRASERO_GLIB_LIBS) ../../libbrasero-media/libbrasero-media.la ../../libbrasero-burn/libbrasero-burn.la
libbrasero_cdrdao_la_LDFLAGS = -module -avoid-version
-include $(top_srcdir)/git.mk
diff --git a/plugins/cdrdao/burn-cdrdao.c b/plugins/cdrdao/burn-cdrdao.c
index ec18b06..8ab3b6c 100644
--- a/plugins/cdrdao/burn-cdrdao.c
+++ b/plugins/cdrdao/burn-cdrdao.c
@@ -43,8 +43,6 @@
#include <glib/gstdio.h>
#include <gmodule.h>
-#include <gconf/gconf-client.h>
-
#include "brasero-error.h"
#include "brasero-plugin-registration.h"
#include "burn-job.h"
@@ -74,7 +72,8 @@ typedef struct _BraseroCdrdaoPrivate BraseroCdrdaoPrivate;
static GObjectClass *parent_class = NULL;
-#define GCONF_KEY_RAW_FLAG "/apps/brasero/config/raw_flag"
+#define BRASERO_SCHEMA_CONFIG "org.gnome.brasero.config"
+#define BRASERO_KEY_RAW_FLAG "raw-flag"
static gboolean
brasero_cdrdao_read_stderr_image (BraseroCdrdao *cdrdao, const gchar *line)
@@ -649,17 +648,15 @@ brasero_cdrdao_class_init (BraseroCdrdaoClass *klass)
static void
brasero_cdrdao_init (BraseroCdrdao *obj)
{
- GConfClient *client;
+ GSettings *settings;
BraseroCdrdaoPrivate *priv;
/* load our "configuration" */
priv = BRASERO_CDRDAO_PRIVATE (obj);
-
- client = gconf_client_get_default ();
- priv->use_raw = gconf_client_get_bool (client,
- GCONF_KEY_RAW_FLAG,
- NULL);
- g_object_unref (client);
+
+ settings = g_settings_new (BRASERO_SCHEMA_CONFIG);
+ priv->use_raw = g_settings_get_boolean (settings, BRASERO_KEY_RAW_FLAG);
+ g_object_unref (settings);
}
static void
@@ -696,6 +693,7 @@ brasero_cdrdao_export_caps (BraseroPlugin *plugin)
brasero_plugin_define (plugin,
"cdrdao",
+ NULL,
_("Copies, burns and blanks CDs"),
"Philippe Rouquier",
0);
@@ -760,7 +758,7 @@ brasero_cdrdao_export_caps (BraseroPlugin *plugin)
BRASERO_BURN_FLAG_FAST_BLANK,
BRASERO_BURN_FLAG_NONE);
- use_raw = brasero_plugin_conf_option_new (GCONF_KEY_RAW_FLAG,
+ use_raw = brasero_plugin_conf_option_new (BRASERO_KEY_RAW_FLAG,
_("Enable the \"--driver generic-mmc-raw\" flag (see cdrdao manual)"),
BRASERO_PLUGIN_OPTION_BOOL);
diff --git a/plugins/cdrkit/Makefile.am b/plugins/cdrkit/Makefile.am
index 570fd38..d6f5055 100644
--- a/plugins/cdrkit/Makefile.am
+++ b/plugins/cdrkit/Makefile.am
@@ -12,15 +12,14 @@ INCLUDES = \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED) \
- $(BRASERO_GLIB_CFLAGS) \
- $(BRASERO_GCONF_CFLAGS)
+ $(BRASERO_GLIB_CFLAGS)
#wodim
wodimdir = $(libdir)/brasero/plugins
wodim_LTLIBRARIES = libbrasero-wodim.la
libbrasero_wodim_la_SOURCES = burn-wodim.c \
burn-cdrkit.h
-libbrasero_wodim_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GCONF_LIBS) ../../libbrasero-media/libbrasero-media.la ../../libbrasero-burn/libbrasero-burn.la
+libbrasero_wodim_la_LIBADD = $(BRASERO_GLIB_LIBS) ../../libbrasero-media/libbrasero-media.la ../../libbrasero-burn/libbrasero-burn.la
libbrasero_wodim_la_LDFLAGS = -module -avoid-version
#genisoimage
diff --git a/plugins/cdrkit/burn-genisoimage.c b/plugins/cdrkit/burn-genisoimage.c
index bb02814..f7d4d5a 100644
--- a/plugins/cdrkit/burn-genisoimage.c
+++ b/plugins/cdrkit/burn-genisoimage.c
@@ -525,6 +525,7 @@ brasero_genisoimage_export_caps (BraseroPlugin *plugin)
brasero_plugin_define (plugin,
"genisoimage",
+ NULL,
/* Translators: image is a disc image here */
_("Creates disc images from a file selection"),
"Philippe Rouquier",
diff --git a/plugins/cdrkit/burn-readom.c b/plugins/cdrkit/burn-readom.c
index fdb7989..f5459b4 100644
--- a/plugins/cdrkit/burn-readom.c
+++ b/plugins/cdrkit/burn-readom.c
@@ -446,6 +446,7 @@ brasero_readom_export_caps (BraseroPlugin *plugin)
brasero_plugin_define (plugin,
"readom",
+ NULL,
_("Copies any disc to a disc image"),
"Philippe Rouquier",
1);
diff --git a/plugins/cdrkit/burn-wodim.c b/plugins/cdrkit/burn-wodim.c
index 0140247..6d07981 100644
--- a/plugins/cdrkit/burn-wodim.c
+++ b/plugins/cdrkit/burn-wodim.c
@@ -47,8 +47,6 @@
#include <glib/gstdio.h>
#include <gmodule.h>
-#include <gconf/gconf-client.h>
-
#include "brasero-units.h"
#include "burn-job.h"
@@ -88,8 +86,9 @@ typedef struct _BraseroWodimPrivate BraseroWodimPrivate;
static GObjectClass *parent_class = NULL;
-#define GCONF_KEY_IMMEDIATE_FLAG "/apps/brasero/config/immed_flag"
-#define GCONF_KEY_MINBUF_VALUE "/apps/brasero/config/minbuf_value"
+#define BRASERO_SCHEMA_CONFIG "org.gnome.brasero.config"
+#define BRASERO_KEY_IMMEDIATE_FLAG "immed-flag"
+#define BRASERO_KEY_MINBUF_VALUE "minbuf-value"
static BraseroBurnResult
brasero_wodim_stderr_read (BraseroProcess *process, const gchar *line)
@@ -1200,23 +1199,20 @@ brasero_wodim_class_init (BraseroWodimClass *klass)
static void
brasero_wodim_init (BraseroWodim *obj)
{
- GConfClient *client;
+ GSettings *settings;
BraseroWodimPrivate *priv;
/* load our "configuration" */
priv = BRASERO_WODIM_PRIVATE (obj);
- client = gconf_client_get_default ();
- priv->immediate = gconf_client_get_bool (client,
- GCONF_KEY_IMMEDIATE_FLAG,
- NULL);
- priv->minbuf = gconf_client_get_int (client,
- GCONF_KEY_MINBUF_VALUE,
- NULL);
+ settings = g_settings_new (BRASERO_SCHEMA_CONFIG);
+
+ priv->immediate = g_settings_get_boolean (settings, BRASERO_KEY_IMMEDIATE_FLAG);
+ priv->minbuf = g_settings_get_int (settings, BRASERO_KEY_MINBUF_VALUE);
if (priv->minbuf > 95 || priv->minbuf < 25)
priv->minbuf = 30;
- g_object_unref (client);
+ g_object_unref (settings);
}
static void
@@ -1275,6 +1271,7 @@ brasero_wodim_export_caps (BraseroPlugin *plugin)
/* NOTE: it seems that cdrecord can burn cue files on the fly */
brasero_plugin_define (plugin,
"wodim",
+ NULL,
_("Burns, blanks and formats CDs and DVDs"),
"Philippe Rouquier",
0);
@@ -1418,10 +1415,10 @@ brasero_wodim_export_caps (BraseroPlugin *plugin)
BRASERO_BURN_FLAG_NONE);
/* add some configure options */
- immed = brasero_plugin_conf_option_new (GCONF_KEY_IMMEDIATE_FLAG,
+ immed = brasero_plugin_conf_option_new (BRASERO_KEY_IMMEDIATE_FLAG,
_("Enable the \"-immed\" flag (see wodim manual)"),
BRASERO_PLUGIN_OPTION_BOOL);
- minbuf = brasero_plugin_conf_option_new (GCONF_KEY_MINBUF_VALUE,
+ minbuf = brasero_plugin_conf_option_new (BRASERO_KEY_MINBUF_VALUE,
_("Minimum drive buffer fill ratio (in %) (see wodim manual):"),
BRASERO_PLUGIN_OPTION_INT);
brasero_plugin_conf_option_int_set_range (minbuf, 25, 95);
diff --git a/plugins/cdrtools/Makefile.am b/plugins/cdrtools/Makefile.am
index 16a4e82..6c8c14c 100644
--- a/plugins/cdrtools/Makefile.am
+++ b/plugins/cdrtools/Makefile.am
@@ -12,15 +12,14 @@ INCLUDES = \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED) \
- $(BRASERO_GLIB_CFLAGS) \
- $(BRASERO_GCONF_CFLAGS)
+ $(BRASERO_GLIB_CFLAGS)
#cdrecord
cdrecorddir = $(libdir)/brasero/plugins
cdrecord_LTLIBRARIES = libbrasero-cdrecord.la
libbrasero_cdrecord_la_SOURCES = burn-cdrecord.c \
burn-cdrtools.h
-libbrasero_cdrecord_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GCONF_LIBS) ../../libbrasero-burn/libbrasero-burn.la
+libbrasero_cdrecord_la_LIBADD = $(BRASERO_GLIB_LIBS) ../../libbrasero-burn/libbrasero-burn.la
libbrasero_cdrecord_la_LDFLAGS = -module -avoid-version
#mkisofs
diff --git a/plugins/cdrtools/burn-cdda2wav.c b/plugins/cdrtools/burn-cdda2wav.c
index c0cd657..16343bd 100644
--- a/plugins/cdrtools/burn-cdda2wav.c
+++ b/plugins/cdrtools/burn-cdda2wav.c
@@ -407,6 +407,7 @@ brasero_cdda2wav_export_caps (BraseroPlugin *plugin)
brasero_plugin_define (plugin,
"cdda2wav",
+ NULL,
_("Copy tracks from an audio CD with all associated information"),
"Philippe Rouquier",
1);
diff --git a/plugins/cdrtools/burn-cdrecord.c b/plugins/cdrtools/burn-cdrecord.c
index 8602b83..9cee2d1 100644
--- a/plugins/cdrtools/burn-cdrecord.c
+++ b/plugins/cdrtools/burn-cdrecord.c
@@ -47,8 +47,6 @@
#include <glib/gstdio.h>
#include <gmodule.h>
-#include <gconf/gconf-client.h>
-
#include "brasero-units.h"
#include "burn-job.h"
@@ -88,8 +86,9 @@ typedef struct _BraseroCDRecordPrivate BraseroCDRecordPrivate;
static GObjectClass *parent_class = NULL;
-#define GCONF_KEY_IMMEDIATE_FLAG "/apps/brasero/config/immed_flag"
-#define GCONF_KEY_MINBUF_VALUE "/apps/brasero/config/minbuf_value"
+#define BRASERO_SCHEMA_CONFIG "org.gnome.brasero.config"
+#define BRASERO_KEY_IMMEDIATE_FLAG "immed-flag"
+#define BRASERO_KEY_MINBUF_VALUE "minbuf-value"
static BraseroBurnResult
brasero_cdrecord_stderr_read (BraseroProcess *process, const gchar *line)
@@ -1135,23 +1134,20 @@ brasero_cdrecord_class_init (BraseroCDRecordClass *klass)
static void
brasero_cdrecord_init (BraseroCDRecord *obj)
{
- GConfClient *client;
+ GSettings *settings;
BraseroCDRecordPrivate *priv;
/* load our "configuration" */
priv = BRASERO_CD_RECORD_PRIVATE (obj);
- client = gconf_client_get_default ();
- priv->immediate = gconf_client_get_bool (client,
- GCONF_KEY_IMMEDIATE_FLAG,
- NULL);
- priv->minbuf = gconf_client_get_int (client,
- GCONF_KEY_MINBUF_VALUE,
- NULL);
+ settings = g_settings_new (BRASERO_SCHEMA_CONFIG);
+
+ priv->immediate = g_settings_get_boolean (settings, BRASERO_KEY_IMMEDIATE_FLAG);
+ priv->minbuf = g_settings_get_int (settings, BRASERO_KEY_MINBUF_VALUE);
if (priv->minbuf > 95 || priv->minbuf < 25)
priv->minbuf = 30;
- g_object_unref (client);
+ g_object_unref (settings);
}
static void
@@ -1209,6 +1205,7 @@ brasero_cdrecord_export_caps (BraseroPlugin *plugin)
/* NOTE: it seems that cdrecord can burn cue files on the fly */
brasero_plugin_define (plugin,
"cdrecord",
+ NULL,
_("Burns, blanks and formats CDs, DVDs and BDs"),
"Philippe Rouquier",
1);
@@ -1421,10 +1418,10 @@ brasero_cdrecord_export_caps (BraseroPlugin *plugin)
BRASERO_BURN_FLAG_NONE);
/* add some configure options */
- immed = brasero_plugin_conf_option_new (GCONF_KEY_IMMEDIATE_FLAG,
+ immed = brasero_plugin_conf_option_new (BRASERO_KEY_IMMEDIATE_FLAG,
_("Enable the \"-immed\" flag (see cdrecord manual)"),
BRASERO_PLUGIN_OPTION_BOOL);
- minbuf = brasero_plugin_conf_option_new (GCONF_KEY_MINBUF_VALUE,
+ minbuf = brasero_plugin_conf_option_new (BRASERO_KEY_MINBUF_VALUE,
_("Minimum drive buffer fill ratio (in %%) (see cdrecord manual):"),
BRASERO_PLUGIN_OPTION_INT);
brasero_plugin_conf_option_int_set_range (minbuf, 25, 95);
diff --git a/plugins/cdrtools/burn-mkisofs.c b/plugins/cdrtools/burn-mkisofs.c
index dd9da23..2b0c635 100644
--- a/plugins/cdrtools/burn-mkisofs.c
+++ b/plugins/cdrtools/burn-mkisofs.c
@@ -530,6 +530,7 @@ brasero_mkisofs_export_caps (BraseroPlugin *plugin)
brasero_plugin_define (plugin,
"mkisofs",
+ NULL,
_("Creates disc images from a file selection"),
"Philippe Rouquier",
2);
diff --git a/plugins/cdrtools/burn-readcd.c b/plugins/cdrtools/burn-readcd.c
index 47476f1..2c52393 100644
--- a/plugins/cdrtools/burn-readcd.c
+++ b/plugins/cdrtools/burn-readcd.c
@@ -456,6 +456,7 @@ brasero_readcd_export_caps (BraseroPlugin *plugin)
brasero_plugin_define (plugin,
"readcd",
+ NULL,
_("Copies any disc to a disc image"),
"Philippe Rouquier",
0);
diff --git a/plugins/checksum/Makefile.am b/plugins/checksum/Makefile.am
index 3002aa5..993f0d9 100644
--- a/plugins/checksum/Makefile.am
+++ b/plugins/checksum/Makefile.am
@@ -13,15 +13,14 @@ INCLUDES = \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED) \
$(BRASERO_GLIB_CFLAGS) \
- $(BRASERO_GTK_CFLAGS) \
- $(BRASERO_GCONF_CFLAGS)
+ $(BRASERO_GTK_CFLAGS)
checksumdir = $(libdir)/brasero/plugins
checksum_LTLIBRARIES = libbrasero-checksum.la
libbrasero_checksum_la_SOURCES = burn-checksum-image.c
libbrasero_checksum_la_LDFLAGS = -module -avoid-version
-libbrasero_checksum_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GCONF_LIBS) ../../libbrasero-media/libbrasero-media.la ../../libbrasero-burn/libbrasero-burn.la
+libbrasero_checksum_la_LIBADD = $(BRASERO_GLIB_LIBS) ../../libbrasero-media/libbrasero-media.la ../../libbrasero-burn/libbrasero-burn.la
checksumfiledir = $(libdir)/brasero/plugins
checksumfile_LTLIBRARIES = libbrasero-checksum-file.la
@@ -30,6 +29,6 @@ libbrasero_checksum_file_la_SOURCES = burn-checksum-files.c \
burn-volume-read.h
libbrasero_checksum_file_la_LDFLAGS = -module -avoid-version
-libbrasero_checksum_file_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GCONF_LIBS) $(BRASERO_GTK_LIBS) ../../libbrasero-media/libbrasero-media.la ../../libbrasero-burn/libbrasero-burn.la
+libbrasero_checksum_file_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GTK_LIBS) ../../libbrasero-media/libbrasero-media.la ../../libbrasero-burn/libbrasero-burn.la
-include $(top_srcdir)/git.mk
diff --git a/plugins/checksum/burn-checksum-files.c b/plugins/checksum/burn-checksum-files.c
index cbd6011..bc878da 100644
--- a/plugins/checksum/burn-checksum-files.c
+++ b/plugins/checksum/burn-checksum-files.c
@@ -45,8 +45,6 @@
#include <gmodule.h>
-#include <gconf/gconf-client.h>
-
#include "scsi-device.h"
#include "brasero-plugin-registration.h"
#include "burn-job.h"
@@ -94,7 +92,9 @@ typedef struct _BraseroChecksumFilesPrivate BraseroChecksumFilesPrivate;
#define BRASERO_CHECKSUM_FILES_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_CHECKSUM_FILES, BraseroChecksumFilesPrivate))
#define BLOCK_SIZE 64
-#define GCONF_KEY_CHECKSUM_TYPE "/apps/brasero/config/checksum_files"
+
+#define BRASERO_SCHEMA_CONFIG "org.gnome.brasero.config"
+#define BRASERO_PROPS_CHECKSUM_FILES "checksum-files"
static BraseroJobClass *parent_class = NULL;
@@ -523,7 +523,7 @@ brasero_checksum_files_create_checksum (BraseroChecksumFiles *self,
GSList *iter;
guint64 file_nb;
BraseroTrack *track;
- GConfClient *client;
+ GSettings *settings;
GHashTable *excludedH;
GChecksumType gchecksum_type;
BraseroChecksumFilesPrivate *priv;
@@ -533,9 +533,9 @@ brasero_checksum_files_create_checksum (BraseroChecksumFiles *self,
priv = BRASERO_CHECKSUM_FILES_PRIVATE (self);
/* get the checksum type */
- client = gconf_client_get_default ();
- checksum_type = gconf_client_get_int (client, GCONF_KEY_CHECKSUM_TYPE, NULL);
- g_object_unref (client);
+ settings = g_settings_new (BRASERO_SCHEMA_CONFIG);
+ checksum_type = g_settings_get_int (settings, BRASERO_PROPS_CHECKSUM_FILES);
+ g_object_unref (settings);
if (checksum_type & BRASERO_CHECKSUM_MD5_FILE)
gchecksum_type = G_CHECKSUM_MD5;
@@ -1472,6 +1472,7 @@ brasero_checksum_files_export_caps (BraseroPlugin *plugin)
BraseroPluginConfOption *checksum_type;
brasero_plugin_define (plugin,
+ "file-checksum",
/* Translators: this is the name of the plugin
* which will be translated only when it needs
* displaying. */
@@ -1513,7 +1514,7 @@ brasero_checksum_files_export_caps (BraseroPlugin *plugin)
g_slist_free (input);
/* add some configure options */
- checksum_type = brasero_plugin_conf_option_new (GCONF_KEY_CHECKSUM_TYPE,
+ checksum_type = brasero_plugin_conf_option_new (BRASERO_PROPS_CHECKSUM_FILES,
_("Hashing algorithm to be used:"),
BRASERO_PLUGIN_OPTION_CHOICE);
brasero_plugin_conf_option_choice_add (checksum_type,
diff --git a/plugins/checksum/burn-checksum-image.c b/plugins/checksum/burn-checksum-image.c
index da01746..4a0b4b3 100644
--- a/plugins/checksum/burn-checksum-image.c
+++ b/plugins/checksum/burn-checksum-image.c
@@ -47,8 +47,6 @@
#include <gmodule.h>
-#include <gconf/gconf-client.h>
-
#include "brasero-plugin-registration.h"
#include "burn-job.h"
#include "burn-volume.h"
@@ -87,7 +85,8 @@ typedef struct _BraseroChecksumImagePrivate BraseroChecksumImagePrivate;
#define BRASERO_CHECKSUM_IMAGE_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_CHECKSUM_IMAGE, BraseroChecksumImagePrivate))
-#define GCONF_KEY_CHECKSUM_TYPE "/apps/brasero/config/checksum_image"
+#define BRASERO_SCHEMA_CONFIG "org.gnome.brasero.config"
+#define BRASERO_PROPS_CHECKSUM_IMAGE "checksum-image"
static BraseroJobClass *parent_class = NULL;
@@ -419,12 +418,12 @@ brasero_checksum_image_create_checksum (BraseroChecksumImage *self,
static BraseroChecksumType
brasero_checksum_get_checksum_type (void)
{
- GConfClient *client;
+ GSettings *settings;
GChecksumType checksum_type;
- client = gconf_client_get_default ();
- checksum_type = gconf_client_get_int (client, GCONF_KEY_CHECKSUM_TYPE, NULL);
- g_object_unref (client);
+ settings = g_settings_new (BRASERO_SCHEMA_CONFIG);
+ checksum_type = g_settings_get_int (settings, BRASERO_PROPS_CHECKSUM_IMAGE);
+ g_object_unref (settings);
return checksum_type;
}
@@ -824,6 +823,7 @@ brasero_checksum_image_export_caps (BraseroPlugin *plugin)
BraseroPluginConfOption *checksum_type;
brasero_plugin_define (plugin,
+ "image-checksum",
/* Translators: this is the name of the plugin
* which will be translated only when it needs
* displaying. */
@@ -851,7 +851,7 @@ brasero_checksum_image_export_caps (BraseroPlugin *plugin)
g_slist_free (input);
/* add some configure options */
- checksum_type = brasero_plugin_conf_option_new (GCONF_KEY_CHECKSUM_TYPE,
+ checksum_type = brasero_plugin_conf_option_new (BRASERO_PROPS_CHECKSUM_IMAGE,
_("Hashing algorithm to be used:"),
BRASERO_PLUGIN_OPTION_CHOICE);
brasero_plugin_conf_option_choice_add (checksum_type,
diff --git a/plugins/dvdauthor/burn-dvdauthor.c b/plugins/dvdauthor/burn-dvdauthor.c
index 982a280..b8134c2 100644
--- a/plugins/dvdauthor/burn-dvdauthor.c
+++ b/plugins/dvdauthor/burn-dvdauthor.c
@@ -370,6 +370,7 @@ brasero_dvd_author_export_caps (BraseroPlugin *plugin)
/* NOTE: it seems that cdrecord can burn cue files on the fly */
brasero_plugin_define (plugin,
"dvdauthor",
+ NULL,
_("Creates disc images suitable for Video DVDs"),
"Philippe Rouquier",
1);
diff --git a/plugins/dvdcss/burn-dvdcss.c b/plugins/dvdcss/burn-dvdcss.c
index 7da5773..ad9a643 100644
--- a/plugins/dvdcss/burn-dvdcss.c
+++ b/plugins/dvdcss/burn-dvdcss.c
@@ -673,6 +673,7 @@ brasero_dvdcss_export_caps (BraseroPlugin *plugin)
brasero_plugin_define (plugin,
"dvdcss",
+ NULL,
/* Translators: image is not a picture but a disc image */
_("Copies CSS encrypted Video DVDs to a disc image"),
"Philippe Rouquier",
diff --git a/plugins/growisofs/Makefile.am b/plugins/growisofs/Makefile.am
index a06cab2..dca2b01 100644
--- a/plugins/growisofs/Makefile.am
+++ b/plugins/growisofs/Makefile.am
@@ -12,15 +12,14 @@ INCLUDES = \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED) \
- $(BRASERO_GLIB_CFLAGS) \
- $(BRASERO_GCONF_CFLAGS)
+ $(BRASERO_GLIB_CFLAGS)
#growisofs
growisofsdir = $(libdir)/brasero/plugins
growisofs_LTLIBRARIES = libbrasero-growisofs.la
libbrasero_growisofs_la_SOURCES = burn-growisofs.c \
burn-growisofs-common.h
-libbrasero_growisofs_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GCONF_LIBS) ../../libbrasero-burn/libbrasero-burn.la
+libbrasero_growisofs_la_LIBADD = $(BRASERO_GLIB_LIBS) ../../libbrasero-burn/libbrasero-burn.la
libbrasero_growisofs_la_LDFLAGS = -module -avoid-version
#dvdrwformat
diff --git a/plugins/growisofs/burn-dvd-rw-format.c b/plugins/growisofs/burn-dvd-rw-format.c
index d80c344..2dbf20b 100644
--- a/plugins/growisofs/burn-dvd-rw-format.c
+++ b/plugins/growisofs/burn-dvd-rw-format.c
@@ -185,7 +185,8 @@ brasero_dvd_rw_format_export_caps (BraseroPlugin *plugin)
GSList *output;
brasero_plugin_define (plugin,
- "dvd+rw-format",
+ "dvd-rw-format",
+ NULL,
_("Blanks and formats rewritable DVDs and BDs"),
"Philippe Rouquier",
4);
diff --git a/plugins/growisofs/burn-growisofs.c b/plugins/growisofs/burn-growisofs.c
index 03f41bd..664567a 100644
--- a/plugins/growisofs/burn-growisofs.c
+++ b/plugins/growisofs/burn-growisofs.c
@@ -43,8 +43,6 @@
#include <gmodule.h>
-#include <gconf/gconf-client.h>
-
#include "brasero-units.h"
#include "brasero-plugin-registration.h"
@@ -76,7 +74,8 @@ typedef struct BraseroGrowisofsPrivate BraseroGrowisofsPrivate;
static GObjectClass *parent_class = NULL;
-#define GCONF_KEY_DAO_FLAG "/apps/brasero/config/dao_flag"
+#define BRASERO_SCHEMA_CONFIG "org.gnome.brasero.config"
+#define BRASERO_KEY_DAO_FLAG "dao-flag"
/* Process start */
static BraseroBurnResult
@@ -741,16 +740,17 @@ brasero_growisofs_finalize (GObject *object)
static void
brasero_growisofs_export_caps (BraseroPlugin *plugin)
{
- BraseroPluginConfOption *use_dao;
- gboolean use_dao_gconf_key;
+ BraseroPluginConfOption *use_dao_opt;
GSList *input_symlink;
GSList *input_joliet;
- GConfClient *client;
+ GSettings *settings;
+ gboolean use_dao;
GSList *output;
GSList *input;
brasero_plugin_define (plugin,
"growisofs",
+ NULL,
_("Burns and blanks DVDs and BDs"),
"Philippe Rouquier",
7);
@@ -860,14 +860,12 @@ brasero_growisofs_export_caps (BraseroPlugin *plugin)
/* DVD+R and DVD-R. DAO and growisofs doesn't always work well with
* these types of media and with some drives. So don't allow it if the
- * workaround is set in GConf (and it should be by default). */
- client = gconf_client_get_default ();
- use_dao_gconf_key = gconf_client_get_bool (client,
- GCONF_KEY_DAO_FLAG,
- NULL);
- g_object_unref (client);
-
- if (use_dao_gconf_key == TRUE) {
+ * workaround is set with GSettings (and it should be by default). */
+ settings = g_settings_new (BRASERO_SCHEMA_CONFIG);
+ use_dao = g_settings_get_boolean (settings, BRASERO_KEY_DAO_FLAG);
+ g_object_unref (settings);
+
+ if (use_dao == TRUE) {
BRASERO_PLUGIN_ADD_STANDARD_DVDR_FLAGS (plugin, BRASERO_BURN_FLAG_NONE);
BRASERO_PLUGIN_ADD_STANDARD_DVDR_PLUS_FLAGS (plugin, BRASERO_BURN_FLAG_NONE);
}
@@ -923,11 +921,10 @@ brasero_growisofs_export_caps (BraseroPlugin *plugin)
BRASERO_BURN_FLAG_FAST_BLANK,
BRASERO_BURN_FLAG_FAST_BLANK);
- use_dao = brasero_plugin_conf_option_new (GCONF_KEY_DAO_FLAG,
- _("Allow DAO use"),
- BRASERO_PLUGIN_OPTION_BOOL);
-
- brasero_plugin_add_conf_option (plugin, use_dao);
+ use_dao_opt = brasero_plugin_conf_option_new (BRASERO_KEY_DAO_FLAG,
+ _("Allow DAO use"),
+ BRASERO_PLUGIN_OPTION_BOOL);
+ brasero_plugin_add_conf_option (plugin, use_dao_opt);
brasero_plugin_register_group (plugin, _(GROWISOFS_DESCRIPTION));
}
diff --git a/plugins/libburnia/burn-libburn.c b/plugins/libburnia/burn-libburn.c
index 98c66d9..6cf25fa 100644
--- a/plugins/libburnia/burn-libburn.c
+++ b/plugins/libburnia/burn-libburn.c
@@ -970,6 +970,7 @@ brasero_libburn_export_caps (BraseroPlugin *plugin)
brasero_plugin_define (plugin,
"libburn",
+ NULL,
_("Burns, blanks and formats CDs, DVDs and BDs"),
"Philippe Rouquier",
15);
diff --git a/plugins/libburnia/burn-libisofs.c b/plugins/libburnia/burn-libisofs.c
index 984363a..4697a15 100644
--- a/plugins/libburnia/burn-libisofs.c
+++ b/plugins/libburnia/burn-libisofs.c
@@ -1042,6 +1042,7 @@ brasero_libisofs_export_caps (BraseroPlugin *plugin)
brasero_plugin_define (plugin,
"libisofs",
+ NULL,
_("Creates disc images from a file selection"),
"Philippe Rouquier",
3);
diff --git a/plugins/local-track/burn-local-image.c b/plugins/local-track/burn-local-image.c
index dbcd9c5..6b1c0eb 100644
--- a/plugins/local-track/burn-local-image.c
+++ b/plugins/local-track/burn-local-image.c
@@ -904,6 +904,7 @@ brasero_local_track_export_caps (BraseroPlugin *plugin)
GSList *caps;
brasero_plugin_define (plugin,
+ "file-downloader",
/* Translators: this is the name of the plugin
* which will be translated only when it needs
* displaying. */
diff --git a/plugins/local-track/burn-uri.c b/plugins/local-track/burn-uri.c
index 56add53..38ec62a 100644
--- a/plugins/local-track/burn-uri.c
+++ b/plugins/local-track/burn-uri.c
@@ -740,6 +740,7 @@ brasero_burn_uri_export_caps (BraseroPlugin *plugin)
GSList *caps;
brasero_plugin_define (plugin,
+ "burn-uri",
/* Translators: this is the name of the plugin
* which will be translated only when it needs
* displaying. */
diff --git a/plugins/transcode/burn-normalize.c b/plugins/transcode/burn-normalize.c
index ff48795..96df891 100644
--- a/plugins/transcode/burn-normalize.c
+++ b/plugins/transcode/burn-normalize.c
@@ -642,7 +642,8 @@ brasero_normalize_export_caps (BraseroPlugin *plugin)
GSList *input;
brasero_plugin_define (plugin,
- N_("Normalize"),
+ "normalize",
+ N_("Normalization"),
_("Sets consistent sound levels between tracks"),
"Philippe Rouquier",
0);
diff --git a/plugins/transcode/burn-transcode.c b/plugins/transcode/burn-transcode.c
index 05e0a65..1154d97 100644
--- a/plugins/transcode/burn-transcode.c
+++ b/plugins/transcode/burn-transcode.c
@@ -1768,6 +1768,7 @@ brasero_transcode_export_caps (BraseroPlugin *plugin)
brasero_plugin_define (plugin,
"transcode",
+ NULL,
_("Converts any song file into a format suitable for audio CDs"),
"Philippe Rouquier",
1);
diff --git a/plugins/transcode/burn-vob.c b/plugins/transcode/burn-vob.c
index 4a5c370..1f682f7 100644
--- a/plugins/transcode/burn-vob.c
+++ b/plugins/transcode/burn-vob.c
@@ -1369,6 +1369,7 @@ brasero_vob_export_caps (BraseroPlugin *plugin)
brasero_plugin_define (plugin,
"transcode2vob",
+ NULL,
_("Converts any video file into a format suitable for Video DVDs"),
"Philippe Rouquier",
0);
diff --git a/plugins/vcdimager/burn-vcdimager.c b/plugins/vcdimager/burn-vcdimager.c
index 2bf508a..98dfd5e 100644
--- a/plugins/vcdimager/burn-vcdimager.c
+++ b/plugins/vcdimager/burn-vcdimager.c
@@ -480,6 +480,7 @@ brasero_vcd_imager_export_caps (BraseroPlugin *plugin)
/* NOTE: it seems that cdrecord can burn cue files on the fly */
brasero_plugin_define (plugin,
"vcdimager",
+ NULL,
_("Creates disc images suitable for SVCDs"),
"Philippe Rouquier",
1);
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 9f1b05a..5683357 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -60,8 +60,8 @@ nautilus/nautilus-burn-extension.c
src/brasero-project-name.c
src/brasero-app.c
data/brasero.desktop.in.in
-data/brasero.schemas.in
-data/brasero.xml.in
+data/org.gnome.brasero.gschema.xml
+data/mime/brasero.xml.in
src/brasero-audio-disc.c
libbrasero-burn/brasero-blank-dialog.c
src/brasero-mime-filter.c
diff --git a/src/Makefile.am b/src/Makefile.am
index f373062..e168c4b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,7 +16,6 @@ INCLUDES = \
$(DISABLE_DEPRECATED) \
$(BRASERO_GLIB_CFLAGS) \
$(BRASERO_GIO_CFLAGS) \
- $(BRASERO_GCONF_CFLAGS) \
$(BRASERO_GSTREAMER_CFLAGS) \
$(BRASERO_GSTREAMER_BASE_CFLAGS) \
$(BRASERO_GTK_CFLAGS) \
@@ -119,7 +118,9 @@ brasero_SOURCES = \
brasero-setting.h \
brasero-setting.c \
brasero-search-engine.h \
- brasero-search-engine.c
+ brasero-search-engine.c \
+ brasero-drive-settings.h \
+ brasero-drive-settings.c
if BUILD_PLAYLIST
brasero_SOURCES += \
@@ -158,7 +159,6 @@ brasero_LDADD = \
$(BRASERO_GLIB_LIBS) \
$(BRASERO_GTHREAD_LIBS) \
$(BRASERO_GIO_LIBS) \
- $(BRASERO_GCONF_LIBS) \
$(BRASERO_GSTREAMER_LIBS) \
$(BRASERO_GSTREAMER_BASE_LIBS) \
$(BRASERO_GTK_LIBS) \
diff --git a/src/brasero-app.c b/src/brasero-app.c
index f67402c..0851843 100644
--- a/src/brasero-app.c
+++ b/src/brasero-app.c
@@ -64,6 +64,7 @@
#include "brasero-jacket-edit.h"
#include "burn-plugin-manager.h"
+#include "brasero-drive-settings.h"
typedef struct _BraseroAppPrivate BraseroAppPrivate;
struct _BraseroAppPrivate
@@ -99,6 +100,7 @@ struct _BraseroAppPrivate
G_DEFINE_TYPE (BraseroApp, brasero_app, G_TYPE_OBJECT);
+
/**
* Menus and toolbar
*/
@@ -549,7 +551,7 @@ brasero_app_burn (BraseroApp *app,
return success;
}
-gboolean
+static BraseroBurnResult
brasero_app_burn_options (BraseroApp *app,
BraseroSessionCfg *session)
{
@@ -579,6 +581,13 @@ brasero_app_session_burn (BraseroApp *app,
BraseroSessionCfg *session,
gboolean burn)
{
+ BraseroDriveSettings *settings;
+
+ /* Set saved temporary directory for the session.
+ * NOTE: BraseroBurnSession can cope with NULL path */
+ settings = brasero_drive_settings_new ();
+ brasero_drive_settings_set_session (settings, BRASERO_BURN_SESSION (session));
+
/* We need to have a drive to start burning immediately */
if (burn && brasero_burn_session_get_burner (BRASERO_BURN_SESSION (session))) {
BraseroStatus *status;
@@ -600,8 +609,10 @@ brasero_app_session_burn (BraseroApp *app,
}
g_object_unref (status);
- if (result == BRASERO_BURN_CANCEL)
+ if (result == BRASERO_BURN_CANCEL) {
+ g_object_unref (settings);
return;
+ }
if (result != BRASERO_BURN_OK) {
GError *error;
@@ -614,18 +625,26 @@ brasero_app_session_burn (BraseroApp *app,
if (error)
g_error_free (error);
+ g_object_unref (settings);
return;
}
- brasero_app_burn (app, BRASERO_BURN_SESSION (session), FALSE);
+ result = brasero_app_burn (app,
+ BRASERO_BURN_SESSION (session),
+ FALSE);
}
else {
BraseroBurnResult result;
result = brasero_app_burn_options (app, session);
- if (result == BRASERO_BURN_OK || result == BRASERO_BURN_RETRY)
- brasero_app_burn (app, BRASERO_BURN_SESSION (session), (result == BRASERO_BURN_RETRY));
+ if (result == BRASERO_BURN_OK || result == BRASERO_BURN_RETRY) {
+ result = brasero_app_burn (app,
+ BRASERO_BURN_SESSION (session),
+ (result == BRASERO_BURN_RETRY));
+ }
}
+
+ g_object_unref (settings);
}
void
diff --git a/src/brasero-app.h b/src/brasero-app.h
index 20ae246..383dc9a 100644
--- a/src/brasero-app.h
+++ b/src/brasero-app.h
@@ -91,10 +91,6 @@ brasero_app_burn (BraseroApp *app,
BraseroBurnSession *session,
gboolean multi);
-gboolean
-brasero_app_burn_options (BraseroApp *app,
- BraseroSessionCfg *session);
-
void
brasero_app_burn_uri (BraseroApp *app,
BraseroDrive *burner,
diff --git a/src/brasero-drive-settings.c b/src/brasero-drive-settings.c
new file mode 100644
index 0000000..965a57a
--- /dev/null
+++ b/src/brasero-drive-settings.c
@@ -0,0 +1,392 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/*
+ * Brasero
+ * Copyright (C) Philippe Rouquier 2005-2010 <bonfire-app wanadoo fr>
+ *
+ * Brasero 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.
+ *
+ * brasero 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 brasero. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <glib.h>
+
+#include "brasero-drive-settings.h"
+#include "brasero-session.h"
+#include "brasero-session-helper.h"
+#include "brasero-drive-properties.h"
+
+typedef struct _BraseroDriveSettingsPrivate BraseroDriveSettingsPrivate;
+struct _BraseroDriveSettingsPrivate
+{
+ BraseroMedia dest_media;
+ BraseroDrive *dest_drive;
+ BraseroTrackType *src_type;
+
+ GSettings *settings;
+ GSettings *config_settings;
+ BraseroBurnSession *session;
+};
+
+#define BRASERO_DRIVE_SETTINGS_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_DRIVE_SETTINGS, BraseroDriveSettingsPrivate))
+
+#define BRASERO_SCHEMA_DRIVES "org.gnome.brasero.drives"
+#define BRASERO_DRIVE_PROPERTIES_PATH "/apps/brasero/drives/"
+#define BRASERO_PROPS_FLAGS "flags"
+#define BRASERO_PROPS_SPEED "speed"
+
+#define BRASERO_SCHEMA_CONFIG "org.gnome.brasero.config"
+#define BRASERO_PROPS_TMP_DIR "tmpdir"
+
+#define BRASERO_DEST_SAVED_FLAGS (BRASERO_DRIVE_PROPERTIES_FLAGS|BRASERO_BURN_FLAG_MULTI)
+
+G_DEFINE_TYPE (BraseroDriveSettings, brasero_drive_settings, G_TYPE_OBJECT);
+
+static GVariant *
+brasero_drive_settings_set_mapping_speed (const GValue *value,
+ const GVariantType *variant_type,
+ gpointer user_data)
+{
+ return g_variant_new_int32 (g_value_get_int64 (value) / 1000);
+}
+
+static gboolean
+brasero_drive_settings_get_mapping_speed (GValue *value,
+ GVariant *variant,
+ gpointer user_data)
+{
+ if (!g_variant_get_int32 (variant)) {
+ BraseroDriveSettingsPrivate *priv;
+ BraseroMedium *medium;
+ BraseroDrive *drive;
+
+ priv = BRASERO_DRIVE_SETTINGS_PRIVATE (user_data);
+ drive = brasero_burn_session_get_burner (priv->session);
+ medium = brasero_drive_get_medium (drive);
+
+ /* Must not be NULL since we only bind when a medium is available */
+ g_assert (medium != NULL);
+
+ g_value_set_int64 (value, brasero_medium_get_max_write_speed (medium));
+ }
+ else
+ g_value_set_int64 (value, g_variant_get_int32 (variant) * 1000);
+
+ return TRUE;
+}
+
+static GVariant *
+brasero_drive_settings_set_mapping_flags (const GValue *value,
+ const GVariantType *variant_type,
+ gpointer user_data)
+{
+ return g_variant_new_int32 (g_value_get_int (value) & BRASERO_DEST_SAVED_FLAGS);
+}
+
+static gboolean
+brasero_drive_settings_get_mapping_flags (GValue *value,
+ GVariant *variant,
+ gpointer user_data)
+{
+ BraseroBurnFlag flags;
+ BraseroBurnFlag current_flags;
+ BraseroDriveSettingsPrivate *priv;
+
+ priv = BRASERO_DRIVE_SETTINGS_PRIVATE (user_data);
+
+ flags = g_variant_get_int32 (variant);
+ if (brasero_burn_session_same_src_dest_drive (priv->session)) {
+ /* Special case */
+ if (flags == 1) {
+ flags = BRASERO_BURN_FLAG_EJECT|
+ BRASERO_BURN_FLAG_BURNPROOF;
+ }
+ else
+ flags &= BRASERO_DEST_SAVED_FLAGS;
+
+ flags |= BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE|
+ BRASERO_BURN_FLAG_FAST_BLANK;
+ }
+ /* This is for the default value when the user has never used it */
+ else if (flags == 1) {
+ BraseroTrackType *source;
+
+ flags = BRASERO_BURN_FLAG_EJECT|
+ BRASERO_BURN_FLAG_BURNPROOF;
+
+ source = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (priv->session), source);
+
+ if (!brasero_track_type_get_has_medium (source))
+ flags |= BRASERO_BURN_FLAG_NO_TMP_FILES;
+
+ brasero_track_type_free (source);
+ }
+ else
+ flags &= BRASERO_DEST_SAVED_FLAGS;
+
+ current_flags = brasero_burn_session_get_flags (BRASERO_BURN_SESSION (priv->session));
+ current_flags &= (~BRASERO_DEST_SAVED_FLAGS);
+
+ g_value_set_int (value, flags|current_flags);
+ return TRUE;
+}
+
+static void
+brasero_drive_settings_bind_session (BraseroDriveSettings *self)
+{
+ BraseroDriveSettingsPrivate *priv;
+ gchar *display_name;
+ gchar *path;
+ gchar *tmp;
+
+ priv = BRASERO_DRIVE_SETTINGS_PRIVATE (self);
+
+ /* Get the drive name: it's done this way to avoid escaping */
+ tmp = brasero_drive_get_display_name (priv->dest_drive);
+ display_name = g_strdup_printf ("drive-%u", g_str_hash (tmp));
+ g_free (tmp);
+
+ if (brasero_track_type_get_has_medium (priv->src_type))
+ path = g_strdup_printf ("%s%s/disc-%i/",
+ BRASERO_DRIVE_PROPERTIES_PATH,
+ display_name,
+ priv->dest_media);
+ else if (brasero_track_type_get_has_data (priv->src_type))
+ path = g_strdup_printf ("%s%s/data-%i/",
+ BRASERO_DRIVE_PROPERTIES_PATH,
+ display_name,
+ priv->dest_media);
+ else if (brasero_track_type_get_has_image (priv->src_type))
+ path = g_strdup_printf ("%s%s/image-%i/",
+ BRASERO_DRIVE_PROPERTIES_PATH,
+ display_name,
+ priv->dest_media);
+ else if (brasero_track_type_get_has_stream (priv->src_type))
+ path = g_strdup_printf ("%s%s/audio-%i/",
+ BRASERO_DRIVE_PROPERTIES_PATH,
+ display_name,
+ priv->dest_media);
+ else {
+ g_free (display_name);
+ return;
+ }
+ g_free (display_name);
+
+ priv->settings = g_settings_new_with_path (BRASERO_SCHEMA_DRIVES, path);
+ g_free (path);
+
+ g_settings_bind_with_mapping (priv->settings, BRASERO_PROPS_SPEED,
+ priv->session, "speed", G_SETTINGS_BIND_DEFAULT,
+ brasero_drive_settings_get_mapping_speed,
+ brasero_drive_settings_set_mapping_speed,
+ self,
+ NULL);
+
+ g_settings_bind_with_mapping (priv->settings, BRASERO_PROPS_FLAGS,
+ priv->session, "flags", G_SETTINGS_BIND_DEFAULT,
+ brasero_drive_settings_get_mapping_flags,
+ brasero_drive_settings_set_mapping_flags,
+ self,
+ NULL);
+}
+
+static void
+brasero_drive_settings_unbind_session (BraseroDriveSettings *self)
+{
+ BraseroDriveSettingsPrivate *priv;
+
+ priv = BRASERO_DRIVE_SETTINGS_PRIVATE (self);
+
+ if (priv->settings) {
+ brasero_track_type_free (priv->src_type);
+ priv->src_type = NULL;
+
+ g_object_unref (priv->dest_drive);
+ priv->dest_drive = NULL;
+
+ priv->dest_media = BRASERO_MEDIUM_NONE;
+
+ g_settings_unbind (priv->settings, "speed");
+ g_settings_unbind (priv->settings, "flags");
+
+ g_object_unref (priv->settings);
+ priv->settings = NULL;
+ }
+}
+
+static void
+brasero_drive_settings_rebind_session (BraseroDriveSettings *self)
+{
+ BraseroDriveSettingsPrivate *priv;
+ BraseroTrackType *type;
+ BraseroMedia new_media;
+ BraseroMedium *medium;
+ BraseroDrive *drive;
+
+ priv = BRASERO_DRIVE_SETTINGS_PRIVATE (self);
+
+ /* See if we really need to do that:
+ * - check the source type has changed
+ * - check the output type has changed */
+ drive = brasero_burn_session_get_burner (priv->session);
+ medium = brasero_drive_get_medium (drive);
+ type = brasero_track_type_new ();
+
+ if (!drive
+ || !medium
+ || brasero_drive_is_fake (drive)
+ || !BRASERO_MEDIUM_VALID (brasero_medium_get_status (medium))
+ || brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (priv->session), type) != BRASERO_BURN_OK) {
+ brasero_drive_settings_unbind_session (self);
+ return;
+ }
+
+ new_media = BRASERO_MEDIUM_TYPE (brasero_medium_get_status (medium));
+
+ if (priv->dest_drive == drive
+ && priv->dest_media == new_media
+ && priv->src_type && brasero_track_type_equal (priv->src_type, type)) {
+ brasero_track_type_free (type);
+ return;
+ }
+
+ brasero_track_type_free (priv->src_type);
+ priv->src_type = type;
+
+ if (priv->dest_drive)
+ g_object_unref (priv->dest_drive);
+
+ priv->dest_drive = g_object_ref (drive);
+
+ priv->dest_media = new_media;
+
+ brasero_drive_settings_bind_session (self);
+}
+
+static void
+brasero_drive_settings_output_changed_cb (BraseroBurnSession *session,
+ BraseroMedium *former_medium,
+ BraseroDriveSettings *self)
+{
+ brasero_drive_settings_rebind_session (self);
+}
+
+static void
+brasero_drive_settings_track_added_cb (BraseroBurnSession *session,
+ BraseroTrack *track,
+ BraseroDriveSettings *self)
+{
+ brasero_drive_settings_rebind_session (self);
+}
+
+static void
+brasero_drive_settings_track_removed_cb (BraseroBurnSession *session,
+ BraseroTrack *track,
+ guint former_position,
+ BraseroDriveSettings *self)
+{
+ brasero_drive_settings_rebind_session (self);
+}
+
+static void
+brasero_drive_settings_unset_session (BraseroDriveSettings *self)
+{
+ BraseroDriveSettingsPrivate *priv;
+
+ priv = BRASERO_DRIVE_SETTINGS_PRIVATE (self);
+
+ brasero_drive_settings_unbind_session (self);
+
+ if (priv->session) {
+ g_signal_handlers_disconnect_by_func (priv->session,
+ brasero_drive_settings_track_added_cb,
+ self);
+ g_signal_handlers_disconnect_by_func (priv->session,
+ brasero_drive_settings_track_removed_cb,
+ self);
+ g_signal_handlers_disconnect_by_func (priv->session,
+ brasero_drive_settings_output_changed_cb,
+ self);
+
+ g_settings_unbind (priv->config_settings, "tmpdir");
+ g_object_unref (priv->config_settings);
+
+ g_object_unref (priv->session);
+ priv->session = NULL;
+ }
+}
+
+void
+brasero_drive_settings_set_session (BraseroDriveSettings *self,
+ BraseroBurnSession *session)
+{
+ BraseroDriveSettingsPrivate *priv;
+
+ priv = BRASERO_DRIVE_SETTINGS_PRIVATE (self);
+
+ brasero_drive_settings_unset_session (self);
+
+ priv->session = g_object_ref (session);
+ g_signal_connect (session,
+ "track-added",
+ G_CALLBACK (brasero_drive_settings_track_added_cb),
+ self);
+ g_signal_connect (session,
+ "track-removed",
+ G_CALLBACK (brasero_drive_settings_track_removed_cb),
+ self);
+ g_signal_connect (session,
+ "output-changed",
+ G_CALLBACK (brasero_drive_settings_output_changed_cb),
+ self);
+ brasero_drive_settings_rebind_session (self);
+
+ priv->config_settings = g_settings_new (BRASERO_SCHEMA_CONFIG);
+ g_settings_bind (priv->config_settings,
+ BRASERO_PROPS_TMP_DIR, session,
+ "tmpdir", G_SETTINGS_BIND_DEFAULT);
+}
+
+static void
+brasero_drive_settings_init (BraseroDriveSettings *object)
+{ }
+
+static void
+brasero_drive_settings_finalize (GObject *object)
+{
+ brasero_drive_settings_unset_session (BRASERO_DRIVE_SETTINGS (object));
+ G_OBJECT_CLASS (brasero_drive_settings_parent_class)->finalize (object);
+}
+
+static void
+brasero_drive_settings_class_init (BraseroDriveSettingsClass *klass)
+{
+ GObjectClass* object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (BraseroDriveSettingsPrivate));
+
+ object_class->finalize = brasero_drive_settings_finalize;
+}
+
+BraseroDriveSettings *
+brasero_drive_settings_new (void)
+{
+ return g_object_new (BRASERO_TYPE_DRIVE_SETTINGS, NULL);
+}
+
diff --git a/src/brasero-drive-settings.h b/src/brasero-drive-settings.h
new file mode 100644
index 0000000..df599dc
--- /dev/null
+++ b/src/brasero-drive-settings.h
@@ -0,0 +1,63 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/*
+ * Brasero
+ * Copyright (C) Philippe Rouquier 2005-2010 <bonfire-app wanadoo fr>
+ *
+ * Brasero 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.
+ *
+ * brasero 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 brasero. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _BRASERO_DRIVE_SETTINGS_H_
+#define _BRASERO_DRIVE_SETTINGS_H_
+
+#include <glib-object.h>
+
+#include "brasero-session.h"
+
+G_BEGIN_DECLS
+
+#define BRASERO_TYPE_DRIVE_SETTINGS (brasero_drive_settings_get_type ())
+#define BRASERO_DRIVE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BRASERO_TYPE_DRIVE_SETTINGS, BraseroDriveSettings))
+#define BRASERO_DRIVE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BRASERO_TYPE_DRIVE_SETTINGS, BraseroDriveSettingsClass))
+#define BRASERO_IS_DRIVE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BRASERO_TYPE_DRIVE_SETTINGS))
+#define BRASERO_IS_DRIVE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BRASERO_TYPE_DRIVE_SETTINGS))
+#define BRASERO_DRIVE_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BRASERO_TYPE_DRIVE_SETTINGS, BraseroDriveSettingsClass))
+
+typedef struct _BraseroDriveSettingsClass BraseroDriveSettingsClass;
+typedef struct _BraseroDriveSettings BraseroDriveSettings;
+
+struct _BraseroDriveSettingsClass
+{
+ GObjectClass parent_class;
+};
+
+struct _BraseroDriveSettings
+{
+ GObject parent_instance;
+};
+
+GType brasero_drive_settings_get_type (void) G_GNUC_CONST;
+
+BraseroDriveSettings *
+brasero_drive_settings_new (void);
+
+void
+brasero_drive_settings_set_session (BraseroDriveSettings *self,
+ BraseroBurnSession *session);
+
+G_END_DECLS
+
+#endif /* _BRASERO_DRIVE_SETTINGS_H_ */
diff --git a/src/brasero-filter-option.c b/src/brasero-filter-option.c
index 5c091c9..c2d49bc 100644
--- a/src/brasero-filter-option.c
+++ b/src/brasero-filter-option.c
@@ -26,12 +26,10 @@
#include <glib.h>
#include <glib/gi18n-lib.h>
-#include <glib/gstdio.h>
+#include <gio/gio.h>
#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
-
#include "brasero-misc.h"
#include "brasero-filter-option.h"
@@ -40,10 +38,7 @@
typedef struct _BraseroFilterOptionPrivate BraseroFilterOptionPrivate;
struct _BraseroFilterOptionPrivate
{
- GConfClient *client;
- guint broken_sym_notify;
- guint sym_notify;
- guint hidden_notify;
+ GSettings *settings;
};
#define BRASERO_FILTER_OPTION_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_FILTER_OPTION, BraseroFilterOptionPrivate))
@@ -51,64 +46,10 @@ struct _BraseroFilterOptionPrivate
G_DEFINE_TYPE (BraseroFilterOption, brasero_filter_option, GTK_TYPE_VBOX);
static void
-brasero_file_filtered_filter_hidden_cb (GtkToggleButton *button,
- BraseroFilterOption *self)
-{
- BraseroFilterOptionPrivate *priv;
-
- priv = BRASERO_FILTER_OPTION_PRIVATE (self);
- gconf_client_set_bool (priv->client,
- BRASERO_FILTER_HIDDEN_KEY,
- gtk_toggle_button_get_active (button),
- NULL);
-}
-
-static void
-brasero_file_filtered_filter_broken_sym_cb (GtkToggleButton *button,
- BraseroFilterOption *self)
-{
- BraseroFilterOptionPrivate *priv;
-
- priv = BRASERO_FILTER_OPTION_PRIVATE (self);
- gconf_client_set_bool (priv->client,
- BRASERO_FILTER_BROKEN_SYM_KEY,
- gtk_toggle_button_get_active (button),
- NULL);
-}
-
-static void
-brasero_file_filtered_replace_sym_cb (GtkToggleButton *button,
- BraseroFilterOption *self)
-{
- BraseroFilterOptionPrivate *priv;
-
- priv = BRASERO_FILTER_OPTION_PRIVATE (self);
- gconf_client_set_bool (priv->client,
- BRASERO_REPLACE_SYMLINK_KEY,
- gtk_toggle_button_get_active (button),
- NULL);
-}
-
-static void
-brasero_file_filtered_gconf_notify_cb (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
-{
- GConfValue *value;
- GtkToggleButton *button = user_data;
-
- value = gconf_entry_get_value (entry);
- gtk_toggle_button_set_active (button, gconf_value_get_bool (value));
-}
-
-static void
brasero_filter_option_init (BraseroFilterOption *object)
{
gchar *string;
- gboolean active;
GtkWidget *frame;
- GError *error = NULL;
GtkWidget *button_sym;
GtkWidget *button_broken;
GtkWidget *button_hidden;
@@ -116,76 +57,28 @@ brasero_filter_option_init (BraseroFilterOption *object)
priv = BRASERO_FILTER_OPTION_PRIVATE (object);
- priv->client = gconf_client_get_default ();
+ priv->settings = g_settings_new (BRASERO_SCHEMA_FILTER);
/* filter hidden files */
- active = gconf_client_get_bool (priv->client,
- BRASERO_FILTER_HIDDEN_KEY,
- NULL);
-
button_hidden = gtk_check_button_new_with_mnemonic (_("Filter _hidden files"));
+ g_settings_bind (priv->settings, BRASERO_PROPS_FILTER_HIDDEN,
+ button_hidden, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_show (button_hidden);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_hidden), active);
- g_signal_connect (button_hidden,
- "toggled",
- G_CALLBACK (brasero_file_filtered_filter_hidden_cb),
- object);
-
- priv->hidden_notify = gconf_client_notify_add (priv->client,
- BRASERO_FILTER_HIDDEN_KEY,
- brasero_file_filtered_gconf_notify_cb,
- button_hidden, NULL, &error);
- if (error) {
- g_warning ("GConf : %s\n", error->message);
- g_error_free (error);
- error = NULL;
- }
/* replace symlink */
- active = gconf_client_get_bool (priv->client,
- BRASERO_REPLACE_SYMLINK_KEY,
- NULL);
-
button_sym = gtk_check_button_new_with_mnemonic (_("Re_place symbolic links"));
+ g_settings_bind (priv->settings, BRASERO_PROPS_FILTER_REPLACE_SYMLINK,
+ button_sym, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_show (button_sym);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_sym), active);
- g_signal_connect (button_sym,
- "toggled",
- G_CALLBACK (brasero_file_filtered_replace_sym_cb),
- object);
-
- priv->sym_notify = gconf_client_notify_add (priv->client,
- BRASERO_REPLACE_SYMLINK_KEY,
- brasero_file_filtered_gconf_notify_cb,
- button_sym, NULL, &error);
- if (error) {
- g_warning ("GConf : %s\n", error->message);
- g_error_free (error);
- error = NULL;
- }
/* filter broken symlink button */
- active = gconf_client_get_bool (priv->client,
- BRASERO_FILTER_BROKEN_SYM_KEY,
- NULL);
-
button_broken = gtk_check_button_new_with_mnemonic (_("Filter _broken symbolic links"));
+ g_settings_bind (priv->settings, BRASERO_PROPS_FILTER_BROKEN,
+ button_broken, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_show (button_broken);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_broken), active);
- g_signal_connect (button_broken,
- "toggled",
- G_CALLBACK (brasero_file_filtered_filter_broken_sym_cb),
- object);
-
- priv->broken_sym_notify = gconf_client_notify_add (priv->client,
- BRASERO_FILTER_BROKEN_SYM_KEY,
- brasero_file_filtered_gconf_notify_cb,
- button_broken, NULL, &error);
- if (error) {
- g_warning ("GConf : %s\n", error->message);
- g_error_free (error);
- error = NULL;
- }
string = g_strdup_printf ("<b>%s</b>", _("Filtering options"));
frame = brasero_utils_pack_properties (string,
@@ -209,26 +102,9 @@ brasero_filter_option_finalize (GObject *object)
priv = BRASERO_FILTER_OPTION_PRIVATE (object);
- if (priv->sym_notify) {
- gconf_client_notify_remove (priv->client, priv->sym_notify);
- priv->sym_notify = 0;
- }
-
- if (priv->hidden_notify) {
- gconf_client_notify_remove (priv->client,
- priv->hidden_notify);
- priv->hidden_notify = 0;
- }
-
- if (priv->broken_sym_notify) {
- gconf_client_notify_remove (priv->client,
- priv->broken_sym_notify);
- priv->broken_sym_notify = 0;
- }
-
- if (priv->client) {
- g_object_unref (priv->client);
- priv->client = NULL;
+ if (priv->settings) {
+ g_object_unref (priv->settings);
+ priv->settings = NULL;
}
G_OBJECT_CLASS (brasero_filter_option_parent_class)->finalize (object);
diff --git a/src/brasero-plugin-manager-ui.c b/src/brasero-plugin-manager-ui.c
index 4ca6352..9260aff 100644
--- a/src/brasero-plugin-manager-ui.c
+++ b/src/brasero-plugin-manager-ui.c
@@ -33,8 +33,6 @@ fy
#include <glib/gi18n.h>
-#include <gconf/gconf-client.h>
-
#include "brasero-misc.h"
#include "brasero-plugin-manager-ui.h"
@@ -146,7 +144,7 @@ about_button_cb (GtkWidget *button,
brasero_plugin_get_author (plugin));
dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
- "program-name", _(brasero_plugin_get_name (plugin)),
+ "program-name", _(brasero_plugin_get_display_name (plugin)),
"copyright", copyright,
"authors", authors,
"comments", brasero_plugin_get_description (plugin),
@@ -191,9 +189,6 @@ configure_button_cb (GtkWidget *button,
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT);
result = gtk_dialog_run (GTK_DIALOG (dialog));
- if (result == GTK_RESPONSE_OK)
- brasero_plugin_option_save_settings (BRASERO_PLUGIN_OPTION (dialog));
-
gtk_widget_destroy (dialog);
}
@@ -223,7 +218,7 @@ plugin_manager_ui_view_info_cell_cb (GtkTreeViewColumn *tree_column,
text = g_markup_printf_escaped ("<b>%s</b>\n%s\n<i>%s</i>",
/* Use the translated name of
* the plugin. */
- _(brasero_plugin_get_name (plugin)),
+ _(brasero_plugin_get_display_name (plugin)),
brasero_plugin_get_description (plugin),
error_string);
g_free (error_string);
@@ -232,7 +227,7 @@ plugin_manager_ui_view_info_cell_cb (GtkTreeViewColumn *tree_column,
text = g_markup_printf_escaped ("<b>%s</b>\n%s",
/* Use the translated name of
* the plugin. */
- _(brasero_plugin_get_name (plugin)),
+ _(brasero_plugin_get_display_name (plugin)),
brasero_plugin_get_description (plugin));
g_object_set (G_OBJECT (cell),
@@ -515,7 +510,7 @@ name_search_cb (GtkTreeModel *model,
return FALSE;
/* Use translated name for the plugin */
- normalized_string = g_utf8_normalize (_(brasero_plugin_get_name (plugin)),
+ normalized_string = g_utf8_normalize (_(brasero_plugin_get_display_name (plugin)),
-1,
G_NORMALIZE_ALL);
normalized_key = g_utf8_normalize (key,
@@ -821,8 +816,8 @@ model_name_sort_func (GtkTreeModel *model,
return 1;
/* Use the translated name for the plugins */
- return g_utf8_collate (_(brasero_plugin_get_name (plugin1)),
- _(brasero_plugin_get_name (plugin2)));
+ return g_utf8_collate (_(brasero_plugin_get_display_name (plugin1)),
+ _(brasero_plugin_get_display_name (plugin2)));
}
static void
diff --git a/src/brasero-plugin-option.c b/src/brasero-plugin-option.c
index cef507b..331b75f 100644
--- a/src/brasero-plugin-option.c
+++ b/src/brasero-plugin-option.c
@@ -31,8 +31,6 @@
#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
-
#include "brasero-plugin.h"
#include "brasero-plugin-information.h"
#include "brasero-plugin-option.h"
@@ -46,154 +44,36 @@ enum {
typedef struct _BraseroPluginOptionPrivate BraseroPluginOptionPrivate;
struct _BraseroPluginOptionPrivate
{
- GSList *widgets;
GtkWidget *title;
GtkWidget *vbox;
-};
-
-struct _BraseroPluginOptionWidget {
- GtkWidget *widget;
- GtkWidget *sensitive;
- BraseroPluginConfOption *option;
- GSList *suboptions;
+ GSettings *settings;
};
-typedef struct _BraseroPluginOptionWidget BraseroPluginOptionWidget;
#define BRASERO_PLUGIN_OPTION_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_PLUGIN_OPTION, BraseroPluginOptionPrivate))
G_DEFINE_TYPE (BraseroPluginOption, brasero_plugin_option, GTK_TYPE_DIALOG);
+#define BRASERO_SCHEMA_CONFIG "org.gnome.brasero.config"
-void
-brasero_plugin_option_save_settings (BraseroPluginOption *self)
-{
- GSList *iter;
- GtkTreeModel *model;
- GConfClient *client;
- GtkTreeIter tree_iter;
- BraseroPluginOptionPrivate *priv;
-
- priv = BRASERO_PLUGIN_OPTION_PRIVATE (self);
-
- client = gconf_client_get_default ();
-
- for (iter = priv->widgets; iter; iter = iter->next) {
- BraseroPluginOptionWidget *widget;
- BraseroPluginConfOptionType type;
- const gchar *value_str;
- gboolean value_bool;
- gint value_int;
- gchar *key;
-
- widget = iter->data;
- if (!gtk_widget_is_sensitive (widget->widget))
- continue;
-
- brasero_plugin_conf_option_get_info (widget->option,
- &key,
- NULL,
- &type);
- switch (type) {
- case BRASERO_PLUGIN_OPTION_BOOL:
- value_bool = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget->widget));
- gconf_client_set_bool (client, key, value_bool, NULL);
- break;
-
- case BRASERO_PLUGIN_OPTION_INT:
- value_int = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (widget->widget));
- gconf_client_set_int (client, key, value_int, NULL);
- break;
-
- case BRASERO_PLUGIN_OPTION_STRING:
- value_str = gtk_entry_get_text (GTK_ENTRY (widget->widget));
- gconf_client_set_string (client, key, value_str, NULL);
- break;
-
- case BRASERO_PLUGIN_OPTION_CHOICE:
- model = gtk_combo_box_get_model (GTK_COMBO_BOX (widget->widget));
- gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget->widget), &tree_iter);
- gtk_tree_model_get (model, &tree_iter,
- VALUE_COL, &value_int,
- -1);
- gconf_client_set_int (client, key, value_int, NULL);
- default:
- break;
- }
-
- g_free (key);
- }
-
- g_object_unref (client);
-}
-
-static void
-brasero_plugin_option_set_toggle_slaves (BraseroPluginOption *self,
- BraseroPluginOptionWidget *option,
- gboolean active)
-{
- BraseroPluginOptionPrivate *priv;
- GSList *iter;
-
- priv = BRASERO_PLUGIN_OPTION_PRIVATE (self);
-
- for (iter = option->suboptions; iter; iter = iter->next) {
- BraseroPluginOptionWidget *suboption;
-
- suboption = iter->data;
- gtk_widget_set_sensitive (suboption->sensitive, active);
- }
-}
-
-static void
-brasero_plugin_option_toggled_changed (GtkWidget *button,
- BraseroPluginOption *self)
-{
- BraseroPluginOptionPrivate *priv;
- gboolean active;
- GSList *iter;
-
- priv = BRASERO_PLUGIN_OPTION_PRIVATE (self);
-
- active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
- for (iter = priv->widgets; iter; iter = iter->next) {
- BraseroPluginOptionWidget *option;
-
- option = iter->data;
- if (option->widget == button) {
- brasero_plugin_option_set_toggle_slaves (self,
- option,
- active);
- break;
- }
- }
-}
-
-static BraseroPluginOptionWidget *
+static GtkWidget *
brasero_plugin_option_add_conf_widget (BraseroPluginOption *self,
BraseroPluginConfOption *option,
GtkBox *container)
{
BraseroPluginOptionPrivate *priv;
- BraseroPluginOptionWidget *info;
- GSList *suboptionsw = NULL;
+ BraseroPluginConfOptionType type;
+ GtkCellRenderer *renderer;
GtkListStore *model;
- GConfClient *client;
- gboolean value_bool;
- gchar *value_str;
- gint value_int;
+ gchar *description;
GSList *suboptions;
GtkWidget *widget;
GtkWidget *label;
+ GtkTreeIter iter;
GtkWidget *hbox;
GtkWidget *box;
- GtkTreeIter iter;
- GtkCellRenderer *renderer;
- BraseroPluginConfOptionType type;
- gchar *description;
gchar *key;
priv = BRASERO_PLUGIN_OPTION_PRIVATE (self);
- client = gconf_client_get_default ();
brasero_plugin_conf_option_get_info (option,
&key,
@@ -212,12 +92,12 @@ brasero_plugin_option_add_conf_widget (BraseroPluginOption *self,
switch (type) {
case BRASERO_PLUGIN_OPTION_BOOL:
widget = gtk_check_button_new_with_label (description);
+ g_settings_bind (priv->settings, key,
+ widget, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_show (widget);
- value_bool = gconf_client_get_bool (client, key, NULL);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), value_bool);
-
suboptions = brasero_plugin_conf_option_bool_get_suboptions (option);
if (suboptions) {
box = gtk_vbox_new (FALSE, 0);
@@ -235,21 +115,17 @@ brasero_plugin_option_add_conf_widget (BraseroPluginOption *self,
0);
for (; suboptions; suboptions = suboptions->next) {
+ GtkWidget *child;
BraseroPluginConfOption *suboption;
suboption = suboptions->data;
/* first create the slaves then set state */
- info = brasero_plugin_option_add_conf_widget (self, suboption, GTK_BOX (box));
- gtk_widget_set_sensitive (info->sensitive, value_bool);
-
- suboptionsw = g_slist_prepend (suboptionsw, info);
+ child = brasero_plugin_option_add_conf_widget (self, suboption, GTK_BOX (box));
+ g_settings_bind (priv->settings, key,
+ child, "sensitive",
+ G_SETTINGS_BIND_DEFAULT);
}
-
- g_signal_connect (widget,
- "toggled",
- G_CALLBACK (brasero_plugin_option_toggled_changed),
- self);
}
else
gtk_box_pack_start (GTK_BOX (hbox),
@@ -266,7 +142,9 @@ brasero_plugin_option_add_conf_widget (BraseroPluginOption *self,
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
- widget = gtk_spin_button_new_with_range (1.0, 500.0, 1.0);
+ widget = gtk_spin_button_new_with_range (brasero_plugin_conf_option_int_get_min (option),
+ brasero_plugin_conf_option_int_get_max (option),
+ 1.0);
gtk_box_pack_start (GTK_BOX (box), widget, FALSE, FALSE, 0);
gtk_widget_show_all (box);
@@ -276,15 +154,9 @@ brasero_plugin_option_add_conf_widget (BraseroPluginOption *self,
FALSE,
0);
- value_int = gconf_client_get_int (client, key, NULL);
-
- if (brasero_plugin_conf_option_int_get_min (option) > value_int)
- value_int = brasero_plugin_conf_option_int_get_min (option);
-
- if (brasero_plugin_conf_option_int_get_max (option) > value_int)
- value_int = brasero_plugin_conf_option_int_get_max (option);
-
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), value_int);
+ g_settings_bind (priv->settings, key,
+ widget, "value",
+ G_SETTINGS_BIND_DEFAULT);
break;
case BRASERO_PLUGIN_OPTION_STRING:
@@ -304,9 +176,9 @@ brasero_plugin_option_add_conf_widget (BraseroPluginOption *self,
FALSE,
0);
- value_str = gconf_client_get_string (client, key, NULL);
- gtk_entry_set_text (GTK_ENTRY (widget), value_str);
- g_free (value_str);
+ g_settings_bind (priv->settings, key,
+ widget, "text",
+ G_SETTINGS_BIND_DEFAULT);
break;
case BRASERO_PLUGIN_OPTION_CHOICE:
@@ -330,7 +202,6 @@ brasero_plugin_option_add_conf_widget (BraseroPluginOption *self,
"text", STRING_COL,
NULL);
- value_int = gconf_client_get_int (client, key, NULL);
suboptions = brasero_plugin_conf_option_choice_get (option);
for (; suboptions; suboptions = suboptions->next) {
BraseroPluginChoicePair *pair;
@@ -341,11 +212,12 @@ brasero_plugin_option_add_conf_widget (BraseroPluginOption *self,
STRING_COL, pair->string,
VALUE_COL, pair->value,
-1);
-
- if (pair->value == value_int)
- gtk_combo_box_set_active_iter (GTK_COMBO_BOX (widget), &iter);
}
+ g_settings_bind (priv->settings, key,
+ widget, "active",
+ G_SETTINGS_BIND_DEFAULT);
+
if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget), &iter)) {
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &iter))
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (widget), &iter);
@@ -359,24 +231,16 @@ brasero_plugin_option_add_conf_widget (BraseroPluginOption *self,
0);
break;
+
default:
widget = NULL;
break;
}
- info = g_new0 (BraseroPluginOptionWidget, 1);
- info->widget = widget;
- info->option = option;
- info->suboptions = suboptionsw;
- info->sensitive = box;
-
- priv->widgets = g_slist_prepend (priv->widgets, info);
-
g_free (key);
g_free (description);
- g_object_unref (client);
- return info;
+ return widget;
}
void
@@ -391,7 +255,7 @@ brasero_plugin_option_set_plugin (BraseroPluginOption *self,
priv = BRASERO_PLUGIN_OPTION_PRIVATE (self);
/* Use the translated name for the plugin. */
- tmp = g_strdup_printf (_("Options for plugin %s"), _(brasero_plugin_get_name (plugin)));
+ tmp = g_strdup_printf (_("Options for plugin %s"), _(brasero_plugin_get_display_name (plugin)));
string = g_strdup_printf ("<b>%s</b>", tmp);
g_free (tmp);
@@ -434,16 +298,9 @@ brasero_plugin_option_init (BraseroPluginOption *object)
gtk_dialog_set_has_separator (GTK_DIALOG (object), FALSE);
gtk_dialog_add_button (GTK_DIALOG (object),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
- gtk_dialog_add_button (GTK_DIALOG (object),
- GTK_STOCK_APPLY, GTK_RESPONSE_OK);
-}
+ GTK_STOCK_CLOSE, GTK_RESPONSE_OK);
-static void
-brasero_plugin_option_widget_free (BraseroPluginOptionWidget *option)
-{
- g_slist_free (option->suboptions);
- g_free (option);
+ priv->settings = g_settings_new (BRASERO_SCHEMA_CONFIG);
}
static void
@@ -453,9 +310,10 @@ brasero_plugin_option_finalize (GObject *object)
priv = BRASERO_PLUGIN_OPTION_PRIVATE (object);
- g_slist_foreach (priv->widgets, (GFunc) brasero_plugin_option_widget_free, NULL);
- g_slist_free (priv->widgets);
- priv->widgets = NULL;
+ if (priv->settings) {
+ g_object_unref (priv->settings);
+ priv->settings = NULL;
+ }
G_OBJECT_CLASS (brasero_plugin_option_parent_class)->finalize (object);
}
diff --git a/src/brasero-plugin-option.h b/src/brasero-plugin-option.h
index 035c764..59602fd 100644
--- a/src/brasero-plugin-option.h
+++ b/src/brasero-plugin-option.h
@@ -58,9 +58,6 @@ void
brasero_plugin_option_set_plugin (BraseroPluginOption *dialog,
BraseroPlugin *plugin);
-void
-brasero_plugin_option_save_settings (BraseroPluginOption *dialog);
-
G_END_DECLS
#endif /* _BRASERO_PLUGIN_OPTION_H_ */
diff --git a/src/brasero-project-name.c b/src/brasero-project-name.c
index fc32ff5..a03c1e7 100644
--- a/src/brasero-project-name.c
+++ b/src/brasero-project-name.c
@@ -498,6 +498,7 @@ brasero_project_name_set_type (BraseroProjectName *self)
static void
brasero_project_name_flags_changed (BraseroBurnSession *session,
+ GParamSpec *pspec,
BraseroProjectName *self)
{
BraseroProjectNamePrivate *priv;
@@ -658,7 +659,7 @@ brasero_project_name_set_session (BraseroProjectName *project,
G_CALLBACK (brasero_project_name_track_removed),
project);
g_signal_connect (priv->session,
- "flags-changed",
+ "notify::flags",
G_CALLBACK (brasero_project_name_flags_changed),
project);
diff --git a/src/brasero-project.c b/src/brasero-project.c
index cc3aba3..a1fc2d0 100644
--- a/src/brasero-project.c
+++ b/src/brasero-project.c
@@ -89,6 +89,7 @@
#include "brasero-notify.h"
#include "brasero-project-parse.h"
#include "brasero-project-name.h"
+#include "brasero-drive-settings.h"
static void brasero_project_class_init (BraseroProjectClass *klass);
static void brasero_project_init (BraseroProject *sp);
@@ -1600,11 +1601,12 @@ brasero_project_image_properties (BraseroProject *project)
return (answer == GTK_RESPONSE_OK) ? BRASERO_BURN_OK:BRASERO_BURN_ERR;
}
-void
+static void
brasero_project_burn (BraseroProject *project)
{
BraseroBurnResult res;
BraseroDisc *current_disc;
+ BraseroDriveSettings *settings;
/* Check that we are ready */
if (brasero_project_check_status (project) != BRASERO_BURN_OK)
@@ -1614,13 +1616,21 @@ brasero_project_burn (BraseroProject *project)
if (brasero_project_check_plugins_not_ready (project, BRASERO_BURN_SESSION (project->priv->session)) != BRASERO_BURN_OK)
return;
+ /* Set saved temporary directory for the session.
+ * NOTE: BraseroBurnSession can cope with NULL path */
+ settings = brasero_drive_settings_new ();
+ brasero_drive_settings_set_session (settings, BRASERO_BURN_SESSION (project->priv->session));
+
if (!brasero_burn_session_is_dest_file (BRASERO_BURN_SESSION (project->priv->session)))
res = brasero_project_drive_properties (project);
else
res = brasero_project_image_properties (project);
- if (res != BRASERO_BURN_OK && res != BRASERO_BURN_RETRY)
+ if (res != BRASERO_BURN_OK
+ && res != BRASERO_BURN_RETRY) {
+ g_object_unref (settings);
return;
+ }
project->priv->is_burning = 1;
@@ -1640,6 +1650,8 @@ brasero_project_burn (BraseroProject *project)
BRASERO_BURN_SESSION (project->priv->session),
res == BRASERO_BURN_RETRY);
+ g_object_unref (settings);
+
/* empty the stack of temporary tracks */
while (brasero_burn_session_pop_tracks (BRASERO_BURN_SESSION (project->priv->session)) == BRASERO_BURN_RETRY);
diff --git a/src/brasero-project.h b/src/brasero-project.h
index 9b9cced..db241ad 100644
--- a/src/brasero-project.h
+++ b/src/brasero-project.h
@@ -66,9 +66,6 @@ typedef struct {
GType brasero_project_get_type (void);
GtkWidget *brasero_project_new (void);
-void
-brasero_project_burn (BraseroProject *project);
-
BraseroBurnResult
brasero_project_confirm_switch (BraseroProject *project,
gboolean keep_files);
diff --git a/src/main.c b/src/main.c
index ee14fc8..259036a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -40,8 +40,6 @@
#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
-
#include <gst/gst.h>
#include <gst/pbutils/pbutils.h>
@@ -469,6 +467,8 @@ main (int argc, char **argv)
{
GOptionContext *context;
+ g_setenv ("GSETTINGS_BACKEND", "gconf", FALSE);
+
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -515,13 +515,3 @@ main (int argc, char **argv)
return 0;
}
-
- /* REMINDER: this is done in burn library now */
-/* gst_init (&argc, &argv);
- gst_pb_utils_init ();
- client = gconf_client_get_default ();
- gconf_client_add_dir (client,
- BRASERO_CONF_DIR,
- GCONF_CLIENT_PRELOAD_NONE,
- NULL);
-*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]