[Xfce4-commits] [apps/xfburn] 24/42: Re-enabling the initial code for setting the starting directory and finish implementation
noreply at xfce.org
noreply at xfce.org
Tue Oct 15 02:22:07 CEST 2019
This is an automated email from the git hooks/post-receive script.
k a t a n a s t e e l p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfburn.
commit ae54261e84f9478c0140013d8d7177baac5bbd57
Author: René Vögeli <rvoegeli at rangee.com>
Date: Wed Nov 14 14:03:00 2018 +0100
Re-enabling the initial code for setting the starting directory and finish implementation
---
xfburn/xfburn-audio-composition.c | 362 ++++++++++++++++----------------
xfburn/xfburn-burn-image-dialog.c | 36 ++--
xfburn/xfburn-data-composition.c | 422 +++++++++++++++++++-------------------
xfburn/xfburn-fs-browser.c | 10 +-
xfburn/xfburn-main.c | 32 +--
xfburn/xfburn-main.h | 4 +-
xfburn/xfburn-utils.c | 16 +-
7 files changed, 441 insertions(+), 441 deletions(-)
diff --git a/xfburn/xfburn-audio-composition.c b/xfburn/xfburn-audio-composition.c
index e8ad307..8be218a 100644
--- a/xfburn/xfburn-audio-composition.c
+++ b/xfburn/xfburn-audio-composition.c
@@ -5,12 +5,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -157,18 +157,18 @@ static void thread_add_files_action (ThreadAddFilesActionParams *params);
static void thread_add_files_drag (ThreadAddFilesDragParams *params);
/* thread helpers */
-static gboolean thread_add_file_to_list_with_name (const gchar *name, XfburnAudioComposition * dc,
- GtkTreeModel * model, const gchar * path, GtkTreeIter * iter,
+static gboolean thread_add_file_to_list_with_name (const gchar *name, XfburnAudioComposition * dc,
+ GtkTreeModel * model, const gchar * path, GtkTreeIter * iter,
GtkTreeIter * insertion, GtkTreeViewDropPosition position);
-static gboolean thread_add_file_to_list (XfburnAudioComposition * dc, GtkTreeModel * model, const gchar * path,
+static gboolean thread_add_file_to_list (XfburnAudioComposition * dc, GtkTreeModel * model, const gchar * path,
GtkTreeIter * iter, GtkTreeIter * insertion, GtkTreeViewDropPosition position);
static gboolean show_add_home_question_dialog (void);
-
+
typedef struct
{
gchar *filename;
gboolean modified;
-
+
guint n_tracks;
GList *full_paths_to_add;
@@ -182,7 +182,7 @@ typedef struct
void *thread_params;
GHashTable *warned_about;
-
+
GSimpleActionGroup *action_group;
GtkBuilder *ui_manager;
@@ -269,9 +269,9 @@ xfburn_audio_composition_get_type (void)
NULL, /* interface_finalize */
NULL /* interface_data */
};
-
- audio_composition_type = g_type_register_static (GTK_TYPE_BOX, "XfburnAudioComposition", &audio_composition_info, 0);
-
+
+ audio_composition_type = g_type_register_static (GTK_TYPE_VBOX, "XfburnAudioComposition", &audio_composition_info, 0);
+
g_type_add_interface_static (audio_composition_type, XFBURN_TYPE_COMPOSITION, &composition_info);
}
@@ -284,9 +284,9 @@ xfburn_audio_composition_class_init (XfburnAudioCompositionClass * klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (XfburnAudioCompositionPrivate));
-
+
parent_class = g_type_class_peek_parent (klass);
-
+
object_class->finalize = xfburn_audio_composition_finalize;
}
@@ -303,7 +303,7 @@ static void
xfburn_audio_composition_init (XfburnAudioComposition * composition)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (composition);
-
+
gtk_orientable_set_orientation(GTK_ORIENTABLE (composition), GTK_ORIENTATION_VERTICAL);
gint x, y;
@@ -321,7 +321,7 @@ xfburn_audio_composition_init (XfburnAudioComposition * composition)
GSimpleAction *action = NULL;
GdkScreen *screen;
GtkIconTheme *icon_theme;
-
+
#if 0 /* CDTEXT */
const gchar ui_string[] = "<ui> <popup name=\"popup-menu\">"
"<menuitem action=\"rename-artist\"/>" "<menuitem action=\"rename-title\"/>" "<menuitem action=\"remove-file\"/>" "</popup></ui>";
@@ -347,7 +347,7 @@ xfburn_audio_composition_init (XfburnAudioComposition * composition)
strncpy (trans_name, xfburn_transcoder_get_name (priv->trans), MAX_NAME_LENGTH);
instances++;
-
+
/* initialize static members */
screen = gtk_widget_get_screen (GTK_WIDGET (composition));
icon_theme = gtk_icon_theme_get_for_screen (screen);
@@ -370,7 +370,7 @@ xfburn_audio_composition_init (XfburnAudioComposition * composition)
hbox_toolbar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
gtk_box_pack_start (GTK_BOX (composition), hbox_toolbar, FALSE, TRUE, 0);
gtk_widget_show (hbox_toolbar);
-
+
/* toolbar */
/* model_toolbar = exo_toolbars_model_new ();
exo_toolbars_model_set_actions (model_toolbar, (gchar **) toolbar_actions, G_N_ELEMENTS (toolbar_actions));
@@ -410,7 +410,7 @@ xfburn_audio_composition_init (XfburnAudioComposition * composition)
gtk_box_pack_start (GTK_BOX (hbox_toolbar), priv->toolbar, TRUE, TRUE, 0);
gtk_widget_show_all (priv->toolbar);
-
+
/* content treeview */
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@@ -492,9 +492,9 @@ xfburn_audio_composition_init (XfburnAudioComposition * composition)
g_signal_connect (G_OBJECT (priv->content), "button-press-event",
G_CALLBACK (cb_treeview_button_pressed), composition);
g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (cb_selection_changed), composition);
-
+
/* adding progress window */
- priv->progress = GTK_WIDGET (xfburn_adding_progress_new ());
+ priv->progress = GTK_WIDGET (xfburn_adding_progress_new ());
g_signal_connect (G_OBJECT (priv->progress), "adding-done", G_CALLBACK (cb_adding_done), composition);
gtk_window_set_transient_for (GTK_WINDOW (priv->progress), GTK_WINDOW (xfburn_main_window_get_instance ()));
/* FIXME: progress should have a busy cursor */
@@ -514,7 +514,7 @@ xfburn_audio_composition_init (XfburnAudioComposition * composition)
GDK_ACTION_COPY | GDK_ACTION_MOVE);
g_signal_connect (G_OBJECT (priv->content), "drag-data-received", G_CALLBACK (cb_content_drag_data_rcv),
composition);
-
+
action = G_SIMPLE_ACTION (g_action_map_lookup_action (G_ACTION_MAP (priv->action_group), "remove-file"));
g_simple_action_set_enabled (action, FALSE);
@@ -525,9 +525,9 @@ static void
xfburn_audio_composition_finalize (GObject * object)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (object);
-
+
g_free (priv->filename);
-
+
/* free static members */
instances--;
if (instances == 0) {
@@ -548,7 +548,7 @@ xfburn_audio_composition_finalize (GObject * object)
when this tab is closed, it does not take ownership of the model, which then
must be unref'ed manually */
g_object_unref (priv->model);
-
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -581,7 +581,7 @@ generate_audio_src (XfburnAudioComposition * ac)
XfburnAudioTrack *atrack;
gint pos;
- gtk_tree_model_get (model, &iter,
+ gtk_tree_model_get (model, &iter,
AUDIO_COMPOSITION_COLUMN_POS, &pos,
AUDIO_COMPOSITION_COLUMN_TRACK, &atrack,
-1);
@@ -609,7 +609,7 @@ cb_begin_burn (XfburnDiscUsage * du, XfburnAudioComposition * dc)
GSList *src;
src = generate_audio_src (dc);
-
+
switch (xfburn_disc_usage_get_disc_type (du)) {
case CD_DISC:
dialog = xfburn_burn_audio_cd_composition_dialog_new (src);
@@ -632,7 +632,7 @@ cb_selection_changed (GtkTreeSelection *selection, XfburnAudioComposition * dc)
gint n_selected_rows;
GSimpleAction *action = NULL;
GActionMap *map = G_ACTION_MAP (priv->action_group);
-
+
n_selected_rows = gtk_tree_selection_count_selected_rows (selection);
if (n_selected_rows == 0) {
action = G_SIMPLE_ACTION (g_action_map_lookup_action (map, "add-file"));
@@ -656,10 +656,10 @@ static gboolean
cb_treeview_button_pressed (GtkTreeView * treeview, GdkEventButton * event, XfburnAudioComposition * dc)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
-
+
if ((event->button == 1) && (event->type == GDK_BUTTON_PRESS)) {
GtkTreePath *path;
-
+
if (gtk_tree_view_get_path_at_pos (treeview, event->x, event->y, &path, NULL, NULL, NULL)) {
gtk_tree_path_free (path);
} else {
@@ -668,10 +668,10 @@ cb_treeview_button_pressed (GtkTreeView * treeview, GdkEventButton * event, Xfbu
selection = gtk_tree_view_get_selection (treeview);
gtk_tree_selection_unselect_all (selection);
}
-
+
return FALSE;
}
-
+
if ((event->button == 3) && (event->type == GDK_BUTTON_PRESS)) {
GtkTreeSelection *selection;
GtkTreePath *path;
@@ -733,14 +733,14 @@ file_exists_on_same_level (GtkTreeModel * model, GtkTreePath * path, gboolean sk
{
GtkTreePath *current_path = NULL;
GtkTreeIter current_iter;
-
+
current_path = gtk_tree_path_copy (path);
for (;gtk_tree_path_prev (current_path););
-
+
if (gtk_tree_model_get_iter (model, ¤t_iter, current_path)) {
do {
gchar *current_filename = NULL;
-
+
if (skip_path && gtk_tree_path_compare (path, current_path) == 0) {
gtk_tree_path_next (current_path);
continue;
@@ -753,12 +753,12 @@ file_exists_on_same_level (GtkTreeModel * model, GtkTreePath * path, gboolean sk
gtk_tree_path_free (current_path);
return TRUE;
}
-
+
g_free (current_filename);
gtk_tree_path_next (current_path);
} while (gtk_tree_model_iter_next (model, ¤t_iter));
}
-
+
gtk_tree_path_free (current_path);
return FALSE;
}
@@ -768,7 +768,7 @@ static void
cb_cell_artist_edited (GtkCellRenderer * renderer, gchar * path, gchar * newtext, XfburnAudioComposition * dc)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
-
+
GtkTreeIter iter;
GtkTreeModel *model;
GtkTreePath *real_path;
@@ -787,7 +787,7 @@ static void
cb_cell_title_edited (GtkCellRenderer * renderer, gchar * path, gchar * newtext, XfburnAudioComposition * dc)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
-
+
GtkTreeIter iter;
GtkTreeModel *model;
GtkTreePath *real_path;
@@ -860,7 +860,7 @@ static void
action_rename_selection_artist (GtkAction * action, XfburnAudioComposition * dc)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
-
+
GtkTreeSelection *selection;
GtkTreeModel *model;
GList *list;
@@ -874,7 +874,7 @@ action_rename_selection_artist (GtkAction * action, XfburnAudioComposition * dc)
column = gtk_tree_view_get_column (GTK_TREE_VIEW (priv->content), 2);
g_assert (column != NULL);
-
+
gtk_tree_view_set_cursor (GTK_TREE_VIEW (priv->content), path, column, TRUE);
gtk_tree_path_free (path);
@@ -885,7 +885,7 @@ static void
action_rename_selection_title (GtkAction * action, XfburnAudioComposition * dc)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
-
+
GtkTreeSelection *selection;
GtkTreeModel *model;
GList *list;
@@ -899,7 +899,7 @@ action_rename_selection_title (GtkAction * action, XfburnAudioComposition * dc)
column = gtk_tree_view_get_column (GTK_TREE_VIEW (priv->content), 3);
g_assert (column != NULL);
-
+
gtk_tree_view_set_cursor (GTK_TREE_VIEW (priv->content), path, column, TRUE);
gtk_tree_path_free (path);
@@ -914,15 +914,15 @@ remove_row_reference (GtkTreeRowReference *reference, XfburnAudioCompositionPriv
GtkTreeModel *model;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
-
+
path = gtk_tree_row_reference_get_path (reference);
if (path) {
GtkTreeIter iter;
-
+
if (gtk_tree_model_get_iter (model, &iter, path)) {
//GtkTreeIter parent, iter_temp;
int secs = 0;
-
+
gtk_tree_model_get (model, &iter, AUDIO_COMPOSITION_COLUMN_LENGTH, &secs, -1);
xfburn_disc_usage_sub_size (XFBURN_DISC_USAGE (priv->disc_usage), secs);
@@ -936,7 +936,7 @@ remove_row_reference (GtkTreeRowReference *reference, XfburnAudioCompositionPriv
gtk_tree_model_get (model, &parent, AUDIO_COMPOSITION_COLUMN_SIZE, &old_size, -1);
humansize = xfburn_humanreadable_filesize (old_size - size);
- gtk_tree_store_set (GTK_TREE_STORE (model), &parent,
+ gtk_tree_store_set (GTK_TREE_STORE (model), &parent,
AUDIO_COMPOSITION_COLUMN_SIZE, old_size - size, -1);
iter_temp = parent;
@@ -944,14 +944,14 @@ remove_row_reference (GtkTreeRowReference *reference, XfburnAudioCompositionPriv
g_free (humansize);
}
*/
-
+
gtk_tree_store_remove (GTK_TREE_STORE (model), &iter);
priv->n_tracks--;
}
-
+
gtk_tree_path_free (path);
}
-
+
gtk_tree_row_reference_free (reference);
}
@@ -959,12 +959,12 @@ static void
action_remove_selection (GSimpleAction * action, GVariant * param, XfburnAudioComposition * dc)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
-
+
GtkTreeSelection *selection;
GtkTreeModel *model;
GList *list_paths = NULL, *el;
GList *references = NULL;
-
+
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->content));
list_paths = gtk_tree_selection_get_selected_rows (selection, &model);
@@ -972,18 +972,18 @@ action_remove_selection (GSimpleAction * action, GVariant * param, XfburnAudioCo
while (el) {
GtkTreePath *path = NULL;
GtkTreeRowReference *reference = NULL;
-
+
path = (GtkTreePath *) el->data;
reference = gtk_tree_row_reference_new (model, path);
gtk_tree_path_free (path);
-
+
if (reference)
references = g_list_prepend (references, reference);
-
+
el = g_list_next (el);
- }
+ }
g_list_free (list_paths);
-
+
g_list_foreach (references, (GFunc) remove_row_reference, priv);
g_list_free (references);
}
@@ -994,9 +994,9 @@ action_add_selected_files (GSimpleAction * action, GVariant * param, XfburnAudio
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
XfburnFileBrowser *browser = xfburn_main_window_get_file_browser (xfburn_main_window_get_instance ());
-
+
gchar *selected_files = NULL;
-
+
xfburn_busy_cursor (priv->content);
if (xfburn_settings_get_boolean("show-filebrowser", FALSE)) {
selected_files = xfburn_file_browser_get_selection (browser);
@@ -1034,7 +1034,7 @@ action_add_selected_files (GSimpleAction * action, GVariant * param, XfburnAudio
}
gtk_widget_destroy (dialog);
}
-
+
if (selected_files) {
GtkTreeSelection *selection;
GList *selected_paths = NULL;
@@ -1046,23 +1046,23 @@ action_add_selected_files (GSimpleAction * action, GVariant * param, XfburnAudio
params->dc = dc;
params->type = -1;
priv->path_where_insert = NULL;
-
+
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->content));
selected_paths = gtk_tree_selection_get_selected_rows (selection, NULL);
params->model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
-
+
if (selected_paths) {
priv->path_where_insert = gtk_tree_path_copy ((GtkTreePath *) (selected_paths->data));
gtk_tree_model_get_iter (params->model, ¶ms->iter_where_insert, priv->path_where_insert);
gtk_tree_model_get (params->model, ¶ms->iter_where_insert, AUDIO_COMPOSITION_COLUMN_TYPE, ¶ms->type, -1);
}
-
+
priv->selected_files = selected_files;
priv->thread_params = params;
g_thread_new ("audio_add_selected", (GThreadFunc) thread_add_files_action, params);
-
+
g_list_foreach (selected_paths, (GFunc) gtk_tree_path_free, NULL);
g_list_free (selected_paths);
}
@@ -1072,12 +1072,12 @@ static void
action_clear (GSimpleAction * action, GVariant * param, XfburnAudioComposition * dc)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
-
+
GtkTreeModel *model;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
gtk_tree_store_clear (GTK_TREE_STORE (model));
-
+
xfburn_disc_usage_set_size (XFBURN_DISC_USAGE (priv->disc_usage), 0);
priv->n_tracks = 0;
}
@@ -1086,7 +1086,7 @@ static void
action_info (GSimpleAction * action, GVariant * param, XfburnAudioComposition * dc)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
-
+
xfce_dialog_show_info(NULL, NULL, "%s", xfburn_transcoder_get_description (priv->trans));
}
@@ -1113,7 +1113,7 @@ cb_content_drag_data_get (GtkWidget * widget, GdkDragContext * dc,
gtk_tree_path_free (temp);
references = g_list_prepend (references, reference);
-
+
row = g_list_next (row);
}
@@ -1132,12 +1132,12 @@ set_modified (XfburnAudioCompositionPrivate *priv)
XfburnMainWindow *mainwin;
GtkUIManager *ui_manager;
GtkActionGroup *action_group;
-
+
mainwin = xfburn_main_window_get_instance ();
ui_manager = xfburn_main_window_get_ui_manager (mainwin);
-
+
action_group = (GtkActionGroup *) gtk_ui_manager_get_action_groups (ui_manager)->data;
-
+
action = gtk_action_group_get_action (action_group, "save-composition");
gtk_action_set_sensitive (GTK_ACTION (action), TRUE);
*/
@@ -1167,12 +1167,12 @@ notify_not_adding (XfburnAudioComposition * dc, GError *error)
}
static gboolean
-thread_add_file_to_list_with_name (const gchar *name, XfburnAudioComposition * dc,
+thread_add_file_to_list_with_name (const gchar *name, XfburnAudioComposition * dc,
GtkTreeModel * model, const gchar * path,
GtkTreeIter * iter, GtkTreeIter * insertion, GtkTreeViewDropPosition position)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
-
+
struct stat s;
if ((stat (path, &s) == 0)) {
@@ -1185,7 +1185,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnAudioComposition * d
if (!S_ISDIR (s.st_mode) && !S_ISREG (s.st_mode)) {
return FALSE;
}
-
+
//DBG ("Adding file %s (%s)", name, path);
basename = g_path_get_basename (path);
@@ -1193,18 +1193,18 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnAudioComposition * d
/* FIXME: is this really what we want? */
/* don't add hidden files/directories */
- g_free (basename);
+ g_free (basename);
return FALSE;
}
g_free (basename);
-
+
xfburn_adding_progress_pulse (XFBURN_ADDING_PROGRESS (priv->progress));
-
+
/* check if the filename is valid */
gdk_threads_enter ();
tree_path = gtk_tree_path_new_first ();
gdk_threads_leave ();
-
+
gdk_threads_enter ();
if (file_exists_on_same_level (model, tree_path, FALSE, name)) {
xfce_dialog_show_error (NULL, NULL, _("A file with the same name is already present in the composition."));
@@ -1215,7 +1215,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnAudioComposition * d
}
gtk_tree_path_free (tree_path);
gdk_threads_leave ();
-
+
/* new directory */
if (S_ISDIR (s.st_mode)) {
GDir *dir = NULL;
@@ -1229,7 +1229,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnAudioComposition * d
g_warning ("unable to open directory : %s", error->message);
g_error_free (error);
-
+
return FALSE;
}
@@ -1240,7 +1240,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnAudioComposition * d
GtkTreeIter new_iter;
gchar *new_path = NULL;
- new_path = g_build_filename (path, filename, NULL);
+ new_path = g_build_filename (path, filename, NULL);
if (new_path) {
guint64 size;
@@ -1248,21 +1248,21 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnAudioComposition * d
gdk_threads_enter ();
gtk_tree_model_get (model, &new_iter, AUDIO_COMPOSITION_COLUMN_SIZE, &size, -1);
gdk_threads_leave ();
- total_size += size;
+ total_size += size;
if (iter_last == NULL)
iter_last = g_new (GtkTreeIter, 1);
*iter_last = new_iter;
position = GTK_TREE_VIEW_DROP_AFTER;
ret = TRUE;
}
-
+
g_free (new_path);
}
}
/* since we don't add the folder, the next song needs
* to get added after the last one from this directory */
- if (iter_last != NULL)
+ if (iter_last != NULL)
*iter = *iter_last;
if (insertion == NULL)
@@ -1345,7 +1345,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnAudioComposition * d
set_modified (priv);
return ret;
}
-
+
return FALSE;
}
@@ -1367,7 +1367,7 @@ thread_add_files_cli (ThreadAddFilesCLIParams *params)
gchar * full_path = (gchar *) list_iter->data;
g_message ("Adding %s to the audio composition... (might take a while)", full_path);
- thread_add_file_to_list (params->dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
+ thread_add_file_to_list (params->dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
g_free (full_path);
}
@@ -1412,7 +1412,7 @@ thread_add_files_action (ThreadAddFilesActionParams *params)
for (i=0; files[i] != NULL && files[i][0] != '\0'; i++) {
GtkTreeIter iter;
gchar *full_path = NULL;
-
+
if (g_str_has_prefix (files[i], "file://"))
full_path = g_build_filename (&files[i][7], NULL);
else if (g_str_has_prefix (files[i], "file:"))
@@ -1438,15 +1438,15 @@ thread_add_files_action (ThreadAddFilesActionParams *params)
gdk_threads_enter ();
has_parent = gtk_tree_model_iter_parent (model, &parent, &iter_where_insert);
gdk_threads_leave ();
-
+
if (has_parent)
- thread_add_file_to_list (dc, model, full_path, &iter, &parent, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
- else
- thread_add_file_to_list (dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
+ thread_add_file_to_list (dc, model, full_path, &iter, &parent, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
+ else
+ thread_add_file_to_list (dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
} else {
- thread_add_file_to_list (dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
+ thread_add_file_to_list (dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
}
-
+
g_free (full_path);
}
@@ -1457,13 +1457,13 @@ thread_add_files_action (ThreadAddFilesActionParams *params)
}
static gboolean
-thread_add_file_to_list (XfburnAudioComposition * dc, GtkTreeModel * model,
+thread_add_file_to_list (XfburnAudioComposition * dc, GtkTreeModel * model,
const gchar * path, GtkTreeIter * iter, GtkTreeIter * insertion, GtkTreeViewDropPosition position)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
struct stat s;
gboolean ret = FALSE;
-
+
if (xfburn_adding_progress_is_aborted (XFBURN_ADDING_PROGRESS (priv->progress))) {
DBG ("Adding aborted");
xfburn_adding_progress_done (XFBURN_ADDING_PROGRESS (priv->progress));
@@ -1475,23 +1475,23 @@ thread_add_file_to_list (XfburnAudioComposition * dc, GtkTreeModel * model,
gchar *basename = NULL;
basename = g_path_get_basename (path);
-
+
ret = thread_add_file_to_list_with_name (basename, dc, model, path, iter, insertion, position);
-
+
g_free (basename);
}
return ret;
}
-static GtkTreeIter *
+static GtkTreeIter *
copy_entry_to (XfburnAudioComposition *dc, GtkTreeIter *src, GtkTreeIter *dest, GtkTreeViewDropPosition position)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
-
+
GtkTreeModel *model;
GtkTreeIter *iter_new = g_new0 (GtkTreeIter, 1);
-
+
GdkPixbuf *icon = NULL;
gint pos = 0;
gchar *name = NULL;
@@ -1502,26 +1502,26 @@ copy_entry_to (XfburnAudioComposition *dc, GtkTreeIter *src, GtkTreeIter *dest,
XfburnAudioTrack *atrack;
GtkTreePath *path_level = NULL;
-
+
//guint n_children = 0;
//guint i;
GtkTreePath *path_src = NULL;
-
+
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
-
- gtk_tree_model_get (model, src,
- AUDIO_COMPOSITION_COLUMN_POS, &pos,
+
+ gtk_tree_model_get (model, src,
+ AUDIO_COMPOSITION_COLUMN_POS, &pos,
AUDIO_COMPOSITION_COLUMN_CONTENT, &name,
AUDIO_COMPOSITION_COLUMN_SIZE, &size,
- AUDIO_COMPOSITION_COLUMN_PATH, &path,
- AUDIO_COMPOSITION_COLUMN_HUMANLENGTH, &humanlength,
+ AUDIO_COMPOSITION_COLUMN_PATH, &path,
+ AUDIO_COMPOSITION_COLUMN_HUMANLENGTH, &humanlength,
AUDIO_COMPOSITION_COLUMN_TRACK, &atrack,
AUDIO_COMPOSITION_COLUMN_TYPE, &type,
-1);
-
+
//DBG ("dest = %p", dest);
if (dest == NULL)
- gtk_tree_store_append (GTK_TREE_STORE (model), iter_new, dest);
+ gtk_tree_store_append (GTK_TREE_STORE (model), iter_new, dest);
else switch (position) {
case GTK_TREE_VIEW_DROP_BEFORE:
gtk_tree_store_insert_before (GTK_TREE_STORE (model), iter_new, NULL, dest);
@@ -1538,30 +1538,30 @@ copy_entry_to (XfburnAudioComposition *dc, GtkTreeIter *src, GtkTreeIter *dest,
} else {
path_level = gtk_tree_path_new_first ();
}
-
+
/*
if (file_exists_on_same_level (model, path_level, FALSE, name)) {
xfce_dialog_warning(NULL, _("A file named \"%s\" already exists in this directory, the file hasn't been added."), name);
goto cleanup;
}
*/
-
+
gtk_tree_path_free (path_level);
-
- gtk_tree_store_append (GTK_TREE_STORE (model), iter_new, dest);
+
+ gtk_tree_store_append (GTK_TREE_STORE (model), iter_new, dest);
break;
}
-
+
gtk_tree_store_set (GTK_TREE_STORE (model), iter_new,
- AUDIO_COMPOSITION_COLUMN_POS, pos,
+ AUDIO_COMPOSITION_COLUMN_POS, pos,
AUDIO_COMPOSITION_COLUMN_CONTENT, name,
AUDIO_COMPOSITION_COLUMN_SIZE, size,
- AUDIO_COMPOSITION_COLUMN_PATH, path,
- AUDIO_COMPOSITION_COLUMN_HUMANLENGTH, humanlength,
+ AUDIO_COMPOSITION_COLUMN_PATH, path,
+ AUDIO_COMPOSITION_COLUMN_HUMANLENGTH, humanlength,
AUDIO_COMPOSITION_COLUMN_TRACK, atrack,
AUDIO_COMPOSITION_COLUMN_TYPE, type,
-1);
-
+
/* copy children */
/*
n_children = gtk_tree_model_iter_n_children (model, src);
@@ -1576,22 +1576,22 @@ copy_entry_to (XfburnAudioComposition *dc, GtkTreeIter *src, GtkTreeIter *dest,
path_src = gtk_tree_model_get_path (model, src);
if (n_children > 0 && gtk_tree_view_row_expanded (GTK_TREE_VIEW (priv->content), path_src)) {
GtkTreePath *path_new = NULL;
-
+
path_new = gtk_tree_model_get_path (model, iter_new);
gtk_tree_view_expand_row (GTK_TREE_VIEW (priv->content), path_new, FALSE);
-
+
gtk_tree_path_free (path_new);
}
*/
gtk_tree_path_free (path_src);
-
+
//cleanup:
if (G_LIKELY (G_IS_OBJECT (icon)))
g_object_unref (icon);
g_free (name);
g_free (humanlength);
g_free (path);
-
+
return iter_new;
}
@@ -1610,9 +1610,9 @@ remove_dummy_row ()
static void
cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guint y, GtkSelectionData * sd,
guint info, guint t, XfburnAudioComposition * composition)
-{
+{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (composition);
-
+
GtkTreeModel *model;
GtkTreePath *path_where_insert = NULL;
GtkTreeViewDropPosition position;
@@ -1620,7 +1620,7 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
g_return_if_fail (sd);
g_return_if_fail (gtk_selection_data_get_data(sd));
-
+
model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
/*
@@ -1637,9 +1637,9 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
return;
*/
-
+
gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), x, y, &path_where_insert, &position);
-
+
xfburn_busy_cursor (priv->content);
/* move a selection inside of the composition window */
@@ -1648,29 +1648,29 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
GtkTreeIter *iter = NULL;
GtkTreeIter *iter_prev = NULL;
AudioCompositionEntryType type_dest = -1;
-
+
xfburn_adding_progress_show (XFBURN_ADDING_PROGRESS (priv->progress));
row = selected_rows = *((GList **) gtk_selection_data_get_data(sd));
-
+
if (path_where_insert) {
iter_where_insert = g_new0 (GtkTreeIter, 1);
gtk_tree_model_get_iter (model, iter_where_insert, path_where_insert);
iter_prev = iter_where_insert;
-
+
gtk_tree_model_get (model, iter_where_insert, AUDIO_COMPOSITION_COLUMN_TYPE, &type_dest, -1);
-
+
if (type_dest == AUDIO_COMPOSITION_TYPE_RAW) {
if (position == GTK_TREE_VIEW_DROP_INTO_OR_AFTER)
position = GTK_TREE_VIEW_DROP_AFTER;
else if (position == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE)
position = GTK_TREE_VIEW_DROP_BEFORE;
- }
+ }
} else {
//position = GTK_TREE_VIEW_DROP_INTO_OR_AFTER;
position = GTK_TREE_VIEW_DROP_AFTER;
}
-
+
/* copy selection */
while (row) {
GtkTreePath *path_src = NULL;
@@ -1679,24 +1679,24 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
AudioCompositionEntryType type;
guint64 size = 0;
int secs = 0;
-
+
reference = (GtkTreeRowReference *) row->data;
-
+
path_src = gtk_tree_row_reference_get_path (reference);
if (!path_src) {
gtk_tree_row_reference_free (reference);
-
+
row = g_list_next (row);
continue;
}
-
+
/*
DBG ("path_where_insert = %p", path_where_insert);
- if (path_where_insert && (position == GTK_TREE_VIEW_DROP_AFTER || position == GTK_TREE_VIEW_DROP_BEFORE)
+ if (path_where_insert && (position == GTK_TREE_VIEW_DROP_AFTER || position == GTK_TREE_VIEW_DROP_BEFORE)
&& (gtk_tree_path_get_depth (path_where_insert) == gtk_tree_path_get_depth (path_src))) {
gtk_tree_path_free (path_src);
gtk_tree_row_reference_free (reference);
-
+
row = g_list_next (row);
continue;
}
@@ -1706,25 +1706,25 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
gtk_tree_model_get (model, &iter_src, AUDIO_COMPOSITION_COLUMN_TYPE, &type,
AUDIO_COMPOSITION_COLUMN_LENGTH, &secs,
AUDIO_COMPOSITION_COLUMN_SIZE, &size, -1);
-
+
/* copy entry */
if ((iter = copy_entry_to (composition, &iter_src, iter_prev, position)) != NULL) {
GtkTreePath *path_parent = gtk_tree_path_copy (path_src);
-
+
if (gdk_drag_context_get_actions(dc) == GDK_ACTION_MOVE) {
/* remove source entry */
/*
* This shouldn't be able to happen anymore w/o folders
- if (gtk_tree_path_up (path_parent) && path_where_insert &&
+ if (gtk_tree_path_up (path_parent) && path_where_insert &&
!gtk_tree_path_is_descendant (path_where_insert, path_parent)) {
// update parent size and humansize
- GtkTreeIter iter_parent;
+ GtkTreeIter iter_parent;
guint64 old_size;
-
- gtk_tree_model_iter_parent (model, &iter_parent, &iter_src);
+
+ gtk_tree_model_iter_parent (model, &iter_parent, &iter_src);
gtk_tree_model_get (model, &iter_parent, AUDIO_COMPOSITION_COLUMN_SIZE, &old_size, -1);
-
- gtk_tree_store_set (GTK_TREE_STORE (model), &iter_parent,
+
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter_parent,
AUDIO_COMPOSITION_COLUMN_SIZE, old_size - size, -1);
}
*/
@@ -1733,7 +1733,7 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
} else {
xfburn_disc_usage_add_size (XFBURN_DISC_USAGE (priv->disc_usage), secs);
}
-
+
gtk_tree_path_free (path_parent);
g_free (iter_prev);
iter_prev = iter;
@@ -1743,16 +1743,16 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
gtk_tree_path_free (path_src);
gtk_tree_row_reference_free (reference);
-
+
row = g_list_next (row);
}
-
+
g_free (iter);
- g_list_free (selected_rows);
+ g_list_free (selected_rows);
gtk_drag_finish (dc, TRUE, FALSE, t);
-
+
if (path_where_insert)
- gtk_tree_path_free (path_where_insert);
+ gtk_tree_path_free (path_where_insert);
tracks_changed (composition);
gtk_widget_hide (priv->progress);
@@ -1767,7 +1767,7 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
int i;
xfburn_adding_progress_show (XFBURN_ADDING_PROGRESS (priv->progress));
-
+
full_paths = (gchar *) gtk_selection_data_get_text (sd);
files = g_strsplit ((gchar *) full_paths, "\n", -1);
@@ -1829,7 +1829,7 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
gtk_drag_finish (dc, FALSE, FALSE, t);
cb_adding_done (XFBURN_ADDING_PROGRESS (priv->progress), composition);
}
- }
+ }
else if (gtk_selection_data_get_target(sd) == gdk_atom_intern ("text/uri-list", FALSE)) {
GList *vfs_paths = NULL;
GList *vfs_path;
@@ -1897,7 +1897,7 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
gtk_drag_finish (dc, FALSE, FALSE, t);
xfburn_default_cursor (priv->content);
}
- }
+ }
else {
g_warning ("Trying to receive an unsupported drag target, this should not happen.");
gtk_drag_finish (dc, FALSE, FALSE, t);
@@ -1934,15 +1934,15 @@ thread_add_files_drag (ThreadAddFilesDragParams *params)
gdk_threads_enter ();
gtk_tree_model_get_iter (model, &iter_where_insert, priv->path_where_insert);
gdk_threads_leave ();
-
+
if (thread_add_file_to_list (composition, model, full_path, &iter, &iter_where_insert, position)) {
- if (position == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE
+ if (position == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE
|| position == GTK_TREE_VIEW_DROP_INTO_OR_AFTER)
gdk_threads_enter ();
gtk_tree_view_expand_row (GTK_TREE_VIEW (widget), priv->path_where_insert, FALSE);
gdk_threads_leave ();
}
-
+
} else {
thread_add_file_to_list (composition, model, full_path, &iter, NULL, position);
}
@@ -1981,7 +1981,7 @@ load_composition_start (GMarkupParseContext * context, const gchar * element_nam
gpointer data, GError ** error)
{
g_error ("This method needs to get fixed, and does not work right now!");
-
+
/*
LoadParserStruct * parserinfo = (LoadParserStruct *) data;
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (parserinfo->dc);
@@ -2002,8 +2002,8 @@ load_composition_start (GMarkupParseContext * context, const gchar * element_nam
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
parent = g_queue_peek_head (parserinfo->queue_iter);
-
- add_file_to_list_with_name (attribute_values[i], parserinfo->dc, model, attribute_values[j], &iter,
+
+ add_file_to_list_with_name (attribute_values[i], parserinfo->dc, model, attribute_values[j], &iter,
parent, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
}
} else if (!strcmp (element_name, "directory")) {
@@ -2015,8 +2015,8 @@ load_composition_start (GMarkupParseContext * context, const gchar * element_nam
GtkTreeModel *model;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
-
- //add_directory_to_list (attribute_values[i], parserinfo->dc, model, attribute_values[j], &iter, parent);
+
+ //add_directory_to_list (attribute_values[i], parserinfo->dc, model, attribute_values[j], &iter, parent);
}
}
*/
@@ -2026,13 +2026,13 @@ static void
load_composition_end (GMarkupParseContext * context, const gchar * element_name, gpointer user_data, GError ** error)
{
LoadParserStruct *parserinfo = (LoadParserStruct *) user_data;
-
+
if (!parserinfo->started)
return;
-
+
if (!strcmp (element_name, "xfburn-composition"))
parserinfo->started = FALSE;
-
+
if (!strcmp (element_name, "directory"))
parserinfo->queue_iter = g_queue_pop_head (parserinfo->queue_iter);
}
@@ -2089,7 +2089,7 @@ load_from_file (XfburnComposition * composition, const gchar * filename)
}
g_queue_free (parserinfo.queue_iter);
-
+
cleanup:
if (gpcontext)
g_markup_parse_context_free (gpcontext);
@@ -2125,20 +2125,20 @@ foreach_save (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, Comp
AudioCompositionEntryType type;
space = g_strnfill (gtk_tree_path_get_depth (path), '\t');
-
+
for (i = info->last_depth; i > gtk_tree_path_get_depth (path); i--) {
gchar *space2 = NULL;
space2 = g_strnfill (i - 1, '\t');
fprintf (info->file_content, "%s</directory>\n", space2);
-
+
g_free (space2);
}
-
+
gtk_tree_model_get (model, iter, AUDIO_COMPOSITION_COLUMN_CONTENT, &name,
AUDIO_COMPOSITION_COLUMN_PATH, &source_path,
AUDIO_COMPOSITION_COLUMN_TYPE, &type, -1);
-
+
fprintf (info->file_content, "%s", space);
switch (type) {
case AUDIO_COMPOSITION_TYPE_RAW:
@@ -2148,7 +2148,7 @@ foreach_save (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, Comp
info->last_depth = gtk_tree_path_get_depth (path);
-
+
g_free (space);
g_free (name);
g_free (source_path);
@@ -2164,13 +2164,13 @@ save_to_file (XfburnComposition * composition)
GtkTreeModel *model;
CompositionSaveInfo info;
gint i;
-
+
if (!(priv->filename)) {
priv->filename = g_strdup ("/tmp/gna");
-
+
g_signal_emit_by_name (G_OBJECT (composition), "name-changed", priv->filename);
}
-
+
file_content = fopen (priv->filename, "w+");
fprintf (file_content, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n");
fprintf (file_content, "<xfburn-composition version=\"0.1\">\n");
@@ -2185,10 +2185,10 @@ save_to_file (XfburnComposition * composition)
space2 = g_strnfill (i - 1, '\t');
fprintf (info.file_content, "%s</directory>\n", space2);
-
+
g_free (space2);
}
-
+
fprintf (file_content, "</xfburn-composition>\n");
fclose (file_content);
}
@@ -2202,12 +2202,12 @@ xfburn_audio_composition_new (void)
return g_object_new (xfburn_audio_composition_get_type (), NULL);
}
-void
+void
xfburn_audio_composition_add_files (XfburnAudioComposition *dc, GSList * filelist)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
ThreadAddFilesCLIParams *params;
-
+
if (filelist != NULL) {
params = g_new (ThreadAddFilesCLIParams, 1);
@@ -2226,7 +2226,7 @@ void
xfburn_audio_composition_hide_toolbar (XfburnAudioComposition * composition)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (composition);
-
+
gtk_widget_hide (priv->toolbar);
}
@@ -2234,7 +2234,7 @@ void
xfburn_audio_composition_show_toolbar (XfburnAudioComposition * composition)
{
XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (composition);
-
+
gtk_widget_show (priv->toolbar);
}
diff --git a/xfburn/xfburn-burn-image-dialog.c b/xfburn/xfburn-burn-image-dialog.c
index 21f039c..9e46380 100644
--- a/xfburn/xfburn-burn-image-dialog.c
+++ b/xfburn/xfburn-burn-image-dialog.c
@@ -66,7 +66,7 @@ typedef struct
{
GtkWidget *chooser_image;
GtkWidget *image_label;
-
+
GtkWidget *device_box;
GtkWidget *check_eject;
@@ -153,7 +153,7 @@ xfburn_burn_image_dialog_init (XfburnBurnImageDialog * obj)
{
GtkBox *box = GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG (obj)));
XfburnBurnImageDialogPrivate *priv = XFBURN_BURN_IMAGE_DIALOG_GET_PRIVATE (obj);
-
+
GdkPixbuf *icon = NULL;
GtkFileFilter *filter;
GtkWidget *frame;
@@ -168,7 +168,7 @@ xfburn_burn_image_dialog_init (XfburnBurnImageDialog * obj)
icon = gtk_icon_theme_load_icon ( gtk_icon_theme_get_default(), "stock_xfburn", x, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
gtk_window_set_icon (GTK_WINDOW (obj), icon);
g_object_unref (icon);
-
+
/* file */
priv->chooser_image = gtk_file_chooser_button_new (_("Image to burn"), GTK_FILE_CHOOSER_ACTION_OPEN);
gtk_widget_show (priv->chooser_image);
@@ -194,18 +194,18 @@ xfburn_burn_image_dialog_init (XfburnBurnImageDialog * obj)
frame = xfce_gtk_frame_box_new_with_content (_("Image to burn"), priv->chooser_image);
gtk_widget_show (frame);
gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
-
+
/* red label for image */
priv->image_label = gtk_label_new ("");
gtk_widget_show (priv->image_label);
gtk_box_pack_start (GTK_BOX (box), priv->image_label, FALSE, FALSE, 0);
update_image_label (GTK_FILE_CHOOSER (priv->chooser_image), obj);
g_signal_connect (G_OBJECT (priv->chooser_image), "selection-changed", G_CALLBACK (update_image_label), obj);
-
+
/* devices list */
priv->device_box = xfburn_device_box_new (SHOW_CD_WRITERS | SHOW_CDRW_WRITERS | SHOW_DVD_WRITERS | SHOW_MODE_SELECTION | SHOW_SPEED_SELECTION);
gtk_widget_show (priv->device_box);
-
+
frame = xfce_gtk_frame_box_new_with_content (_("Burning device"), priv->device_box);
gtk_widget_show (frame);
gtk_box_pack_start (box, frame, FALSE, FALSE, BORDER);
@@ -281,7 +281,7 @@ xfburn_burn_image_dialog_finalize (GObject *object)
/*************/
/* internals */
/*************/
-static gboolean
+static gboolean
prepare_params (ThreadBurnIsoParams *params, struct burn_drive *drive, gchar **failure_msg)
{
struct burn_write_opts * burn_options;
@@ -383,7 +383,7 @@ create_disc (ThreadBurnIsoParams *params, gchar **failure_msg)
*failure_msg = _("An error occurred in the burn backend");
return FALSE;
}
-
+
burn_session_add_track (params->session, params->track, BURN_POS_END);
return TRUE;
@@ -407,14 +407,14 @@ thread_burn_iso (ThreadBurnIsoParams * params)
// this assumes that an iso image can only have one track
sectors[0] = burn_disc_get_sectors (params->disc);
-
+
xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG (dialog_progress), XFBURN_PROGRESS_DIALOG_STATUS_RUNNING, _("Burning image..."));
fifos = g_new(struct burn_source *,1);
fifos[0] = params->fifo_src;
xfburn_perform_burn_write (dialog_progress, drive_info->drive, params->write_mode, params->burn_options, DATA_BYTES_PER_SECTOR, params->disc, fifos, sectors);
-
+
xfburn_device_release (drive_info, params->eject);
} else {
xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG (dialog_progress), _("Unable to grab the drive."));
@@ -432,7 +432,7 @@ thread_burn_iso (ThreadBurnIsoParams * params)
void
burn_image_dialog_error (XfburnBurnImageDialog * dialog, const gchar * msg_error)
{
- xfce_dialog_show_error (NULL, NULL, "%s", msg_error);
+ xfce_dialog_show_error (NULL, NULL, "%s", msg_error);
}
static void
@@ -466,7 +466,7 @@ cb_dialog_response (XfburnBurnImageDialog * dialog, gint response_id, gpointer u
priv->params->dialog_progress = dialog_progress;
gtk_widget_show (dialog_progress);
-
+
g_thread_new ("burn_iso", (GThreadFunc) thread_burn_iso, priv->params);
} else {
xfburn_main_leave_window ();
@@ -480,7 +480,7 @@ update_image_label (GtkFileChooser *chooser, XfburnBurnImageDialog * dialog)
if (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)) == NULL) {
gtk_label_set_markup (GTK_LABEL(priv->image_label),
- _("<span weight=\"bold\" foreground=\"darkred\" stretch=\"semiexpanded\">Please select an image to burn</span>"));
+ _("<span weight=\"bold\" foreground=\"darkred\" stretch=\"semiexpanded\">Please select an image to burn</span>"));
} else {
gtk_label_set_text (GTK_LABEL(priv->image_label), "");
check_burn_button (dialog);
@@ -506,7 +506,7 @@ check_burn_button (XfburnBurnImageDialog * dialog)
}
}
-static gboolean
+static gboolean
check_media (XfburnBurnImageDialog * dialog, ThreadBurnIsoParams *params, struct burn_drive *drive)
{
enum burn_disc_status disc_state;
@@ -525,7 +525,7 @@ check_media (XfburnBurnImageDialog * dialog, ThreadBurnIsoParams *params, struct
} else if (disc_state != BURN_DISC_BLANK) {
if (disc_state == BURN_DISC_FULL)
burn_image_dialog_error (dialog, _("Closed disc with data detected. Need blank or appendable disc"));
- else if (disc_state == BURN_DISC_EMPTY)
+ else if (disc_state == BURN_DISC_EMPTY)
burn_image_dialog_error (dialog, _("No disc detected in drive"));
else {
burn_image_dialog_error (dialog, _("Cannot recognize state of drive and disc"));
@@ -551,7 +551,7 @@ check_media (XfburnBurnImageDialog * dialog, ThreadBurnIsoParams *params, struct
return TRUE;
}
-static void
+static void
cb_clicked_ok (GtkButton *button, gpointer user_data)
{
XfburnBurnImageDialog * dialog = (XfburnBurnImageDialog *) user_data;
@@ -582,7 +582,7 @@ cb_clicked_ok (GtkButton *button, gpointer user_data)
device = xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box));
speed = xfburn_device_box_get_speed (XFBURN_DEVICE_BOX (priv->device_box));
write_mode = xfburn_device_box_get_mode (XFBURN_DEVICE_BOX (priv->device_box));
-
+
params = g_new0 (ThreadBurnIsoParams, 1);
params->device = device;
params->iso_path = iso_path;
@@ -592,7 +592,7 @@ cb_clicked_ok (GtkButton *button, gpointer user_data)
params->dummy = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_dummy));
params->burnfree = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_burnfree));
params->stream_recording = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_stream_recording));
-
+
if (!xfburn_device_grab (device, &drive_info)) {
burn_image_dialog_error (dialog, _("Unable to grab the drive."));
diff --git a/xfburn/xfburn-data-composition.c b/xfburn/xfburn-data-composition.c
index 8dcc5e4..b6f59d1 100644
--- a/xfburn/xfburn-data-composition.c
+++ b/xfburn/xfburn-data-composition.c
@@ -5,12 +5,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -140,20 +140,20 @@ static void thread_add_files_action (ThreadAddFilesActionParams *params);
static void thread_add_files_drag (ThreadAddFilesDragParams *params);
/* thread helpers */
-static gboolean thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc,
- GtkTreeModel * model, const gchar * path, GtkTreeIter * iter,
+static gboolean thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc,
+ GtkTreeModel * model, const gchar * path, GtkTreeIter * iter,
GtkTreeIter * insertion, GtkTreeViewDropPosition position);
-static gboolean thread_add_file_to_list (XfburnDataComposition * dc, GtkTreeModel * model, const gchar * path,
+static gboolean thread_add_file_to_list (XfburnDataComposition * dc, GtkTreeModel * model, const gchar * path,
GtkTreeIter * iter, GtkTreeIter * insertion, GtkTreeViewDropPosition position);
static void concat_free (char * msg, char ** combined_msg);
static IsoImage * generate_iso_image (XfburnDataComposition * dc);
static gboolean show_add_home_question_dialog (void);
-
+
typedef struct
{
gchar *filename;
gboolean modified;
-
+
guint n_new_directory;
GList *full_paths_to_add;
@@ -166,7 +166,7 @@ typedef struct
guint32 time;
void *thread_params;
-
+
GSimpleActionGroup *action_group;
GtkBuilder *ui_manager;
@@ -249,9 +249,9 @@ xfburn_data_composition_get_type (void)
NULL, /* interface_finalize */
NULL /* interface_data */
};
-
+
data_composition_type = g_type_register_static (GTK_TYPE_BOX, "XfburnDataComposition", &data_composition_info, 0);
-
+
g_type_add_interface_static (data_composition_type, XFBURN_TYPE_COMPOSITION, &composition_info);
}
@@ -264,9 +264,9 @@ xfburn_data_composition_class_init (XfburnDataCompositionClass * klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (XfburnDataCompositionPrivate));
-
+
parent_class = g_type_class_peek_parent (klass);
-
+
object_class->finalize = xfburn_data_composition_finalize;
}
@@ -299,7 +299,7 @@ xfburn_data_composition_init (XfburnDataComposition * composition)
GAction *action = NULL;
GdkScreen *screen;
GtkIconTheme *icon_theme;
-
+
const gchar ui_string[] = "<interface><menu id=\"popup-menu\">"
"<section>"
"<item><attribute name=\"action\">win.create-dir</attribute><attribute name=\"label\">Create directory</attribute></item>"
@@ -317,7 +317,7 @@ xfburn_data_composition_init (XfburnDataComposition * composition)
priv->full_paths_to_add = NULL;
instances++;
-
+
/* initialize static members */
screen = gtk_widget_get_screen (GTK_WIDGET (composition));
icon_theme = gtk_icon_theme_get_for_screen (screen);
@@ -341,7 +341,7 @@ xfburn_data_composition_init (XfburnDataComposition * composition)
hbox_toolbar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
gtk_box_pack_start (GTK_BOX (composition), hbox_toolbar, FALSE, TRUE, 0);
gtk_widget_show (hbox_toolbar);
-
+
/* toolbar */
/* model_toolbar = exo_toolbars_model_new ();
exo_toolbars_model_set_actions (model_toolbar, (gchar **) toolbar_actions, G_N_ELEMENTS (toolbar_actions));
@@ -376,24 +376,24 @@ xfburn_data_composition_init (XfburnDataComposition * composition)
gtk_box_pack_start (GTK_BOX (hbox_toolbar), priv->toolbar, TRUE, TRUE, 0);
gtk_widget_show_all (priv->toolbar);
-
+
/* volume name */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 10);
gtk_box_pack_start (GTK_BOX (hbox_toolbar), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
-
+
label = gtk_label_new (_("Volume name :"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
-
+
priv->entry_volume_name = gtk_entry_new ();
set_default_name (composition);
gtk_box_pack_start (GTK_BOX (hbox), priv->entry_volume_name, FALSE, FALSE, 0);
gtk_widget_show (priv->entry_volume_name);
-
+
/* content treeview */
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@@ -405,7 +405,7 @@ xfburn_data_composition_init (XfburnDataComposition * composition)
model = gtk_tree_store_new (DATA_COMPOSITION_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_UINT64, G_TYPE_STRING, G_TYPE_UINT);
priv->model = model;
-
+
gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (model), DATA_COMPOSITION_COLUMN_CONTENT,
directory_tree_sortfunc, NULL, NULL);
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), DATA_COMPOSITION_COLUMN_CONTENT, GTK_SORT_ASCENDING);
@@ -452,9 +452,9 @@ xfburn_data_composition_init (XfburnDataComposition * composition)
g_signal_connect (G_OBJECT (priv->content), "button-press-event",
G_CALLBACK (cb_treeview_button_pressed), composition);
g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (cb_selection_changed), composition);
-
+
/* adding progress window */
- priv->progress = GTK_WIDGET (xfburn_adding_progress_new ());
+ priv->progress = GTK_WIDGET (xfburn_adding_progress_new ());
g_signal_connect (G_OBJECT (priv->progress), "adding-done", G_CALLBACK (cb_adding_done), composition);
gtk_window_set_transient_for (GTK_WINDOW (priv->progress), GTK_WINDOW (xfburn_main_window_get_instance ()));
/* FIXME: progress should have a busy cursor */
@@ -474,7 +474,7 @@ xfburn_data_composition_init (XfburnDataComposition * composition)
GDK_ACTION_COPY | GDK_ACTION_MOVE);
g_signal_connect (G_OBJECT (priv->content), "drag-data-received", G_CALLBACK (cb_content_drag_data_rcv),
composition);
-
+
action = g_action_map_lookup_action (G_ACTION_MAP (priv->action_group), "remove-file");
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
}
@@ -483,9 +483,9 @@ static void
xfburn_data_composition_finalize (GObject * object)
{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (object);
-
+
g_free (priv->filename);
-
+
/* free static members */
instances--;
if (instances == 0) {
@@ -500,7 +500,7 @@ xfburn_data_composition_finalize (GObject * object)
}
g_object_unref (priv->model);
-
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -532,7 +532,7 @@ cb_begin_burn (XfburnDataDiscUsage * du, XfburnDataComposition * dc)
}
image = generate_iso_image (XFBURN_DATA_COMPOSITION (dc));
-
+
switch (xfburn_disc_usage_get_disc_type (XFBURN_DISC_USAGE (du))) {
case CD_DISC:
dialog = xfburn_burn_data_cd_composition_dialog_new (image, has_default_name (dc));
@@ -564,7 +564,7 @@ cb_selection_changed (GtkTreeSelection *selection, XfburnDataComposition * dc)
g_action_map_lookup_action (G_ACTION_MAP (priv->action_group), "create-dir"),
g_action_map_lookup_action (G_ACTION_MAP (priv->action_group), "remove-file"),
};
-
+
n_selected_rows = gtk_tree_selection_count_selected_rows (selection);
if (n_selected_rows == 0) {
g_simple_action_set_enabled (G_SIMPLE_ACTION (action[0]), TRUE);
@@ -585,10 +585,10 @@ static gboolean
cb_treeview_button_pressed (GtkTreeView * treeview, GdkEventButton * event, XfburnDataComposition * dc)
{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
-
+
if ((event->button == 1) && (event->type == GDK_BUTTON_PRESS)) {
GtkTreePath *path;
-
+
if (gtk_tree_view_get_path_at_pos (treeview, event->x, event->y, &path, NULL, NULL, NULL)) {
gtk_tree_path_free (path);
} else {
@@ -597,10 +597,10 @@ cb_treeview_button_pressed (GtkTreeView * treeview, GdkEventButton * event, Xfbu
selection = gtk_tree_view_get_selection (treeview);
gtk_tree_selection_unselect_all (selection);
}
-
+
return FALSE;
}
-
+
if ((event->button == 3) && (event->type == GDK_BUTTON_PRESS)) {
GtkTreeSelection *selection;
GtkTreePath *path;
@@ -673,14 +673,14 @@ file_exists_on_same_level (GtkTreeModel * model, GtkTreePath * path, gboolean sk
{
GtkTreePath *current_path = NULL;
GtkTreeIter current_iter;
-
+
current_path = gtk_tree_path_copy (path);
for (;gtk_tree_path_prev (current_path););
-
+
if (gtk_tree_model_get_iter (model, ¤t_iter, current_path)) {
do {
gchar *current_filename = NULL;
-
+
if (skip_path && gtk_tree_path_compare (path, current_path) == 0) {
gtk_tree_path_next (current_path);
continue;
@@ -692,12 +692,12 @@ file_exists_on_same_level (GtkTreeModel * model, GtkTreePath * path, gboolean sk
gtk_tree_path_free (current_path);
return TRUE;
}
-
+
g_free (current_filename);
gtk_tree_path_next (current_path);
} while (gtk_tree_model_iter_next (model, ¤t_iter));
}
-
+
gtk_tree_path_free (current_path);
return FALSE;
}
@@ -706,7 +706,7 @@ static void
cb_cell_file_edited (GtkCellRenderer * renderer, gchar * path, gchar * newtext, XfburnDataComposition * dc)
{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
-
+
GtkTreeIter iter;
GtkTreeModel *model;
GtkTreePath *real_path;
@@ -715,7 +715,7 @@ cb_cell_file_edited (GtkCellRenderer * renderer, gchar * path, gchar * newtext,
xfce_dialog_show_error (NULL, NULL, _("You must give a name to the file."));
return;
}
-
+
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
real_path = gtk_tree_path_new_from_string (path);
@@ -762,7 +762,7 @@ static void
action_rename_selection (GSimpleAction *action, GVariant *param, XfburnDataComposition *dc)
{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
-
+
GtkTreeSelection *selection;
GtkTreeModel *model;
GList *list;
@@ -775,7 +775,7 @@ action_rename_selection (GSimpleAction *action, GVariant *param, XfburnDataCompo
path = (GtkTreePath *) list->data;
column = gtk_tree_view_get_column (GTK_TREE_VIEW (priv->content), DATA_COMPOSITION_COLUMN_CONTENT - 1);
/* -1 because of COLUMN_ICON */
-
+
gtk_tree_view_set_cursor (GTK_TREE_VIEW (priv->content), path, column, TRUE);
gtk_tree_path_free (path);
@@ -786,7 +786,7 @@ static void
action_create_directory (GSimpleAction *action, GVariant *param, XfburnDataComposition *dc)
{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
-
+
GtkTreeModel *model;
GtkTreeSelection *selection;
GList *selected_paths = NULL;
@@ -794,30 +794,30 @@ action_create_directory (GSimpleAction *action, GVariant *param, XfburnDataCompo
GtkTreeIter iter_where_insert, iter_directory;
DataCompositionEntryType type = -1;
gchar *humansize = NULL;
-
+
GtkTreePath *inserted_path = NULL;
gchar *directory_text = NULL;
-
+
GtkTreeViewColumn *column;
GtkTreePath *path = NULL;
-
+
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->content));
selected_paths = gtk_tree_selection_get_selected_rows (selection, NULL);
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
-
+
if (selected_paths) {
path_where_insert = (GtkTreePath *) (selected_paths->data);
gtk_tree_model_get_iter (model, &iter_where_insert, path_where_insert);
gtk_tree_model_get (model, &iter_where_insert, DATA_COMPOSITION_COLUMN_TYPE, &type, -1);
}
-
+
if (type == DATA_COMPOSITION_TYPE_DIRECTORY) {
gtk_tree_store_append (GTK_TREE_STORE (model), &iter_directory, &iter_where_insert);
gtk_tree_view_expand_row (GTK_TREE_VIEW (priv->content), path_where_insert, FALSE);
} else if (type == DATA_COMPOSITION_TYPE_FILE) {
GtkTreeIter parent;
-
+
if (gtk_tree_model_iter_parent (model, &parent, &iter_where_insert))
gtk_tree_store_append (GTK_TREE_STORE (model), &iter_directory, &parent);
else
@@ -825,34 +825,34 @@ action_create_directory (GSimpleAction *action, GVariant *param, XfburnDataCompo
} else {
gtk_tree_store_append (GTK_TREE_STORE (model), &iter_directory, NULL);
}
-
+
humansize = xfburn_humanreadable_filesize (4);
-
+
inserted_path = gtk_tree_model_get_path (model, &iter_directory);
if (file_exists_on_same_level (model, inserted_path, TRUE, _("New directory")))
directory_text = g_strdup_printf ("%s %d", _("New directory"), ++(priv->n_new_directory));
else
directory_text = g_strdup (_("New directory"));
gtk_tree_path_free (inserted_path);
-
+
gtk_tree_store_set (GTK_TREE_STORE (model), &iter_directory,
- DATA_COMPOSITION_COLUMN_ICON, icon_directory,
+ DATA_COMPOSITION_COLUMN_ICON, icon_directory,
DATA_COMPOSITION_COLUMN_CONTENT, directory_text,
DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize,
DATA_COMPOSITION_COLUMN_SIZE, (guint64) 4,
DATA_COMPOSITION_COLUMN_TYPE, DATA_COMPOSITION_TYPE_DIRECTORY, -1);
g_free (directory_text);
g_free (humansize);
-
+
xfburn_disc_usage_add_size (XFBURN_DISC_USAGE (priv->disc_usage), 4);
-
+
gtk_widget_realize (priv->content);
-
+
/* put the cell renderer in edition mode */
column = gtk_tree_view_get_column (GTK_TREE_VIEW (priv->content), DATA_COMPOSITION_COLUMN_CONTENT - 1);
/* -1 because of COLUMN_ICON */
path = gtk_tree_model_get_path (model, &iter_directory);
-
+
gtk_tree_view_set_cursor (GTK_TREE_VIEW (priv->content), path, column, TRUE);
gtk_tree_path_free (path);
}
@@ -862,17 +862,17 @@ remove_row_reference (GtkTreeRowReference *reference, XfburnDataCompositionPriva
{
GtkTreePath *path = NULL;
GtkTreeModel *model;
-
+
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
-
+
path = gtk_tree_row_reference_get_path (reference);
if (path) {
GtkTreeIter iter;
-
+
if (gtk_tree_model_get_iter (model, &iter, path)) {
GtkTreeIter parent, iter_temp;
guint64 size = 0;
-
+
gtk_tree_model_get (model, &iter, DATA_COMPOSITION_COLUMN_SIZE, &size, -1);
xfburn_disc_usage_sub_size (XFBURN_DISC_USAGE (priv->disc_usage), size);
@@ -885,7 +885,7 @@ remove_row_reference (GtkTreeRowReference *reference, XfburnDataCompositionPriva
gtk_tree_model_get (model, &parent, DATA_COMPOSITION_COLUMN_SIZE, &old_size, -1);
humansize = xfburn_humanreadable_filesize (old_size - size);
- gtk_tree_store_set (GTK_TREE_STORE (model), &parent,
+ gtk_tree_store_set (GTK_TREE_STORE (model), &parent,
DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize,
DATA_COMPOSITION_COLUMN_SIZE, old_size - size, -1);
@@ -893,13 +893,13 @@ remove_row_reference (GtkTreeRowReference *reference, XfburnDataCompositionPriva
g_free (humansize);
}
-
+
gtk_tree_store_remove (GTK_TREE_STORE (model), &iter);
}
-
+
gtk_tree_path_free (path);
}
-
+
gtk_tree_row_reference_free (reference);
}
@@ -907,12 +907,12 @@ static void
action_remove_selection (GSimpleAction *action, GVariant *param, XfburnDataComposition *dc)
{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
-
+
GtkTreeSelection *selection;
GtkTreeModel *model;
GList *list_paths = NULL, *el;
GList *references = NULL;
-
+
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->content));
list_paths = gtk_tree_selection_get_selected_rows (selection, &model);
@@ -920,18 +920,18 @@ action_remove_selection (GSimpleAction *action, GVariant *param, XfburnDataCompo
while (el) {
GtkTreePath *path = NULL;
GtkTreeRowReference *reference = NULL;
-
+
path = (GtkTreePath *) el->data;
reference = gtk_tree_row_reference_new (model, path);
gtk_tree_path_free (path);
-
+
if (reference)
references = g_list_prepend (references, reference);
-
+
el = g_list_next (el);
- }
+ }
g_list_free (list_paths);
-
+
g_list_foreach (references, (GFunc) remove_row_reference, priv);
g_list_free (references);
}
@@ -942,7 +942,7 @@ add_cb (GtkWidget * widget, gpointer data)
XfburnDataComposition * dc = XFBURN_DATA_COMPOSITION(data);
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
gchar *selected_files = NULL;
-
+
GSList *list = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER (priv->add_filechooser));
GString * str = g_string_new(NULL);
GSList * curr;
@@ -1018,7 +1018,7 @@ action_add_or_select (GSimpleAction *action, GVariant *param, XfburnDataComposit
{
if (xfburn_settings_get_boolean("show-filebrowser", FALSE)) {
XfburnFileBrowser *browser = xfburn_main_window_get_file_browser (xfburn_main_window_get_instance ());
-
+
add_files (xfburn_file_browser_get_selection (browser), dc);
} else {
select_files(dc);
@@ -1042,23 +1042,23 @@ add_files(gchar * selected_files, XfburnDataComposition *dc)
params->dc = dc;
params->type = -1;
priv->path_where_insert = NULL;
-
+
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->content));
selected_paths = gtk_tree_selection_get_selected_rows (selection, NULL);
params->model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
-
+
if (selected_paths) {
priv->path_where_insert = gtk_tree_path_copy ((GtkTreePath *) (selected_paths->data));
gtk_tree_model_get_iter (params->model, ¶ms->iter_where_insert, priv->path_where_insert);
gtk_tree_model_get (params->model, ¶ms->iter_where_insert, DATA_COMPOSITION_COLUMN_TYPE, ¶ms->type, -1);
}
-
+
priv->selected_files = selected_files;
priv->thread_params = params;
g_thread_new ("data_add_files", (GThreadFunc) thread_add_files_action, params);
-
+
g_list_foreach (selected_paths, (GFunc) gtk_tree_path_free, NULL);
g_list_free (selected_paths);
}
@@ -1106,12 +1106,12 @@ static void
action_clear (GSimpleAction *action, GVariant *param, XfburnDataComposition *dc)
{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
-
+
GtkTreeModel *model;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
gtk_tree_store_clear (GTK_TREE_STORE (model));
-
+
set_default_name (dc);
xfburn_disc_usage_set_size (XFBURN_DISC_USAGE (priv->disc_usage), 0);
@@ -1140,7 +1140,7 @@ cb_content_drag_data_get (GtkWidget * widget, GdkDragContext * dc,
gtk_tree_path_free (temp);
references = g_list_prepend (references, reference);
-
+
row = g_list_next (row);
}
@@ -1159,12 +1159,12 @@ set_modified (XfburnDataCompositionPrivate *priv)
XfburnMainWindow *mainwin;
GtkUIManager *ui_manager;
GtkActionGroup *action_group;
-
+
mainwin = xfburn_main_window_get_instance ();
ui_manager = xfburn_main_window_get_ui_manager (mainwin);
-
+
action_group = (GtkActionGroup *) gtk_ui_manager_get_action_groups (ui_manager)->data;
-
+
action = gtk_action_group_get_action (action_group, "save-composition");
gtk_action_set_sensitive (GTK_ACTION (action), TRUE);
*/
@@ -1173,12 +1173,12 @@ set_modified (XfburnDataCompositionPrivate *priv)
}
static gboolean
-thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc,
+thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc,
GtkTreeModel * model, const gchar * path,
GtkTreeIter * iter, GtkTreeIter * insertion, GtkTreeViewDropPosition position)
{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
-
+
struct stat s;
if ((g_lstat (path, &s) == 0)) {
@@ -1190,9 +1190,9 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc
if (!(S_ISDIR (s.st_mode) ||S_ISREG (s.st_mode) || S_ISCHR(s.st_mode) || S_ISBLK(s.st_mode) || S_ISLNK (s.st_mode))) {
return FALSE;
}
-
+
xfburn_adding_progress_pulse (XFBURN_ADDING_PROGRESS (priv->progress));
-
+
/* ensure that we can only drop on top of folders, not files */
if (insertion) {
gdk_threads_enter ();
@@ -1205,7 +1205,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc
position = GTK_TREE_VIEW_DROP_AFTER;
else if (position == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE)
position = GTK_TREE_VIEW_DROP_BEFORE;
- }
+ }
}
/* find parent */
@@ -1214,7 +1214,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc
case GTK_TREE_VIEW_DROP_AFTER:
if (insertion) {
GtkTreeIter iter_parent;
-
+
gdk_threads_enter ();
if (gtk_tree_model_iter_parent (model, &iter_parent, insertion)) {
parent = g_new0 (GtkTreeIter, 1);
@@ -1229,7 +1229,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc
memcpy (parent, insertion, sizeof (GtkTreeIter));
break;
}
-
+
/* check if the filename is valid */
gdk_threads_enter ();
if (parent) {
@@ -1238,7 +1238,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc
} else {
tree_path = gtk_tree_path_new_first ();
}
-
+
if (file_exists_on_same_level (model, tree_path, FALSE, name)) {
xfce_dialog_show_error (NULL, NULL, _("A file with the same name is already present in the composition."));
@@ -1249,7 +1249,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc
}
gtk_tree_path_free (tree_path);
gdk_threads_leave ();
-
+
/* new directory */
if (S_ISDIR (s.st_mode) && !S_ISLNK (s.st_mode)) {
GDir *dir = NULL;
@@ -1263,7 +1263,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc
g_error_free (error);
g_free (parent);
-
+
return FALSE;
}
@@ -1273,7 +1273,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc
gtk_tree_store_set (GTK_TREE_STORE (model), iter,
DATA_COMPOSITION_COLUMN_ICON, icon_directory,
DATA_COMPOSITION_COLUMN_CONTENT, name,
- DATA_COMPOSITION_COLUMN_TYPE, DATA_COMPOSITION_TYPE_DIRECTORY,
+ DATA_COMPOSITION_COLUMN_TYPE, DATA_COMPOSITION_TYPE_DIRECTORY,
DATA_COMPOSITION_COLUMN_PATH, path,
DATA_COMPOSITION_COLUMN_SIZE, (guint64) 4, -1);
xfburn_disc_usage_add_size (XFBURN_DISC_USAGE (priv->disc_usage), (guint64) 4);
@@ -1283,7 +1283,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc
GtkTreeIter new_iter;
gchar *new_path = NULL;
- new_path = g_build_filename (path, filename, NULL);
+ new_path = g_build_filename (path, filename, NULL);
if (new_path) {
guint64 size;
@@ -1291,9 +1291,9 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc
gdk_threads_enter ();
gtk_tree_model_get (model, &new_iter, DATA_COMPOSITION_COLUMN_SIZE, &size, -1);
gdk_threads_leave ();
- total_size += size;
+ total_size += size;
}
-
+
g_free (new_path);
}
}
@@ -1354,7 +1354,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc
DATA_COMPOSITION_COLUMN_ICON, (G_IS_OBJECT (mime_icon_pixbuf) ? mime_icon_pixbuf : icon_file),
DATA_COMPOSITION_COLUMN_CONTENT, name,
DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize,
- DATA_COMPOSITION_COLUMN_SIZE, (guint64) s.st_size,
+ DATA_COMPOSITION_COLUMN_SIZE, (guint64) s.st_size,
DATA_COMPOSITION_COLUMN_PATH, path,
DATA_COMPOSITION_COLUMN_TYPE, DATA_COMPOSITION_TYPE_FILE, -1);
@@ -1372,7 +1372,7 @@ thread_add_file_to_list_with_name (const gchar *name, XfburnDataComposition * dc
set_modified (priv);
return TRUE;
}
-
+
return FALSE;
}
@@ -1394,7 +1394,7 @@ thread_add_files_cli (ThreadAddFilesCLIParams *params)
gchar * full_path = (gchar *) list_iter->data;
g_message ("Adding %s to the data composition... (might take a while)", full_path);
- thread_add_file_to_list (params->dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
+ thread_add_file_to_list (params->dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
g_free (full_path);
}
@@ -1439,7 +1439,7 @@ thread_add_files_action (ThreadAddFilesActionParams *params)
for (i=0; files[i] != NULL && files[i][0] != '\0'; i++) {
GtkTreeIter iter;
gchar *full_path = NULL;
-
+
if (g_str_has_prefix (files[i], "file://"))
full_path = g_build_filename (&files[i][7], NULL);
else if (g_str_has_prefix (files[i], "file:"))
@@ -1461,24 +1461,24 @@ thread_add_files_action (ThreadAddFilesActionParams *params)
if (params->type == DATA_COMPOSITION_TYPE_DIRECTORY) {
guint64 old_size, size;
gchar *humansize = NULL;
-
+
thread_add_file_to_list (dc, model, full_path, &iter, &iter_where_insert, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
gdk_threads_enter ();
gtk_tree_view_expand_row (GTK_TREE_VIEW (priv->content), path_where_insert, FALSE);
-
+
/* update parent directory size */
gtk_tree_model_get (model, &iter_where_insert, DATA_COMPOSITION_COLUMN_SIZE, &old_size, -1);
gtk_tree_model_get (model, &iter, DATA_COMPOSITION_COLUMN_SIZE, &size, -1);
gdk_threads_leave ();
-
+
humansize = xfburn_humanreadable_filesize (old_size + size);
-
+
gdk_threads_enter ();
- gtk_tree_store_set (GTK_TREE_STORE (model), &iter_where_insert,
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter_where_insert,
DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize,
DATA_COMPOSITION_COLUMN_SIZE, old_size + size, -1);
gdk_threads_leave ();
-
+
g_free (humansize);
} else if (params->type == DATA_COMPOSITION_TYPE_FILE) {
GtkTreeIter parent;
@@ -1487,15 +1487,15 @@ thread_add_files_action (ThreadAddFilesActionParams *params)
gdk_threads_enter ();
has_parent = gtk_tree_model_iter_parent (model, &parent, &iter_where_insert);
gdk_threads_leave ();
-
+
if (has_parent)
- thread_add_file_to_list (dc, model, full_path, &iter, &parent, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
- else
- thread_add_file_to_list (dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
+ thread_add_file_to_list (dc, model, full_path, &iter, &parent, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
+ else
+ thread_add_file_to_list (dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
} else {
- thread_add_file_to_list (dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
+ thread_add_file_to_list (dc, model, full_path, &iter, NULL, GTK_TREE_VIEW_DROP_AFTER);
}
-
+
g_free (full_path);
}
/* end if files */
@@ -1506,13 +1506,13 @@ thread_add_files_action (ThreadAddFilesActionParams *params)
}
static gboolean
-thread_add_file_to_list (XfburnDataComposition * dc, GtkTreeModel * model,
+thread_add_file_to_list (XfburnDataComposition * dc, GtkTreeModel * model,
const gchar * path, GtkTreeIter * iter, GtkTreeIter * insertion, GtkTreeViewDropPosition position)
{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
struct stat s;
gboolean ret = FALSE;
-
+
if (xfburn_adding_progress_is_aborted (XFBURN_ADDING_PROGRESS (priv->progress))) {
DBG ("Adding aborted");
xfburn_adding_progress_done (XFBURN_ADDING_PROGRESS (priv->progress));
@@ -1524,9 +1524,9 @@ thread_add_file_to_list (XfburnDataComposition * dc, GtkTreeModel * model,
gchar *basename = NULL;
basename = g_path_get_basename (path);
-
+
ret = thread_add_file_to_list_with_name (basename, dc, model, path, iter, insertion, position);
-
+
g_free (basename);
}
@@ -1537,12 +1537,12 @@ static gboolean
copy_entry_to (XfburnDataComposition *dc, GtkTreeIter *src, GtkTreeIter *dest, GtkTreeViewDropPosition position)
{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
-
+
gboolean ret = FALSE;
-
+
GtkTreeModel *model;
GtkTreeIter iter_new;
-
+
GdkPixbuf *icon = NULL;
gchar *name = NULL;
gchar *humansize = NULL;
@@ -1551,17 +1551,17 @@ copy_entry_to (XfburnDataComposition *dc, GtkTreeIter *src, GtkTreeIter *dest, G
DataCompositionEntryType type;
GtkTreePath *path_level = NULL;
-
+
guint n_children = 0;
guint i;
GtkTreePath *path_src = NULL;
-
+
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
-
+
gtk_tree_model_get (model, src, DATA_COMPOSITION_COLUMN_ICON, &icon, DATA_COMPOSITION_COLUMN_CONTENT, &name,
DATA_COMPOSITION_COLUMN_HUMANSIZE, &humansize, DATA_COMPOSITION_COLUMN_SIZE, &size,
DATA_COMPOSITION_COLUMN_PATH, &path, DATA_COMPOSITION_COLUMN_TYPE, &type, -1);
-
+
switch (position) {
case GTK_TREE_VIEW_DROP_BEFORE:
case GTK_TREE_VIEW_DROP_AFTER:
@@ -1575,23 +1575,23 @@ copy_entry_to (XfburnDataComposition *dc, GtkTreeIter *src, GtkTreeIter *dest, G
} else {
path_level = gtk_tree_path_new_first ();
}
-
+
if (file_exists_on_same_level (model, path_level, FALSE, name)) {
xfce_dialog_show_warning(NULL, NULL, _("A file named \"%s\" already exists in this directory, the file hasn't been added."), name);
goto cleanup;
}
-
+
gtk_tree_path_free (path_level);
-
- gtk_tree_store_append (GTK_TREE_STORE (model), &iter_new, dest);
+
+ gtk_tree_store_append (GTK_TREE_STORE (model), &iter_new, dest);
break;
}
-
- gtk_tree_store_set (GTK_TREE_STORE (model), &iter_new, DATA_COMPOSITION_COLUMN_ICON, icon,
+
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter_new, DATA_COMPOSITION_COLUMN_ICON, icon,
DATA_COMPOSITION_COLUMN_CONTENT, name, DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize,
DATA_COMPOSITION_COLUMN_SIZE, size, DATA_COMPOSITION_COLUMN_PATH, path,
DATA_COMPOSITION_COLUMN_TYPE, type, -1);
-
+
/* copy children */
n_children = gtk_tree_model_iter_n_children (model, src);
@@ -1605,32 +1605,32 @@ copy_entry_to (XfburnDataComposition *dc, GtkTreeIter *src, GtkTreeIter *dest, G
path_src = gtk_tree_model_get_path (model, src);
if (n_children > 0 && gtk_tree_view_row_expanded (GTK_TREE_VIEW (priv->content), path_src)) {
GtkTreePath *path_new = NULL;
-
+
path_new = gtk_tree_model_get_path (model, &iter_new);
gtk_tree_view_expand_row (GTK_TREE_VIEW (priv->content), path_new, FALSE);
-
+
gtk_tree_path_free (path_new);
}
gtk_tree_path_free (path_src);
-
+
ret = TRUE;
-
+
cleanup:
if (G_LIKELY (G_IS_OBJECT (icon)))
g_object_unref (icon);
g_free (name);
g_free (humansize);
g_free (path);
-
+
return ret;
}
static void
cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guint y, GtkSelectionData * sd,
guint info, guint t, XfburnDataComposition * composition)
-{
+{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (composition);
-
+
GtkTreeModel *model;
GtkTreePath *path_where_insert = NULL;
GtkTreeViewDropPosition position;
@@ -1638,11 +1638,11 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
g_return_if_fail (sd);
g_return_if_fail (gtk_selection_data_get_data (sd));
-
+
model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
-
+
gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), x, y, &path_where_insert, &position);
-
+
xfburn_busy_cursor (priv->content);
/* move a selection inside of the composition window */
@@ -1650,27 +1650,27 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
GList *row = NULL, *selected_rows = NULL;
GtkTreeIter *iter = NULL;
DataCompositionEntryType type_dest = -1;
-
+
xfburn_adding_progress_show (XFBURN_ADDING_PROGRESS (priv->progress));
row = selected_rows = *((GList **) gtk_selection_data_get_data(sd));
-
+
if (path_where_insert) {
gtk_tree_model_get_iter (model, &iter_where_insert, path_where_insert);
iter = &iter_where_insert;
-
+
gtk_tree_model_get (model, &iter_where_insert, DATA_COMPOSITION_COLUMN_TYPE, &type_dest, -1);
-
+
if (type_dest == DATA_COMPOSITION_TYPE_FILE) {
if (position == GTK_TREE_VIEW_DROP_INTO_OR_AFTER)
position = GTK_TREE_VIEW_DROP_AFTER;
else if (position == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE)
position = GTK_TREE_VIEW_DROP_BEFORE;
- }
+ }
} else {
position = GTK_TREE_VIEW_DROP_INTO_OR_AFTER;
}
-
+
/* copy selection */
while (row) {
GtkTreePath *path_src = NULL;
@@ -1678,33 +1678,33 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
GtkTreeRowReference *reference = NULL;
DataCompositionEntryType type;
guint64 size = 0;
-
+
reference = (GtkTreeRowReference *) row->data;
-
+
path_src = gtk_tree_row_reference_get_path (reference);
if (!path_src) {
gtk_tree_row_reference_free (reference);
-
+
row = g_list_next (row);
continue;
}
-
- if (path_where_insert && (position == GTK_TREE_VIEW_DROP_AFTER || position == GTK_TREE_VIEW_DROP_BEFORE)
+
+ if (path_where_insert && (position == GTK_TREE_VIEW_DROP_AFTER || position == GTK_TREE_VIEW_DROP_BEFORE)
&& (gtk_tree_path_get_depth (path_where_insert) == gtk_tree_path_get_depth (path_src))) {
gtk_tree_path_free (path_src);
gtk_tree_row_reference_free (reference);
-
+
row = g_list_next (row);
continue;
}
- if (path_where_insert && type == DATA_COMPOSITION_TYPE_DIRECTORY
+ if (path_where_insert && type == DATA_COMPOSITION_TYPE_DIRECTORY
&& gtk_tree_path_is_descendant (path_where_insert, path_src)) {
gtk_tree_path_free (path_src);
gtk_tree_path_free (path_where_insert);
gtk_tree_row_reference_free (reference);
-
+
gtk_drag_finish (dc, FALSE, FALSE, t);
return;
}
@@ -1712,64 +1712,64 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
gtk_tree_model_get_iter (model, &iter_src, path_src);
gtk_tree_model_get (model, &iter_src, DATA_COMPOSITION_COLUMN_TYPE, &type,
DATA_COMPOSITION_COLUMN_SIZE, &size, -1);
-
+
/* copy entry */
- if (copy_entry_to (composition, &iter_src, iter, position)) {
+ if (copy_entry_to (composition, &iter_src, iter, position)) {
GtkTreePath *path_parent = gtk_tree_path_copy (path_src);
-
+
/* update new parent size */
- if (iter && (position == GTK_TREE_VIEW_DROP_INTO_OR_AFTER
+ if (iter && (position == GTK_TREE_VIEW_DROP_INTO_OR_AFTER
|| position == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE)) {
guint64 old_size = 0;
gchar *parent_humansize = NULL;
gtk_tree_model_get (model, iter, DATA_COMPOSITION_COLUMN_SIZE, &old_size, -1);
-
+
parent_humansize = xfburn_humanreadable_filesize (old_size + size);
gtk_tree_store_set (GTK_TREE_STORE (model), iter, DATA_COMPOSITION_COLUMN_HUMANSIZE, parent_humansize,
DATA_COMPOSITION_COLUMN_SIZE, old_size + size, -1);
-
+
g_free (parent_humansize);
}
-
+
if (gdk_drag_context_get_actions(dc) == GDK_ACTION_MOVE) {
/* remove source entry */
- if (gtk_tree_path_up (path_parent) && path_where_insert &&
+ if (gtk_tree_path_up (path_parent) && path_where_insert &&
!gtk_tree_path_is_descendant (path_where_insert, path_parent)) {
/* update parent size and humansize */
- GtkTreeIter iter_parent;
+ GtkTreeIter iter_parent;
guint64 old_size;
gchar *parent_humansize = NULL;
-
- gtk_tree_model_iter_parent (model, &iter_parent, &iter_src);
+
+ gtk_tree_model_iter_parent (model, &iter_parent, &iter_src);
gtk_tree_model_get (model, &iter_parent, DATA_COMPOSITION_COLUMN_SIZE, &old_size, -1);
-
+
parent_humansize = xfburn_humanreadable_filesize (old_size - size);
- gtk_tree_store_set (GTK_TREE_STORE (model), &iter_parent,
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter_parent,
DATA_COMPOSITION_COLUMN_HUMANSIZE, parent_humansize,
DATA_COMPOSITION_COLUMN_SIZE, old_size - size, -1);
g_free (parent_humansize);
}
-
+
gtk_tree_store_remove (GTK_TREE_STORE (model), &iter_src);
} else {
xfburn_disc_usage_add_size (XFBURN_DISC_USAGE (priv->disc_usage), size);
}
-
+
gtk_tree_path_free (path_parent);
}
gtk_tree_path_free (path_src);
gtk_tree_row_reference_free (reference);
-
+
row = g_list_next (row);
}
-
- g_list_free (selected_rows);
+
+ g_list_free (selected_rows);
gtk_drag_finish (dc, TRUE, FALSE, t);
-
+
if (path_where_insert)
- gtk_tree_path_free (path_where_insert);
+ gtk_tree_path_free (path_where_insert);
gtk_widget_hide (priv->progress);
xfburn_default_cursor (priv->content);
}
@@ -1783,7 +1783,7 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
xfburn_adding_progress_show (XFBURN_ADDING_PROGRESS (priv->progress));
full_paths = (gchar *) gtk_selection_data_get_text (sd);
-
+
files = g_strsplit ((gchar *) full_paths, "\n", -1);
if (files) {
@@ -1800,7 +1800,7 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
if (full_path[strlen (full_path) - 1] == '\r')
full_path[strlen (full_path) - 1] = '\0';
-
+
DBG ("Adding path '%s'", full_path);
/* remember path to add it later in another thread */
@@ -1826,7 +1826,7 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
}
gtk_drag_finish (dc, TRUE, FALSE, t);
- }
+ }
else if (gtk_selection_data_get_target(sd) == gdk_atom_intern ("text/uri-list", FALSE)) {
GList *vfs_paths = NULL;
GList *vfs_path;
@@ -1888,7 +1888,7 @@ cb_content_drag_data_rcv (GtkWidget * widget, GdkDragContext * dc, guint x, guin
gtk_drag_finish (dc, FALSE, FALSE, t);
xfburn_default_cursor (priv->content);
}
- }
+ }
else {
g_warning ("Trying to receive an unsupported drag target, this should not happen.");
gtk_drag_finish (dc, FALSE, FALSE, t);
@@ -1925,16 +1925,16 @@ thread_add_files_drag (ThreadAddFilesDragParams *params)
gdk_threads_enter ();
gtk_tree_model_get_iter (model, &iter_where_insert, priv->path_where_insert);
gdk_threads_leave ();
-
+
if (thread_add_file_to_list (composition, model, full_path, &iter, &iter_where_insert, position)) {
- if (position == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE
+ if (position == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE
|| position == GTK_TREE_VIEW_DROP_INTO_OR_AFTER) {
gdk_threads_enter ();
gtk_tree_view_expand_row (GTK_TREE_VIEW (widget), priv->path_where_insert, FALSE);
gdk_threads_leave ();
}
}
-
+
} else {
thread_add_file_to_list (composition, model, full_path, &iter, NULL, position);
}
@@ -1953,7 +1953,7 @@ fill_image_with_composition (GtkTreeModel *model, IsoImage *image, IsoDir * pare
IsoDir *dir = NULL;
int r;
gchar *basename;
-
+
gtk_tree_model_get (model, iter, DATA_COMPOSITION_COLUMN_TYPE, &type,
DATA_COMPOSITION_COLUMN_CONTENT, &name, DATA_COMPOSITION_COLUMN_PATH, &src, -1);
@@ -1993,20 +1993,20 @@ fill_image_with_composition (GtkTreeModel *model, IsoImage *image, IsoDir * pare
if (src != NULL && *src != '\0') {
basename = g_path_get_basename (src);
-
+
/* check if the file has been renamed */
if (strcmp (basename, name) != 0) {
/* rename the iso_node */
r = iso_node_set_name (node, name);
-
+
if (r == 0) {
/* The first string is the renamed name, the second one the original name */
xfce_dialog_show_warning(NULL, NULL, _("Duplicate filename '%s' for '%s'"), name, src);
-
+
g_free (basename);
g_free (name);
g_free (src);
-
+
continue;
}
}
@@ -2142,7 +2142,7 @@ load_composition_start (GMarkupParseContext * context, const gchar * element_nam
LoadParserStruct * parserinfo = (LoadParserStruct *) data;
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (parserinfo->dc);
-
+
if (!(parserinfo->started) && !strcmp (element_name, "xfburn-composition"))
parserinfo->started = TRUE;
else if (!(parserinfo->started))
@@ -2159,8 +2159,8 @@ load_composition_start (GMarkupParseContext * context, const gchar * element_nam
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
parent = g_queue_peek_head (parserinfo->queue_iter);
-
- add_file_to_list_with_name (attribute_values[i], parserinfo->dc, model, attribute_values[j], &iter,
+
+ add_file_to_list_with_name (attribute_values[i], parserinfo->dc, model, attribute_values[j], &iter,
parent, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
}
} else if (!strcmp (element_name, "directory")) {
@@ -2172,8 +2172,8 @@ load_composition_start (GMarkupParseContext * context, const gchar * element_nam
GtkTreeModel *model;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->content));
-
- //add_directory_to_list (attribute_values[i], parserinfo->dc, model, attribute_values[j], &iter, parent);
+
+ //add_directory_to_list (attribute_values[i], parserinfo->dc, model, attribute_values[j], &iter, parent);
}
}
*/
@@ -2183,13 +2183,13 @@ static void
load_composition_end (GMarkupParseContext * context, const gchar * element_name, gpointer user_data, GError ** error)
{
LoadParserStruct *parserinfo = (LoadParserStruct *) user_data;
-
+
if (!parserinfo->started)
return;
-
+
if (!strcmp (element_name, "xfburn-composition"))
parserinfo->started = FALSE;
-
+
if (!strcmp (element_name, "directory"))
parserinfo->queue_iter = g_queue_pop_head (parserinfo->queue_iter);
}
@@ -2246,7 +2246,7 @@ load_from_file (XfburnComposition * composition, const gchar * filename)
}
g_queue_free (parserinfo.queue_iter);
-
+
cleanup:
if (gpcontext)
g_markup_parse_context_free (gpcontext);
@@ -2282,20 +2282,20 @@ foreach_save (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, Comp
DataCompositionEntryType type;
space = g_strnfill (gtk_tree_path_get_depth (path), '\t');
-
+
for (i = info->last_depth; i > gtk_tree_path_get_depth (path); i--) {
gchar *space2 = NULL;
space2 = g_strnfill (i - 1, '\t');
fprintf (info->file_content, "%s</directory>\n", space2);
-
+
g_free (space2);
}
-
+
gtk_tree_model_get (model, iter, DATA_COMPOSITION_COLUMN_CONTENT, &name,
DATA_COMPOSITION_COLUMN_PATH, &source_path,
DATA_COMPOSITION_COLUMN_TYPE, &type, -1);
-
+
fprintf (info->file_content, "%s", space);
switch (type) {
case DATA_COMPOSITION_TYPE_FILE:
@@ -2303,7 +2303,7 @@ foreach_save (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, Comp
break;
case DATA_COMPOSITION_TYPE_DIRECTORY:
fprintf (info->file_content, "<directory name=\"%s\" source=\"%s\"", name, source_path);
-
+
if (gtk_tree_model_iter_has_child (model, iter))
fprintf (info->file_content, ">\n");
else
@@ -2314,7 +2314,7 @@ foreach_save (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, Comp
info->last_depth = gtk_tree_path_get_depth (path);
-
+
g_free (space);
g_free (name);
g_free (source_path);
@@ -2330,13 +2330,13 @@ save_to_file (XfburnComposition * composition)
GtkTreeModel *model;
CompositionSaveInfo info;
gint i;
-
+
if (!(priv->filename)) {
priv->filename = g_strdup ("/tmp/gna");
-
+
g_signal_emit_by_name (G_OBJECT (composition), "name-changed", priv->filename);
}
-
+
file_content = fopen (priv->filename, "w+");
fprintf (file_content, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n");
fprintf (file_content, "<xfburn-composition version=\"0.1\">\n");
@@ -2351,10 +2351,10 @@ save_to_file (XfburnComposition * composition)
space2 = g_strnfill (i - 1, '\t');
fprintf (info.file_content, "%s</directory>\n", space2);
-
+
g_free (space2);
}
-
+
fprintf (file_content, "</xfburn-composition>\n");
fclose (file_content);
}
@@ -2368,12 +2368,12 @@ xfburn_data_composition_new (void)
return g_object_new (xfburn_data_composition_get_type (), NULL);
}
-void
+void
xfburn_data_composition_add_files (XfburnDataComposition *dc, GSList * filelist)
{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (dc);
ThreadAddFilesCLIParams *params;
-
+
if (filelist != NULL) {
params = g_new (ThreadAddFilesCLIParams, 1);
@@ -2392,7 +2392,7 @@ void
xfburn_data_composition_hide_toolbar (XfburnDataComposition * composition)
{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (composition);
-
+
gtk_widget_hide (priv->toolbar);
}
@@ -2400,7 +2400,7 @@ void
xfburn_data_composition_show_toolbar (XfburnDataComposition * composition)
{
XfburnDataCompositionPrivate *priv = XFBURN_DATA_COMPOSITION_GET_PRIVATE (composition);
-
+
gtk_widget_show (priv->toolbar);
}
diff --git a/xfburn/xfburn-fs-browser.c b/xfburn/xfburn-fs-browser.c
index 0ef4a6f..06981a1 100644
--- a/xfburn/xfburn-fs-browser.c
+++ b/xfburn/xfburn-fs-browser.c
@@ -112,7 +112,7 @@ xfburn_fs_browser_init (XfburnFsBrowser * browser)
g_signal_connect (G_OBJECT (browser), "row-expanded", G_CALLBACK (cb_browser_row_expanded), browser);
g_signal_connect (G_OBJECT (browser), "row-activated", G_CALLBACK (cb_browser_row_activated), browser);
-
+
/* load the directory list */
xfburn_fs_browser_refresh (browser);
@@ -227,7 +227,7 @@ cb_browser_drag_data_get (GtkWidget * widget, GdkDragContext * dc,
{
if (info == DATA_COMPOSITION_DND_TARGET_TEXT_PLAIN) {
gchar *full_path = NULL;
-
+
full_path = xfburn_fs_browser_get_selection (browser);
gtk_selection_data_set_text (data, full_path, -1);
g_free (full_path);
@@ -284,7 +284,7 @@ xfburn_fs_browser_refresh (XfburnFsBrowser * browser)
text = g_strdup_printf (_("%s's home"), g_get_user_name ());
screen = gtk_widget_get_screen (GTK_WIDGET (browser));
- icon_theme = gtk_icon_theme_get_for_screen (screen);
+ icon_theme = gtk_icon_theme_get_for_screen (screen);
icon = gtk_icon_theme_load_icon (icon_theme, "gnome-fs-home", x, 0, NULL);
gtk_tree_store_append (GTK_TREE_STORE (model), &iter_home, NULL);
@@ -339,12 +339,12 @@ xfburn_fs_browser_get_selection (XfburnFsBrowser *browser)
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser));
if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
gchar *path = NULL;
-
+
gtk_tree_model_get (model, &iter, FS_BROWSER_COLUMN_PATH, &path, -1);
full_path = g_strdup_printf ("file://%s", path);
g_free (path);
}
-
+
return full_path;
}
diff --git a/xfburn/xfburn-main.c b/xfburn/xfburn-main.c
index 014f3bd..a01456f 100644
--- a/xfburn/xfburn-main.c
+++ b/xfburn/xfburn-main.c
@@ -5,12 +5,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -71,21 +71,21 @@ static gchar *transcoder_selection = NULL;
static gchar *initial_dir = NULL;
static GOptionEntry optionentries[] = {
- { "burn-image", 'i', G_OPTION_FLAG_OPTIONAL_ARG /* || G_OPTION_FLAG_FILENAME */, G_OPTION_ARG_CALLBACK, &parse_option,
+ { "burn-image", 'i', G_OPTION_FLAG_OPTIONAL_ARG /* || G_OPTION_FLAG_FILENAME */, G_OPTION_ARG_CALLBACK, &parse_option,
"Open the burn image dialog, optionally followed by the image filename", NULL },
- { "blank", 'b', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &parse_option,
+ { "blank", 'b', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &parse_option,
"Open the blank disc dialog", NULL },
- { "data-composition", 'd', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &parse_option,
+ { "data-composition", 'd', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &parse_option,
"Start a data composition, optionally followed by files/directories to be added to the composition", NULL },
- { "audio-composition", 'a', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &parse_option,
+ { "audio-composition", 'a', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &parse_option,
"Start an audio composition, optionally followed by files/directories to be added to the composition", NULL },
- { "transcoder", 't', 0, G_OPTION_ARG_STRING, &transcoder_selection,
+ { "transcoder", 't', 0, G_OPTION_ARG_STRING, &transcoder_selection,
"Select the transcoder, run with --transcoder=list to see the available ones", NULL },
- { "directory", 'D', G_OPTION_FLAG_OPTIONAL_ARG , G_OPTION_ARG_CALLBACK, &parse_option,
+ { "directory", 'D', G_OPTION_FLAG_OPTIONAL_ARG , G_OPTION_ARG_CALLBACK, &parse_option,
"Start the file browser in the specified directory, or the current directory if none is specified (the default is to start in your home directory)", NULL },
- { "version", 'V', 0 , G_OPTION_ARG_NONE, &show_version,
+ { "version", 'V', 0 , G_OPTION_ARG_NONE, &show_version,
"Display program version and exit", NULL },
- { "main", 'm', 0, G_OPTION_ARG_NONE, &show_main,
+ { "main", 'm', 0, G_OPTION_ARG_NONE, &show_main,
"Show main program even when other action is specified on the command line.", NULL },
{ NULL, ' ', 0, 0, NULL, NULL, NULL }
};
@@ -100,7 +100,7 @@ xfburn_main_enter_window (void)
window_counter++;
}
-void
+void
xfburn_main_leave_window (void)
{
/* if a main window is present, then it is in control */
@@ -199,7 +199,7 @@ main (int argc, char **argv)
g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
*/
#endif
-
+
g_set_application_name (_("Xfburn"));
gdk_threads_init ();
@@ -256,7 +256,7 @@ main (int argc, char **argv)
g_print ("\tGStreamer support (built with %d.%d.%d, linked against %d.%d.%d%s)\n",
GST_VERSION_MAJOR, GST_VERSION_MINOR, GST_VERSION_MICRO,
gst_major, gst_minor, gst_micro, nano_str);
-
+
#endif
exit (EXIT_SUCCESS);
}
@@ -271,7 +271,7 @@ main (int argc, char **argv)
DBG ("%s version %s for Xfce %s\n", PACKAGE, VERSION, xfce_version_string ());
xfburn_settings_init ();
-
+
#ifdef HAVE_GUDEV
error_msg = xfburn_udev_manager_create_global ();
if (error_msg) {
@@ -393,7 +393,7 @@ main (int argc, char **argv)
mainwin = xfburn_main_window_new ();
gtk_widget_show (mainwin);
-
+
if (add_data_composition)
xfburn_main_window_add_data_composition_with_files (XFBURN_MAIN_WINDOW (mainwin), argc-1, argv+1);
@@ -416,7 +416,7 @@ main (int argc, char **argv)
xfburn_settings_flush ();
xfburn_settings_free ();
-
+
burn_finish ();
gdk_threads_leave ();
diff --git a/xfburn/xfburn-main.h b/xfburn/xfburn-main.h
index 1121b53..752f0bf 100644
--- a/xfburn/xfburn-main.h
+++ b/xfburn/xfburn-main.h
@@ -5,12 +5,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
diff --git a/xfburn/xfburn-utils.c b/xfburn/xfburn-utils.c
index f613cb9..15b42ef 100644
--- a/xfburn/xfburn-utils.c
+++ b/xfburn/xfburn-utils.c
@@ -73,7 +73,7 @@ xfburn_humanreadable_filesize (guint64 size)
if (!xfburn_settings_get_boolean ("human-readable-units", TRUE))
return g_strdup_printf ("%lu B", (long unsigned int) size);
-
+
/* copied from GnomeBaker */
while (human_size > 1024 && unit < 4) {
@@ -125,7 +125,7 @@ xfburn_browse_for_file (GtkEntry *entry, GtkWindow *parent)
{
GtkWidget *dialog;
const gchar *text;
-
+
text = gtk_entry_get_text (entry);
dialog = gtk_file_chooser_dialog_new (_("Select command"), parent, GTK_FILE_CHOOSER_ACTION_SAVE, "_Cancel",
@@ -137,14 +137,14 @@ xfburn_browse_for_file (GtkEntry *entry, GtkWindow *parent)
if (strlen (text) > 0)
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog), text);
-
+
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
gchar *filename = NULL;
-
+
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
gtk_entry_set_text (entry, filename);
g_free (filename);
- }
+ }
gtk_widget_destroy (dialog);
}
@@ -213,7 +213,7 @@ xfburn_capture_libburn_messages (void)
{
int ret;
-#ifdef DEBUG_LIBBURN
+#ifdef DEBUG_LIBBURN
ret = burn_msgs_set_severities ("NEVER", "DEBUG", libburn_msg_prefix);
#else
ret = burn_msgs_set_severities ("ALL", "NEVER", libburn_msg_prefix);
@@ -228,7 +228,7 @@ xfburn_console_libburn_messages (void)
{
int ret;
-#ifdef DEBUG_LIBBURN
+#ifdef DEBUG_LIBBURN
ret = burn_msgs_set_severities ("NEVER", "DEBUG", libburn_msg_prefix);
#else
ret = burn_msgs_set_severities ("NEVER", "FATAL", libburn_msg_prefix);
@@ -236,7 +236,7 @@ xfburn_console_libburn_messages (void)
if (ret <= 0)
g_warning ("Failed to set libburn message severities");
-
+
}
int
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list