[rhythmbox] remove party mode



commit 6a4d642278f1a1fdb2d56b93647010b1ad37138c
Author: Jonathan Matthew <jonathan d14n org>
Date:   Tue Apr 26 21:32:37 2022 +1000

    remove party mode
    
    This never really went anywhere.  The original idea is a long way from
    what you'd come up with now if you were designing a way for honest but
    untrusted people (such as guests in your home) to play music from your
    collection, so what had been implemented isn't a useful starting point
    to get there.

 data/ui/app-menu.ui                  |  5 ---
 doc/reference/rhythmbox-sections.txt |  1 -
 shell/rb-playlist-manager.c          |  8 +---
 shell/rb-shell.c                     | 85 ------------------------------------
 shell/rb-shell.h                     |  2 -
 sources/rb-source.c                  | 32 ++------------
 6 files changed, 5 insertions(+), 128 deletions(-)
---
diff --git a/data/ui/app-menu.ui b/data/ui/app-menu.ui
index d3d722037..d1852aff8 100644
--- a/data/ui/app-menu.ui
+++ b/data/ui/app-menu.ui
@@ -5,11 +5,6 @@
       <submenu>
        <attribute name="label" translatable="yes">_View</attribute>
        <section>
-         <item>
-           <attribute name="label" translatable="yes">P_arty Mode</attribute>
-           <attribute name="action">win.party-mode</attribute>
-           <attribute name="accel">F11</attribute>
-         </item>
          <item>
            <attribute name="label" translatable="yes">Side Pane</attribute>
            <attribute name="action">win.display-page-tree-visible</attribute>
diff --git a/doc/reference/rhythmbox-sections.txt b/doc/reference/rhythmbox-sections.txt
index 212189f40..03e86e115 100644
--- a/doc/reference/rhythmbox-sections.txt
+++ b/doc/reference/rhythmbox-sections.txt
@@ -234,7 +234,6 @@ rb_shell_notify_custom
 rb_shell_do_notify
 rb_shell_register_entry_type_for_source
 rb_shell_get_source_by_entry_type
-rb_shell_get_party_mode
 rb_shell_append_display_page
 rb_shell_add_widget
 rb_shell_remove_widget
