brasero r780 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r780 - in trunk: . src
- Date: Sun, 27 Apr 2008 15:05:44 +0100 (BST)
Author: philippr
Date: Sun Apr 27 14:05:44 2008
New Revision: 780
URL: http://svn.gnome.org/viewvc/brasero?rev=780&view=rev
Log:
Fix #520578 â Check Integrity menu entry still present even with plugins disabled
* src/burn-caps.c (brasero_burn_caps_can_checksum):
* src/burn-caps.h:
* src/main.c (brasero_caps_changed_cb), (brasero_app_create_app):
Modified:
trunk/ChangeLog
trunk/src/burn-caps.c
trunk/src/burn-caps.h
trunk/src/main.c
Modified: trunk/src/burn-caps.c
==============================================================================
--- trunk/src/burn-caps.c (original)
+++ trunk/src/burn-caps.c Sun Apr 27 14:05:44 2008
@@ -3631,3 +3631,28 @@
return BRASERO_BURN_NOT_SUPPORTED;
}
+
+gboolean
+brasero_burn_caps_can_checksum (BraseroBurnCaps *self)
+{
+ GSList *iter;
+
+ if (self->priv->tests == NULL)
+ return FALSE;
+
+ for (iter = self->priv->tests; iter; iter = iter->next) {
+ BraseroCapsTest *tmp;
+ GSList *links;
+
+ tmp = iter->data;
+ for (links = tmp->links; links; links = links->next) {
+ BraseroCapsLink *link;
+
+ link = links->data;
+ if (brasero_caps_link_active (link))
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
Modified: trunk/src/burn-caps.h
==============================================================================
--- trunk/src/burn-caps.h (original)
+++ trunk/src/burn-caps.h Sun Apr 27 14:05:44 2008
@@ -60,7 +60,7 @@
BraseroBurnCaps *brasero_burn_caps_get_default ();
gint
-brasero_burn_caps_register_plugin_group (BraseroBurnCaps *self,
+brasero_burn_caps_register_plugin_group (BraseroBurnCaps *caps,
const gchar *name);
/**
@@ -68,9 +68,12 @@
*/
BraseroMedia
-brasero_burn_caps_media_capabilities (BraseroBurnCaps *self,
+brasero_burn_caps_media_capabilities (BraseroBurnCaps *caps,
BraseroMedia media);
+gboolean
+brasero_burn_caps_can_checksum (BraseroBurnCaps *caps);
+
/**
* Returns a GSList * of BraseroTask * for a given session
*/
Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c (original)
+++ trunk/src/main.c Sun Apr 27 14:05:44 2008
@@ -59,6 +59,8 @@
#include "brasero-pref.h"
#include "burn-debug.h"
#include "burn.h"
+#include "burn-caps.h"
+#include "burn-plugin-manager.h"
static GConfClient *client;
gchar *project_uri;
@@ -490,14 +492,34 @@
app);
}
+static void
+brasero_caps_changed_cb (BraseroPluginManager *manager,
+ BraseroApp *app)
+{
+ BraseroBurnCaps *caps;
+ GtkWidget *widget;
+
+ caps = brasero_burn_caps_get_default ();
+ widget = gtk_ui_manager_get_widget (app->manager, "/menubar/ToolMenu/Check");
+
+ if (!brasero_burn_caps_can_checksum (caps))
+ gtk_widget_set_sensitive (widget, FALSE);
+ else
+ gtk_widget_set_sensitive (widget, TRUE);
+
+ g_object_unref (caps);
+}
+
static BraseroApp *
brasero_app_create_app (void)
{
BraseroApp *app;
GtkWidget *menubar;
GError *error = NULL;
+ BraseroBurnCaps *caps;
GtkAccelGroup *accel_group;
GtkActionGroup *action_group;
+ BraseroPluginManager *plugin_manager;
/* New window */
app = g_new0 (BraseroApp, 1);
@@ -558,6 +580,22 @@
menubar = gtk_ui_manager_get_widget (app->manager, "/menubar");
gnome_app_set_menus (GNOME_APP (app->mainwin), GTK_MENU_BAR (menubar));
+ /* check if we can use checksums (we need plugins enabled) */
+ caps = brasero_burn_caps_get_default ();
+ if (!brasero_burn_caps_can_checksum (caps)) {
+ GtkWidget *widget;
+
+ widget = gtk_ui_manager_get_widget (app->manager, "/menubar/ToolMenu/Check");
+ gtk_widget_set_sensitive (widget, FALSE);
+ }
+ g_object_unref (caps);
+
+ plugin_manager = brasero_plugin_manager_get_default ();
+ g_signal_connect (plugin_manager,
+ "caps-changed",
+ G_CALLBACK (brasero_caps_changed_cb),
+ app);
+
/* add accelerators */
accel_group = gtk_ui_manager_get_accel_group (app->manager);
gtk_window_add_accel_group (GTK_WINDOW (app->mainwin), accel_group);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]