~ubuntu-branches/debian/experimental/brasero/experimental

« back to all changes in this revision

Viewing changes to src/burn-plugin.c

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette, Pedro Fragoso, Luca Bruno, Josselin Mouette, Emilio Pozuelo Monfort
  • Date: 2009-06-24 18:59:46 UTC
  • mfrom: (1.2.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624185946-iyxkgf3gjptir5y3
Tags: 2.26.2-1
[ Pedro Fragoso ]
* Add myself to Maintainer field
  - Thanks Ondřej Surý
* New upstream version (Closes: #528945)
  - Split package into brasero, libbrasero-media0 and libbrasero-dev
  - Add Replaces to libbrasero-media0
  - Bump libgtk to 2.14.0
  - Remove libnotify Build-dep
  - Add Build-dep libnautilus-extension-dev (>= 2.22.2)
    and install it.
  - Add Build-dep to libsm-dev
  - Add Build-dep on intltool
* Install omf files to prevent crash on Help
* Move gstreamer0.10-plugins-bad to Suggests, and add
  dvdauthor and vcdimager
* Recommends gvfs (Closes: #491827)
* Pass --disable-scrollkeeper in DEB_CONFIGURE_EXTRA_FLAGS
* debian/patches/007-fix-gnome-doc-utils-path.patch:
  - Removed, not needed anymore
* debian/patches/008-fix-volume-identifier-crash.patch:
  - Removed, merged upstream
* debian/patches/011_nautilus_menu_move.patch:
 - Move CD/DVD Creator Menu to Acessories, taken from Ubuntu

[ Luca Bruno ]
* debian/control.in:
  - Add Build-Depend gtk-doc-tools 1.9.
* debian/patches/006-fix-libdvdcss.patch:
  - Removed as applied upstream.

[ Josselin Mouette ]
* New upstream release.
* Update build-dependencies.
* Move the translations and data to a new brasero-common package.
* Rewrite the descriptions.
* Add -dev depends to the development package.
* Remove inappropriate recommends in the library package.
* Let’s not forget dvd+rw-tools so that we can write DVDs too.
* Rework dependencies accordingly.
* Put the nautilus extension in brasero.
* Conflict against nautilus-cd-burner to avoid having two burning 
  extensions.
* Include clean-la.mk and gnome-version.mk; build-depend on 
  gnome-pkg-tools 0.7.
* Don’t run dh_makeshlibs on brasero and libbrasero-plugins.
* 011_nautilus_menu_move.patch: add NoDisplay=true, this icon is 
  duplicating existing functionality (brasero icon in sound&video 
  menu, and nautilus autorun).
* Update list of copyright holders.

[ Emilio Pozuelo Monfort ]
* debian/copyright: updated.

[ Josselin Mouette ]
* copyright: improve indentation, and point to versioned LGPL.
* 090_relibtoolize.patch: add a relibtoolization patch to avoid the 
  rpath crap.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * brasero
3
3
 * Copyright (C) Philippe Rouquier 2007-2008 <bonfire-app@wanadoo.fr>
4
4
 * 
5
 
 * brasero is free software.
6
 
 * 
7
 
 * You may redistribute it and/or modify it under the terms of the
8
 
 * GNU General Public License, as published by the Free Software
9
 
 * Foundation; either version 2 of the License, or (at your option)
10
 
 * any later version.
 
5
 *  Brasero is free software; you can redistribute it and/or modify
 
6
 *  it under the terms of the GNU General Public License as published by
 
7
 *  the Free Software Foundation; either version 2 of the License, or
 
8
 *  (at your option) any later version.
11
9
 * 
12
10
 * brasero is distributed in the hope that it will be useful,
13
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
33
31
 
34
32
#include <gconf/gconf-client.h>
35
33
 
 
34
#include "brasero-media-private.h"
 
35
 
36
36
#include "burn-basics.h"
37
37
#include "burn-debug.h"
38
38
#include "burn-plugin.h"
39
39
#include "burn-plugin-private.h"
40
40
#include "burn-caps.h"
 
41
#include "brasero-media.h"
41
42
 
42
43
#define BRASERO_PLUGIN_PRIORITY_KEY                     "/apps/brasero/config/priority"
43
44
 
100
101
        GSList *blank_flags;
101
102
 
102
103
        BraseroPluginProcessFlag process_flags;
 
104
 
 
105
        guint compulsory:1;
103
106
};
104
107
 
105
108
static const gchar *default_icon = "gtk-cdrom";
125
128
static guint plugin_signals [LAST_SIGNAL] = { 0 };
126
129
 
127
130
void
 
131
brasero_plugin_set_compulsory (BraseroPlugin *self,
 
132
                               gboolean compulsory)
 
133
{
 
134
        BraseroPluginPrivate *priv;
 
135
 
 
136
        priv = BRASERO_PLUGIN_PRIVATE (self);
 
137
        priv->compulsory = compulsory;
 
138
}
 
139
 
 
140
gboolean
 
141
brasero_plugin_get_compulsory (BraseroPlugin *self)
 
142
{
 
143
        BraseroPluginPrivate *priv;
 
144
 
 
145
        priv = BRASERO_PLUGIN_PRIVATE (self);
 
146
        return priv->compulsory;
 
147
}
 
148
 
 
149
void
128
150
brasero_plugin_set_active (BraseroPlugin *self, gboolean active)
129
151
{
130
152
        BraseroPluginPrivate *priv;
389
411
        caps = brasero_burn_caps_get_default ();
390
412
 
391
413
        /* make sure the name used has characters usable by GConf */
392
 
        if (brasero_burn_caps_plugin_can_burn (caps, self) == BRASERO_BURN_OK)
 
414
        if (brasero_plugin_can_burn (self) == BRASERO_BURN_OK)
393
415
                type = 0;
394
 
        else if (brasero_burn_caps_plugin_can_image (caps, self) == BRASERO_BURN_OK)
 
416
        else if (brasero_plugin_can_image (self) == BRASERO_BURN_OK)
395
417
                type = 1;
396
 
        else if (brasero_burn_caps_plugin_can_convert (caps, self) == BRASERO_BURN_OK)
 
418
        else if (brasero_plugin_can_convert (self) == BRASERO_BURN_OK)
397
419
                type = 2;
398
420
 
399
 
        gconf_name = g_strdup (priv->name);
400
 
        g_strdelimit (gconf_name, " +()", '_');
 
421
        gconf_name = gconf_escape_key (priv->name, -1);
401
422
        priority_path = g_strdup_printf ("%s/%s-%s",
402
423
                                         BRASERO_PLUGIN_PRIORITY_KEY,
403
424
                                         gconf_name,
404
425
                                         category [type]);
405
 
 
406
426
        g_free (gconf_name);
407
427
        g_object_unref (caps);
408
428
 
429
449
}
430
450
 
431
451
void
432
 
brasero_plugin_register_group (BraseroPlugin *self,
433
 
                               const gchar *name)
 
452
brasero_plugin_set_group (BraseroPlugin *self,
 
453
                          gint group_id)
434
454
{
435
 
        guint id;
436
 
        BraseroBurnCaps *caps;
437
455
        BraseroPluginPrivate *priv;
438
456
 
439
457
        priv = BRASERO_PLUGIN_PRIVATE (self);
440
 
 
441
 
        caps = brasero_burn_caps_get_default ();
442
 
        id = brasero_burn_caps_register_plugin_group (caps, name);
443
 
        priv->group = id;
444
 
        g_object_unref (caps);
 
458
        priv->group = group_id;
445
459
}
446
460
 
447
461
guint
494
508
                flags->media = media;
495
509
                flags_list = g_slist_prepend (flags_list, flags);
496
510
        }
 
511
        else for (pair = flags->pairs; pair; pair = pair->next) {
 
512
                /* have a look at the BraseroPluginFlagPair to see if there
 
513
                 * is an exactly similar pair of flags or at least which
 
514
                 * encompasses it to avoid redundancy. */
 
515
                if ((pair->supported & supported) == supported
 
516
                &&  (pair->compulsory & compulsory) == compulsory)
 
517
                        return flags_list;
 
518
        }
497
519
 
498
520
        pair = g_new0 (BraseroPluginFlagPair, 1);
499
521
        pair->supported = supported;
512
534
                          BraseroBurnFlag compulsory)
