[Xfce4-commits] <parole:master> Merged f06ff6c539a8448495306348d3f93f25a2ebf8f0 from ochosi/comments

Sean Davis noreply at xfce.org
Sun Nov 11 17:10:01 CET 2012


Updating branch refs/heads/master
         to 198bf0cc40a8a4a956f3905801c91c0cfa57dc42 (commit)
       from 8842c66f7618f71763c2df82ecfe5817fbccbaa3 (commit)

commit 198bf0cc40a8a4a956f3905801c91c0cfa57dc42
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sun Nov 11 11:09:07 2012 -0500

    Merged f06ff6c539a8448495306348d3f93f25a2ebf8f0 from ochosi/comments

 src/main.c               |    7 +++++++
 src/parole-about.c       |    3 +++
 src/parole-builder.c     |    2 ++
 src/parole-conf-dialog.c |   23 ++++++++++++++++++++++-
 src/parole-conf.c        |   14 ++++++++++++++
 5 files changed, 48 insertions(+), 1 deletions(-)

diff --git a/src/main.c b/src/main.c
index a062d8e..9b88115 100644
--- a/src/main.c
+++ b/src/main.c
@@ -70,6 +70,7 @@ parole_sig_handler (gint sig, gpointer data)
     parole_player_terminate (player);
 }
 
+/* Load discs that are passed as cli arguments to Parole */
 static void
 parole_send_play_disc (const gchar *uri, const gchar *device)
 {
@@ -105,6 +106,7 @@ parole_send_play_disc (const gchar *uri, const gchar *device)
     g_object_unref (proxy);
 }
 
+/* Load files that are passed as cli arguments to Parole */
 static void
 parole_send_files (gchar **filenames, gboolean enqueue)
 {
@@ -231,6 +233,7 @@ int main (int argc, char **argv)
         return EXIT_FAILURE;
     }
     
