121
130
static void rb_shell_playing_entry_changed_cb (RBShellPlayer *player,
122
131
RhythmDBEntry *entry,
133
static void rb_shell_playing_from_queue_cb (RBShellPlayer *player,
124
136
static void source_activated_cb (RBSourceList *sourcelist,
125
137
RBSource *source,
127
static void rb_shell_db_error_cb (RhythmDB *db,
128
const char *uri, const char *msg,
139
static void rb_shell_db_load_error_cb (RhythmDB *db,
140
const char *uri, const char *msg,
142
static void rb_shell_db_save_error_cb (RhythmDB *db,
143
const char *uri, const GError *error,
130
145
static void rb_shell_db_entry_added_cb (RhythmDB *db,
131
146
RhythmDBEntry *entry,
184
199
static void rb_shell_view_sourcelist_changed_cb (GtkAction *action,
201
static void rb_shell_view_toolbar_changed_cb (GtkAction *action,
203
static void rb_shell_view_fullscreen_changed_cb (GtkAction *action,
186
205
static void rb_shell_view_smalldisplay_changed_cb (GtkAction *action,
207
static void rb_shell_view_queue_as_sidebar_changed_cb (GtkAction *action,
188
209
static void rb_shell_load_complete_cb (RhythmDB *db, RBShell *shell);
189
210
static void rb_shell_sync_sourcelist_visibility (RBShell *shell);
211
static void rb_shell_sync_toolbar_visibility (RBShell *shell);
190
212
static void rb_shell_sync_smalldisplay (RBShell *shell);
213
static void rb_shell_sync_pane_visibility (RBShell *shell);
191
214
static void sourcelist_visibility_changed_cb (GConfClient *client,
193
216
GConfEntry *entry,
218
static void toolbar_visibility_changed_cb (GConfClient *client,
195
222
static void smalldisplay_changed_cb (GConfClient *client,
197
224
GConfEntry *entry,
226
static void fullscreen_changed_cb (GConfClient *client,
199
230
static void sourcelist_drag_received_cb (RBSourceList *sourcelist,
200
231
RBSource *source,
201
232
GtkSelectionData *data,
423
480
{ "ViewSourceList", NULL, N_("Source _List"), "<control>L",
424
481
N_("Change the visibility of the source list"),
425
482
G_CALLBACK (rb_shell_view_sourcelist_changed_cb), TRUE },
483
{ "ViewToolbar", NULL, N_("_Toolbar"), "<control>T",
484
N_("Change the visibility of the toolbar"),
485
G_CALLBACK (rb_shell_view_toolbar_changed_cb), TRUE },
426
486
{ "ViewSmallDisplay", NULL, N_("_Small Display"), "<control>D",
427
487
N_("Make the main window smaller"),
428
G_CALLBACK (rb_shell_view_smalldisplay_changed_cb),
488
G_CALLBACK (rb_shell_view_smalldisplay_changed_cb), },
489
{ "ViewFullscreen", NULL, N_("_Fullscreen"), "F11",
490
N_("Expand the window to fill the screen"),
491
G_CALLBACK (rb_shell_view_fullscreen_changed_cb), FALSE },
492
{ "ViewQueueAsSidebar", NULL, N_("_Queue as Sidebar"), "<control>K",
493
N_("Change whether the queue is visible as a source or a sidebar"),
494
G_CALLBACK (rb_shell_view_queue_as_sidebar_changed_cb) },
431
496
static guint rb_shell_n_toggle_entries = G_N_ELEMENTS (rb_shell_toggle_entries);
738
828
RBShell *shell = RB_SHELL (object);
740
gtk_widget_hide (shell->priv->window);
741
gtk_widget_hide (GTK_WIDGET (shell->priv->tray_icon));
830
rb_debug ("Finalizing shell");
742
832
rb_shell_player_stop (shell->priv->player_shell);
744
834
eel_gconf_monitor_remove (CONF_PREFIX);
835
eel_gconf_notification_remove (shell->priv->sourcelist_visibility_notify_id);
836
eel_gconf_notification_remove (shell->priv->toolbar_visibility_notify_id);
837
eel_gconf_notification_remove (shell->priv->smalldisplay_notify_id);
838
eel_gconf_notification_remove (shell->priv->fullscreen_notify_id);
746
840
gtk_widget_destroy (GTK_WIDGET (shell->priv->load_error_dialog));
747
841
g_list_free (shell->priv->supported_media_extensions);
749
843
gtk_widget_destroy (GTK_WIDGET (shell->priv->tray_icon));
751
g_list_free (shell->priv->sources);
753
g_hash_table_destroy (shell->priv->sources_hash);
845
if (shell->priv->save_playlist_id > 0) {
846
g_source_remove (shell->priv->save_playlist_id);
847
shell->priv->save_playlist_id = 0;
850
if (shell->priv->save_db_id > 0) {
851
g_source_remove (shell->priv->save_db_id);
852
shell->priv->save_db_id = 0;
855
rb_debug ("shutting down playlist manager");
856
rb_playlist_manager_shutdown (shell->priv->playlist_manager);
858
rb_debug ("unreffing playlist manager");
755
859
g_object_unref (G_OBJECT (shell->priv->playlist_manager));
861
rb_debug ("unreffing removable media manager");
756
862
g_object_unref (G_OBJECT (shell->priv->removable_media_manager));
758
864
#ifdef WITH_AUDIOSCROBBLER
865
rb_debug ("unreffing audioscrobbler");
759
866
g_object_unref (G_OBJECT (shell->priv->audioscrobbler));
869
rb_debug ("unreffing clipboard shell");
762
870
g_object_unref (G_OBJECT (shell->priv->clipboard_shell));
764
gtk_widget_destroy (shell->priv->window);
767
eel_gconf_notification_remove (shell->priv->sourcelist_visibility_notify_id);
768
eel_gconf_notification_remove (shell->priv->smalldisplay_notify_id);
770
872
rb_debug ("shutting down DB");
771
873
rhythmdb_shutdown (shell->priv->db);
773
875
rb_debug ("unreffing DB");
774
876
g_object_unref (G_OBJECT (shell->priv->db));
878
rb_debug ("destroying prefs");
776
879
if (shell->priv->prefs != NULL)
777
880
gtk_widget_destroy (shell->priv->prefs);
882
rb_debug ("destroying tooltips");
883
gtk_object_destroy (GTK_OBJECT (shell->priv->tooltips));
779
885
g_free (shell->priv->rhythmdb_file);
780
g_free (shell->priv);
887
rb_debug ("destroying window");
888
gtk_widget_destroy (shell->priv->window);
890
g_list_free (shell->priv->sources);
891
shell->priv->sources = NULL;
893
g_hash_table_destroy (shell->priv->sources_hash);
782
895
((GObjectClass*)rb_shell_parent_class)->finalize (G_OBJECT (shell));
921
1036
shell->priv->actiongroup,
922
1037
shell->priv->player_shell);
923
1038
g_object_set (shell->priv->player_shell, "statusbar", shell->priv->statusbar, NULL);
1039
gtk_widget_show (GTK_WIDGET (shell->priv->statusbar));
925
1041
g_signal_connect_object (G_OBJECT (shell->priv->sourcelist), "selected",
926
1042
G_CALLBACK (source_selected_cb), shell, 0);
928
1044
vbox = gtk_vbox_new (FALSE, 4);
929
1045
shell->priv->notebook = gtk_notebook_new ();
1046
gtk_widget_show (vbox);
1047
gtk_widget_show (shell->priv->notebook);
930
1048
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (shell->priv->notebook), FALSE);
931
1049
gtk_notebook_set_show_border (GTK_NOTEBOOK (shell->priv->notebook), FALSE);
932
1050
g_signal_connect_object (G_OBJECT (shell->priv->sourcelist),
933
1051
"size-allocate",
934
1052
G_CALLBACK (paned_size_allocate_cb),
937
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (shell->priv->source_header), FALSE, TRUE, 0);
938
gtk_box_pack_start_defaults (GTK_BOX (vbox), shell->priv->notebook);
940
gtk_paned_pack1 (GTK_PANED (shell->priv->paned),
941
shell->priv->sourcelist, FALSE, TRUE);
942
gtk_paned_pack2 (GTK_PANED (shell->priv->paned), vbox, TRUE, TRUE);
1055
shell->priv->queue_source = RB_PLAYLIST_SOURCE (rb_play_queue_source_new (shell));
1056
g_object_set (G_OBJECT(shell->priv->player_shell), "queue-source", shell->priv->queue_source, NULL);
1057
g_object_set (G_OBJECT(shell->priv->clipboard_shell), "queue-source", shell->priv->queue_source, NULL);
1058
rb_shell_append_source (shell, RB_SOURCE (shell->priv->queue_source), NULL);
1059
g_object_get (G_OBJECT (shell->priv->queue_source), "sidebar", &shell->priv->queue_sidebar, NULL);
1060
gtk_widget_show_all (shell->priv->queue_sidebar);
1062
/* set up sidebars */
1063
shell->priv->paned = gtk_hpaned_new ();
1065
shell->priv->queue_paned = gtk_vpaned_new ();
1067
gtk_paned_pack1 (GTK_PANED (shell->priv->queue_paned),
1068
shell->priv->sourcelist,
1070
gtk_paned_pack2 (GTK_PANED (shell->priv->queue_paned),
1071
shell->priv->queue_sidebar,
1074
GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
1076
gtk_box_pack_start (GTK_BOX (vbox),
1077
GTK_WIDGET (shell->priv->source_header),
1079
gtk_box_pack_start (GTK_BOX (vbox),
1080
shell->priv->notebook,
1084
gtk_paned_pack1 (GTK_PANED (shell->priv->paned),
1085
shell->priv->queue_paned,
1087
gtk_paned_pack2 (GTK_PANED (shell->priv->paned),
1090
gtk_widget_show (vbox);
1092
g_signal_connect_object (G_OBJECT (shell->priv->queue_paned),
1094
G_CALLBACK (sidebar_paned_size_allocate_cb),
1096
gtk_widget_show (shell->priv->paned);
944
1098
vbox = gtk_vbox_new (FALSE, 0);
945
1099
gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
946
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (shell->priv->player_shell), FALSE, TRUE, 0);
947
shell->priv->hsep = gtk_hseparator_new ();
948
gtk_box_pack_start (GTK_BOX (vbox), shell->priv->hsep, FALSE, FALSE, 5);
1100
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (shell->priv->player_shell), FALSE, TRUE, 6);
1101
gtk_widget_show (GTK_WIDGET (shell->priv->player_shell));
949
1103
gtk_box_pack_start (GTK_BOX (vbox), shell->priv->paned, TRUE, TRUE, 0);
950
1104
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (shell->priv->statusbar), FALSE, TRUE, 0);
1105
gtk_widget_show (vbox);
952
1107
gtk_container_add (GTK_CONTAINER (win), vbox);
953
gtk_widget_show_all (vbox);
955
1109
#ifdef WITH_AUDIOSCROBBLER
956
1110
rb_debug ("Audioscrobbler support enabled.");
961
1115
/* sync state */
962
1116
shell->priv->sourcelist_visibility_notify_id =
963
1117
eel_gconf_notification_add (CONF_UI_SOURCELIST_HIDDEN,
964
(GConfClientNotifyFunc) sourcelist_visibility_changed_cb,
1118
(GConfClientNotifyFunc) sourcelist_visibility_changed_cb,
1120
shell->priv->toolbar_visibility_notify_id =
1121
eel_gconf_notification_add (CONF_UI_TOOLBAR_HIDDEN,
1122
(GConfClientNotifyFunc) toolbar_visibility_changed_cb,
966
1124
shell->priv->smalldisplay_notify_id =
967
1125
eel_gconf_notification_add (CONF_UI_SMALL_DISPLAY,
968
(GConfClientNotifyFunc) smalldisplay_changed_cb,
1126
(GConfClientNotifyFunc) smalldisplay_changed_cb,
1128
shell->priv->smalldisplay_notify_id =
1129
eel_gconf_notification_add (CONF_UI_FULLSCREEN,
1130
(GConfClientNotifyFunc) fullscreen_changed_cb,
971
1133
/* read the cached copies of the gconf keys */
972
1134
shell->priv->window_width = eel_gconf_get_integer (CONF_STATE_WINDOW_WIDTH);
974
1136
shell->priv->small_width = eel_gconf_get_integer (CONF_STATE_SMALL_WIDTH);
975
1137
shell->priv->window_maximised = eel_gconf_get_boolean (CONF_STATE_WINDOW_MAXIMIZED);
976
1138
shell->priv->window_small = eel_gconf_get_boolean (CONF_UI_SMALL_DISPLAY);
1139
shell->priv->window_fullscreen = eel_gconf_get_boolean (CONF_UI_FULLSCREEN);
1140
shell->priv->queue_as_sidebar = eel_gconf_get_boolean (CONF_UI_QUEUE_AS_SIDEBAR);
977
1141
shell->priv->window_x = eel_gconf_get_integer (CONF_STATE_WINDOW_X_POSITION);
978
1142
shell->priv->window_y = eel_gconf_get_integer (CONF_STATE_WINDOW_Y_POSITION);
979
1143
shell->priv->paned_position = eel_gconf_get_integer (CONF_STATE_PANED_POSITION);
1144
shell->priv->sourcelist_height = eel_gconf_get_integer (CONF_STATE_SOURCELIST_HEIGHT);
982
1147
rb_debug ("shell: syncing with gconf");
983
1148
rb_shell_sync_sourcelist_visibility (shell);
1149
rb_shell_sync_pane_visibility (shell);
985
1151
shell->priv->load_error_dialog = rb_load_failure_dialog_new ();
986
1152
shell->priv->show_db_errors = FALSE;
987
1153
gtk_widget_hide (shell->priv->load_error_dialog);
989
g_signal_connect_object (G_OBJECT (shell->priv->db), "error",
990
G_CALLBACK (rb_shell_db_error_cb), shell, 0);
1155
g_signal_connect_object (G_OBJECT (shell->priv->db), "load-error",
1156
G_CALLBACK (rb_shell_db_load_error_cb), shell, 0);
1157
g_signal_connect_object (G_OBJECT (shell->priv->db), "save-error",
1158
G_CALLBACK (rb_shell_db_save_error_cb), shell, 0);
991
1159
g_signal_connect_object (G_OBJECT (shell->priv->db), "entry-added",
992
1160
G_CALLBACK (rb_shell_db_entry_added_cb), shell, 0);
1045
1213
gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, FALSE, 0);
1046
1214
gtk_box_reorder_child (GTK_BOX (vbox), menubar, 0);
1216
hbox = gtk_hbox_new (FALSE, 0);
1217
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
1218
gtk_box_reorder_child (GTK_BOX (vbox), hbox, 1);
1220
toolbar = gtk_ui_manager_get_widget (shell->priv->ui_manager, "/ToolBar");
1221
gtk_box_pack_start_defaults (GTK_BOX (hbox), toolbar);
1222
rb_shell_sync_toolbar_visibility (shell);
1224
shell->priv->volume_button = bacon_volume_button_new (GTK_ICON_SIZE_LARGE_TOOLBAR,
1226
g_signal_connect (shell->priv->volume_button, "value-changed",
1227
G_CALLBACK (rb_shell_volume_widget_changed_cb),
1229
bacon_volume_button_set_value (BACON_VOLUME_BUTTON (shell->priv->volume_button),
1230
eel_gconf_get_float (CONF_STATE_VOLUME));
1233
tool_item = gtk_tool_item_new ();
1234
gtk_tool_item_set_expand (tool_item, TRUE);
1235
gtk_widget_show (GTK_WIDGET (tool_item));
1236
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), tool_item, -1);
1238
tool_item = gtk_tool_item_new ();
1239
gtk_container_add (GTK_CONTAINER (tool_item), shell->priv->volume_button);
1240
gtk_widget_show_all (GTK_WIDGET (tool_item));
1241
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), tool_item, -1);
1243
gtk_widget_show (hbox);
1245
shell->priv->tooltips = gtk_tooltips_new ();
1246
gtk_tooltips_enable (shell->priv->tooltips);
1248
gtk_tooltips_set_tip (GTK_TOOLTIPS (shell->priv->tooltips),
1249
GTK_WIDGET (shell->priv->volume_button),
1250
_("Change the music volume"), NULL);
1048
1252
if (error != NULL) {
1049
1253
g_warning ("Couldn't merge %s: %s",
1050
1254
rb_file ("rhythmbox-ui.xml"), error->message);
1051
1255
g_clear_error (&error);
1054
g_timeout_add (10000, (GSourceFunc) idle_save_playlist_manager, shell->priv->playlist_manager);
1258
shell->priv->save_playlist_id = g_timeout_add (10000, (GSourceFunc) idle_save_playlist_manager, shell->priv->playlist_manager);
1056
1260
rb_shell_sync_window_state (shell, FALSE);
1261
rb_shell_sync_fullscreen (shell);
1058
1263
rb_shell_select_source (shell, RB_SOURCE (shell->priv->library_source));
1061
1266
/* GO GO GO! */
1062
if (rhythmdb_exists) {
1063
rb_debug ("loading database");
1064
rhythmdb_load (shell->priv->db);
1065
/* Disabled for now */
1067
rb_debug ("adding db save-when-needed thread");
1068
g_timeout_add (10000, (GSourceFunc) idle_save_rhythmdb, shell->priv->db);
1267
rb_debug ("loading database");
1268
rhythmdb_load (shell->priv->db);
1072
1270
rb_debug ("shell: syncing window state");
1073
1271
rb_shell_sync_paned (shell);
1917
rb_shell_view_queue_as_sidebar_changed_cb (GtkAction *action,
1920
shell->priv->queue_as_sidebar = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
1921
eel_gconf_set_boolean (CONF_UI_QUEUE_AS_SIDEBAR, shell->priv->queue_as_sidebar);
1923
if (shell->priv->queue_as_sidebar &&
1924
shell->priv->selected_source == RB_SOURCE (shell->priv->queue_source)) {
1925
/* queue no longer exists as a source, so change to the library */
1926
rb_shell_select_source (shell, RB_SOURCE (shell->priv->library_source));
1929
rb_shell_sync_pane_visibility (shell);
1933
rb_shell_view_fullscreen_changed_cb (GtkAction *action,
1936
eel_gconf_set_boolean (CONF_UI_FULLSCREEN,
1937
gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
1689
1941
rb_shell_cmd_about (GtkAction *action,
1690
1942
RBShell *shell)
1713
1965
const char *translator_credits = _("translator_credits");
1967
const char *license[] = {
1968
N_("Rhythmbox is free software; you can redistribute it and/or modify\n"
1969
"it under the terms of the GNU General Public License as published by\n"
1970
"the Free Software Foundation; either version 2 of the License, or\n"
1971
"(at your option) any later version.\n"),
1972
N_("Rhythmbox is distributed in the hope that it will be useful,\n"
1973
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
1974
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
1975
"GNU General Public License for more details.\n"),
1976
N_("You should have received a copy of the GNU General Public License\n"
1977
"along with Rhythmbox; if not, write to the Free Software Foundation, Inc.,\n"
1978
"59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n")
1981
char *license_trans;
1715
1983
pixbuf = gdk_pixbuf_new_from_file (rb_file ("about-logo.png"), NULL);
1717
1985
authors[0] = _("Maintainers:");
1725
1993
comment = g_string_new (_("Music management and playback software for GNOME."));
1995
license_trans = g_strconcat (_(license[0]), "\n", _(license[1]), "\n",
1996
_(license[2]), "\n", NULL);
1727
1998
gtk_show_about_dialog (GTK_WINDOW (shell->priv->window),
1728
1999
"name", "Rhythmbox",
1729
2000
"version", VERSION,
1730
"copyright", "Copyright \xc2\xa9 2003, 2004 Colin Walters\nCopyright \xc2\xa9 2002, 2003 Jorn Baayen",
2001
"copyright", "Copyright \xc2\xa9 2005 The Rhythmbox authors\nCopyright \xc2\xa9 2003 - 2005 Colin Walters\nCopyright \xc2\xa9 2002, 2003 Jorn Baayen",
2002
"license", license_trans,
2003
"website", "http://www.gnome.org/projects/rhythmbox",
1731
2004
"comments", comment->str,
1732
2005
"authors", (const char **) authors,
1733
2006
"documenters", (const char **) documenters,
1734
2007
"translator-credits", strcmp (translator_credits, "translator_credits") != 0 ? translator_credits : NULL,
1735
2008
"logo", pixbuf,
1737
2011
g_string_free (comment, TRUE);
2012
g_free (license_trans);
2156
new_station_location_added (RBNewStationDialog *dialog,
2160
rb_iradio_source_add_from_playlist (shell->priv->iradio_source, uri);
1877
2164
rb_shell_cmd_new_station (GtkAction *action,
1878
2165
RBShell *shell)
1880
2167
GtkWidget *dialog;
1881
2168
RBEntryView *entry_view = rb_source_get_entry_view (RB_SOURCE (shell->priv->iradio_source));
1882
2170
rb_debug ("Got new station command");
1883
dialog = rb_station_properties_dialog_new (entry_view, TRUE);
1884
gtk_widget_show_all (dialog);
2172
dialog = rb_new_station_dialog_new (entry_view);
2173
g_signal_connect_object (dialog, "location-added",
2174
G_CALLBACK (new_station_location_added),
1885
2177
gtk_dialog_run (GTK_DIALOG (dialog));
2179
gtk_widget_destroy (dialog);
2278
rb_shell_sync_pane_visibility (RBShell *shell)
2280
gboolean sourcelist_visible;
2283
g_object_get (G_OBJECT (shell->priv->sourcelist), "visible", &sourcelist_visible, NULL);
2284
if (shell->priv->queue_source)
2285
g_object_set (G_OBJECT (shell->priv->queue_source), "visibility", !shell->priv->queue_as_sidebar, NULL);
2287
if (shell->priv->queue_as_sidebar)
2288
gtk_widget_show (shell->priv->queue_sidebar);
2290
gtk_widget_hide (shell->priv->queue_sidebar);
2292
if (sourcelist_visible == FALSE && shell->priv->queue_as_sidebar == FALSE)
2293
gtk_widget_hide (GTK_WIDGET (shell->priv->queue_paned));
2295
gtk_widget_show (GTK_WIDGET (shell->priv->queue_paned));
2297
action = gtk_action_group_get_action (shell->priv->actiongroup,
2298
"ViewQueueAsSidebar");
2299
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
2300
shell->priv->queue_as_sidebar);
2305
rb_shell_sync_toolbar_visibility (RBShell *shell)
2311
visible = !eel_gconf_get_boolean (CONF_UI_TOOLBAR_HIDDEN);
2313
toolbar = gtk_ui_manager_get_widget (shell->priv->ui_manager, "/ToolBar");
2315
gtk_widget_show (toolbar);
2317
gtk_widget_hide (toolbar);
2319
action = gtk_action_group_get_action (shell->priv->actiongroup,
2321
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
2326
rb_shell_sync_fullscreen (RBShell *shell)
2328
gboolean fullscreen;
2331
fullscreen = eel_gconf_get_boolean (CONF_UI_FULLSCREEN);
2334
gtk_window_fullscreen (GTK_WINDOW (shell->priv->window));
2336
gtk_window_unfullscreen (GTK_WINDOW (shell->priv->window));
2339
action = gtk_action_group_get_action (shell->priv->actiongroup,
2341
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
1984
2346
rb_shell_sync_smalldisplay (RBShell *shell)
1986
2348
GtkAction *action;
2349
GtkAction *queue_action;
1988
2352
rb_shell_sync_window_state (shell, FALSE);
1990
2354
action = gtk_action_group_get_action (shell->priv->actiongroup,
1991
2355
"ViewSourceList");
2356
queue_action = gtk_action_group_get_action (shell->priv->actiongroup,
2357
"ViewQueueAsSidebar");
2359
toolbar = gtk_ui_manager_get_widget (shell->priv->ui_manager, "/ToolBar");
1993
2361
if (shell->priv->window_small) {
1994
2362
g_object_set (G_OBJECT (action), "sensitive", FALSE, NULL);
2363
g_object_set (G_OBJECT (queue_action), "sensitive", FALSE, NULL);
1996
2365
gtk_widget_hide (GTK_WIDGET (shell->priv->paned));
1997
2366
gtk_widget_hide (GTK_WIDGET (shell->priv->statusbar));
1998
gtk_widget_hide (GTK_WIDGET (shell->priv->hsep));
2367
gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
2000
2369
g_object_set (G_OBJECT (action), "sensitive", TRUE, NULL);
2370
g_object_set (G_OBJECT (queue_action), "sensitive", TRUE, NULL);
2002
2372
gtk_widget_show (GTK_WIDGET (shell->priv->paned));
2003
2373
rb_statusbar_sync_state (shell->priv->statusbar);
2004
gtk_widget_show (GTK_WIDGET (shell->priv->hsep));
2374
gtk_toolbar_unset_style (GTK_TOOLBAR (toolbar));
2007
2377
rb_source_header_sync_control_state (shell->priv->source_header);
2807
3213
RBShell *shell = RB_SHELL (proxy);
2808
3214
RhythmDBEntry *entry;
2810
RBSource *playing_source;
2812
3216
rb_debug ("setting rating of playing entry to %f", rating);
2814
playing_source = rb_shell_player_get_playing_source (shell->priv->player_shell);
2815
if (playing_source != NULL) {
2816
view = rb_source_get_entry_view (playing_source);
2817
entry = rb_entry_view_get_playing_entry (view);
2818
if (entry != NULL) {
2819
GValue value = {0, };
2820
g_value_init (&value, G_TYPE_DOUBLE);
2821
g_value_set_double (&value, rating);
2823
rhythmdb_entry_set (shell->priv->db, entry, RHYTHMDB_PROP_RATING, &value);
2825
g_value_unset (&value);
2826
rhythmdb_commit (shell->priv->db);
3218
entry = rb_shell_player_get_playing_entry (shell->priv->player_shell);
3219
if (entry != NULL) {
3220
GValue value = {0, };
3221
g_value_init (&value, G_TYPE_DOUBLE);
3222
g_value_set_double (&value, rating);
3224
rhythmdb_entry_set (shell->priv->db, entry, RHYTHMDB_PROP_RATING, &value);
3226
g_value_unset (&value);
3227
rhythmdb_commit (shell->priv->db);