513
535
{
514
536
        BraseroPluginPrivate *priv;
 
537
        GSList *list;
 
538
        GSList *iter;
515
539
 
516
540
        priv = BRASERO_PLUGIN_PRIVATE (self);
517
 
        priv->flags = brasero_plugin_set_flags_real (priv->flags,
518
 
                                                     media,
519
 
                                                     supported,
520
 
                                                     compulsory);
 
541
 
 
542
        list = brasero_media_get_all_list (media);
 
543
        for (iter = list; iter; iter = iter->next) {
 
544
                BraseroMedia medium;
 
545
 
 
546
                medium = GPOINTER_TO_INT (iter->data);
 
547
                priv->flags = brasero_plugin_set_flags_real (priv->flags,
 
548
                                                             medium,
 
549
                                                             supported,
 
550
                                                             compulsory);
 
551
        }
 
552
        g_slist_free (list);
521
553
}
522
554
 
523
555
static gboolean
537
569
 
538
570
        flags = brasero_plugin_get_flags (flags_list, media);
539
571
        if (!flags) {
 
572
 
540
573
                if (supported_retval)
541
574
                        *supported_retval = BRASERO_BURN_FLAG_NONE;
542
575
                if (compulsory_retval)
605
638
        BraseroPluginPrivate *priv;
606
639
 
607
640
        priv = BRASERO_PLUGIN_PRIVATE (self);
 
641
 
608
642
        current &= BRASERO_PLUGIN_IMAGE_FLAG_MASK;
609
643
 
610
644
        /* If there is no flag that's no use checking anything. If there is no
623
657
}
624
658
 
625
659
gboolean
 
660
brasero_plugin_check_media_restrictions (BraseroPlugin *self,
 
661
                                         BraseroMedia media)
 
662
{
 
663
        BraseroPluginPrivate *priv;
 
664
 
 
665
        priv = BRASERO_PLUGIN_PRIVATE (self);
 
666
 
 
667
        /* no restrictions */
 
668
        if (!priv->flags)
 
669
                return TRUE;
 
670
 
 
671
        return (brasero_plugin_get_flags (priv->flags, media) != NULL);
 
672
}
 
