[Xfce4-commits] <parole:master> Removed statusbar and moved buffering to a progressbar that shows when buffering.

Christoph Mende noreply at xfce.org
Mon Jul 23 01:25:25 CEST 2012


Updating branch refs/heads/master
         to 66986d8f74bf3876971e33e45d0b278359649e02 (commit)
       from c9564ad89ee02764053a636106260af69b4725b5 (commit)

commit 66986d8f74bf3876971e33e45d0b278359649e02
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Wed Jul 11 09:58:03 2012 -0400

    Removed statusbar and moved buffering to a progressbar that shows when buffering.

 data/interfaces/parole.ui |  108 +++++++++++++++++++++++----------------------
 src/parole-player.c       |   27 ++++++++---
 2 files changed, 74 insertions(+), 61 deletions(-)

diff --git a/data/interfaces/parole.ui b/data/interfaces/parole.ui
index 85c5253..06621e4 100644
--- a/data/interfaces/parole.ui
+++ b/data/interfaces/parole.ui
@@ -757,20 +757,28 @@
                                                           </packing>
                                                         </child>
                                                         <child>
-                                                          <object class="GtkLabel" id="label_elapsed">
+                                                          <object class="GtkVBox" id="vbox2">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <object class="GtkHBox" id="play_box">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <object class="GtkLabel" id="label_elapsed">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="label" translatable="yes">0:00</property>
-                                                          </object>
-                                                          <packing>
+                                                            </object>
+                                                            <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">True</property>
                                                             <property name="padding">6</property>
-                                                            <property name="position">3</property>
-                                                          </packing>
-                                                        </child>
-                                                        <child>
-                                                          <object class="GtkHScale" id="scale">
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <object class="GtkHScale" id="scale">
                                                             <property name="visible">True</property>
                                                             <property name="sensitive">False</property>
                                                             <property name="can_focus">True</property>
@@ -779,24 +787,53 @@
                                                             <signal name="button-release-event" handler="parole_player_range_button_release" swapped="no"/>
                                                             <signal name="value-changed" handler="parole_player_range_value_changed" swapped="no"/>
                                                             <signal name="scroll-event" handler="parole_player_scroll_event_cb" swapped="no"/>
-                                                          </object>
-                                                          <packing>
+                                                            </object>
+                                                            <packing>
                                                             <property name="expand">True</property>
                                                             <property name="fill">True</property>
-                                                            <property name="position">4</property>
-                                                          </packing>
-                                                        </child>
-                                                        <child>
-                                                          <object class="GtkLabel" id="label_duration">
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <object class="GtkLabel" id="label_duration">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="label" translatable="yes">0:00</property>
+                                                            </object>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="padding">6</property>
+                                                            <property name="position">2</property>
+                                                            </packing>
+                                                            </child>
+                                                            </object>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="padding">6</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <object class="GtkProgressBar" id="progressbar_buffering">
+                                                            <property name="can_focus">False</property>
+                                                            <property name="no_show_all">True</property>
+                                                            <property name="show_text">True</property>
+                                                            <property name="text" translatable="yes">Buffering (0%)</property>
+                                                            </object>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
                                                           </object>
                                                           <packing>
-                                                            <property name="expand">False</property>
+                                                            <property name="expand">True</property>
                                                             <property name="fill">True</property>
                                                             <property name="padding">6</property>
-                                                            <property name="position">5</property>
+                                                            <property name="position">3</property>
                                                           </packing>
                                                         </child>
                                                         <child>
@@ -819,7 +856,7 @@ audio-volume-medium</property>
                                                           <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">True</property>
-                                                            <property name="position">6</property>
+                                                            <property name="position">4</property>
                                                           </packing>
                                                         </child>
                                                       </object>
@@ -960,41 +997,6 @@ audio-volume-medium</property>
             <property name="position">1</property>
           </packing>
         </child>
-        <child>
-          <object class="GtkHSeparator" id="status-sep">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkAlignment" id="statusalign">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="left_padding">5</property>
-            <property name="right_padding">5</property>
-            <child>
-              <object class="GtkHBox" id="statusbox">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="no_show_all">True</property>
-                <property name="spacing">5</property>
-                <child>
-                  <placeholder/>
-                </child>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">3</property>
-          </packing>
-        </child>
       </object>
     </child>
   </object>
diff --git a/src/parole-player.c b/src/parole-player.c
index 6d9d918..62d6529 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -54,7 +54,6 @@
 #include "parole-filters.h"
 #include "parole-disc.h"
 #include "parole-disc-menu.h"
-#include "parole-statusbar.h"
 #include "parole-screensaver.h"
 #include "parole-conf-dialog.h"
 #include "parole-conf.h"
