[Goodies-commits] r4966 - xfburn/trunk/xfburn
David Mohr
squisher at xfce.org
Thu Jun 19 03:12:31 CEST 2008
Author: squisher
Date: 2008-06-19 01:12:31 +0000 (Thu, 19 Jun 2008)
New Revision: 4966
Modified:
xfburn/trunk/xfburn/xfburn-data-composition.c
xfburn/trunk/xfburn/xfburn-main.c
Log:
Implementing adding of files to a data composition from the command line
Modified: xfburn/trunk/xfburn/xfburn-data-composition.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-data-composition.c 2008-06-18 16:13:44 UTC (rev 4965)
+++ xfburn/trunk/xfburn/xfburn-data-composition.c 2008-06-19 01:12:31 UTC (rev 4966)
@@ -1023,6 +1023,7 @@
basename = g_path_get_basename (path);
if ( (strlen (basename) > 1) && (basename[0] == '.') ) {
+ /* FIXME: is this really what we want? */
/* don't add hidden files/directories */
g_free (basename);
@@ -1814,10 +1815,30 @@
}
void
-xfburn_data_composition_add_files (XfburnDataComposition *content, int filec, char **filenames)
+xfburn_data_composition_add_files (XfburnDataComposition *dc, int filec, char **filenames)
{
if (filec > 0) {
- g_error ("not yet implemented");
+ XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
+
+ GtkTreeModel *model;
+ int i;
+ gchar *full_path = NULL;
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
+
+ xfburn_busy_cursor (priv->content);
+
+ for (i=0; i<filec; i++) {
+ GtkTreeIter iter;
+
+ g_message ("Adding %s to the data composition... (might take a while)", filenames[i]);
+
+ full_path = g_build_filename (filenames[i], NULL);
+
+ add_file_to_list (dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
+ }
+
+ xfburn_default_cursor (priv->content);
}
}
Modified: xfburn/trunk/xfburn/xfburn-main.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-main.c 2008-06-18 16:13:44 UTC (rev 4965)
+++ xfburn/trunk/xfburn/xfburn-main.c 2008-06-19 01:12:31 UTC (rev 4966)
@@ -60,7 +60,7 @@
{ "burn-image", 'i', G_OPTION_FLAG_OPTIONAL_ARG /* || G_OPTION_FLAG_FILENAME */, G_OPTION_ARG_CALLBACK, &parse_option,
"Open the burn image dialog. The filename of the image can optionally be specified as a parameter", NULL },
{ "data-composition", 'd', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &parse_option,
- "Start a data composition. Optionally followed by files to be added to the composition.", NULL },
+ "Start a data composition. Optionally followed by files/directories to be added to the composition.", NULL },
{ "version", 'V', G_OPTION_FLAG_NO_ARG , G_OPTION_ARG_NONE, &show_version,
"Display program version and exit", NULL },
{ "main", 'm', G_OPTION_FLAG_NO_ARG , G_OPTION_ARG_NONE, &show_main,
@@ -172,6 +172,7 @@
gtk_widget_destroy (dialog);
}
+ /* main window */
if (!other_action || show_main) {
mainwin = xfburn_main_window_new ();
@@ -183,6 +184,7 @@
gtk_main ();
}
+ /* shutdown */
#ifdef HAVE_THUNAR_VFS
thunar_vfs_shutdown ();
#endif
More information about the Goodies-commits
mailing list