rhythmbox r5678 - in trunk: . data plugins/ipod plugins/mtpdevice
- From: jmatthew svn gnome org
- To: svn-commits-list gnome org
- Subject: rhythmbox r5678 - in trunk: . data plugins/ipod plugins/mtpdevice
- Date: Mon, 14 Apr 2008 10:45:26 +0100 (BST)
Author: jmatthew
Date: Mon Apr 14 10:45:26 2008
New Revision: 5678
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=5678&view=rev
Log:
2008-04-14 Jonathan Matthew <jonathan d14n org>
patch by: Mirco MÃller <macslow bangang de>
* data/rhythmbox.schemas:
* plugins/ipod/rb-ipod-source.c: (rb_ipod_source_class_init),
(impl_get_browser_key), (impl_get_paned_key):
* plugins/mtpdevice/rb-mtp-source.c: (rb_mtp_source_class_init),
(impl_get_browser_key), (impl_get_paned_key):
Add gconf keys for tracking the browser state for ipod and mtp
devices, showing the browser by default. From #508555.
Modified:
trunk/ChangeLog
trunk/data/rhythmbox.schemas
trunk/plugins/ipod/rb-ipod-source.c
trunk/plugins/mtpdevice/rb-mtp-source.c
Modified: trunk/data/rhythmbox.schemas
==============================================================================
--- trunk/data/rhythmbox.schemas (original)
+++ trunk/data/rhythmbox.schemas Mon Apr 14 10:45:26 2008
@@ -12,6 +12,28 @@
</locale>
</schema>
<schema>
+ <key>/schemas/apps/rhythmbox/state/ipod/show_browser</key>
+ <applyto>/apps/rhythmbox/state/ipod/show_browser</applyto>
+ <owner>rhythmbox</owner>
+ <type>bool</type>
+ <default>TRUE</default>
+ <locale name="C">
+ <short>Show browser in for iPods</short>
+ <long>Show the artist and album browser for an iPod.</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/apps/rhythmbox/state/mtp/show_browser</key>
+ <applyto>/apps/rhythmbox/state/mtp/show_browser</applyto>
+ <owner>rhythmbox</owner>
+ <type>bool</type>
+ <default>TRUE</default>
+ <locale name="C">
+ <short>Show browser in for MTP-devices</short>
+ <long>Show the artist and album browser for an MTP-device.</long>
+ </locale>
+ </schema>
+ <schema>
<key>/schemas/apps/rhythmbox/grace_period</key>
<applyto>/apps/rhythmbox/grace_period</applyto>
<owner>rhythmbox</owner>
Modified: trunk/plugins/ipod/rb-ipod-source.c
==============================================================================
--- trunk/plugins/ipod/rb-ipod-source.c (original)
+++ trunk/plugins/ipod/rb-ipod-source.c Mon Apr 14 10:45:26 2008
@@ -48,11 +48,17 @@
#include "rhythmdb.h"
#include "rb-cut-and-paste-code.h"
+#define CONF_STATE_PANED_POSITION CONF_PREFIX "/state/ipod/paned_position"
+#define CONF_STATE_SHOW_BROWSER CONF_PREFIX "/state/ipod/show_browser"
+
static GObject *rb_ipod_source_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties);
static void rb_ipod_source_dispose (GObject *object);
+static char *impl_get_browser_key (RBSource *source);
+static char *impl_get_paned_key (RBBrowserSource *source);
+
static gboolean impl_show_popup (RBSource *source);
static void impl_move_to_trash (RBSource *asource);
static void rb_ipod_load_songs (RBiPodSource *source);
@@ -128,10 +134,13 @@
GObjectClass *object_class = G_OBJECT_CLASS (klass);
RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
RBRemovableMediaSourceClass *rms_class = RB_REMOVABLE_MEDIA_SOURCE_CLASS (klass);
+ RBBrowserSourceClass *browser_source_class = RB_BROWSER_SOURCE_CLASS (klass);
object_class->constructor = rb_ipod_source_constructor;
object_class->dispose = rb_ipod_source_dispose;
+ source_class->impl_can_browse = (RBSourceFeatureFunc) rb_true_function;
+ source_class->impl_get_browser_key = impl_get_browser_key;
source_class->impl_show_popup = impl_show_popup;
source_class->impl_delete_thyself = impl_delete_thyself;
source_class->impl_can_move_to_trash = (RBSourceFeatureFunc) rb_true_function;
@@ -149,6 +158,8 @@
rms_class->impl_track_added = NULL;
#endif
+ browser_source_class->impl_get_paned_key = impl_get_paned_key;
+
g_type_class_add_private (klass, sizeof (RBiPodSourcePrivate));
}
@@ -1070,6 +1081,18 @@
return actions;
}
+static char *
+impl_get_browser_key (RBSource *source)
+{
+ return g_strdup (CONF_STATE_SHOW_BROWSER);
+}
+
+static char *
+impl_get_paned_key (RBBrowserSource *source)
+{
+ return g_strdup (CONF_STATE_PANED_POSITION);
+}
+
static gboolean
impl_show_popup (RBSource *source)
{
Modified: trunk/plugins/mtpdevice/rb-mtp-source.c
==============================================================================
--- trunk/plugins/mtpdevice/rb-mtp-source.c (original)
+++ trunk/plugins/mtpdevice/rb-mtp-source.c Mon Apr 14 10:45:26 2008
@@ -42,11 +42,16 @@
#include "rb-mtp-source.h"
+#define CONF_STATE_PANED_POSITION CONF_PREFIX "/state/mtp/paned_position"
+#define CONF_STATE_SHOW_BROWSER CONF_PREFIX "/state/mtp/show_browser"
+
static GObject *rb_mtp_source_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties);
static void rb_mtp_source_finalize (GObject *object);
+static char *impl_get_browser_key (RBSource *source);
+static char *impl_get_paned_key (RBBrowserSource *source);
static void rb_mtp_source_load_tracks (RBMtpSource*);
static gboolean rb_mtp_source_transfer_track_to_disk (LIBMTP_mtpdevice_t *device,
@@ -92,10 +97,14 @@
GObjectClass *object_class = G_OBJECT_CLASS (klass);
RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
RBRemovableMediaSourceClass *rms_class = RB_REMOVABLE_MEDIA_SOURCE_CLASS (klass);
+ RBBrowserSourceClass *browser_source_class = RB_BROWSER_SOURCE_CLASS (klass);
object_class->constructor = rb_mtp_source_constructor;
object_class->finalize = rb_mtp_source_finalize;
+ source_class->impl_can_browse = (RBSourceFeatureFunc) rb_true_function;
+ source_class->impl_get_browser_key = impl_get_browser_key;
+
source_class->impl_can_rename = (RBSourceFeatureFunc) rb_true_function;
source_class->impl_can_delete = (RBSourceFeatureFunc) rb_true_function;
#ifdef ENABLE_TRACK_TRANSFER
@@ -111,6 +120,8 @@
source_class->impl_delete = impl_delete;
source_class->impl_copy = impl_copy;
+ browser_source_class->impl_get_paned_key = impl_get_paned_key;
+
rms_class->impl_track_added = impl_track_added;
rms_class->impl_build_dest_uri = impl_build_dest_uri;
rms_class->impl_get_mime_types = impl_get_mime_types;
@@ -182,6 +193,18 @@
G_OBJECT_CLASS (rb_mtp_source_parent_class)->finalize (object);
}
+static char *
+impl_get_browser_key (RBSource *source)
+{
+ return g_strdup (CONF_STATE_SHOW_BROWSER);
+}
+
+static char *
+impl_get_paned_key (RBBrowserSource *source)
+{
+ return g_strdup (CONF_STATE_PANED_POSITION);
+}
+
RBBrowserSource *
rb_mtp_source_new (RBShell *shell,
LIBMTP_mtpdevice_t *device,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]