+    /* Command-line options */
     GOptionEntry option_entries[] = 
     {
 	{ "new-instance", 'i', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &new_instance, N_("Open a new instance"), NULL },
@@ -284,6 +287,7 @@ int main (int argc, char **argv)
     if ( version )
 	show_version ();
 	
+	/* Check for cli options if there is an instance of Parole already */
     if ( !new_instance && parole_dbus_name_has_owner (PAROLE_DBUS_NAME) )
     {
 	if (!enqueue)
@@ -322,6 +326,7 @@ int main (int argc, char **argv)
 	    parole_send_message ("Mute");
     }
 	
+	/* Create a new instance because Parole isn't running */
     else
     {
 	builder = parole_builder_get_main_interface ();
@@ -371,10 +376,12 @@ int main (int argc, char **argv)
 	    g_error_free (error);
 	}
 
+    /* Initialize the plugin-manager and load the plugins */
 	plugins = parole_plugins_manager_new (!no_plugins);
 	parole_plugins_manager_load (plugins);
 	g_object_unref (builder);
 	
+	/* Start main process */
 	gdk_notify_startup_complete ();
 	gtk_main ();
 	
diff --git a/src/parole-about.c b/src/parole-about.c
index 5b1d7c4..db8291d 100644
--- a/src/parole-about.c
+++ b/src/parole-about.c
@@ -34,8 +34,10 @@
 #include "parole-about.h"
 
 
+/* About dialog */
 void parole_about (GtkWindow *parent)
 {
+    /* List of authors */
     static const gchar *authors[] = 
     {
 	"Ali Abdallah <aliov at xfce.org>",
@@ -44,6 +46,7 @@ void parole_about (GtkWindow *parent)
 	NULL,
     };
 
+    /* List of translators */
     static const gchar *documenters[] =
     {
 	"Ali Abdallah <aliov at xfce.org>",
diff --git a/src/parole-builder.c b/src/parole-builder.c
index cc1752c..d874948 100644
--- a/src/parole-builder.c
+++ b/src/parole-builder.c
@@ -31,6 +31,8 @@
 #include "interfaces/parole_ui.h"
 #include "parole-builder.h"
 
+
+/* Build Parole's UI from the interface-file */
 GtkBuilder *
 parole_builder_get_main_interface (void)
 {
diff --git a/src/parole-conf-dialog.c b/src/parole-conf-dialog.c
index 3158cb1..173a64c 100644
--- a/src/parole-conf-dialog.c
+++ b/src/parole-conf-dialog.c
@@ -117,6 +117,7 @@ struct ParoleConfDialogPrivate
 
 G_DEFINE_TYPE (ParoleConfDialog, parole_conf_dialog, G_TYPE_OBJECT)
 
+/* Destroy the dialog */
 static void 
 parole_conf_dialog_destroy (GtkWidget *widget, ParoleConfDialog *self)
 {
@@ -124,13 +125,15 @@ parole_conf_dialog_destroy (GtkWidget *widget, ParoleConfDialog *self)
     g_object_unref (self);
 }
 
+/* Replace the playlist with newly opened files */
 void replace_playlist_toggled_cb (GtkToggleButton *widget, ParoleConfDialog *self)
 {
     g_object_set (G_OBJECT (self->priv->conf),
 		  "replace-playlist", gtk_toggle_button_get_active (widget),
 		  NULL);
 }
-								 
+		
+/* Remove duplicate entries from the playlist FIXME */						 
 void remove_duplicated_toggled_cb (GtkToggleButton *widget, ParoleConfDialog *self)
 {
     g_object_set (G_OBJECT (self->priv->conf),
@@ -138,6 +141,7 @@ void remove_duplicated_toggled_cb (GtkToggleButton *widget, ParoleConfDialog *se
 		  NULL);
 }
 
+/* Automatically start playing opened files (vs. just adding them to the playlist) */
 void start_playing_opened_toggled_cb (GtkToggleButton *widget, ParoleConfDialog *self)
 {
     g_object_set (G_OBJECT (self->priv->conf),
@@ -145,6 +149,7 @@ void start_playing_opened_toggled_cb (GtkToggleButton *widget, ParoleConfDialog
 		  NULL);
 }
 
+/* Remember whether the playlist was visible in the previous session */
 void remember_playlist_toggled_cb (GtkToggleButton *widget, ParoleConfDialog *self)
 {
     g_object_set (G_OBJECT (self->priv->conf),
@@ -159,6 +164,7 @@ void multimedia_keys_toggled_cb (GtkToggleButton *widget, ParoleConfDialog *self
 		  NULL);
 }
 
+/* Change the various image properties */
 void reset_color_clicked_cb (GtkButton *button, ParoleConfDialog *self)
 {
     gtk_range_set_value (GTK_RANGE (self->priv->brightness), 0);
@@ -186,6 +192,7 @@ void parole_conf_dialog_subtitle_encoding_changed_cb (GtkComboBox *widget, Parol
 		  NULL);
 }
 
+/* Enable visualisations */
 void parole_conf_dialog_enable_vis_changed_cb (GtkToggleButton *widget, ParoleConfDialog *self)
 {
     gboolean active;
@@ -199,6 +206,7 @@ void parole_conf_dialog_enable_vis_changed_cb (GtkToggleButton *widget, ParoleCo
     gtk_widget_set_sensitive (self->priv->vis_combox, active);
 }
 
+/* Generic function to change all image properties */
 static void
 set_effect_value (ParoleConfDialog *self, GtkRange *range, const gchar *name)
 {
@@ -211,21 +219,25 @@ set_effect_value (ParoleConfDialog *self, GtkRange *range, const gchar *name)
 		  NULL);
 }
 
+/* Change brightness */
 void brightness_value_changed_cb (GtkRange *range, ParoleConfDialog *self)
 {
     set_effect_value (self, range, "brightness");
 }
 
+/* Change contrast */
 void contrast_value_changed_cb (GtkRange *range, ParoleConfDialog *self)
 {
     set_effect_value (self, range, "contrast");
 }
 
+/* Change hue */
 void hue_value_changed_cb (GtkRange *range, ParoleConfDialog *self)
 {
     set_effect_value (self, range, "hue");
 }
 
+/* Change saturation */
 void saturation_value_changed_cb (GtkRange *range, ParoleConfDialog *self)
 {
     set_effect_value (self, range, "saturation");
@@ -257,6 +269,7 @@ void parole_conf_dialog_reset_saver_changed_cb (GtkToggleButton *widget, ParoleC
 		  NULL);
 }
 
+/* Change subtitle font */
 void parole_conf_dialog_font_set_cb (GtkFontButton *button, ParoleConfDialog *self)
 {
     g_object_set (G_OBJECT (self->priv->conf), 
@@ -264,6 +277,7 @@ void parole_conf_dialog_font_set_cb (GtkFontButton *button, ParoleConfDialog *se
 		  NULL);
 }
 
+/* Enable subtitles by default */
 void parole_conf_dialog_enable_subtitle_changed_cb (GtkToggleButton *widget, ParoleConfDialog *self)
 {
     gboolean active;
@@ -275,6 +289,7 @@ void parole_conf_dialog_enable_subtitle_changed_cb (GtkToggleButton *widget, Par
 		  NULL);
 }
 
+/* Finalize the dialog */
 static void
 parole_conf_dialog_finalize (GObject *object)
 {
@@ -288,6 +303,7 @@ parole_conf_dialog_finalize (GObject *object)
     G_OBJECT_CLASS (parole_conf_dialog_parent_class)->finalize (object);
 }
 
+/* Initialize the config-dialog class */
 static void
 parole_conf_dialog_class_init (ParoleConfDialogClass *klass)
 {
@@ -298,6 +314,7 @@ parole_conf_dialog_class_init (ParoleConfDialogClass *klass)
     g_type_class_add_private (klass, sizeof (ParoleConfDialogPrivate));
 }
 
+/* Initialize the dialog */
 static void
 parole_conf_dialog_init (ParoleConfDialog *self)
 {
@@ -307,12 +324,14 @@ parole_conf_dialog_init (ParoleConfDialog *self)
     self->priv->vis_plugins = parole_vis_get_plugins ();
 }
 
+/* Fill the combobox with visualisations */
 static void
 parole_conf_dialog_add_vis_plugins (gpointer key, gpointer value, GtkWidget *combox)
 {
     gtk_combo_box_append_text (GTK_COMBO_BOX (combox), (const gchar *) key);
 }
 
+/* Set the combobox to the default visualisation plugin */
 static gboolean 
 parole_conf_dialog_set_default_vis_plugin (GtkTreeModel *model, GtkTreePath *path,
 					   GtkTreeIter *iter, ParoleConfDialog *self)
@@ -407,6 +426,7 @@ parole_conf_dialog_set_defaults_general (ParoleConfDialog *self, GtkBuilder *bui
     
 }
 
+/* Load the settings stored in the rc file */
 static void
 parole_conf_dialog_set_defaults (ParoleConfDialog *self)
 {
@@ -423,6 +443,7 @@ parole_conf_dialog_set_defaults (ParoleConfDialog *self)
 		  "subtitle-encoding", &subtitle_encoding,
 		  NULL);
 
+    /* Update widget-states according to settings */
     gtk_widget_set_sensitive (self->priv->vis_combox, vis_enabled);
     gtk_widget_set_sensitive (self->priv->font_button, subtitle);
     
diff --git a/src/parole-conf.c b/src/parole-conf.c
index 70b849a..1560d49 100644
--- a/src/parole-conf.c
+++ b/src/parole-conf.c
@@ -44,22 +44,29 @@ static gpointer parole_conf_object = NULL;
 enum
 {
     PROP_0,
+    /*Visualisations*/
     PROP_VIS_ENABLED,
     PROP_VIS_NAME,
+    /*Screensaver*/
     PROP_DISABLE_SCREEN_SAVER,
+    /*Subtitles*/
     PROP_SUBTITLE_ENABLED,
     PROP_SUBTITLE_FONT,
     PROP_SUBTITLE_ENCODING,
+    /*Playback*/
     PROP_REPEAT,
     PROP_SHUFFLE,
+    /*Video properties*/
     PROP_BRIGHTNESS,
     PROP_CONTRAST,
     PROP_HUE,
     PROP_SATURATION,
     PROP_ASPECT_RATIO,
+    /*Window properties*/
     PROP_WINDOW_WIDTH,
     PROP_WINDOW_HEIGHT,
     PROP_MINIMIZED,
+    /*Grab Multimedia keys*/
     PROP_MULTIMEDIA_KEYS,
     /*Playlist*/
     PROP_SHOWHIDE_PLAYLIST,
@@ -115,6 +122,7 @@ G_DEFINE_TYPE (ParoleConf, parole_conf, G_TYPE_OBJECT)
 
 
 
+/* Write property-values to the Xfconf channel */
 static void parole_conf_set_property (GObject *object,
                                       guint prop_id,
                                       const GValue *value,
@@ -162,6 +170,7 @@ static void parole_conf_set_property (GObject *object,
     g_signal_handler_unblock (conf->channel, conf->property_changed_id);
 }
 
+/* Read property-values from the Xfconf channel */
 static void parole_conf_get_property (GObject *object,
                                       guint prop_id,
                                       GValue *value,
@@ -591,6 +600,7 @@ parole_conf_class_init (ParoleConfClass *klass)
     
 }
 
+/* Load the rc file */
 static void
 parole_conf_load_rc_file (ParoleConf *conf)
 {
@@ -606,6 +616,8 @@ parole_conf_load_rc_file (ParoleConf *conf)
 
     /* look for preferences */
     rc = parole_get_resource_file (PAROLE_RC_GROUP_GENERAL, TRUE);
+    
+    /* Check whether rc file exists */
     if (G_UNLIKELY (rc == NULL))
     {
         g_debug ("Unable to lookup rc file in : %s\n", PAROLE_RESOURCE_FILE);
@@ -615,6 +627,8 @@ parole_conf_load_rc_file (ParoleConf *conf)
     xfce_rc_set_group (rc, "Configuration");
 
     pspecs = g_object_class_list_properties (G_OBJECT_GET_CLASS (conf), &nspecs);
+    
+    /* Load each property */ 
     for (n = 0; n < nspecs; ++n)
     {
         pspec = pspecs[n];


More information about the Xfce4-commits mailing list