673
 
 
674
gboolean
626
675
brasero_plugin_get_record_flags (BraseroPlugin *self,
627
676
                                 BraseroMedia media,
628
677
                                 BraseroBurnFlag current,
930
979
        priv = BRASERO_PLUGIN_PRIVATE (self);
931
980
 
932
981
        value = gconf_entry_get_value (entry);
933
 
        if (value->type != GCONF_VALUE_INT)
 
982
        if (!value)
 
983
                priv->priority = 0;
 
984
        else if (value->type != GCONF_VALUE_INT)
934
985
                return;
935
 
 
936
 
        self = BRASERO_PLUGIN (data);
 
986
        else
 
987
                priv->priority = gconf_value_get_int (value);
937
988
 
938
989
        is_active = brasero_plugin_get_active (self);
939
 
        priv->priority = gconf_value_get_int (value);
940
990
 
941
991
        g_object_notify (G_OBJECT (self), "priority");
942
992
        if (is_active != brasero_plugin_get_active (self))
1058
1108
                priv->notify_priority = 0;
1059
1109
                g_object_unref (client);
1060
1110
        }
1061
 
                
 
1111
 
 
1112
        if (priv->error) {
 
1113
                g_free (priv->error);
 
1114
                priv->error = NULL;
 
1115
        }
 
1116
 
1062
1117
        G_OBJECT_CLASS (parent_class)->finalize (object);
1063
1118
}
1064
1119
 
1126
1181
 
1127
1182
        priv = BRASERO_PLUGIN_PRIVATE (object);
1128
1183
        priv->type = G_TYPE_NONE;
 
1184
        priv->compulsory = TRUE;
1129
1185
}
1130
1186
 
1131
1187
static void