[Xfce4-commits] <parole:master> Better chooser interface.
Ali Abdallah
noreply at xfce.org
Fri Apr 15 16:44:05 CEST 2011
Updating branch refs/heads/master
to 4770f9661ddae192446ddb83d3d0cc0f7245839c (commit)
from 6d95f5740234781afc222d6017728702d8bed5c0 (commit)
commit 4770f9661ddae192446ddb83d3d0cc0f7245839c
Author: Ali Abdallah <aliov at xfce.org>
Date: Fri Apr 15 16:43:07 2011 +0200
Better chooser interface.
data/desktop/parole.desktop.in.in | 2 +-
data/interfaces/Makefile.am | 6 +-
data/interfaces/mediachooser.ui | 217 ++++++++++++++++++++++---------------
data/interfaces/open-location.ui | 178 ++++++++++++++++++++++++++++++
data/pixmaps/Makefile.am | 3 +-
data/pixmaps/loader.gif | Bin 0 -> 673 bytes
plugins/tray/tray-provider.c | 63 ++++-------
src/parole-utils.c | 3 +
8 files changed, 343 insertions(+), 129 deletions(-)
diff --git a/data/desktop/parole.desktop.in.in b/data/desktop/parole.desktop.in.in
index 1fcd40b..ec62c3f 100644
--- a/data/desktop/parole.desktop.in.in
+++ b/data/desktop/parole.desktop.in.in
@@ -1,5 +1,5 @@
[Desktop Entry]
-_Name=Parole Media Player
+_Name=Parole
Icon=parole
Exec=parole %F
Terminal=false
diff --git a/data/interfaces/Makefile.am b/data/interfaces/Makefile.am
index dbb3922..58a9c85 100644
--- a/data/interfaces/Makefile.am
+++ b/data/interfaces/Makefile.am
@@ -4,7 +4,8 @@ interfaces = \
playlist.ui \
mediachooser.ui \
save-playlist.ui \
- plugins.ui
+ plugins.ui \
+ open-location.ui
interfaces_h = \
$(interfaces:.ui=_ui.h)
@@ -27,6 +28,9 @@ mediachooser_ui.h: mediachooser.ui
save-playlist_ui.h: save-playlist.ui
exo-csource --static --strip-comments --strip-content --name=save_playlist_ui $< > $@
+open-location_ui.h: open-location.ui
+ exo-csource --static --strip-comments --strip-content --name=open_location_ui $< > $@
+
plugins_ui.h: plugins.ui
exo-csource --static --strip-comments --strip-content --name=plugins_ui $< > $@
diff --git a/data/interfaces/mediachooser.ui b/data/interfaces/mediachooser.ui
index e546f3d..ac62ab2 100644
--- a/data/interfaces/mediachooser.ui
+++ b/data/interfaces/mediachooser.ui
@@ -1,109 +1,154 @@
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
+ <!-- interface-requires libxfce4ui 4.5 -->
<!-- interface-naming-policy project-wide -->
- <object class="GtkVBox" id="vbox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">4</property>
- <child>
- <object class="GtkFileChooserWidget" id="filechooserwidget">
+ <object class="XfceTitledDialog" id="chooser">
+ <property name="title" translatable="yes">Parole Media Chooser</property>
+ <property name="default_width">680</property>
+ <property name="default_height">480</property>
+ <property name="icon_name">audio-x-generic</property>
+ <property name="type_hint">normal</property>
+ <property name="has_separator">False</property>
+ <property name="subtitle" translatable="yes">Open media files</property>
+ <signal name="destroy" handler="parole_media_chooser_destroy_cb"/>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox">
<property name="visible">True</property>
- <property name="border_width">5</property>
<property name="orientation">vertical</property>
- <property name="spacing">1</property>
- <signal name="file_activated" handler="media_chooser_file_activate_cb"/>
- <signal name="current_folder_changed" handler="media_chooser_folder_changed_cb"/>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="recursive">
- <property name="label" translatable="yes">Scan folders recursively</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="parole_media_chooser_recursive_toggled_cb"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="replace">
- <property name="label" translatable="yes">Replace playlist with opened files</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="parole_media_chooser_replace_toggled_cb"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="play-added-files">
- <property name="label" translatable="yes">Start playing opened files</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="start_playing_toggled_cb"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="border_width">5</property>
- <property name="spacing">5</property>
- <property name="layout_style">end</property>
+ <property name="spacing">2</property>
<child>
- <object class="GtkButton" id="close">
- <property name="label">gtk-close</property>
+ <object class="GtkVBox" id="vbox">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- <signal name="clicked" handler="parole_media_chooser_close"/>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkFileChooserWidget" id="filechooserwidget">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">1</property>
+ <signal name="file_activated" handler="media_chooser_file_activate_cb"/>
+ <signal name="current_folder_changed" handler="media_chooser_folder_changed_cb"/>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="recursive">
+ <property name="label" translatable="yes">Scan folders recursively</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="parole_media_chooser_recursive_toggled_cb"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="replace">
+ <property name="label" translatable="yes">Replace playlist with opened files</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="parole_media_chooser_replace_toggled_cb"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="play-added-files">
+ <property name="label" translatable="yes">Start playing opened files</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="start_playing_toggled_cb"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkButton" id="open">
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- <signal name="clicked" handler="parole_media_chooser_open"/>
+ <property name="layout_style">edge</property>
+ <child>
+ <object class="GtkHBox" id="info">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">5</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <object class="GtkButton" id="close">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="parole_media_chooser_close_clicked"/>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="open">
+ <property name="label" translatable="yes">Add</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">image1</property>
+ <signal name="clicked" handler="parole_media_chooser_add_clicked"/>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="pack_type">end</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="position">4</property>
- </packing>
</child>
</object>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="stock">gtk-add</property>
+ </object>
</interface>
diff --git a/data/interfaces/open-location.ui b/data/interfaces/open-location.ui
new file mode 100644
index 0000000..ca7ced4
--- /dev/null
+++ b/data/interfaces/open-location.ui
@@ -0,0 +1,178 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-requires libxfce4ui 4.5 -->
+ <!-- interface-naming-policy project-wide -->
+ <object class="XfceTitledDialog" id="open-location">
+ <property name="default_width">400</property>
+ <property name="icon_name">gtk-network</property>
+ <property name="type_hint">normal</property>
+ <property name="has_separator">False</property>
+ <property name="subtitle" translatable="yes">Open location of media file or live stream</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Enter the address of a location to open</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="stock">gtk-info</property>
+ <property name="icon-size">1</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkEntry" id="entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="clear-history">
+ <property name="label" translatable="yes">Clear history</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">image2</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="open">
+ <property name="label">gtk-open</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">cancel</action-widget>
+ <action-widget response="-5">open</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="stock">gtk-clear</property>
+ </object>
+ <object class="GtkDialog" id="dialog1">
+ <property name="border_width">5</property>
+ <property name="type_hint">normal</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/data/pixmaps/Makefile.am b/data/pixmaps/Makefile.am
index 62495dd..a1d4d08 100644
--- a/data/pixmaps/Makefile.am
+++ b/data/pixmaps/Makefile.am
@@ -1,5 +1,6 @@
pixmaps = \
- parole.png
+ parole.png \
+ loader.gif
pixmaps_DATA = \
$(pixmaps)
diff --git a/data/pixmaps/loader.gif b/data/pixmaps/loader.gif
new file mode 100644
index 0000000..d0bce15
Binary files /dev/null and b/data/pixmaps/loader.gif differ
diff --git a/plugins/tray/tray-provider.c b/plugins/tray/tray-provider.c
index 88a3f94..25ce4ab 100644
--- a/plugins/tray/tray-provider.c
+++ b/plugins/tray/tray-provider.c
@@ -199,6 +199,23 @@ notification_closed_cb (NotifyNotification *n, TrayProvider *tray)
}
static void
+close_notification (TrayProvider *tray)
+{
+ if ( tray->n )
+ {
+ GError *error = NULL;
+ notify_notification_close (tray->n, &error);
+ if ( error )
+ {
+ g_warning ("Failed to close notification : %s", error->message);
+ g_error_free (error);
+ }
+ g_object_unref (tray->n);
+ tray->n = NULL;
+ }
+}
+
+static void
notify_playing (TrayProvider *tray, const ParoleStream *stream)
{
GdkPixbuf *pix;
@@ -302,10 +319,6 @@ notify_playing (TrayProvider *tray, const ParoleStream *stream)
static void
state_changed_cb (ParoleProviderPlayer *player, const ParoleStream *stream, ParoleState state, TrayProvider *tray)
{
-#ifdef HAVE_LIBNOTIFY
- gboolean tag;
-#endif
-
tray->state = state;
if ( tray->menu )
@@ -319,47 +332,17 @@ state_changed_cb (ParoleProviderPlayer *player, const ParoleStream *stream, Paro
if ( state == PAROLE_STATE_PLAYING )
{
- g_object_get (G_OBJECT (stream),
- "tag-available", &tag,
- NULL);
-
- if ( tag )
- notify_playing (tray, stream);
+ notify_playing (tray, stream);
}
else if ( state <= PAROLE_STATE_PAUSED )
{
- if ( tray->n )
- {
- GError *error = NULL;
- notify_notification_close (tray->n, &error);
- if ( error )
- {
- g_warning ("Failed to close notification : %s", error->message);
- g_error_free (error);
- }
- g_object_unref (tray->n);
- tray->n = NULL;
- }
+ close_notification (tray);
if ( state < PAROLE_STATE_PAUSED )
tray->notify = TRUE;
}
#endif
}
-static void
-tag_message_cb (ParoleProviderPlayer *player, const ParoleStream *stream, TrayProvider *tray)
-{
-#ifdef HAVE_LIBNOTIFY
- ParoleState state;
-
- state = parole_provider_player_get_state (player);
-
- if (state == PAROLE_STATE_PLAYING )
- notify_playing (tray, stream);
-
-#endif
-}
-
static gboolean
read_entry_bool (const gchar *entry, gboolean fallback)
{
@@ -608,10 +591,6 @@ tray_provider_set_player (ParoleProviderPlugin *plugin, ParoleProviderPlayer *pl
g_signal_connect (player, "state_changed",
G_CALLBACK (state_changed_cb), tray);
-
- g_signal_connect (player, "tag-message",
- G_CALLBACK (tag_message_cb), tray);
-
}
static void
@@ -650,6 +629,10 @@ static void tray_provider_finalize (GObject *object)
if ( GTK_IS_WIDGET (tray->window) && g_signal_handler_is_connected (tray->window, tray->sig) )
g_signal_handler_disconnect (tray->window, tray->sig);
+
+#ifdef HAVE_LIBNOTIFY
+ close_notification (tray);
+#endif
g_object_unref (G_OBJECT (tray->tray));
diff --git a/src/parole-utils.c b/src/parole-utils.c
index 96b21ec..9ee5c6a 100644
--- a/src/parole-utils.c
+++ b/src/parole-utils.c
@@ -365,6 +365,9 @@ void parole_get_media_files (GtkFileFilter *filter, const gchar *path,
playlist_filter = parole_get_supported_playlist_filter ();
g_object_ref_sink (playlist_filter);
+ gtk_main_iteration_do (FALSE);
+
+
if ( g_file_test (path, G_FILE_TEST_IS_REGULAR ) )
{
file = parole_file_new (path);
More information about the Xfce4-commits
mailing list