[Goodies-commits] r7836 - in parole/trunk: . data/interfaces parole po
Ali Abdallah
aliov at xfce.org
Sun Jul 26 01:23:21 CEST 2009
Author: aliov
Date: 2009-07-25 23:23:20 +0000 (Sat, 25 Jul 2009)
New Revision: 7836
Added:
parole/trunk/data/interfaces/plugins.ui
Removed:
parole/trunk/data/interfaces/openlocation.ui
Modified:
parole/trunk/ChangeLog
parole/trunk/TODO
parole/trunk/data/interfaces/Makefile.am
parole/trunk/data/interfaces/mediachooser.ui
parole/trunk/data/interfaces/parole.ui
parole/trunk/data/interfaces/save-playlist.ui
parole/trunk/parole/parole-conf.c
parole/trunk/parole/parole-mediachooser.c
parole/trunk/parole/parole-module.c
parole/trunk/parole/parole-module.h
parole/trunk/parole/parole-player.c
parole/trunk/parole/parole-plugin.c
parole/trunk/parole/parole-plugins-manager.c
parole/trunk/parole/parole-rc-utils.c
parole/trunk/parole/parole-rc-utils.h
parole/trunk/parole/parole.h
parole/trunk/po/POTFILES.in
parole/trunk/po/parole-media-player.pot
Log:
* Provides a dialog to load/unload plugins.
* data/interfaces/ Mark some gtk labels as non-translatable+default
respone of some buttons in the dialogs.
* parole/parole-rc-utils.{c,h} added function to load list entries+
Split the configuration file into groups.
Modified: parole/trunk/ChangeLog
===================================================================
--- parole/trunk/ChangeLog 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/ChangeLog 2009-07-25 23:23:20 UTC (rev 7836)
@@ -1,3 +1,10 @@
+2009-07-26: 01:15 Ali aliov at xfce.org
+ * Provides a dialog to load/unload plugins.
+ * data/interfaces/ Mark some gtk labels as non-translatable+default
+ respone of some buttons in the dialogs.
+ * parole/parole-rc-utils.{c,h} added function to load list entries+
+ Split the configuration file into groups.
+
2009-07-23: 23:00 Ali aliov at xfce.org
* parole/parole-gst.c Only emit media progressed signal when the
state is playing.
Modified: parole/trunk/TODO
===================================================================
--- parole/trunk/TODO 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/TODO 2009-07-25 23:23:20 UTC (rev 7836)
@@ -1,10 +1,12 @@
=== Media player ===
+* Configure plugins dialog to load/unload plugins.
+* Better statusbar information.
* Complete the shortcut keys.
+* Encoding support for subtitles.
* Better support for cdda.
-* Better statusbar information.
+* Probably something like totem-fullscreen?
* Support some playlist title entity.
-* Encoding support for subtitles.
-* Configure plugins dialog to load/unload plugins.
+* Move to next chapter in movie.
* ...
=== Plugins ===
Modified: parole/trunk/data/interfaces/Makefile.am
===================================================================
--- parole/trunk/data/interfaces/Makefile.am 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/data/interfaces/Makefile.am 2009-07-25 23:23:20 UTC (rev 7836)
@@ -3,8 +3,8 @@
parole-settings.ui \
playlist.ui \
mediachooser.ui \
- openlocation.ui \
- save-playlist.ui
+ save-playlist.ui \
+ plugins.ui
interfaces_h = \
$(interfaces:.ui=_ui.h)
@@ -24,12 +24,12 @@
mediachooser_ui.h: mediachooser.ui
exo-csource --static --strip-comments --strip-content --name=mediachooser_ui $< > $@
-openlocation_ui.h: openlocation.ui
- exo-csource --static --strip-comments --strip-content --name=openlocation_ui $< > $@
-
save-playlist_ui.h: save-playlist.ui
exo-csource --static --strip-comments --strip-content --name=save_playlist_ui $< > $@
+plugins_ui.h: plugins.ui
+ exo-csource --static --strip-comments --strip-content --name=plugins_ui $< > $@
+
endif
DISTCLEANFILES = \
Modified: parole/trunk/data/interfaces/mediachooser.ui
===================================================================
--- parole/trunk/data/interfaces/mediachooser.ui 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/data/interfaces/mediachooser.ui 2009-07-25 23:23:20 UTC (rev 7836)
@@ -29,7 +29,7 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="close">
- <property name="label" translatable="no">gtk-close</property>
+ <property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
Modified: parole/trunk/data/interfaces/parole.ui
===================================================================
--- parole/trunk/data/interfaces/parole.ui 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/data/interfaces/parole.ui 2009-07-25 23:23:20 UTC (rev 7836)
@@ -143,89 +143,139 @@
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<child>
- <object class="GtkTreeView" id="treeview">
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="enable_search">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox2">
+ <object class="GtkNotebook" id="main-notebook">
<property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="scrollable">True</property>
+ <property name="group_id">0</property>
<child>
- <object class="GtkNotebook" id="notebook">
+ <object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
- <property name="scrollable">True</property>
- <property name="group_id">0</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">5</property>
<child>
- <object class="GtkVBox" id="vbox3">
+ <object class="GtkHPaned" id="hpaned">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">5</property>
+ <property name="can_focus">True</property>
<child>
- <object class="GtkHPaned" id="hpaned">
+ <object class="GtkVBox" id="vbox8">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkVBox" id="vbox8">
+ <object class="GtkHBox" id="output">
<property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="play-box">
+ <property name="visible">True</property>
<property name="orientation">vertical</property>
+ <property name="spacing">5</property>
<child>
- <object class="GtkHBox" id="output">
+ <object class="GtkHScale" id="scale">
<property name="visible">True</property>
- <child>
- <placeholder/>
- </child>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="draw_value">False</property>
+ <signal name="button_press_event" handler="parole_player_range_button_press"/>
+ <signal name="value_changed" handler="parole_player_range_value_changed"/>
+ <signal name="button_release_event" handler="parole_player_range_button_release"/>
</object>
<packing>
+ <property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkVBox" id="play-box">
+ <object class="GtkHBox" id="hbox7">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">5</property>
<child>
- <object class="GtkHScale" id="scale">
+ <object class="GtkVBox" id="vbox6">
<property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="draw_value">False</property>
- <signal name="button_press_event" handler="parole_player_range_button_press"/>
- <signal name="value_changed" handler="parole_player_range_value_changed"/>
- <signal name="button_release_event" handler="parole_player_range_button_release"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox7">
- <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">5</property>
<child>
- <object class="GtkVBox" id="vbox6">
+ <object class="GtkHBox" id="hbox6">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
- <object class="GtkHBox" id="hbox6">
+ <object class="GtkButton" id="back">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">image6</property>
+ <property name="relief">none</property>
+ <property name="focus_on_click">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="stop">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">image7</property>
+ <property name="relief">none</property>
+ <property name="focus_on_click">False</property>
+ <accelerator key="s" signal="clicked"/>
+ <signal name="clicked" handler="parole_player_stop_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="play-pause">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">image8</property>
+ <property name="relief">none</property>
+ <property name="focus_on_click">False</property>
+ <accelerator key="space" signal="activate"/>
+ <signal name="clicked" handler="parole_player_play_pause_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="forward">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">image9</property>
+ <property name="relief">none</property>
+ <property name="focus_on_click">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox8">
+ <property name="visible">True</property>
<property name="spacing">5</property>
<child>
- <object class="GtkButton" id="back">
+ <object class="GtkImage" id="volume-image">
<property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">image6</property>
- <property name="relief">none</property>
- <property name="focus_on_click">False</property>
+ <property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="expand">False</property>
@@ -233,93 +283,25 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="stop">
+ <object class="GtkHScale" id="volume">
+ <property name="width_request">100</property>
+ <property name="height_request">10</property>
<property name="visible">True</property>
- <property name="sensitive">False</property>
<property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">image7</property>
- <property name="relief">none</property>
- <property name="focus_on_click">False</property>
- <accelerator key="s" signal="clicked"/>
- <signal name="clicked" handler="parole_player_stop_clicked"/>
+ <property name="show_fill_level">True</property>
+ <property name="draw_value">False</property>
+ <signal name="value_changed" handler="parole_player_volume_value_changed_cb"/>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkButton" id="play-pause">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">image8</property>
- <property name="relief">none</property>
- <property name="focus_on_click">False</property>
- <accelerator key="space" signal="activate"/>
- <signal name="clicked" handler="parole_player_play_pause_clicked"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="forward">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">image9</property>
- <property name="relief">none</property>
- <property name="focus_on_click">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox8">
- <property name="visible">True</property>
- <property name="spacing">5</property>
- <child>
- <object class="GtkImage" id="volume-image">
- <property name="visible">True</property>
- <property name="stock">gtk-missing-image</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHScale" id="volume">
- <property name="width_request">100</property>
- <property name="height_request">10</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="show_fill_level">True</property>
- <property name="draw_value">False</property>
- <signal name="value_changed" handler="parole_player_volume_value_changed_cb"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="padding">30</property>
- <property name="pack_type">end</property>
- <property name="position">4</property>
- </packing>
- </child>
</object>
<packing>
- <property name="position">0</property>
+ <property name="padding">30</property>
+ <property name="pack_type">end</property>
+ <property name="position">4</property>
</packing>
</child>
</object>
@@ -327,24 +309,23 @@
<property name="position">0</property>
</packing>
</child>
- <child>
- <object class="GtkButton" id="show-hide-list">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">image18</property>
- <signal name="clicked" handler="parole_player_show_hide_playlist"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">1</property>
- </packing>
- </child>
</object>
<packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="show-hide-list">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">image18</property>
+ <signal name="clicked" handler="parole_player_show_hide_playlist"/>
+ </object>
+ <packing>
<property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
@@ -356,80 +337,80 @@
</child>
</object>
<packing>
- <property name="resize">True</property>
- <property name="shrink">False</property>
+ <property name="expand">False</property>
+ <property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkNotebook" id="notebook-playlist">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="scrollable">True</property>
- <property name="enable_popup">True</property>
- </object>
- <packing>
- <property name="resize">False</property>
- <property name="shrink">False</property>
- </packing>
- </child>
</object>
<packing>
- <property name="position">0</property>
+ <property name="resize">True</property>
+ <property name="shrink">False</property>
</packing>
</child>
- </object>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="Player">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Media player</property>
- </object>
- <packing>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="albums-box">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
<child>
- <object class="GtkLabel" id="label5">
+ <object class="GtkNotebook" id="notebook-playlist">
<property name="visible">True</property>
- <property name="label" translatable="yes">Nothing yet.</property>
+ <property name="can_focus">True</property>
+ <property name="scrollable">True</property>
</object>
<packing>
- <property name="position">0</property>
+ <property name="resize">False</property>
+ <property name="shrink">False</property>
</packing>
</child>
</object>
<packing>
- <property name="position">1</property>
+ <property name="position">0</property>
</packing>
</child>
- <child type="tab">
- <object class="GtkLabel" id="album">
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="Player">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Media player</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="albums-box">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="label5">
<property name="visible">True</property>
- <property name="label" translatable="yes">Albums</property>
+ <property name="label" translatable="yes">Nothing yet.</property>
</object>
<packing>
- <property name="position">1</property>
- <property name="tab_fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
- <child type="tab">
- <placeholder/>
- </child>
</object>
<packing>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
+ <child type="tab">
+ <object class="GtkLabel" id="album">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Albums</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <placeholder/>
+ </child>
</object>
<packing>
- <property name="position">1</property>
+ <property name="position">0</property>
</packing>
</child>
</object>
Added: parole/trunk/data/interfaces/plugins.ui
===================================================================
--- parole/trunk/data/interfaces/plugins.ui (rev 0)
+++ parole/trunk/data/interfaces/plugins.ui 2009-07-25 23:23:20 UTC (rev 7836)
@@ -0,0 +1,245 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy project-wide -->
+ <object class="GtkListStore" id="liststore">
+ <columns>
+ <!-- column-name toggle -->
+ <column type="gboolean"/>
+ <!-- column-name plugin -->
+ <column type="gchararray"/>
+ <!-- column-name data -->
+ <column type="GObject"/>
+ </columns>
+ </object>
+ <object class="GtkDialog" id="dialog">
+ <property name="border_width">5</property>
+ <property name="type_hint">normal</property>
+ <property name="has_separator">False</property>
+ <signal name="response" handler="gtk_widget_destroy"/>
+ <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="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkViewport" id="viewport1">
+ <property name="visible">True</property>
+ <property name="resize_mode">queue</property>
+ <child>
+ <object class="GtkTreeView" id="treeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="model">liststore</property>
+ <property name="headers_clickable">False</property>
+ <property name="search_column">0</property>
+ <signal name="cursor_changed" handler="parole_plugins_manager_tree_cursor_changed_cb"/>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+ <property name="resizable">True</property>
+ <property name="title">Enabled</property>
+ <property name="clickable">True</property>
+ <child>
+ <object class="GtkCellRendererToggle" id="cellrenderertoggle">
+ <signal name="toggled" handler="parole_plugins_manager_cell_toggled_cb"/>
+ </object>
+ <attributes>
+ <attribute name="active">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+ <property name="title">Plugin</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext1"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVSeparator" id="vseparator1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkHBox" id="hbox5">
+ <property name="visible">True</property>
+ <property name="spacing">4</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Description:</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="description">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="spacing">4</property>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Author:</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="author">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="spacing">4</property>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Copyright:</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="copyright">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="spacing">4</property>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Site:</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="site">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</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>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkButton" id="close">
+ <property name="label" translatable="yes">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>
+ </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="0">close</action-widget>
+ </action-widgets>
+ </object>
+</interface>
Modified: parole/trunk/data/interfaces/save-playlist.ui
===================================================================
--- parole/trunk/data/interfaces/save-playlist.ui 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/data/interfaces/save-playlist.ui 2009-07-25 23:23:20 UTC (rev 7836)
@@ -83,7 +83,7 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button2">
- <property name="label" translatable="no">gtk-close</property>
+ <property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -98,7 +98,7 @@
</child>
<child>
<object class="GtkButton" id="button1">
- <property name="label" translatable="no">gtk-save</property>
+ <property name="label">gtk-save</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
Modified: parole/trunk/parole/parole-conf.c
===================================================================
--- parole/trunk/parole/parole-conf.c 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/parole/parole-conf.c 2009-07-25 23:23:20 UTC (rev 7836)
@@ -68,26 +68,26 @@
case PROP_VIS_ENABLED:
conf->priv->enable_vis = g_value_get_boolean (value);
g_object_notify (G_OBJECT (conf), "vis-enabled");
- parole_rc_write_entry_bool ("VIS_ENABLED", conf->priv->enable_vis);
+ parole_rc_write_entry_bool ("VIS_ENABLED", PAROLE_RC_GROUP_GENERAL, conf->priv->enable_vis);
break;
case PROP_VIS_NAME:
if ( conf->priv->vis_sink )
g_free (conf->priv->vis_sink);
conf->priv->vis_sink = g_strdup (g_value_get_string (value));
g_object_notify (G_OBJECT (conf), "vis-name");
- parole_rc_write_entry_string ("VIS_NAME", conf->priv->vis_sink);
+ parole_rc_write_entry_string ("VIS_NAME", PAROLE_RC_GROUP_GENERAL, conf->priv->vis_sink);
break;
case PROP_SUBTITLE_ENABLED:
conf->priv->enable_subtitle = g_value_get_boolean (value);
g_object_notify (G_OBJECT (conf), "enable-subtitle");
- parole_rc_write_entry_bool ("ENABLE_SUBTITLE", conf->priv->enable_subtitle);
+ parole_rc_write_entry_bool ("ENABLE_SUBTITLE", PAROLE_RC_GROUP_GENERAL, conf->priv->enable_subtitle);
break;
case PROP_SUBTITLE_FONT:
if ( conf->priv->subtitle_font )
g_free (conf->priv->subtitle_font);
conf->priv->subtitle_font = g_strdup (g_value_get_string (value));
g_object_notify (G_OBJECT (conf), "subtitle-font");
- parole_rc_write_entry_string ("SUBTITLE_FONT", conf->priv->subtitle_font);
+ parole_rc_write_entry_string ("SUBTITLE_FONT", PAROLE_RC_GROUP_GENERAL, conf->priv->subtitle_font);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -182,10 +182,10 @@
{
conf->priv = PAROLE_CONF_GET_PRIVATE (conf);
- conf->priv->enable_vis = parole_rc_read_entry_bool ("VIS_ENABLED", FALSE);
- conf->priv->vis_sink = g_strdup (parole_rc_read_entry_string ("VIS_NAME", "none"));
- conf->priv->enable_subtitle = parole_rc_read_entry_bool ("ENABLE_SUBTITLE", TRUE);
- conf->priv->subtitle_font = g_strdup (parole_rc_read_entry_string ("SUBTITLE_FONT", "Sans 12"));
+ conf->priv->enable_vis = parole_rc_read_entry_bool ("VIS_ENABLED", PAROLE_RC_GROUP_GENERAL, FALSE);
+ conf->priv->vis_sink = g_strdup (parole_rc_read_entry_string ("VIS_NAME", PAROLE_RC_GROUP_GENERAL, "none"));
+ conf->priv->enable_subtitle = parole_rc_read_entry_bool ("ENABLE_SUBTITLE", PAROLE_RC_GROUP_GENERAL, TRUE);
+ conf->priv->subtitle_font = g_strdup (parole_rc_read_entry_string ("SUBTITLE_FONT", PAROLE_RC_GROUP_GENERAL, "Sans 12"));
}
ParoleConf *
Modified: parole/trunk/parole/parole-mediachooser.c
===================================================================
--- parole/trunk/parole/parole-mediachooser.c 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/parole/parole-mediachooser.c 2009-07-25 23:23:20 UTC (rev 7836)
@@ -33,7 +33,6 @@
#include <libxfcegui4/libxfcegui4.h>
#include "interfaces/mediachooser_ui.h"
-#include "interfaces/openlocation_ui.h"
#include "parole-mediachooser.h"
#include "parole-builder.h"
@@ -54,9 +53,6 @@
void media_chooser_folder_changed_cb (GtkWidget *widget,
gpointer data);
-void parole_media_chooser_open_location_cb (GtkButton *bt,
- ParoleMediaChooser *chooser);
-
enum
{
MEDIA_FILES_OPENED,
@@ -68,8 +64,7 @@
G_DEFINE_TYPE (ParoleMediaChooser, parole_media_chooser, GTK_TYPE_DIALOG)
-void
-parole_media_chooser_close (GtkWidget *widget, ParoleMediaChooser *chooser)
+void parole_media_chooser_close (GtkWidget *widget, ParoleMediaChooser *chooser)
{
gtk_widget_destroy (GTK_WIDGET (chooser));
}
@@ -82,7 +77,7 @@
if ( folder )
{
- parole_rc_write_entry_string ("media-chooser-folder", folder);
+ parole_rc_write_entry_string ("media-chooser-folder", PAROLE_RC_GROUP_GENERAL, folder);
g_free (folder);
}
}
@@ -126,28 +121,31 @@
parole_window_busy_cursor (GTK_WIDGET (chooser)->window);
parole_media_chooser_add (chooser, file_chooser);
- parole_media_chooser_close (NULL, chooser);
+ gtk_widget_destroy (GTK_WIDGET (chooser));
}
-void
-parole_media_chooser_open_location_cb (GtkButton *bt, ParoleMediaChooser *chooser)
+static void
+parole_media_chooser_open_location_cb (GtkDialog *dialog, gint response_id, ParoleMediaChooser *chooser)
{
GtkWidget *entry;
const gchar *location;
- entry = GTK_WIDGET (g_object_get_data (G_OBJECT (chooser), "entry"));
- location = gtk_entry_get_text (GTK_ENTRY (entry));
-
- if ( !location || strlen (location) == 0)
- goto out;
+ if ( response_id == GTK_RESPONSE_OK )
+ {
+ entry = GTK_WIDGET (g_object_get_data (G_OBJECT (chooser), "entry"));
+ location = gtk_entry_get_text (GTK_ENTRY (entry));
+
+ if ( !location || strlen (location) == 0)
+ goto out;
- TRACE ("Location %s", location);
+ TRACE ("Location %s", location);
- gtk_widget_hide (GTK_WIDGET (chooser));
- g_signal_emit (G_OBJECT (chooser), signals [LOCATION_OPENED], 0, location);
-
-out:
- parole_media_chooser_close (NULL, chooser);
+ gtk_widget_hide (GTK_WIDGET (chooser));
+ g_signal_emit (G_OBJECT (chooser), signals [LOCATION_OPENED], 0, location);
+ }
+
+ out:
+ gtk_widget_destroy (GTK_WIDGET (dialog));
}
static void
@@ -178,7 +176,7 @@
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (file_chooser), parole_get_supported_video_filter ());
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (file_chooser), parole_get_supported_playlist_filter ());
- folder = parole_rc_read_entry_string ("media-chooser-folder", NULL);
+ folder = parole_rc_read_entry_string ("media-chooser-folder", PAROLE_RC_GROUP_GENERAL, NULL);
if ( folder )
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (file_chooser), folder);
@@ -197,7 +195,7 @@
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (media_chooser)->vbox), vbox);
gtk_builder_connect_signals (builder, chooser);
g_signal_connect (chooser, "destroy",
- G_CALLBACK (parole_media_chooser_close), chooser);
+ G_CALLBACK (gtk_widget_destroy), chooser);
g_object_unref (builder);
}
@@ -205,25 +203,45 @@
static void
parole_media_chooser_open_location_internal (GtkWidget *chooser)
{
- GtkBuilder *builder;
+ GtkWidget *label;
+ GtkWidget *entry;
GtkWidget *vbox;
- GtkWidget *open;
- GtkWidget *entry;
- builder = parole_builder_new_from_string (openlocation_ui, openlocation_ui_length);
+ gtk_window_set_title (GTK_WINDOW (chooser), _("Open location..."));
- vbox = GTK_WIDGET (gtk_builder_get_object (builder, "vbox"));
- entry = GTK_WIDGET (gtk_builder_get_object (builder, "entry"));
- open = GTK_WIDGET (gtk_builder_get_object (builder, "open"));
+ label = gtk_label_new (_("Open location of media file or live stream"));
+ entry = gtk_entry_new ();
+
+ gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
+
g_object_set_data (G_OBJECT (chooser), "entry", entry);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (chooser)->vbox), vbox);
+ vbox = gtk_vbox_new (TRUE, 4);
- gtk_builder_connect_signals (builder, chooser);
- g_signal_connect (chooser, "destroy",
- G_CALLBACK (parole_media_chooser_close), chooser);
- g_object_unref (builder);
+ gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 0);
+
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (chooser)->vbox),
+ vbox,
+ TRUE,
+ TRUE,
+ 0);
+
+ gtk_dialog_add_buttons (GTK_DIALOG (chooser),
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_OK,
+ NULL);
+
+ gtk_dialog_set_default_response (GTK_DIALOG (chooser), GTK_RESPONSE_OK);
+
+ g_signal_connect (chooser, "delete-event",
+ G_CALLBACK (gtk_widget_destroy), chooser);
+
+ g_signal_connect (chooser, "response",
+ G_CALLBACK (parole_media_chooser_open_location_cb), chooser);
+
+ gtk_widget_show_all (GTK_WIDGET (chooser));
}
static void
Modified: parole/trunk/parole/parole-module.c
===================================================================
--- parole/trunk/parole/parole-module.c 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/parole/parole-module.c 2009-07-25 23:23:20 UTC (rev 7836)
@@ -34,7 +34,6 @@
parole_module_load (GTypeModule *gtype_module)
{
ParoleModule *module;
- ParolePlugin *plugin;
module = PAROLE_MODULE (gtype_module);
@@ -46,17 +45,16 @@
return FALSE;
}
- if ( !g_module_symbol (module->mod, "parole_plugin_constructor", (gpointer) &module->constructor) )
+ if ( !g_module_symbol (module->mod, "parole_plugin_constructor", (gpointer) &module->constructor) ||
+ !g_module_symbol (module->mod, "parole_plugin_get_description", (gpointer) &module->get_plugin_description))
{
- g_critical ("Plugin %s missing required constructor symbol", gtype_module->name);
+ g_critical ("Plugin %s missing required symbols", gtype_module->name);
g_module_close (module->mod);
return FALSE;
}
- plugin = (*module->constructor) ();
+ module->desc = (*module->get_plugin_description) ();
- g_object_set_data (G_OBJECT (module), "plugin", plugin);
-
return TRUE;
}
@@ -64,18 +62,11 @@
parole_module_unload (GTypeModule *gtype_module)
{
ParoleModule *module;
- ParolePlugin *plugin;
module = PAROLE_MODULE (gtype_module);
- plugin = g_object_get_data (G_OBJECT (module), "plugin");
+ parole_module_set_active (module, FALSE);
- if (plugin)
- {
- g_signal_emit_by_name (G_OBJECT (plugin), "free-data", 0);
- g_object_unref (plugin);
- }
-
g_module_close (module->mod);
module->constructor = NULL;
}
@@ -92,6 +83,11 @@
static void
parole_module_init (ParoleModule *module)
{
+ module->mod = NULL;
+ module->constructor = NULL;
+ module->get_plugin_description = NULL;
+ module->plugin = NULL;
+ module->desc = NULL;
}
ParoleModule *
@@ -105,3 +101,25 @@
return module;
}
+
+void parole_module_set_active (ParoleModule *module, gboolean active)
+{
+ if ( active )
+ {
+ g_return_if_fail (module->constructor != NULL);
+
+ module->plugin = (*module->constructor) ();
+
+ module->enabled = TRUE;
+ }
+ else
+ {
+ if ( module->plugin )
+ {
+ g_signal_emit_by_name (G_OBJECT (module->plugin), "free-data", 0);
+ g_object_unref (module->plugin);
+ module->plugin = NULL;
+ }
+ module->enabled = FALSE;
+ }
+}
Modified: parole/trunk/parole/parole-module.h
===================================================================
--- parole/trunk/parole/parole-module.h 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/parole/parole-module.h 2009-07-25 23:23:20 UTC (rev 7836)
@@ -23,6 +23,7 @@
#include <glib-object.h>
+#include "parole.h"
#include "parole-plugin.h"
G_BEGIN_DECLS
@@ -38,9 +39,14 @@
GTypeModule parent;
GModule *mod;
+ ParolePlugin *plugin;
+ ParolePluginDesc *desc;
+ gboolean enabled;
ParolePlugin *(*constructor) (void);
+ ParolePluginDesc *(*get_plugin_description) (void);
+
} ParoleModule;
typedef struct
@@ -53,6 +59,9 @@
ParoleModule *parole_module_new (const gchar *filename);
+void parole_module_set_active (ParoleModule *module,
+ gboolean active);
+
G_END_DECLS
#endif /* __PAROLE_MODULE_H */
Modified: parole/trunk/parole/parole-player.c
===================================================================
--- parole/trunk/parole/parole-player.c 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/parole/parole-player.c 2009-07-25 23:23:20 UTC (rev 7836)
@@ -122,7 +122,8 @@
GtkWidget *gst;
GtkWidget *window;
- GtkWidget *playlist_box;
+ GtkWidget *playlist_nt;
+ GtkWidget *main_nt; /*Main notebook*/
GtkWidget *show_hide_playlist;
GtkWidget *play_pause;
GtkWidget *stop;
@@ -162,7 +163,7 @@
"image", &img,
NULL);
- visible = GTK_WIDGET_VISIBLE (player->priv->playlist_box);
+ visible = GTK_WIDGET_VISIBLE (player->priv->playlist_nt);
if ( !visible )
{
@@ -170,7 +171,7 @@
"stock", GTK_STOCK_GO_FORWARD,
NULL);
- gtk_widget_show_all (player->priv->playlist_box);
+ gtk_widget_show_all (player->priv->playlist_nt);
gtk_widget_set_tooltip_text (GTK_WIDGET (player->priv->show_hide_playlist), _("Hide playlist"));
}
else
@@ -179,7 +180,7 @@
"stock", GTK_STOCK_GO_BACK,
NULL);
- gtk_widget_hide_all (player->priv->playlist_box);
+ gtk_widget_hide_all (player->priv->playlist_nt);
gtk_widget_set_tooltip_text (GTK_WIDGET (player->priv->show_hide_playlist), _("Show playlist"));
}
g_object_unref (img);
@@ -617,13 +618,18 @@
static void
parole_player_full_screen_menu_item_activate (ParolePlayer *player)
{
+ static gint current_page = 0;
+
if ( player->priv->full_screen )
{
parole_statusbar_set_visible (player->priv->status, TRUE);
gtk_widget_show (player->priv->play_box);
gtk_widget_show (player->priv->menu_bar);
- gtk_widget_show (player->priv->playlist_box);
+ gtk_widget_show (player->priv->playlist_nt);
+ gtk_widget_show (player->priv->show_hide_playlist);
+ gtk_notebook_set_show_tabs (GTK_NOTEBOOK (player->priv->main_nt), TRUE);
gtk_window_unfullscreen (GTK_WINDOW (player->priv->window));
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (player->priv->playlist_nt), current_page);
player->priv->full_screen = FALSE;
}
else
@@ -631,7 +637,10 @@
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_box);
+ gtk_widget_hide (player->priv->playlist_nt);
+ gtk_widget_hide (player->priv->show_hide_playlist);
+ current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (player->priv->playlist_nt));
+ gtk_notebook_set_show_tabs (GTK_NOTEBOOK (player->priv->main_nt), FALSE);
gtk_window_fullscreen (GTK_WINDOW (player->priv->window));
player->priv->full_screen = TRUE;
}
@@ -817,7 +826,7 @@
gdouble value;
value = gtk_range_get_value (range);
parole_player_change_volume (player, value);
- parole_rc_write_entry_int ("volume", (gint)(value * 100));
+ parole_rc_write_entry_int ("volume", PAROLE_RC_GROUP_GENERAL, (gint)(value * 100));
}
static void
@@ -917,6 +926,7 @@
G_CALLBACK (parole_player_gst_widget_motion_notify_event), player);
player->priv->window = GTK_WIDGET (gtk_builder_get_object (builder, "main-window"));
+ player->priv->main_nt = GTK_WIDGET (gtk_builder_get_object (builder, "main-notebook"));
player->priv->play_pause = GTK_WIDGET (gtk_builder_get_object (builder, "play-pause"));
player->priv->stop = GTK_WIDGET (gtk_builder_get_object (builder, "stop"));
@@ -927,18 +937,18 @@
player->priv->menu_bar = GTK_WIDGET (gtk_builder_get_object (builder, "menubar"));
player->priv->play_box = GTK_WIDGET (gtk_builder_get_object (builder, "play-box"));
- player->priv->playlist_box = GTK_WIDGET (gtk_builder_get_object (builder, "notebook-playlist"));
+ player->priv->playlist_nt = GTK_WIDGET (gtk_builder_get_object (builder, "notebook-playlist"));
player->priv->show_hide_playlist = GTK_WIDGET (gtk_builder_get_object (builder, "show-hide-list"));
gtk_range_set_range (GTK_RANGE (player->priv->volume), 0, 1.0);
gtk_range_set_value (GTK_RANGE (player->priv->volume),
- (gdouble) (parole_rc_read_entry_int ("volume", 100)/100.));
+ (gdouble) (parole_rc_read_entry_int ("volume", PAROLE_RC_GROUP_GENERAL, 100)/100.));
/*
* Pack the playlist.
*/
- gtk_notebook_append_page (GTK_NOTEBOOK (player->priv->playlist_box),
+ gtk_notebook_append_page (GTK_NOTEBOOK (player->priv->playlist_nt),
GTK_WIDGET (player->priv->list),
gtk_label_new (_("Playlist")));
@@ -955,7 +965,7 @@
gtk_widget_show (player->priv->gst);
parole_player_change_volume (player,
- (gdouble) (parole_rc_read_entry_int ("volume", 100)/100.));
+ (gdouble) (parole_rc_read_entry_int ("volume", PAROLE_RC_GROUP_GENERAL, 100)/100.));
g_signal_connect (player->priv->list, "media_activated",
G_CALLBACK (parole_player_media_activated_cb), player);
Modified: parole/trunk/parole/parole-plugin.c
===================================================================
--- parole/trunk/parole/parole-plugin.c 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/parole/parole-plugin.c 2009-07-25 23:23:20 UTC (rev 7836)
@@ -56,10 +56,10 @@
gchar *title;
gchar *author;
gchar *desc;
-
+
+ GtkWidget *widget;
gboolean packed;
-
/* sig id's*/
gulong gst_sig1;
gulong gst_sig2;
@@ -177,7 +177,7 @@
G_PARAM_CONSTRUCT_ONLY));
/**
- * ParolePlugin:desc:
+ * ParolePlugin:description:
*
* Description of the plugin.
*
@@ -185,7 +185,7 @@
**/
g_object_class_install_property (object_class,
PROP_DESC,
- g_param_spec_string ("desc",
+ g_param_spec_string ("description",
NULL, NULL,
NULL,
G_PARAM_READWRITE|
@@ -218,6 +218,7 @@
priv->title = NULL;
priv->packed = FALSE;
+ priv->widget = NULL;
priv->gst = PAROLE_GST (parole_gst_new ());
@@ -300,6 +301,9 @@
if ( priv->title )
g_free (priv->title);
+
+ if ( priv->packed && GTK_IS_WIDGET (priv->widget))
+ gtk_widget_destroy (GTK_WIDGET (priv->widget));
G_OBJECT_CLASS (parole_plugin_parent_class)->finalize (object);
}
@@ -320,7 +324,7 @@
plugin = g_object_new (PAROLE_TYPE_PLUGIN,
"title", title,
- "desc", desc,
+ "description", desc,
"author", author,
NULL);
return plugin;
@@ -372,6 +376,7 @@
g_object_unref (manager);
priv->packed = TRUE;
+ priv->widget = widget;
}
/**
Modified: parole/trunk/parole/parole-plugins-manager.c
===================================================================
--- parole/trunk/parole/parole-plugins-manager.c 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/parole/parole-plugins-manager.c 2009-07-25 23:23:20 UTC (rev 7836)
@@ -30,10 +30,20 @@
#include <libxfce4util/libxfce4util.h>
+#include "interfaces/plugins_ui.h"
+
#include "parole-builder.h"
+#include "parole-rc-utils.h"
#include "parole-plugins-manager.h"
#include "parole-module.h"
+void parole_plugins_manager_cell_toggled_cb (GtkCellRendererToggle *cell_renderer,
+ gchar *path,
+ ParolePluginsManager *manager);
+
+void parole_plugins_manager_tree_cursor_changed_cb (GtkTreeView *view,
+ ParolePluginsManager *manager);
+
static void parole_plugins_manager_finalize (GObject *object);
#define PAROLE_PLUGINS_MANAGER_GET_PRIVATE(o) \
@@ -42,19 +52,135 @@
struct ParolePluginsManagerPrivate
{
GtkWidget *list_nt;
- GtkWidget *view_nt;
+ GtkWidget *main_nt;
GPtrArray *array;
};
G_DEFINE_TYPE (ParolePluginsManager, parole_plugins_manager, G_TYPE_OBJECT)
+enum
+{
+ COL_ACTIVE,
+ COL_PLUGIN,
+ COL_DATA
+};
+
static void
-parole_plugins_manager_unload_all (gpointer data, gpointer user_data)
+parole_plugins_manager_save_rc (gchar *filename, gboolean active)
{
+ gchar **saved_plugins;
+ gchar **plugins_rc;
+ guint num = 0, i;
+ saved_plugins = parole_rc_read_entry_list ("plugins", PAROLE_RC_GROUP_PLUGINS);
+
+ if ( saved_plugins )
+ num = g_strv_length (saved_plugins);
+
+ if ( active )
+ {
+ plugins_rc = g_new0 (gchar *, num + 2);
+
+ for ( i = 0; i < num; i++)
+ {
+ plugins_rc[i] = g_strdup (saved_plugins[i]);
+ }
+
+ plugins_rc[num] = g_strdup (filename);
+ plugins_rc[num + 1] = NULL;
+ parole_rc_write_entry_list ("plugins", PAROLE_RC_GROUP_PLUGINS, plugins_rc);
+ }
+ else
+ {
+ plugins_rc = g_new0 (gchar *, num + 1);
+
+ for ( i = 0; i < num; i++)
+ {
+ if ( g_strcmp0 (saved_plugins[i], filename) )
+ plugins_rc[i] = g_strdup (saved_plugins[i]);
+ else
+ plugins_rc[i] = NULL;
+ }
+ plugins_rc[num] = NULL;
+ parole_rc_write_entry_list ("plugins", PAROLE_RC_GROUP_PLUGINS, plugins_rc);
+ }
+ g_strfreev (plugins_rc);
+ g_strfreev (saved_plugins);
+}
+
+void
+parole_plugins_manager_cell_toggled_cb (GtkCellRendererToggle *cell_renderer,
+ gchar *path_str,
+ ParolePluginsManager *manager)
+{
ParoleModule *module;
+ GtkListStore *store;
+ GtkTreeIter iter;
+ GtkTreePath *path;
+ gboolean active;
+
+ store = g_object_get_data (G_OBJECT (manager), "liststore");
+
+ path = gtk_tree_path_new_from_string (path_str);
+ gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path);
+ gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
+ COL_ACTIVE, &active,
+ COL_DATA, &module,
+ -1);
+
+ active ^= 1;
+
+ parole_module_set_active (module, active);
+
+ gtk_list_store_set (GTK_LIST_STORE (store), &iter,
+ COL_ACTIVE, active,
+ -1);
+
+ gtk_tree_path_free (path);
+
+ parole_plugins_manager_save_rc (G_TYPE_MODULE (module)->name, active);
+}
+
+void parole_plugins_manager_tree_cursor_changed_cb (GtkTreeView *view,
+ ParolePluginsManager *manager)
+{
+ ParoleModule *module;
+ GtkWidget *desc;
+ GtkWidget *author;
+ GtkWidget *copyright;
+ GtkWidget *site;
+ GtkTreeSelection *sel;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
+
+ if ( !gtk_tree_selection_get_selected (sel, &model, &iter))
+ return;
+
+ gtk_tree_model_get (model,
+ &iter,
+ COL_DATA,
+ &module,
+ -1);
+
+
+ desc = g_object_get_data (G_OBJECT (manager), "desc");
+ author = g_object_get_data (G_OBJECT (manager), "author");
+ copyright = g_object_get_data (G_OBJECT (manager), "copyright");
+ site = g_object_get_data (G_OBJECT (manager), "site");
+
+ gtk_label_set_text (GTK_LABEL (desc), module->desc->desc);
+ gtk_label_set_text (GTK_LABEL (author), module->desc->author);
+}
+
+static void
+parole_plugins_manager_unload_all (gpointer data, gpointer user_data)
+{
+ ParoleModule *module;
+
module = PAROLE_MODULE (data);
g_type_module_unuse (G_TYPE_MODULE (data));
@@ -64,9 +190,123 @@
static void
parole_plugins_manager_show_plugins_pref (GtkWidget *widget, ParolePluginsManager *manager)
{
+ GtkBuilder *builder;
+ GtkWidget *view;
+ GtkWidget *window;
+ GtkWidget *desc;
+ GtkWidget *author;
+ GtkWidget *copyright;
+ GtkWidget *site;
+ GtkTreeSelection *sel;
+ GtkListStore *store;
+ GtkTreePath *path;
+ GtkTreeIter iter;
+ guint i;
+ builder = parole_builder_new_from_string (plugins_ui, plugins_ui_length);
+
+ window = GTK_WIDGET (gtk_builder_get_object (builder, "dialog"));
+ view = GTK_WIDGET (gtk_builder_get_object (builder, "treeview"));
+ store = GTK_LIST_STORE (gtk_builder_get_object (builder, "liststore"));
+
+ desc = GTK_WIDGET (gtk_builder_get_object (builder, "description"));
+ author = GTK_WIDGET (gtk_builder_get_object (builder, "author"));
+ copyright = GTK_WIDGET (gtk_builder_get_object (builder, "copyright"));
+ site = GTK_WIDGET (gtk_builder_get_object (builder, "site"));
+
+ g_object_set_data (G_OBJECT (manager), "liststore", store);
+ g_object_set_data (G_OBJECT (manager), "desc", desc);
+ g_object_set_data (G_OBJECT (manager), "author", author);
+ g_object_set_data (G_OBJECT (manager), "copyright", copyright);
+ g_object_set_data (G_OBJECT (manager), "site", site);
+
+ gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (gtk_widget_get_toplevel (manager->priv->main_nt)));
+
+ for ( i = 0; i < manager->priv->array->len; i++)
+ {
+ ParoleModule *module;
+ module = g_ptr_array_index (manager->priv->array, i);
+
+ if ( module->desc )
+ {
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ COL_ACTIVE, module->enabled,
+ COL_PLUGIN, module->desc->title,
+ COL_DATA, module,
+ -1);
+ }
+ }
+
+ gtk_builder_connect_signals (builder, manager);
+ gtk_widget_show_all (window);
+ g_object_unref (builder);
+
+ sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
+
+ path = gtk_tree_path_new_from_string ("0");
+
+ gtk_tree_selection_select_path (sel, path);
+ gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE);
+ gtk_tree_path_free (path);
+
}
+void
+parole_plugins_manager_load_plugins (ParolePluginsManager *manager)
+{
+ ParoleModule *module;
+ GDir *dir;
+ const gchar *name;
+ gchar *path;
+ GError *error = NULL;
+ gchar **plugins_rc;
+ guint len = 0, i = 0;
+
+ plugins_rc = parole_rc_read_entry_list ("plugins", PAROLE_RC_GROUP_PLUGINS);
+
+ if ( plugins_rc && plugins_rc[0] )
+ len = g_strv_length (plugins_rc);
+
+ dir = g_dir_open (PAROLE_PLUGINS_DIR, 0, &error);
+
+ if ( error )
+ {
+ g_critical ("Error opening plugins dir: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ while ( (name = g_dir_read_name (dir) ))
+ {
+ if ( g_str_has_suffix (name, "." G_MODULE_SUFFIX) )
+ {
+ path = g_build_filename (PAROLE_PLUGINS_DIR, name, NULL);
+ TRACE ("loading module with path %s", path);
+
+ module = parole_module_new (path);
+
+ if ( g_type_module_use (G_TYPE_MODULE (module)) )
+ {
+ g_ptr_array_add (manager->priv->array, module);
+
+ for ( i = 0; i < len; i++)
+ {
+ if ( !g_strcmp0 (plugins_rc[i], path) )
+ {
+ parole_module_set_active (module, TRUE);
+ break;
+ }
+ }
+ }
+ else
+ g_object_unref (module);
+ g_free (path);
+ }
+ }
+ g_dir_close (dir);
+}
+
static void
parole_plugins_manager_class_init (ParolePluginsManagerClass *klass)
{
@@ -88,7 +328,9 @@
manager->priv->array = g_ptr_array_new ();
builder = parole_builder_get_main_interface ();
+
manager->priv->list_nt = GTK_WIDGET (gtk_builder_get_object (builder, "notebook-playlist"));
+ manager->priv->main_nt = GTK_WIDGET (gtk_builder_get_object (builder, "main-notebook"));
g_signal_connect (gtk_builder_get_object (builder, "plugins-menu-item"), "activate",
G_CALLBACK (parole_plugins_manager_show_plugins_pref), manager);
@@ -113,20 +355,6 @@
G_OBJECT_CLASS (parole_plugins_manager_parent_class)->finalize (object);
}
-static void
-parole_plugins_manager_add (ParolePluginsManager *manager, const gchar *filename)
-{
- ParoleModule *module;
-
- module = parole_module_new (filename);
-
- if ( g_type_module_use (G_TYPE_MODULE (module)) )
- g_ptr_array_add (manager->priv->array, module);
- else
- g_object_unref (module);
-
-}
-
ParolePluginsManager *
parole_plugins_manager_new (void)
{
@@ -145,36 +373,6 @@
return PAROLE_PLUGINS_MANAGER (parole_plugins_manager_object);
}
-void parole_plugins_manager_load_plugins (ParolePluginsManager *manager)
-{
- GDir *dir;
- const gchar *name;
- gchar *path;
- GError *error = NULL;
-
- dir = g_dir_open (PAROLE_PLUGINS_DIR, 0, &error);
-
- if ( error )
- {
- g_critical ("Error opening plugins dir: %s", error->message);
- g_error_free (error);
- return;
- }
-
- while ( (name = g_dir_read_name (dir) ))
- {
- if ( g_str_has_suffix (name, "." G_MODULE_SUFFIX) )
- {
- path = g_build_filename (PAROLE_PLUGINS_DIR, name, NULL);
- TRACE ("loading module with path %s", path);
- parole_plugins_manager_add (manager, path);
- g_free (path);
- }
- }
-
- g_dir_close (dir);
-}
-
void parole_plugins_manager_pack (ParolePluginsManager *manager, ParolePlugin *plugin,
GtkWidget *widget, ParolePluginContainer container)
{
Modified: parole/trunk/parole/parole-rc-utils.c
===================================================================
--- parole/trunk/parole/parole-rc-utils.c 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/parole/parole-rc-utils.c 2009-07-25 23:23:20 UTC (rev 7836)
@@ -35,67 +35,105 @@
#define MEDIA_PLAYER_RESOURCE_FILE "xfce4/parole/parole-media-player.rc"
static XfceRc *
-open_resource_file (gboolean readonly)
+open_resource_file (const gchar *group, gboolean readonly)
{
gchar *file;
XfceRc *rc;
file = xfce_resource_save_location (XFCE_RESOURCE_CONFIG, MEDIA_PLAYER_RESOURCE_FILE, TRUE);
rc = xfce_rc_simple_open (file, readonly);
+
+ if (rc)
+ xfce_rc_set_group (rc, group);
+
g_free (file);
return rc;
}
-void parole_rc_write_entry_bool (const gchar *property, gboolean value)
+void parole_rc_write_entry_bool (const gchar *property, const gchar *group, gboolean value)
{
- XfceRc *rc = open_resource_file (FALSE);
+ XfceRc *rc = open_resource_file (group, FALSE);
xfce_rc_write_bool_entry (rc, property, value);
xfce_rc_close (rc);
}
-void parole_rc_write_entry_int (const gchar *property, gint value)
+void parole_rc_write_entry_int (const gchar *property, const gchar *group, gint value)
{
- XfceRc *rc = open_resource_file (FALSE);
+ XfceRc *rc = open_resource_file (group, FALSE);
xfce_rc_write_int_entry (rc, property, value);
xfce_rc_close (rc);
}
-void parole_rc_write_entry_string (const gchar *property, const gchar *value)
+void parole_rc_write_entry_string (const gchar *property, const gchar *group, const gchar *value)
{
- XfceRc *rc = open_resource_file (FALSE);
+ XfceRc *rc = open_resource_file (group, FALSE);
xfce_rc_write_entry (rc, property, value);
xfce_rc_close (rc);
}
-gboolean parole_rc_read_entry_bool (const gchar *property, gboolean fallback)
+void parole_rc_write_entry_list (const gchar *property, const gchar *group, gchar **value)
{
- XfceRc *rc = open_resource_file (TRUE);
+ XfceRc *rc = open_resource_file (group, FALSE);
+ xfce_rc_write_list_entry (rc, property, value, ";");
+ xfce_rc_close (rc);
+}
+
+gboolean parole_rc_read_entry_bool (const gchar *property, const gchar *group, gboolean fallback)
+{
+ XfceRc *rc = open_resource_file (group, TRUE);
+ gboolean ret_val = fallback;
+
if ( rc )
- return xfce_rc_read_bool_entry (rc, property, fallback);
-
- return fallback;
+ {
+ ret_val = xfce_rc_read_bool_entry (rc, property, fallback);
+ xfce_rc_close (rc);
+ }
+
+ return ret_val;
}
-gint parole_rc_read_entry_int (const gchar *property, gint fallback)
+gint parole_rc_read_entry_int (const gchar *property, const gchar *group, gint fallback)
{
- XfceRc *rc = open_resource_file (TRUE);
+ XfceRc *rc = open_resource_file (group, TRUE);
+ gint ret_val = fallback;
if ( rc )
- return xfce_rc_read_int_entry (rc, property, fallback);
-
- return fallback;
+ {
+ ret_val = xfce_rc_read_int_entry (rc, property, fallback);
+ xfce_rc_close (rc);
+ }
+
+ return ret_val;
}
-const gchar *parole_rc_read_entry_string (const gchar *property, const gchar *fallback)
+const gchar *parole_rc_read_entry_string (const gchar *property, const gchar *group, const gchar *fallback)
{
- XfceRc *rc = open_resource_file (TRUE);
+ const gchar *ret_val = fallback;
+ XfceRc *rc = open_resource_file (group, TRUE);
if ( rc )
- return xfce_rc_read_entry (rc, property, fallback);
-
- return fallback;
+ {
+ ret_val = xfce_rc_read_entry (rc, property, fallback);
+ xfce_rc_close (rc);
+ }
+
+ return ret_val;
}
+
+gchar **parole_rc_read_entry_list (const gchar *property, const gchar *group)
+{
+ gchar **ret_val = NULL;
+ XfceRc *rc = open_resource_file (group, TRUE);
+
+ if ( rc )
+ {
+ ret_val = xfce_rc_read_list_entry (rc, property, ";");
+ xfce_rc_close (rc);
+ }
+
+ return ret_val;
+}
Modified: parole/trunk/parole/parole-rc-utils.h
===================================================================
--- parole/trunk/parole/parole-rc-utils.h 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/parole/parole-rc-utils.h 2009-07-25 23:23:20 UTC (rev 7836)
@@ -21,23 +21,38 @@
#ifndef __RC_UTILS_
#define __RC_UTILS_
+#define PAROLE_RC_GROUP_GENERAL "General"
+#define PAROLE_RC_GROUP_PLUGINS "General"
+
void parole_rc_write_entry_bool (const gchar *property,
+ const gchar *group,
gboolean value);
void parole_rc_write_entry_int (const gchar *property,
+ const gchar *group,
gint value);
void parole_rc_write_entry_string (const gchar *property,
+ const gchar *group,
const gchar *value);
+
+void parole_rc_write_entry_list (const gchar *property,
+ const gchar *group,
+ gchar **value);
gboolean parole_rc_read_entry_bool (const gchar *property,
+ const gchar *group,
gboolean fallback);
gint parole_rc_read_entry_int (const gchar *property,
+ const gchar *group,
gint fallback);
const gchar *parole_rc_read_entry_string (const gchar *property,
+ const gchar *group,
const gchar *fallback);
-
+gchar **parole_rc_read_entry_list (const gchar *property,
+ const gchar *group);
+
#endif /* __RC_UTILS_ */
Modified: parole/trunk/parole/parole.h
===================================================================
--- parole/trunk/parole/parole.h 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/parole/parole.h 2009-07-25 23:23:20 UTC (rev 7836)
@@ -20,8 +20,17 @@
#include <parole/parole-plugin.h>
-ParolePlugin *parole_plugin_constructor (void);
+typedef struct
+{
+ gchar *title;
+ gchar *desc;
+ gchar *author;
+
+} ParolePluginDesc;
+ParolePluginDesc *parole_plugin_get_description (void);
+ParolePlugin *parole_plugin_constructor (void);
+
/**
* ParolePluginConstruct:
* @plugin: A #ParolePlugin.
@@ -40,14 +49,23 @@
* @author: author.
*
**/
-#define PAROLE_PLUGIN_CONSTRUCT(construct, title, desc, author) \
- G_MODULE_EXPORT ParolePlugin *parole_plugin_constructor (void) \
- { \
- ParolePlugin *plugin; \
- ParolePluginConstruct constructor \
- = (ParolePluginConstruct) construct; \
- \
- plugin = parole_plugin_new (title, desc, author); \
- constructor (plugin); \
- return plugin; \
+#define PAROLE_PLUGIN_CONSTRUCT(construct, p_title, p_desc, p_author) \
+ G_MODULE_EXPORT ParolePluginDesc *parole_plugin_get_description (void) \
+ { \
+ ParolePluginDesc *plugin_desc; \
+ plugin_desc = g_new0 (ParolePluginDesc, 1); \
+ plugin_desc->author = (p_author); \
+ plugin_desc->title = (p_title); \
+ plugin_desc->desc = (p_desc); \
+ return plugin_desc; \
+ } \
+ G_MODULE_EXPORT ParolePlugin *parole_plugin_constructor (void) \
+ { \
+ ParolePlugin *plugin; \
+ ParolePluginConstruct constructor \
+ = (ParolePluginConstruct) construct; \
+ \
+ plugin = parole_plugin_new (p_title, p_desc, p_author); \
+ constructor (plugin); \
+ return plugin; \
}
Modified: parole/trunk/po/POTFILES.in
===================================================================
--- parole/trunk/po/POTFILES.in 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/po/POTFILES.in 2009-07-25 23:23:20 UTC (rev 7836)
@@ -2,7 +2,7 @@
[type: gettext/glade]data/interfaces/parole.ui
[type: gettext/glade]data/interfaces/mediachooser.ui
[type: gettext/glade]data/interfaces/playlist.ui
-[type: gettext/glade]data/interfaces/openlocation.ui
+[type: gettext/glade]data/interfaces/plugins.ui
[type: gettext/glade]data/interfaces/parole-settings.ui
[type: gettext/glade]data/interfaces/save-playlist.ui
data/desktop/parole.desktop.in.in
Modified: parole/trunk/po/parole-media-player.pot
===================================================================
--- parole/trunk/po/parole-media-player.pot 2009-07-25 13:39:29 UTC (rev 7835)
+++ parole/trunk/po/parole-media-player.pot 2009-07-25 23:23:20 UTC (rev 7836)
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-07-23 23:27+0200\n"
+"POT-Creation-Date: 2009-07-26 01:16+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
@@ -48,10 +48,26 @@
msgid "_View"
msgstr ""
-#: ../data/interfaces/openlocation.ui.h:1
-msgid "Open location of media file or live stream"
+#: ../data/interfaces/plugins.ui.h:1
+msgid "<b>Author:</b>"
msgstr ""
+#: ../data/interfaces/plugins.ui.h:2
+msgid "<b>Copyright:</b>"
+msgstr ""
+
+#: ../data/interfaces/plugins.ui.h:3
+msgid "<b>Description:</b>"
+msgstr ""
+
+#: ../data/interfaces/plugins.ui.h:4
+msgid "<b>Site:</b>"
+msgstr ""
+
+#: ../data/interfaces/plugins.ui.h:5
+msgid "gtk-close"
+msgstr ""
+
#: ../data/interfaces/parole-settings.ui.h:1
msgid "<b>Audio</b>"
msgstr ""
@@ -98,7 +114,7 @@
msgid "Select File Types (By Extension)"
msgstr ""
-#: ../data/desktop/parole.desktop.in.in.h:1 ../parole/parole-player.c:153
+#: ../data/desktop/parole.desktop.in.in.h:1 ../parole/parole-player.c:154
msgid "Parole Media Player"
msgstr ""
@@ -129,14 +145,22 @@
"Unable to load video GStreamer plugin, check your GStreamer installation"
msgstr ""
-#: ../parole/parole-mediachooser.c:173
+#: ../parole/parole-mediachooser.c:171
msgid "Add media files"
msgstr ""
-#: ../parole/parole-mediachooser.c:192
+#: ../parole/parole-mediachooser.c:190
msgid "Add"
msgstr ""
+#: ../parole/parole-mediachooser.c:210
+msgid "Open location..."
+msgstr ""
+
+#: ../parole/parole-mediachooser.c:212
+msgid "Open location of media file or live stream"
+msgstr ""
+
#: ../parole/parole-medialist.c:380
msgid "Error saving playlist file"
msgstr ""
@@ -149,7 +173,7 @@
msgid "Unknown playlist format, Please select a support playlist format"
msgstr ""
-#: ../parole/parole-medialist.c:455 ../parole/parole-player.c:943
+#: ../parole/parole-medialist.c:455 ../parole/parole-player.c:953
msgid "Playlist"
msgstr ""
@@ -173,28 +197,28 @@
msgid "Media list"
msgstr ""
-#: ../parole/parole-player.c:174
+#: ../parole/parole-player.c:175
msgid "Hide playlist"
msgstr ""
-#: ../parole/parole-player.c:183
+#: ../parole/parole-player.c:184
msgid "Show playlist"
msgstr ""
-#: ../parole/parole-player.c:335 ../parole/parole-statusbar.c:125
+#: ../parole/parole-player.c:336 ../parole/parole-statusbar.c:125
#: ../parole/parole-statusbar.c:127
msgid "Playing"
msgstr ""
-#: ../parole/parole-player.c:336
+#: ../parole/parole-player.c:337
msgid "Media stream is not seekable"
msgstr ""
-#: ../parole/parole-player.c:354 ../parole/parole-player.c:367
+#: ../parole/parole-player.c:355 ../parole/parole-player.c:368
msgid "Paused"
msgstr ""
-#: ../parole/parole-player.c:385
+#: ../parole/parole-player.c:386
msgid "Stopped"
msgstr ""
More information about the Goodies-commits
mailing list