@@ -238,7 +237,6 @@ struct ParolePlayerPrivate
 {
     DBusGConnection     *bus;
     ParoleMediaList	*list;
-    ParoleStatusbar     *status;
     ParoleDisc          *disc;
     ParoleScreenSaver   *screen_saver;
     ParoleConf          *conf;
@@ -263,6 +261,9 @@ struct ParolePlayerPrivate
     GtkWidget		*seekb;
     GtkWidget		*range;
     
+    GtkWidget		*playcontrol_box;
+    GtkWidget		*progressbar_buffering;
+    
     GtkWidget		*label_elapsed;
     GtkWidget		*label_duration;
     GtkWidget		*fs_window; /* Window for packing control widgets 
@@ -1049,13 +1050,26 @@ parole_player_buffering_cb (ParoleGst *gst, const ParoleStream *stream, gint per
     {
 	player->priv->buffering = FALSE;
 	parole_gst_resume (PAROLE_GST (player->priv->gst));
+	gtk_widget_show (player->priv->playcontrol_box);
+	gtk_widget_hide (player->priv->progressbar_buffering);
     }
     else
     {
 	player->priv->buffering = TRUE;
 	
+	
 	if ( player->priv->state == PAROLE_MEDIA_STATE_PLAYING )
 	    parole_gst_pause (PAROLE_GST (player->priv->gst));
+	    
+    gchar *buff;
+    
+    buff = g_strdup_printf ("%s (%d%%)", _("Buffering"), percentage);
+    
+    gtk_progress_bar_set_text (GTK_PROGRESS_BAR (player->priv->progressbar_buffering), buff);
+    gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (player->priv->progressbar_buffering), (gdouble) percentage/100);
+    gtk_widget_show (player->priv->progressbar_buffering);
+	gtk_widget_hide (player->priv->playcontrol_box);
+    g_free (buff);
     }
 }
 
@@ -1133,7 +1147,6 @@ parole_player_full_screen (ParolePlayer *player, gboolean fullscreen)
 	npages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (player->priv->main_nt));
 	gtk_widget_reparent (player->priv->play_box, player->priv->control);
 	gtk_widget_hide (player->priv->fs_window);
-	parole_statusbar_set_visible (player->priv->status, TRUE);
 	parole_disc_menu_set_fullscreen (player->priv->disc_menu, FALSE);
 	gtk_widget_show (player->priv->play_box);
 	gtk_widget_show (player->priv->menu_bar);
@@ -1154,8 +1167,6 @@ parole_player_full_screen (ParolePlayer *player, gboolean fullscreen)
 	parole_player_move_fs_window (player);
 	gtk_widget_reparent (player->priv->play_box, player->priv->fs_window);
 	
-	parole_statusbar_set_visible (player->priv->status, FALSE);
-	
 	gtk_widget_hide (player->priv->play_box);
 	gtk_widget_hide (player->priv->menu_bar);
 	gtk_widget_hide (player->priv->playlist_nt);
@@ -1507,7 +1518,6 @@ parole_player_finalize (GObject *object)
     
     g_object_unref (player->priv->conf);
     g_object_unref (player->priv->video_filter);
-    g_object_unref (player->priv->status);
     g_object_unref (player->priv->disc);
     g_object_unref (player->priv->disc_menu);
     g_object_unref (player->priv->screen_saver);
@@ -1909,8 +1919,6 @@ parole_player_init (ParolePlayer *player)
     
     player->priv->gst = parole_gst_new (FALSE, player->priv->conf);
 
-    player->priv->status = parole_statusbar_new ();
-
     player->priv->disc = parole_disc_new ();
     g_signal_connect (player->priv->disc, "disc-selected",
 		      G_CALLBACK (parole_player_disc_selected_cb), player);
@@ -1971,6 +1979,9 @@ parole_player_init (ParolePlayer *player)
    
     player->priv->main_nt = GTK_WIDGET (gtk_builder_get_object (builder, "main-notebook"));
     
+    player->priv->play_box = GTK_WIDGET (gtk_builder_get_object (builder, "play_box"));
+    player->priv->progressbar_buffering = GTK_WIDGET (gtk_builder_get_object (builder, "progressbar_buffering"));
+    
     player->priv->label_duration = GTK_WIDGET(gtk_builder_get_object(builder, "label_duration"));
     player->priv->label_elapsed = GTK_WIDGET(gtk_builder_get_object(builder, "label_elapsed"));
     player->priv->play_pause = GTK_WIDGET (gtk_builder_get_object (builder, "play-pause"));


More information about the Xfce4-commits mailing list