diff --git a/shell/rb-playlist-manager.c b/shell/rb-playlist-manager.c
index 0d6eba6d4..4974c9f6a 100644
--- a/shell/rb-playlist-manager.c
+++ b/shell/rb-playlist-manager.c
@@ -1729,7 +1729,6 @@ rb_playlist_manager_set_source (RBPlaylistManager *mgr,
        GApplication *app;
        gboolean playlist_active;
        gboolean playlist_local = FALSE;
-       gboolean party_mode;
        gboolean can_save;
        gboolean can_edit;
        gboolean can_rename;
@@ -1738,8 +1737,6 @@ rb_playlist_manager_set_source (RBPlaylistManager *mgr,
 
        app = g_application_get_default ();
 
-       party_mode = rb_shell_get_party_mode (mgr->priv->shell);
-
        if (mgr->priv->selected_source != NULL) {
                g_object_unref (mgr->priv->selected_source);
        }
@@ -1750,12 +1747,11 @@ rb_playlist_manager_set_source (RBPlaylistManager *mgr,
                g_object_get (mgr->priv->selected_source, "is-local", &playlist_local, NULL);
        }
 
-       can_save = playlist_local && !party_mode;
+       can_save = playlist_local;
        gaction = g_action_map_lookup_action (G_ACTION_MAP (app), "playlist-save");
        g_object_set (gaction, "enabled", can_save, NULL);
 
-       can_edit = (playlist_local && RB_IS_AUTO_PLAYLIST_SOURCE (mgr->priv->selected_source) &&
-                   !party_mode);
+       can_edit = (playlist_local && RB_IS_AUTO_PLAYLIST_SOURCE (mgr->priv->selected_source));
        gaction = g_action_map_lookup_action (G_ACTION_MAP (app), "playlist-edit");
        g_object_set (gaction, "enabled", can_edit, NULL);
 
diff --git a/shell/rb-shell.c b/shell/rb-shell.c
index 96476d055..85b3123f8 100644
--- a/shell/rb-shell.c
+++ b/shell/rb-shell.c
@@ -128,7 +128,6 @@ static gboolean rb_shell_key_press_event_cb (GtkWidget *win,
                                             RBShell *shell);
 static void rb_shell_sync_window_state (RBShell *shell, gboolean dont_maximise);
 static void rb_shell_sync_paned (RBShell *shell);
-static void rb_shell_sync_party_mode (RBShell *shell);
 static void rb_shell_select_page (RBShell *shell, RBDisplayPage *display_page);
 static void display_page_selected_cb (RBDisplayPageTree *display_page_tree,
                                      RBDisplayPage *page,
@@ -172,7 +171,6 @@ static void paned_size_allocate_cb (GtkWidget *widget,
 
 static void jump_to_playing_action_cb (GSimpleAction *, GVariant *, gpointer);
 static void add_music_action_cb (GAction *action, GVariant *parameter, RBShell *shell);
-static void view_party_mode_changed_cb (GAction *action, GVariant *parameter, RBShell *shell);
 
 static gboolean rb_shell_visibility_changing (RBShell *shell, gboolean initial, gboolean visible);
 
@@ -288,8 +286,6 @@ struct _RBShellPrivate
        char *cached_title;
        gboolean cached_playing;
 
-       gboolean party_mode;
-
        GSettings *settings;
 
        GSettings *plugin_settings;
@@ -1708,12 +1704,6 @@ rb_shell_constructed (GObject *object)
        g_action_map_add_action (G_ACTION_MAP (shell->priv->window), action);
        g_signal_connect (shell->priv->settings, "changed", G_CALLBACK (rb_shell_settings_changed_cb), shell);
 
-       action = G_ACTION (g_simple_action_new_stateful ("party-mode",
-                                                        NULL,
-                                                        g_variant_new_boolean (FALSE)));
-       g_action_map_add_action (G_ACTION_MAP (shell->priv->window), action);
-       g_signal_connect (action, "change-state", G_CALLBACK (view_party_mode_changed_cb), shell);
-
        action = G_ACTION (g_simple_action_new ("library-import", NULL));
        g_signal_connect (action, "activate", G_CALLBACK (add_music_action_cb), shell);
        g_action_map_add_action (G_ACTION_MAP (app), action);
@@ -1737,7 +1727,6 @@ rb_shell_constructed (GObject *object)
        construct_plugins (shell);
 
        rb_shell_sync_window_state (shell, FALSE);
-       rb_shell_sync_party_mode (shell);
 
        rb_shell_select_page (shell, RB_DISPLAY_PAGE (shell->priv->library_source));
 
@@ -1931,12 +1920,7 @@ rb_shell_window_delete_cb (GtkWidget *win,
                           GdkEventAny *event,
                           RBShell *shell)
 {
-       if (shell->priv->party_mode) {
-               return TRUE;
-       }
-
        rb_shell_quit (shell, NULL);
-
        return TRUE;
 }
 
@@ -2396,14 +2380,6 @@ rb_shell_set_window_title (RBShell *shell,
        }
 }
 
-static void
-view_party_mode_changed_cb (GAction *action, GVariant *parameter, RBShell *shell)
-{
-       shell->priv->party_mode = g_variant_get_boolean (parameter);
-       g_simple_action_set_state (G_SIMPLE_ACTION (action), parameter);
-       rb_shell_sync_party_mode (shell);
-}
-
 static void
 add_music_action_cb (GAction *action, GVariant *parameter, RBShell *shell)
 {
@@ -2527,53 +2503,6 @@ rb_shell_load_complete_cb (RhythmDB *db,
        g_idle_add ((GSourceFunc) idle_handle_load_complete, shell);
 }
 
-static gboolean
-window_state_event_cb (GtkWidget           *widget,
-                      GdkEventWindowState *event,
-                      RBShell             *shell)
-{
-       if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) {
-               rb_shell_present (shell, gtk_get_current_event_time (), NULL);
-       }
-
-       return TRUE;
-}
-
-static void
-rb_shell_sync_party_mode (RBShell *shell)
-{
-       GAction *action;
-
-       /* party mode does not use gsettings as a model since it
-          should not be persistent */
-
-       /* disable/enable quit action */
-       action = g_action_map_lookup_action (G_ACTION_MAP (shell->priv->application), "quit");
-       g_simple_action_set_enabled (G_SIMPLE_ACTION (action), !shell->priv->party_mode);
-
-       /* show/hide queue as sidebar ? */
-
-       g_object_set (shell->priv->player_shell, "queue-only", shell->priv->party_mode, NULL);
-
-       /* Set playlist manager source to the current source to update properties */
-       if (shell->priv->selected_page && RB_IS_SOURCE (shell->priv->selected_page)) {
-               RBSource *source = RB_SOURCE (shell->priv->selected_page);
-               g_object_set (shell->priv->playlist_manager, "source", source, NULL);
-               rb_shell_clipboard_set_source (shell->priv->clipboard_shell, source);
-       }
-
-       gtk_window_set_keep_above (GTK_WINDOW (shell->priv->window), shell->priv->party_mode);
-       if (shell->priv->party_mode) {
-               gtk_window_fullscreen (GTK_WINDOW (shell->priv->window));
-               gtk_window_stick (GTK_WINDOW (shell->priv->window));
-               g_signal_connect (shell->priv->window, "window-state-event", G_CALLBACK 
(window_state_event_cb), shell);
-       } else {
-               gtk_window_unstick (GTK_WINDOW (shell->priv->window));
-               gtk_window_unfullscreen (GTK_WINDOW (shell->priv->window));
-               g_signal_handlers_disconnect_by_func (shell->priv->window, window_state_event_cb, shell);
-       }
-}
-
 static void
 rb_shell_sync_paned (RBShell *shell)
 {
@@ -3026,20 +2955,6 @@ rb_shell_load_uri (RBShell *shell,
        return TRUE;
 }
 
-/**
- * rb_shell_get_party_mode:
- * @shell: the #RBShell
- *
- * Returns %TRUE if the shell is in party mode
- *
- * Return value: %TRUE if the shell is in party mode
- */
-gboolean
-rb_shell_get_party_mode (RBShell *shell)
-{
-       return shell->priv->party_mode;
-}
-
 /**
  * rb_shell_present:
  * @shell: the #RBShell
diff --git a/shell/rb-shell.h b/shell/rb-shell.h
index 9da7a43e9..d99f0c912 100644
--- a/shell/rb-shell.h
+++ b/shell/rb-shell.h
@@ -158,8 +158,6 @@ void            rb_shell_register_entry_type_for_source (RBShell *shell,
 RBSource * rb_shell_get_source_by_entry_type (RBShell *shell,
                                              RhythmDBEntryType *type);
 
-gboolean        rb_shell_get_party_mode (RBShell *shell);
-
 void           rb_shell_append_display_page (RBShell *shell, RBDisplayPage *page, RBDisplayPage *parent);
 
 void           rb_shell_add_widget (RBShell *shell, GtkWidget *widget, RBShellUILocation location, gboolean 
expand, gboolean fill);
diff --git a/sources/rb-source.c b/sources/rb-source.c
index fd977524b..c113a92e7 100644
--- a/sources/rb-source.c
+++ b/sources/rb-source.c
@@ -718,19 +718,6 @@ default_can_rename (RBSource *source)
        return FALSE;
 }
 
-static gboolean
-is_party_mode (RBSource *source)
-{
-       gboolean result = FALSE;
-       RBShell *shell;
-
-       g_object_get (source, "shell", &shell, NULL);
-       result = rb_shell_get_party_mode (shell);
-       g_object_unref (shell);
-
-       return result;
-}
-
 /**
  * rb_source_can_rename:
  * @source: a #RBSource.
@@ -743,12 +730,7 @@ gboolean
 rb_source_can_rename (RBSource *source)
 {
        RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);
-
-       if (is_party_mode (source)) {
-               return FALSE;
-       } else {
-               return klass->can_rename (source);
-       }
+       return klass->can_rename (source);
 }
 
 /**
@@ -822,11 +804,7 @@ gboolean
 rb_source_can_delete (RBSource *source)
 {
        RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);
-       if (is_party_mode (source)) {
-               return FALSE;
-       } else {
-               return klass->can_delete (source);
-       }
+       return klass->can_delete (source);
 }
 
 /**
@@ -842,11 +820,7 @@ gboolean
 rb_source_can_move_to_trash (RBSource *source)
 {
        RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);
-       if (is_party_mode (source)) {
-               return FALSE;
-       } else {
-               return klass->can_move_to_trash (source);
-       }
+       return klass->can_move_to_trash (source);
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]