~ubuntu-branches/ubuntu/precise/rhythmbox/precise-security

« back to all changes in this revision

Viewing changes to plugins/ipod/rb-ipod-helpers.c

  • Committer: Package Import Robot
  • Author(s): Rodney Dawes
  • Date: 2012-03-09 07:24:47 UTC
  • mfrom: (1.1.64)
  • Revision ID: package-import@ubuntu.com-20120309072447-ltf9ea8d9vj5zmiy
Tags: 2.95.5-0ubuntu1
* New upstream release. (LP: #949424)
  - Add support for allowing plug-ins to specify that they should be
    enabled by default. (LP: #934235)
  - Magnatune plug-in is re-enabled upstream.
  - Removal of gtk_dialog_run in most all cases.
  - Porting of more plug-ins to python-gi. 
* debian/control, debian/*.install:
  - Remove the useless coherence plug-in install file.
  - Move some core plug-ins into main rhythmbox package.
    + audiocd, generic-player, iradio, mmkeys, power-manager, rb
  - Split out the NPAPI plug-in to a separate package.
  - Split out the zeitgeist plug-in to a separate package.
  - Split out the magnatune store plug-in to a separate package.
  - Split out the visualizer plug-in to a separate package.
    + Disable building the visualizer plug-in package, as it needs
      libmx which is in universe and not main.
* debian/patches/*:
  - Refreshed patches against new source that had problems applying.
  - Remvoe the mpris name patch which is included upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
200
200
        }
201
201
}
202
202
 
203
 
static void
204
 
fill_model_combo (GtkWidget *combo, const char *mount_path)
 
203
void
 
204
rb_ipod_helpers_fill_model_combo (GtkWidget *combo, const char *mount_path)
205
205
{
206
206
        GHashTable *models;
207
207
        Itdb_Device *device;
237
237
                                            NULL, NULL);
238
238
}
239
239
 
240
 
gboolean
241
 
rb_ipod_helpers_show_first_time_dialog (GMount *mount, const char *builder_file)
242
 
{
243
 
        /* could be an uninitialised iPod, ask the user */
244
 
        GtkBuilder *builder;
245
 
        GtkWidget *dialog;
246
 
        GtkWidget *widget;
247
 
        GtkWidget *name_widget;
248
 
        GtkTreeModel *tree_model;
249
 
        GtkTreeIter iter;
250
 
        int response;
251
 
        char *mountpoint;
252
 
        const Itdb_IpodInfo *info;
253
 
        char *ipod_name;
254
 
        GFile *root;
255
 
        GError *error = NULL;
256
 
 
257
 
        root = g_mount_get_root (mount);
258
 
        if (root == NULL) {
259
 
                return FALSE;      
260
 
        }
261
 
        mountpoint = g_file_get_path (root);
262
 
        g_object_unref (G_OBJECT (root));
263
 
 
264
 
        if (mountpoint == NULL) {
265
 
                return FALSE;
266
 
        }
267
 
 
268
 
        /* create message dialog with model-number combo box
269
 
         * and asking whether they want to initialise the iPod
270
 
         */
271
 
        builder = rb_builder_load (builder_file, NULL);
272
 
        if (builder == NULL) {
273
 
                return FALSE;
274
 
        }
275
 
        dialog = GTK_WIDGET (gtk_builder_get_object (builder, "ipod_init"));
276
 
        widget = GTK_WIDGET (gtk_builder_get_object (builder, "model_combo"));
277
 
        name_widget = GTK_WIDGET (gtk_builder_get_object (builder, "name_entry"));
278
 
        fill_model_combo (widget, mountpoint);
279
 
        g_object_unref (builder);
280
 
 
281
 
        rb_debug ("showing init dialog for ipod mount on '%s'", mountpoint);
282
 
 
283
 
        response = gtk_dialog_run (GTK_DIALOG (dialog));
284
 
        if (response != GTK_RESPONSE_ACCEPT) {
285
 
                gtk_widget_destroy (dialog);
286
 
                g_free (mountpoint);
287
 
                return FALSE;
288
 
        }
289
 
 
290
 
        /* get model number and name */
291
 
        tree_model = gtk_combo_box_get_model (GTK_COMBO_BOX (widget));
292
 
        if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget), &iter)) {
293
 
                gtk_widget_destroy (dialog);
294
 
                g_free (mountpoint);
295
 
                return FALSE;
296
 
        }
297
 
        gtk_tree_model_get (tree_model, &iter, COL_INFO, &info, -1);
298
 
        ipod_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (name_widget)));
299
 
 
300
 
        gtk_widget_destroy (dialog);
301
 
 
302
 
        rb_debug ("attempting to init ipod on '%s', with model '%s' and name '%s'",
303
 
                  mountpoint, info->model_number, ipod_name);
304
 
        if (!itdb_init_ipod (mountpoint, info->model_number, ipod_name, &error)) {
305
 
                rb_error_dialog (NULL, _("Unable to initialize new iPod"), "%s", error->message);
306
 
 
307
 
                g_free (mountpoint);
308
 
                g_free (ipod_name);
309
 
                g_error_free (error);
310
 
                return FALSE;
311
 
        }
312
 
 
313
 
        g_free (mountpoint);
314
 
        g_free (ipod_name);
315
 
 
316
 
        return TRUE;
317
 
}
318
 
 
319
240
static gchar *
320
241
rb_ipod_helpers_get_itunesdb_path (GMount *mount)
321
242
{