Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 04/12/2005, à 18:41

PierreR

[Graveman] Importation des sessions précédentes

Une des fonctionnalités qui me manquait dans le très bon logiciel de gravure qu'est Graveman est l'importation des sessions précédentes d'un CD multisession. En effet, je fais beaucoup de multisession et je ne sais jamais s'il reste assez de place sur un CD.
J'ai donc décidé d'ajouter cela moi même -- d'autant plus que ça avait l'air d'être plutôt au fond de la todolist : http://graveman.tuxfamily.org/.

J'ai fait un paquet .deb pour ceux qui voudraient essayer : http://simelec.aircraftcutaway.com/graveman_0.4.0CVS-0ubuntu1_i386.deb

! : ATTENTION : Il est bien entendu que c'est une version CVS donc instable, seulement pour tester.

Diffs pour la version SVN actuelle (0.4.0CVS) :

include/graveman.h :

58,60c58,61
< #define TYPE_FILE  3
< #define TYPE_MP3   4
< #define TYPE_IMAGEBOOT 5
---
> #define TYPE_FILE  4
> #define TYPE_OLD   8
> #define TYPE_MP3   16
> #define TYPE_IMAGEBOOT 32
176a178
> #include "import_past_sessions.h"

-----------------------------------------------------------------------------------------

include/callbacks.h :

69a70
> extern void change_remplissage_et_texte(GtkWidget *Acombo, gpointer Adata, Ttypemajpbar Aupdatetext);
85a87
> extern gint _add_a_file(gchar *Anom, GtkTreeStore *ATreeStore, GtkTreeIter *Aparent, Tgrave *Ag, guint64 *Adatasize, GtkTreeIter *Aiter, gboolean Aold);

-----------------------------------------------------------------------------------------

src/callbacks.c :

117c117
< gint _add_a_file(gchar *Anom, GtkTreeStore *ATreeStore, GtkTreeIter *Aparent, Tgrave *Ag, guint64 *Adatasize, GtkTreeIter *Aiter)
---
> gint _add_a_file(gchar *Anom, GtkTreeStore *ATreeStore, GtkTreeIter *Aparent, Tgrave *Ag, guint64 *Adatasize, GtkTreeIter *Aiter, gboolean Aold)
148c148
<     gtk_tree_store_set(ATreeStore, &Liter, 0, TYPE_DIR, 1, get_image("DirIcon"), 2, Lonlynameutf8, 3, "", 4, Lnomutf8, 5, LOnlyName, 6, 0, -1);
---
>     gtk_tree_store_set(ATreeStore, &Liter, 0, TYPE_DIR+(Aold ? TYPE_OLD : 0), 1, get_image("DirIcon"), 2, Lonlynameutf8, 3, "", 4, Aold ? _("past session") : Lnomutf8, 5, LOnlyName, 6, 0, -1);
162c162
<       Lret = _add_a_file(Lfullname, ATreeStore, &Liter, Ag, Adatasize, NULL);
---
>       Lret = _add_a_file(Lfullname, ATreeStore, &Liter, Ag, Adatasize, NULL, Aold);
174,175c174,175
<     gtk_tree_store_set(ATreeStore, &Liter, 0, TYPE_FILE, 1, get_image("FileIcon"), 2, Lonlynameutf8,
<                                            3, Lformatsizeutf8, 4, Lnomutf8, 5, Anom, 6, Lfi.st_size, -1);
---
>     gtk_tree_store_set(ATreeStore, &Liter, 0, TYPE_FILE+(Aold ? TYPE_OLD : 0), 1, get_image("FileIcon"), 2, Lonlynameutf8,
>                                            3, Lformatsizeutf8, 4, Aold ? _("past session") : Lnomutf8, 5, Anom, 6, Lfi.st_size, -1);
180c180
<     *(Adatasize)=*(Adatasize) + Lfi.st_size;
---
>     if(!Aold) *(Adatasize) += Lfi.st_size;
443a444
>   gboolean LselectCD = TRUE;
461,462c462,464
<         *Ldatasize-=Lsizenbr;
<         g_assert((*Ldatasize) >= 0);
---
>         if((Ltype & TYPE_OLD) != TYPE_OLD) {
>           *Ldatasize-=Lsizenbr;
>           g_assert((*Ldatasize) >= 0);
464,465c466,467
<         /* on enleve la taille des eventuels enfants */
<         remove_children_size(Ltreedata, &Liter, Ldatasize, Lg);
---
>           /* on enleve la taille des eventuels enfants */
>           remove_children_size(Ltreedata, &Liter, Ldatasize, Lg);
467,470c469,475
<         gtk_tree_store_remove(GTK_TREE_STORE(Ltreedata), &Liter);
<         gtk_tree_row_reference_deleted(Lproxy, Lpath);
<         gtk_tree_path_free(Lpath);
<       } 
---
>           gtk_tree_store_remove(GTK_TREE_STORE(Ltreedata), &Liter);
>           gtk_tree_row_reference_deleted(Lproxy, Lpath);
>         } else {
>           LselectCD = FALSE;
>         }
>       }
>       gtk_tree_path_free(Lpath);
481c486
<   if (gtk_tree_model_get_iter_first(Ltreedata, &Liter)) {
---
>   if (gtk_tree_model_get_iter_first(Ltreedata, &Liter) && LselectCD) {
536c541
< 
---
>   
552c557
<     if (Ltype == TYPE_FILE) {
---
>     if ((Ltype & TYPE_FILE) == TYPE_FILE) {
565c570
<       _add_a_file((gchar *) Lcur->data, GTK_TREE_STORE(Ltreemodel), &Liter, Lg, Ldatasize, NULL);
---
>       _add_a_file((gchar *) Lcur->data, GTK_TREE_STORE(Ltreemodel), &Liter, Lg, Ldatasize, NULL, FALSE);
788a794
>   GtkToggleButton *Ltoggledatamulti = GTK_TOGGLE_BUTTON(sc_grave_get_widget(Lg, "datamulti"));
840a847,855
>   if (!g_ascii_strcasecmp(Lname, "dstdatacombo")) {
>     /* update past session(s) informations */
> _DEB("Update past session(s) informations.");
>     unimport_past_sessions(Adata);
>     if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(Ltoggledatamulti))==TRUE && !Lisimgiso) {
>       import_past_sessions(Adata);
>     }
>   }
> 
1432c1447
<     Ltodisable = (Ltype != TYPE_FILE);
---
>     Ltodisable = ((Ltype & TYPE_FILE) != TYPE_FILE);
1478a1494
> 
1802a1819,1823
>   change_remplissage_et_texte(Acombo, Adata, PB_NONE);
> }
> 
> void change_remplissage_et_texte(GtkWidget *Acombo, gpointer Adata, Ttypemajpbar Aupdatetext)
> {
1805c1826
<   gchar *Lvalue = get_combo_value(Acombo);
---
>   gint Lvalue = (gint)get_combo_value(Acombo);
1814c1835
<     (*Lmaxlen) = (unsigned long long)strtoul(Lvalue, NULL, 10) * 1024 * 1024;
---
>     *Lmaxlen = Lvalue * 1024 * 1024;
1819,1820c1840
<     (*Lmaxlen) = (unsigned long long)strtoul(Lvalue, NULL, 10) * 1024 * 1024;
<     
---
>     *Lmaxlen = Lvalue * 1024 * 1024;
1825c1845
<     (*Lmaxlen) = (unsigned long long)strtoul(Lvalue, NULL, 10);
---
>     *Lmaxlen = Lvalue;
1828c1848
<   switch_pbar_status(Lcontenance, *Lmaxlen, *Llen, PB_NONE);
---
>   switch_pbar_status(Lcontenance, *Lmaxlen, *Llen, Aupdatetext);
1922c1942
<           i == 0 ? &Lfirstiter : NULL);
---
>           i == 0 ? &Lfirstiter : NULL, FALSE);
1967c1987
<         if (Ltype == TYPE_FILE) {
---
>         if ((Ltype & TYPE_FILE) == TYPE_FILE) {
2149a2170,2184
> 
>     if(!g_ascii_strcasecmp(Lname, "bodycddata")) {
>       GtkToggleButton *Ltoggledatamulti = GTK_TOGGLE_BUTTON(sc_grave_get_widget(Lg, "datamulti"));
>       if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(Ltoggledatamulti))==TRUE) {
>         GtkComboBox *Lcombodata = GTK_COMBO_BOX(sc_grave_get_widget(Lg, "dstdatacombo"));
>         GtkTreeModel *Lmodelcombodata = gtk_combo_box_get_model(GTK_COMBO_BOX(Lcombodata));
>         Tdriveinfo *Ldrive;
>         if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(Lcombodata), &Liter)) {
>           gtk_tree_model_get(Lmodelcombodata, &Liter, 0, &Ldrive, -1);
>           if(!IS_AN_IMG(Ldrive)==TRUE) {
>             import_past_sessions(Adata);
>           }
>         }
>       }
>     }
2162c2197,2204
<   if (Lact) gtk_spin_button_set_value(Lspin, 1);
---
>   if (Lact) {
>     gtk_spin_button_set_value(Lspin, 1);
>     /* we import past session(s) (if exist in the selected drive) */
>     import_past_sessions(Adata);
>   } else {
>     /* we unimport past session(s) previously imported */
>     unimport_past_sessions(Adata);
>   }

-----------------------------------------------------------------------------------------

include/interface.h :

43c43
<     guint64 *Adatasize, guint64 *Adatamaxsize, guint64 *Advddatasize, guint64 *Advddatamaxsize);
---
>     guint64 *Adatasize, guint64 *Adatapastsize, guint64 *Adatamaxsize, guint64 *Advddatasize, guint64 *Advddatamaxsize);

-----------------------------------------------------------------------------------------

src/interface.c :

458c458
<   if (type != TYPE_FILE && Lonlyone) {
---
>   if ((type & TYPE_FILE) != TYPE_FILE && Lonlyone) {
466c466
<   if (type == TYPE_DIR && Lonlyone) {
---
>   if ((type & TYPE_DIR) == TYPE_DIR && Lonlyone && (type & TYPE_OLD) != TYPE_OLD) {
472c472
<   if (type == TYPE_FILE && Lonlyone) {
---
>   if ((type & TYPE_FILE) == TYPE_FILE && Lonlyone && (type & TYPE_OLD) != TYPE_OLD) {
480c480
<   if (type != TYPE_FILE && Lonlyone) {
---
>   if ((type & TYPE_FILE) != TYPE_FILE && Lonlyone) {
490c490
<   if (type != TYPE_FILE && Lonlyone) {
---
>   if ((type & TYPE_FILE) != TYPE_FILE && Lonlyone) {
501c501
<   if (type != TYPE_CD) {
---
>   if (type != TYPE_CD && (type & TYPE_OLD) != TYPE_OLD) {
524c524
<   if (type == TYPE_FILE) {
---
>   if ((type & TYPE_FILE) == TYPE_FILE) {
613c613
<   guint64 *Adatasize, guint64 *Adatamaxsize, guint64 *Advddatasize, guint64 *Advddatamaxsize)
---
>   guint64 *Adatasize, guint64 *Adatapastsize, guint64 *Adatamaxsize, guint64 *Advddatasize, guint64 *Advddatamaxsize)
634a635
>   sc_grave_set_data(Lg, Adatapastsize, "datapastsize");
707c708
<   prepare_disable_when_iso(Lg, "dstdatacombo", "nbrcddata", "datamulti", "datanotfix", "datasimul", NULL);
---
>   prepare_disable_when_iso(Lg, "dstdatacombo", "nbrcddata", "datamulti", "dataonfly", "datanotfix", "datasimul", NULL);
1555,1556d1555
<   gtk_tree_selection_select_iter(Lselection, &Liter);
<   gtk_toggle_top_menu(Ltopmenu, Ag);
1659a1659,1660
>   Lcell = gtk_tree_view_column_new();
>   gtk_tree_view_column_set_title(Lcell, _("Location"));
1661,1664c1662,1663
<   Lcell = gtk_tree_view_column_new_with_attributes("", Lcellrender, "pixbuf", 1, NULL);
<   gtk_tree_view_column_set_resizable(Lcell, TRUE);
<   gtk_tree_view_append_column(GTK_TREE_VIEW(Atreeview), Lcell);
< 
---
>   gtk_tree_view_column_pack_start(Lcell, Lcellrender, FALSE);
>   gtk_tree_view_column_set_attributes(Lcell, Lcellrender, "pixbuf", 1, NULL);
1666,1667c1665,1668
<   Lcell = gtk_tree_view_column_new_with_attributes(_("Location"), Lcellrender, "text", 2, NULL);
<   gtk_tree_view_column_set_resizable(Lcell, TRUE);
---
>   gtk_tree_view_column_pack_start(Lcell, Lcellrender, TRUE);
>   gtk_tree_view_column_set_attributes(Lcell, Lcellrender, "text", 2, NULL);
>   gtk_tree_view_column_set_sizing (Lcell, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
>   gtk_tree_view_column_set_sort_column_id (Lcell, 2);
1672c1673,1674
<   gtk_tree_view_column_set_resizable(Lcell, TRUE);
---
>   gtk_tree_view_column_set_sizing (Lcell, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
>   gtk_tree_view_column_set_sort_column_id (Lcell, 3); 
1677c1679,1680
<   gtk_tree_view_column_set_resizable(Lcell, TRUE);
---
>   gtk_tree_view_column_set_sizing (Lcell, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
>   gtk_tree_view_column_set_sort_column_id (Lcell, 4); 
1679d1681
< 
1692a1695,1696
>   Lcell = gtk_tree_view_column_new();
>   gtk_tree_view_column_set_title(Lcell, _("Track"));
1694,1697c1698,1699
<   Lcell = gtk_tree_view_column_new_with_attributes("", Lcellrender, "pixbuf", 1, NULL);
<   gtk_tree_view_column_set_resizable(Lcell, TRUE);
<   gtk_tree_view_append_column(GTK_TREE_VIEW(Atreeaudio), Lcell);
< 
---
>   gtk_tree_view_column_pack_start(Lcell, Lcellrender, FALSE);
>   gtk_tree_view_column_set_attributes(Lcell, Lcellrender, "pixbuf", 1, NULL);
1699c1701,1703
<   Lcell = gtk_tree_view_column_new_with_attributes(_("Track"), Lcellrender, "text", 2, NULL);
---
>   gtk_tree_view_column_pack_start(Lcell, Lcellrender, TRUE);
>   gtk_tree_view_column_set_attributes(Lcell, Lcellrender, "text", 2, NULL);
>   gtk_tree_view_column_set_sizing (Lcell, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
1702c1706
<   gtk_tree_view_append_column(GTK_TREE_VIEW(Atreeaudio), Lcell);
---
>   gtk_tree_view_append_column(Atreeaudio, Lcell);
1704a1709
>   g_object_set (Lcellrender, "xalign", 1.0, NULL);
1705a1711
>   gtk_tree_view_column_set_sizing (Lcell, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
1711a1718
>   gtk_tree_view_column_set_sizing (Lcell, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
1733a1741,1742
>   Lcell = gtk_tree_view_column_new();
>   gtk_tree_view_column_set_title(Lcell, _("Name"));
1735,1738c1744,1745
<   Lcell = gtk_tree_view_column_new_with_attributes("", Lcellrender, "pixbuf", 1, NULL);
<   gtk_tree_view_column_set_resizable(Lcell, TRUE);
<   gtk_tree_view_append_column(Atreedata, Lcell);
<   
---
>   gtk_tree_view_column_pack_start(Lcell, Lcellrender, FALSE);
>   gtk_tree_view_column_set_attributes(Lcell, Lcellrender, "pixbuf", 1, NULL);
1740,1742c1747,1749
<   Lcell = gtk_tree_view_column_new_with_attributes(_("Name"), Lcellrender, "text", 2, NULL);
<   
<   gtk_tree_view_column_set_sort_column_id (Lcell, 2);
---
>   gtk_tree_view_column_pack_start(Lcell, Lcellrender, TRUE);
>   gtk_tree_view_column_set_attributes(Lcell, Lcellrender, "text", 2, NULL);
>   gtk_tree_view_column_set_sizing (Lcell, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
1743a1751
>   gtk_tree_view_column_set_sort_column_id (Lcell, 2);
1746a1755
>   g_object_set (Lcellrender, "xalign", 1.0, NULL);
1748c1757
<   gtk_tree_view_column_set_sort_column_id (Lcell, 3);
---
>   gtk_tree_view_column_set_sizing (Lcell, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
1749a1759
>   gtk_tree_view_column_set_sort_column_id (Lcell, 3);
1753a1764,1765
>   gtk_tree_view_column_set_sizing (Lcell, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
>   gtk_tree_view_column_set_resizable(Lcell, TRUE);

-----------------------------------------------------------------------------------------

src/charset.c :

115a116,117
>   Lcell = gtk_tree_view_column_new();
>   gtk_tree_view_column_set_title(Lcell, _("Code / Location"));
117,120c119,120
<   Lcell = gtk_tree_view_column_new_with_attributes("", Lcellrender, "pixbuf", 1, NULL);
<   gtk_tree_view_append_column(GTK_TREE_VIEW(Atreeview), Lcell);
<   gtk_tree_view_column_set_resizable(Lcell, TRUE);
< 
---
>   gtk_tree_view_column_pack_start(Lcell, Lcellrender, FALSE);
>   gtk_tree_view_column_set_attributes(Lcell, Lcellrender, "pixbuf", 1, NULL);
122,123c122,125
<   Lcell = gtk_tree_view_column_new_with_attributes(_("Code / Location"), Lcellrender, "text", 2, NULL);
<   gtk_tree_view_column_set_resizable(Lcell, TRUE);
---
>   gtk_tree_view_column_pack_start(Lcell, Lcellrender, TRUE);
>   gtk_tree_view_column_set_attributes(Lcell, Lcellrender, "text", 2, NULL);
>   gtk_tree_view_column_set_sizing (Lcell, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
>   gtk_tree_view_column_set_sort_column_id (Lcell, 2);
128c130,131
<   gtk_tree_view_column_set_resizable(Lcell, TRUE);
---
>   gtk_tree_view_column_set_sizing (Lcell, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
>   gtk_tree_view_column_set_sort_column_id (Lcell, 3); 

-----------------------------------------------------------------------------------------

include/cdrdao_grav.h :

27a28,30
> extern gint get_cdinfo_timeout(Tgrave *Ag, Tdriveinfo *Adevice, gdouble Atimeout, GError **Aerror);
> extern void get_capacities(Tgrave *Ag, Tdriveinfo *Adevice, guint64 *Aremainingcapacity, guint64 *Atotalcapacity, GError **Aerror);
> extern gint get_last_start(Tgrave *Ag, Tdriveinfo *Adevice, GError **Aerror);

-----------------------------------------------------------------------------------------

src/cdrdao_grav.c :

66a67,68
> #define CDRDAO_TOTAL_CAPACITY "Total Capacity"
> #define CDRDAO_REMAINING_CAPACITY "Remaining Capacity"
72a75,80
>   return get_cdinfo_timeout(Ag, Adevice, 0, Aerror);
> }
> 
> /* like get_cdinfo but with a timeout (in seconds) */
> gint get_cdinfo_timeout(Tgrave *Ag, Tdriveinfo *Adevice, gdouble Atimeout, GError **Aerror)
> {
80a89
>   GIOChannel *Lcomerr;
81a91
>   guint Lcomeventerr;
86a97
>   GTimer *Ltimer = g_timer_new();
111a123,127
>   Lcomerr = g_io_channel_unix_new( g_err );
>   g_io_channel_set_encoding (Lcomerr, NULL, NULL);
>   g_io_channel_set_flags( Lcomerr, G_IO_FLAG_NONBLOCK, NULL );
>   Lcomeventerr = g_io_add_watch (Lcomerr, (G_IO_IN | G_IO_PRI),
>                                       read_all_output_callback, Ag);
114a131,134
>     if(Atimeout && g_timer_elapsed(Ltimer, NULL) > Atimeout) {
> _DEB("get_cd_info_timeout : TIMEOUT (time : [%f]>[%f]) (probablement n'y a t-il pas de CD dans le lecteur)", g_timer_elapsed(Ltimer, NULL), Atimeout);
>       kill(*Lpid, SIGKILL);
>     }
118a139
>   g_source_remove(Lcomeventerr);
120a142
>   g_io_channel_shutdown(Lcomerr, FALSE, NULL);
121a144
>   g_io_channel_unref(Lcomerr);
122a146,147
>   g_timer_destroy(Ltimer);
> 
173a199,341
> 
> /* get remaining capacity of the inserted media in byte (0 if the media is not appendable) and total capacity */
> void get_capacities(Tgrave *Ag, Tdriveinfo *Adevice, guint64 *Aremainingcapacity, guint64 *Atotalcapacity, GError **Aerror)
> {
>   gchar Lcommandline[_BUF_SIZE];
>   gboolean Lstatus;
>   gchar **Larrbuf;
>   gchar **Lcmd;
>   gint i;
>   gchar *Lstrcapacity;
>   gint g_err, g_out, Lnbrarg;
>   GIOChannel *Lcom;
>   guint Lcomevent;
>   gint Lloccont = 2;
>   gint *Lpid = (gint *)sc_grave_get_data(Ag, "pid");
>   GString *Loutput;
>   gchar *Lcdprg = config_get_string("cdrdao");
> 
>   *Aremainingcapacity = 0;
>   *Atotalcapacity = 0;
> 
>   if (!Lcdprg || !*Lcdprg) return;
> 
>   g_snprintf(Lcommandline, sizeof(Lcommandline)-1, "%s disk-info --device %s", Lcdprg, DRIVE_DEV(Adevice));
> _DEB("execution de [%s]", Lcommandline);
>   if (!g_shell_parse_argv(Lcommandline, &Lnbrarg, &Lcmd, Aerror)) return;
> 
>   Lstatus = g_spawn_async_with_pipes(NULL, Lcmd, NULL, (GSpawnFlags) (G_SPAWN_DO_NOT_REAP_CHILD), NULL, NULL,
>       Lpid, NULL, &g_out, &g_err, Aerror);
>   g_strfreev(Lcmd);
> 
>   if (Lstatus == FALSE) return;
> 
>   Loutput = g_string_new("");
>   sc_grave_set_data(Ag, Loutput, "buffer");
>   sc_grave_set_data(Ag, &Lloccont, "loccont");
>   
>   Lcom = g_io_channel_unix_new( g_out );
>   g_io_channel_set_encoding (Lcom, NULL, NULL);
>   g_io_channel_set_flags( Lcom, G_IO_FLAG_NONBLOCK, NULL );
>   Lcomevent = g_io_add_watch (Lcom, (G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI),
>                                       read_all_output_callback, Ag);
> 
>   while (Lloccont > 0) {
>     gtk_main_iteration();
>   }
>   tools_exit_prog(*Lpid, FALSE, Aerror, NULL);
> 
>   g_source_remove(Lcomevent);
> 
>   g_io_channel_shutdown(Lcom, FALSE, NULL);
>   g_io_channel_unref(Lcom);
>   g_spawn_close_pid(*Lpid);
> 
>   Larrbuf = g_strsplit(Loutput->str, "\n", 0);
> 
>   g_string_free(Loutput, TRUE);
> 
>   sc_grave_del_data(Ag, "loccount");
>   sc_grave_del_data(Ag, "buffer");
> 
> 
>   for (i=0; Larrbuf[i]; i++) {
>     if (!*Larrbuf[i]) continue;
>     if (!strncmp(Larrbuf[i], CDRDAO_REMAINING_CAPACITY, strlen(CDRDAO_REMAINING_CAPACITY))) {
>       if ((Lstrcapacity = (strstr(Larrbuf[i], " (")+2))) {
>         *Aremainingcapacity = (guint64)(g_ascii_strtod(Lstrcapacity, NULL));
>         *Aremainingcapacity *= 2*1024;
>       }
>     } else if (!strncmp(Larrbuf[i], CDRDAO_TOTAL_CAPACITY, strlen(CDRDAO_TOTAL_CAPACITY))) {
>       if ((Lstrcapacity = (strstr(Larrbuf[i], " (")+2))) {
>         *Atotalcapacity = (guint64)(g_ascii_strtod(Lstrcapacity, NULL));
>         *Atotalcapacity *= 2*1024;
>       }
>     }
>   }
>   
>   g_strfreev(Larrbuf);
> }
> 
> /* get start sector of last session (0 if no last session) */
> gint get_last_start(Tgrave *Ag, Tdriveinfo *Adevice, GError **Aerror)
> {
>   gchar Lcommandline[_BUF_SIZE];
>   gboolean Lstatus;
>   gchar **Larrbuf;
>   gchar **Lcmd;
>   gint g_err, g_out, Lnbrarg;
>   GIOChannel *Lcom;
>   guint Lcomevent;
>   gint Lloccont = 2;
>   gint *Lpid = (gint *)sc_grave_get_data(Ag, "pid");
>   GString *Loutput;
>   gchar *Lcdprg = config_get_string("cdrdao");
>   gint Llaststart;
> 
>   if (!Lcdprg || !*Lcdprg) return 0;
> 
>   g_snprintf(Lcommandline, sizeof(Lcommandline)-1, "%s msinfo --device %s", Lcdprg, DRIVE_DEV(Adevice));
> _DEB("execution de [%s]", Lcommandline);
>   if (!g_shell_parse_argv(Lcommandline, &Lnbrarg, &Lcmd, Aerror)) return 0;
> 
>   Lstatus = g_spawn_async_with_pipes(NULL, Lcmd, NULL, (GSpawnFlags) (G_SPAWN_DO_NOT_REAP_CHILD), NULL, NULL,
>       Lpid, NULL, &g_out, &g_err, Aerror);
>   g_strfreev(Lcmd);
> 
>   if (Lstatus == FALSE) return 0;
> 
>   Loutput = g_string_new("");
>   sc_grave_set_data(Ag, Loutput, "buffer");
>   sc_grave_set_data(Ag, &Lloccont, "loccont");
> 
>   Lcom = g_io_channel_unix_new( g_out );
>   g_io_channel_set_encoding (Lcom, NULL, NULL);
>   g_io_channel_set_flags( Lcom, G_IO_FLAG_NONBLOCK, NULL );
>   Lcomevent = g_io_add_watch (Lcom, (G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI),
>                                       read_all_output_callback, Ag);
> 
>   while (Lloccont > 0) {
>     gtk_main_iteration();
>   }
>   tools_exit_prog(*Lpid, FALSE, Aerror, NULL);
> 
>   g_source_remove(Lcomevent);
> 
>   g_io_channel_shutdown(Lcom, FALSE, NULL);
>   g_io_channel_unref(Lcom);
>   g_spawn_close_pid(*Lpid);
> 
>   Larrbuf = g_strsplit(Loutput->str, ",", 0);
> 
>   g_string_free(Loutput, TRUE);
> 
>   sc_grave_del_data(Ag, "loccount");
>   sc_grave_del_data(Ag, "buffer");
> 
>   Llaststart = (gint)(g_ascii_strtod(Larrbuf[0], NULL));
>   
>   g_strfreev(Larrbuf);
>   
>   return Llaststart;
> }
> 

-----------------------------------------------------------------------------------------

src/main.c :

33c33
<   guint64 Laudiolen = 0, Ldatasize = 0, Ldvdsize = 0;
---
>   guint64 Laudiolen = 0, Ldatasize = 0, Ldatapastsize = 0, Ldvdsize = 0;
88c88
<   manage_main_window (&Laudiolen, &Laudiomaxlen, &Ldatasize, &Ldatamaxsize, &Ldvdsize, &Ldvddatamaxsize); 
---
>   manage_main_window (&Laudiolen, &Laudiomaxlen, &Ldatasize, &Ldatapastsize, &Ldatamaxsize, &Ldvdsize, &Ldvddatamaxsize); 

-----------------------------------------------------------------------------------------

include/matos.h :

52a53
> extern void matos_mount_device(Tdriveinfo *Adrive, gchar *Amountpoint, GError **Aerror);

-----------------------------------------------------------------------------------------

src/matos.c :

27a28,30
> #ifdef HAVE_GCONF
> #include <gconf/gconf-client.h>
> #endif
124c127
<  * scan /etc/ftab file to do this */
---
>  * scan /etc/mtab file to do this */
166a170,225
> /* try to mount device
>  * and set Amountpoint according to /etc/mtab */
> void matos_mount_device(Tdriveinfo *Adrive, gchar *Amountpoint, GError **Aerror)
> {
>   gchar Lcommand[_BUF_SIZE];
>   gchar *Lcontent = NULL;
>   gint i;
>   gchar **Larrbuf, *Lcur, *s, *Lcurdev = NULL;
>   GSList *Llistdev;
> #ifdef HAVE_GCONF
>   GConfClient *Lgconfclient = gconf_client_get_default();
>   gboolean Lbrowsekey;
> 
>   /* on systems using gnome_volume_manager, avoid media browsing */
>   Lbrowsekey = gconf_client_get_bool(Lgconfclient, "/desktop/gnome/volume_manager/autobrowse", NULL);
>   gconf_client_set_bool(Lgconfclient, "/desktop/gnome/volume_manager/autobrowse", FALSE, NULL);
> #endif
> 
>   g_snprintf(Lcommand, sizeof(Lcommand)-1, "/bin/mount %s", (gchar *)(Adrive->dev->data));
> 
> _DEB("try to mount [%s]", Lcommand);
> 
>   if(!g_spawn_command_line_sync(Lcommand, NULL, NULL, NULL, Aerror)) goto out;
> 
>   if (!g_file_get_contents("/etc/mtab", &Lcontent, NULL, Aerror) || !Lcontent) goto out;
>   Larrbuf = g_strsplit(Lcontent, "\n", 0);
> 
>   for (i=0; Larrbuf[i]; ++i) {
>     s = Lcur = Larrbuf[i];
>     if (!*Lcur) continue;
> 
>     while (g_ascii_isalnum(*s) || *s=='/') s++;
>     *s=0;
>     for (Llistdev = Adrive->dev; Llistdev; Llistdev = g_slist_next(Llistdev)) {
>       Lcurdev = (gchar *) Llistdev->data;
>       if (!g_ascii_strcasecmp(Lcurdev, Lcur)) {
>         while (!g_ascii_isalnum(*s) && *s!='/') ++s;
>         Lcur = s;
>         while (g_ascii_isalnum(*s) || *s=='/') ++s;
>         *s=0;
>         g_strlcpy(Amountpoint, Lcur, _BUF_SIZE-1);
>         break;
>       }
>     }
>   }
>   g_strfreev(Larrbuf);
>   g_free(Lcontent);
> 
> out:
> #ifdef HAVE_GCONF
>   if(Lbrowsekey) {
>     gconf_client_set_bool(Lgconfclient, "/desktop/gnome/volume_manager/autobrowse", TRUE, NULL);
>   }
> #endif
> }
> 

-----------------------------------------------------------------------------------------

src/data.c :

45c45
<   if (Ltype == TYPE_DIR || Ltype == TYPE_FILE) {
---
>   if (((Ltype & TYPE_DIR) == TYPE_DIR || (Ltype & TYPE_FILE) == TYPE_FILE) && (Ltype & TYPE_OLD) != TYPE_OLD) {
59c59
<       if (Lparenttype != TYPE_DIR) break;
---
>       if ((Lparenttype & TYPE_DIR) != TYPE_DIR) break;
69c69
<       if (Ltype == TYPE_FILE) {
---
>       if ((Ltype & TYPE_FILE) == TYPE_FILE) {

-----------------------------------------------------------------------------------------

src/support.c :

332c332
<   if (Ltype != TYPE_DIR) return;
---
>   if ((Ltype & TYPE_DIR) != TYPE_DIR) return;

-----------------------------------------------------------------------------------------

include/param.h :

34a35
> extern gchar *param_get_isofs(gchar *Adir);

-----------------------------------------------------------------------------------------

src/param.c :

34a35,37
>   const gchar *Lpath;
>   gchar **Lpaths;
>   gint i;
38a42,51
>     Lpath=g_getenv("PATH");
>     Lpaths=g_strsplit(Lpath,":",0);
>     i=0;
>     while(Lpaths[i]) {
>       g_strlcpy(Lsearchdir, Lpaths[i], _BUF_SIZE-1);
>       strncat(Lsearchdir, "/wrapman", _BUF_SIZE-1);
>       _DEB("on cherche wrapman [%s]", Lsearchdir);
>       if (g_file_test(Lsearchdir, G_FILE_TEST_IS_EXECUTABLE)) return g_strdup(Lsearchdir);
>       ++i;
>     }
58a72,112
> /* search for isofs binarie */
> gchar *param_get_isofs(gchar *Adir)
> {
>   gchar *Lptr;
>   gchar Lsearchdir[_BUF_SIZE];
>   gchar *Lcurdir = NULL;
>   const gchar *Lpath;
>   gchar **Lpaths;
>   gint i;
> 
>   if (!Adir) {
>     Lpath=g_getenv("PATH");
>     Lpaths=g_strsplit(Lpath,":",0);
>     i=0;
>     while(Lpaths[i]) {
>       g_strlcpy(Lsearchdir, Lpaths[i], _BUF_SIZE-1);
>       strncat(Lsearchdir, "/isofs", _BUF_SIZE-1);
>       _DEB("on cherche isofs [%s]", Lsearchdir);
>       if (g_file_test(Lsearchdir, G_FILE_TEST_IS_EXECUTABLE)) return g_strdup(Lsearchdir);
>       ++i;
>     }
>     return NULL;
>   } else if (*Adir == '.') {
>     Lcurdir = g_get_current_dir();
>     g_strlcpy(Lsearchdir, Lcurdir, _BUF_SIZE-1);
>     g_free(Lcurdir);
>   } else {
>     g_strlcpy(Lsearchdir, Adir, _BUF_SIZE-1);
>     if ((Lptr = strrchr(Lsearchdir, '/'))) *Lptr=0;
>   }
> 
>   _DEB("on cherche isofs dans le repertoire [%s]", Lsearchdir);
>   if (g_file_test(Lsearchdir, G_FILE_TEST_IS_DIR)) {
>     strncat(Lsearchdir, "/isofs", _BUF_SIZE-1);
>   _DEB("on cherche isofs [%s]", Lsearchdir);
>     if (g_file_test(Lsearchdir, G_FILE_TEST_IS_EXECUTABLE)) return g_strdup(Lsearchdir);
>   }
> 
>   return NULL;
> }
> 
283c337
<   if (!(Lptr = param_get_wrapman(Aargv[0]))) {
---
>   if (!(Lptr = param_get_wrapman(g_path_is_absolute(Aargv[0])?Aargv[0]:NULL))) {
287a342,346
> 
>   if (!(Lptr = param_get_isofs(g_path_is_absolute(Aargv[0])?Aargv[0]:NULL)))
>     g_warning(_("cannot find isofs binarie !"));
>   else
>     param_store_value("isofs", Lptr);

-----------------------------------------------------------------------------------------

configure.in :

60a61,75
> 
> dnl GConf
> PKG_CHECK_MODULES(GCONF, [gconf-2.0], HAVE_GCONF=1)
> if test $HAVE_GCONF = 1; then
>   PACKAGE_CFLAGS="$PACKAGE_CFLAGS $GCONF_CFLAGS"
>   PACKAGE_LIBS="$PACKAGE_LIBS $GCONF_LIBS"
>   AC_DEFINE(HAVE_GCONF,1,[Define for gconf support])
> else
>   echo "***"
>   echo "*** Warning! Unable to find GConf."
>   echo "*** If you don't use gnome-volume-manager you shouldn't bother with that,"
>   echo "*** elsewhere some little features will be disabled."
>   echo "***"
> fi
> 
300c315,316
< po/Makefile.in
---
> po/Makefile
> src/libisofs/Makefile

-----------------------------------------------------------------------------------------

src/Makefile.am :

2a3,4
> SUBDIRS = libisofs
> 
49c51,53
<               wav.c graveman.h 
---
>               wav.c graveman.h \
>               import_past_sessions.c graveman.h \
>               iso.c graveman.h 

-----------------------------------------------------------------------------------------

src/config.c :

90a91
>   { CONF_STRING, "dataonfly", "", CONF_SAVEONEXIT + CONF_CHECK },
115a117
>   { CONF_STRING, "topmenu", "", CONF_SAVEONEXIT + CONF_TOPMENU },

-----------------------------------------------------------------------------------------

include/config_file.h :

34a35
> #define CONF_TOPMENU    0x0040

-----------------------------------------------------------------------------------------

src/config_grav.c

142c142
<     if ((Lcurentry->level & CONF_SPIN) || (Lcurentry->level & CONF_CHECK)) {
---
>     if ((Lcurentry->level & CONF_SPIN) || (Lcurentry->level & CONF_CHECK) || (Lcurentry->level & CONF_TOPMENU)) {
151c151
<       } else {
---
>       } else if (Lcurentry->level & CONF_CHECK) {
152a153,167
>       } else { /* if Lcurentry->level & CONF_TOPMENU */ 
>         GtkTreeModel *Ltreemodel = gtk_tree_view_get_model(GTK_TREE_VIEW(Lwidget));
>         GtkTreeIter Liter;
>         gchar *Llast = config_get_string(Lcurentry->entry);
>         gchar *Lident;
>         GtkTreeSelection *Lselection = gtk_tree_view_get_selection(GTK_TREE_VIEW(Lwidget));
>         gtk_tree_model_get_iter_first(Ltreemodel, &Liter);
>         do {
>           gtk_tree_model_get(Ltreemodel, &Liter, 0, &Lident, -1);
>           if(Llast!=NULL && !g_ascii_strcasecmp(Llast, Lident)) {
>             gtk_tree_selection_select_iter(Lselection, &Liter);
>           }
>         } while(gtk_tree_model_iter_next(Ltreemodel, &Liter));
>         g_free(Llast);
>         g_free(Lident);
248a264,273
>     } else if ((Lcurentry->level & CONF_TOPMENU) == CONF_TOPMENU) {
>       GtkTreeModel *Ltreemodel = gtk_tree_view_get_model(GTK_TREE_VIEW(Lwidget));
>       GtkTreeSelection *Lselection = gtk_tree_view_get_selection(GTK_TREE_VIEW(Lwidget));
>       GtkTreeIter Liter;
>       if (gtk_tree_selection_get_selected(Lselection, &Ltreemodel, &Liter)) {
>         gchar *Lident;
>         gtk_tree_model_get(Ltreemodel, &Liter, 0, &Lident, -1);
>         config_store_value(Lcurentry->entry, Lident);
>         g_free(Lident);
>       }

-----------------------------------------------------------------------------------------

include/import_past_sessions.h :

#ifndef _G_IMPORT_PREVIOUS_SESSION_H
#define _G_IMPORT_PREVIOUS_SESSION_H

extern void import_past_sessions(gpointer Adata);
extern void unimport_past_sessions(gpointer Adata);

#endif

-----------------------------------------------------------------------------------------

include/iso.h :

#ifndef _G_ISO_H
#define _G_ISO_H

typedef struct {
  gchar *voli;
  gchar *appi;
  gchar *copy;
  gchar *abst;
  gchar *bibl;
  gchar *prep;
  gchar *publ;
} Tisoinfo;

extern Tisoinfo *iso_get_info(Tgrave *Ag, Tdriveinfo *Adevice, gint Asector, GError **Aerror);
extern void iso_free_info(Tisoinfo *Aisoinfo);

#endif

-----------------------------------------------------------------------------------------

src/import_past_sessions.c :

#include "graveman.h"
#include "iso.h"


/* trying to import past session(s)
on th CD which is probably in the selected drive
when multisession togglebox is checked */
void import_past_sessions(gpointer Adata)
{
  Tgrave *Lg = (Tgrave *)Adata;
  Tdriveinfo *Ldrive = NULL;
  gint Lpid = 0;
  gint Lcdinfo;
  guint64 Ltotalcapacity;
  guint64 Lremainingcapacity;
  GtkComboBox *Lcomboremplidata;
  GtkTreeModel *Lmodelremplidata;
  GtkTreeIter Liter;
  guint64 Loldcapacity = 0;
  guint64 Lcurcapacity = 0;
  guint64 *Lsize;
  guint64 *Lpastsize;
  guint64 *Lmaxsize;
  gint i = 0;
  gboolean Lmounted;
  gchar Lmountpoint[_BUF_SIZE] = "";
  GtkTreeView *Lliste;
  GtkTreeModel *Ltreemodel;
  GDir *Lgdir;
  const gchar *Ldirname;
  gchar *Lfullname;
  GtkTreePath *Lpath = NULL;
  gint Lsector=0;
  Tisoinfo *Lisoinfo;

  Ldrive = matos_get_drive_info(Lg, "dstdatacombo");

  sc_grave_set_data(Lg, &Lpid, "pid");

  Lmounted = matos_umount_device(Ldrive, NULL);
_DEB("import_past_session : Lmounted : [%s]", (Lmounted ? "mounted" : "notMounted"));

  Lcdinfo = get_cdinfo_timeout(Lg, Ldrive, 2., NULL);

  /* if the CD is not a multisession appendable one, we stop here */
  if(!Lcdinfo || (Lcdinfo & _MEDIA_APPENDABLE) != _MEDIA_APPENDABLE || (Lcdinfo & _MEDIA_BLANK) == _MEDIA_BLANK) {
    sc_grave_del_data(Lg, "pid");
_DEB("import_past_session : no session found");
    return;
  }

  get_capacities(Lg, Ldrive, &Lremainingcapacity, &Ltotalcapacity, NULL);

  sc_grave_del_data(Lg, "pid");

  if(Ltotalcapacity <= Lremainingcapacity) return;

  Lcomboremplidata = GTK_COMBO_BOX(sc_grave_get_widget(Lg, "listeremplidata"));

  /* we look for the nearest capacity in the list show by listeremplidata combo widget
   * in order to get the corresponding entry in the widget active */
  Lmodelremplidata = gtk_combo_box_get_model(Lcomboremplidata);
  gtk_tree_model_get_iter_first(Lmodelremplidata, &Liter);
  do {
    gtk_tree_model_get(Lmodelremplidata, &Liter, 0, &Lcurcapacity, -1);
    Lcurcapacity *= 1024*1024;
    if(Lcurcapacity >= Ltotalcapacity) break;
    Loldcapacity = Lcurcapacity;
  } while(gtk_tree_model_iter_next(Lmodelremplidata, &Liter), ++i);
  Lmaxsize = (guint64 *)sc_grave_get_data(Lg, "datamaxsize");
  if(Lcurcapacity-Ltotalcapacity > Ltotalcapacity-Loldcapacity) {
    *Lmaxsize = Loldcapacity;
    gtk_combo_box_set_active(Lcomboremplidata, i-1);
  } else {
    *Lmaxsize = Lcurcapacity;
    gtk_combo_box_set_active(Lcomboremplidata, i);
  }

  /* update sizebar by adding datapastsize */
  Lsize = (guint64 *)sc_grave_get_data(Lg, "datasize");
  Lpastsize = (guint64 *)sc_grave_get_data(Lg, "datapastsize");
  *Lsize -= *Lpastsize;
  *Lpastsize = Ltotalcapacity-Lremainingcapacity;
  *Lsize += *Lpastsize;
_DEB("Import past session(s) : Lpastsize = [%u] (%u Mo).", (unsigned)(*Lpastsize), (unsigned)(*Lpastsize/1024/1024));
  change_remplissage_et_texte(GTK_WIDGET(Lcomboremplidata), Lg, PB_UPDATE_DATA);

  /* getting start of last session to update informations about iso9660 filesystem */
  sc_grave_set_data(Lg, &Lpid, "pid");
  Lsector = get_last_start(Lg, Ldrive, NULL);
  sc_grave_del_data(Lg, "pid");

  /* adding files from past sessions in LISTEDATA */
  matos_mount_device(Ldrive, &Lmountpoint, NULL);
  if(!Lmountpoint[0]) return;

_DEB("Mountpoint : [%s]", Lmountpoint);

  Lliste = GTK_TREE_VIEW(sc_grave_get_widget(Lg, "LISTEDATA"));
  Ltreemodel = gtk_tree_view_get_model(Lliste);
  gtk_tree_model_get_iter_first(Ltreemodel, &Liter);

  Lgdir = g_dir_open(Lmountpoint, 0, NULL);
  if (!Lgdir) {
    _WARN("erreur ouverture repertoire '%s'", Lmountpoint);
    return;
  }

  while ((Ldirname = g_dir_read_name(Lgdir))) {
    Lfullname = g_strdup_printf("%s/%s", Lmountpoint, Ldirname);
    _add_a_file(Lfullname, GTK_TREE_STORE(Ltreemodel), &Liter, Lg, Lsize, NULL, TRUE);
    g_free(Lfullname);
  }

  g_dir_close(Lgdir);

  Lpath = gtk_tree_path_new_from_indices(0, -1);
  gtk_tree_view_expand_row(Lliste, Lpath, FALSE);
  gtk_tree_path_free(Lpath);

  if(Lmounted == FALSE) matos_umount_device(Ldrive, NULL);

  /* updating informations about iso9660 filesystem (volume id, app id,...) */
  sc_grave_set_data(Lg, &Lpid, "pid");
  Lisoinfo = iso_get_info(Lg, Ldrive, Lsector, NULL);
  sc_grave_del_data(Lg, "pid");

  gtk_entry_set_text(GTK_ENTRY(sc_grave_get_widget(Lg, "datavoli")), Lisoinfo->voli);
  gtk_tree_model_get_iter_first(Ltreemodel, &Liter);  /* the CD */
  gtk_tree_store_set(GTK_TREE_STORE(Ltreemodel), &Liter, 2, Lisoinfo->voli, -1);
  gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(sc_grave_get_widget(Lg, "dataappi"))), Lisoinfo->appi, -1);
  gtk_entry_set_text(GTK_ENTRY(sc_grave_get_widget(Lg, "datacopy")), Lisoinfo->copy);
  gtk_entry_set_text(GTK_ENTRY(sc_grave_get_widget(Lg, "dataabst")), Lisoinfo->abst);
  gtk_entry_set_text(GTK_ENTRY(sc_grave_get_widget(Lg, "databibl")), Lisoinfo->bibl);
  gtk_entry_set_text(GTK_ENTRY(sc_grave_get_widget(Lg, "dataprep")), Lisoinfo->prep);
  gtk_entry_set_text(GTK_ENTRY(sc_grave_get_widget(Lg, "datapubl")), Lisoinfo->publ);

  iso_free_info(Lisoinfo);
}

void unimport_past_sessions(gpointer Adata)
{
  Tgrave *Lg = (Tgrave *)Adata;
  GtkComboBox *Lcomboremplidata;
  guint64 *Lsize;
  guint64 *Lpastsize;
  GtkTreeView *Lliste = GTK_TREE_VIEW(sc_grave_get_widget(Lg, "LISTEDATA"));
  GtkTreeModel *Lmodelliste = gtk_tree_view_get_model(Lliste);
  GtkTreeSelection *Lselection = gtk_tree_view_get_selection(Lliste);
  gtk_tree_selection_select_all(Lselection);
  GList *Lfiles = gtk_tree_selection_get_selected_rows(Lselection, &Lmodelliste);
  GList *Lrefs = NULL;
  GList *Lnode = NULL;
  GtkTreeIter Liter;
  gint Ltype;
  gpointer Lproxy = g_object_newv(G_TYPE_OBJECT, 0, NULL);

  /* update sizebar by removing datapastsize */
  Lsize = (guint64 *)sc_grave_get_data(Lg, "datasize");
  Lpastsize = (guint64 *)sc_grave_get_data(Lg, "datapastsize");
  *Lsize -= *Lpastsize;
_DEB("Unimport past session(s) : Lpastsize -= [%u] (%u Mo).", (unsigned)(*Lpastsize), (unsigned)(*Lpastsize/1024/1024));
  *Lpastsize = 0;

  Lcomboremplidata = GTK_COMBO_BOX(sc_grave_get_widget(Lg, "listeremplidata"));
  change_remplissage_et_texte(GTK_WIDGET(Lcomboremplidata), Lg, PB_UPDATE_DATA);

  /* removing all old files from LISTEDATA */
  for (Lnode = Lfiles; Lnode; Lnode = Lnode->next) {
    Lrefs = g_list_append(Lrefs, gtk_tree_row_reference_new_proxy(Lproxy, Lmodelliste, Lnode->data));
    gtk_tree_path_free(Lnode->data); /* Free unneeded tree path */
  }
  g_list_free(Lfiles); /* Emptied list */

  for (Lnode = Lrefs; Lnode; Lnode = Lnode->next) {
    GtkTreePath *Lpath = gtk_tree_row_reference_get_path(Lnode->data);

    if (Lpath) {
      gtk_tree_model_get_iter(Lmodelliste, &Liter, Lpath);
      gtk_tree_model_get(Lmodelliste, &Liter, 0, &Ltype, -1);
      if ((Ltype & TYPE_OLD) == TYPE_OLD) {
        gtk_tree_store_remove(GTK_TREE_STORE(Lmodelliste), &Liter);
        gtk_tree_row_reference_deleted(Lproxy, Lpath);
      }
      gtk_tree_path_free(Lpath);
    }
    gtk_tree_row_reference_free(Lnode->data); /* No longer needed */
  }
  g_list_free(Lrefs);

  g_object_unref(Lproxy);

  gtk_tree_selection_unselect_all(Lselection);
}

-----------------------------------------------------------------------------------------

src/iso.c :

#include "graveman.h"
#include "iso.h"


#define ISOFS_VOLI "volume id"
#define ISOFS_APPI "Application id"
#define ISOFS_COPY "Copyright id"
#define ISOFS_ABST "Abstract file id"
#define ISOFS_BIBL "Bibliographic file id"
#define ISOFS_PREP "Preparer id"
#define ISOFS_PUBL "Publisher id"

Tisoinfo *iso_get_info(Tgrave *Ag, Tdriveinfo *Adevice, gint Asector, GError **Aerror)
{
  gchar Lcommandline[_BUF_SIZE];
  gboolean Lstatus;
  gchar **Larrbuf;
  gchar **Lcmd;
  gint i;
  gint g_err, g_out, Lnbrarg;
  GIOChannel *Lcom;
  guint Lcomevent;
  gint Lloccont = 2;
  gint *Lpid = (gint *)sc_grave_get_data(Ag, "pid");
  GString *Loutput;
  gchar *Lcdprg = param_get_string("isofs");
  Tisoinfo *Lisoinfo = g_malloc0(sizeof(Tisoinfo));

  if (!Lcdprg || !*Lcdprg) return NULL;

  g_snprintf(Lcommandline, sizeof(Lcommandline)-1, "%s %s %d", Lcdprg, DRIVE_DEV(Adevice), Asector);
_DEB("execution de [%s]", Lcommandline);
  if (!g_shell_parse_argv(Lcommandline, &Lnbrarg, &Lcmd, Aerror)) return NULL;


  Lstatus = g_spawn_async_with_pipes(NULL, Lcmd, NULL, (GSpawnFlags) (G_SPAWN_DO_NOT_REAP_CHILD), NULL, NULL,
      Lpid, NULL, &g_out, &g_err, Aerror);
  g_strfreev(Lcmd);

  if (Lstatus == FALSE) return NULL;

  Loutput = g_string_new("");
  sc_grave_set_data(Ag, Loutput, "buffer");
  sc_grave_set_data(Ag, &Lloccont, "loccont");
  
  Lcom = g_io_channel_unix_new( g_out );
  g_io_channel_set_encoding (Lcom, NULL, NULL);
  g_io_channel_set_flags( Lcom, G_IO_FLAG_NONBLOCK, NULL );
  Lcomevent = g_io_add_watch (Lcom, (G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI),
                                      read_all_output_callback, Ag);

  while (Lloccont > 0) {
    gtk_main_iteration();
  }
  tools_exit_prog(*Lpid, FALSE, Aerror, NULL);

  g_source_remove(Lcomevent);

  g_io_channel_shutdown(Lcom, FALSE, NULL);
  g_io_channel_unref(Lcom);
  g_spawn_close_pid(*Lpid);


  Larrbuf = g_strsplit(Loutput->str, "\n", 0);

  g_string_free(Loutput, TRUE);

  sc_grave_del_data(Ag, "loccount");
  sc_grave_del_data(Ag, "buffer");


  for (i=0; Larrbuf[i]; i++) {
    if (!*Larrbuf[i]) continue;
    if (!strncmp(Larrbuf[i], ISOFS_VOLI, strlen(ISOFS_VOLI))) {
      Lisoinfo->voli = g_strdup(g_strrstr(Larrbuf[i], ": ")+2);
      Lisoinfo->voli = g_strchomp(Lisoinfo->voli);
    } else if (!strncmp(Larrbuf[i], ISOFS_APPI, strlen(ISOFS_APPI))) {
      Lisoinfo->appi = g_strdup(g_strrstr(Larrbuf[i], ": ")+2);
      Lisoinfo->appi = g_strchomp(Lisoinfo->appi);
    } else if (!strncmp(Larrbuf[i], ISOFS_COPY, strlen(ISOFS_COPY))) {
      Lisoinfo->copy = g_strdup(g_strrstr(Larrbuf[i], ": ")+2);
      Lisoinfo->copy = g_strchomp(Lisoinfo->copy);
    } else if (!strncmp(Larrbuf[i], ISOFS_ABST, strlen(ISOFS_ABST))) {
      Lisoinfo->abst = g_strdup(g_strrstr(Larrbuf[i], ": ")+2);
      Lisoinfo->abst = g_strchomp(Lisoinfo->abst);
    } else if (!strncmp(Larrbuf[i], ISOFS_BIBL, strlen(ISOFS_BIBL))) {
      Lisoinfo->bibl = g_strdup(g_strrstr(Larrbuf[i], ": ")+2);
      Lisoinfo->bibl = g_strchomp(Lisoinfo->bibl);
    } else if (!strncmp(Larrbuf[i], ISOFS_PREP, strlen(ISOFS_PREP))) {
      Lisoinfo->prep = g_strdup(g_strrstr(Larrbuf[i], ": ")+2);
      Lisoinfo->prep = g_strchomp(Lisoinfo->prep);
    } else if (!strncmp(Larrbuf[i], ISOFS_PUBL, strlen(ISOFS_PUBL))) {
      Lisoinfo->publ = g_strdup(g_strrstr(Larrbuf[i], ": ")+2);
      Lisoinfo->publ = g_strchomp(Lisoinfo->publ);
    }
  }
  
  g_strfreev(Larrbuf);

  return Lisoinfo;
}


void iso_free_info(Tisoinfo *Aisoinfo)
{
  g_free(Aisoinfo->voli);
  g_free(Aisoinfo->appi);
  g_free(Aisoinfo->copy);
  g_free(Aisoinfo->abst);
  g_free(Aisoinfo->bibl);
  g_free(Aisoinfo->prep);
  g_free(Aisoinfo->publ);
  
  g_free(Aisoinfo);
}

-----------------------------------------------------------------------------------------

src/libisofs : à télécharger à l'adresse : http://libcdrom.sourceforge.net/libisofs.html

-----------------------------------------------------------------------------------------

src/libisofs/Makefile.am :

## Process this file with automake to produce Makefile.in

## This file is part of graveman (and not libisofs)

AM_CFLAGS = -DISOFS_MAIN -O3 -Wall -pedantic 

bin_PROGRAMS = isofs

isofs_SOURCES = isofs.c

EDIT : Correction d'un bug (retard au lancement de 30 secondes si absence de CD).
EDIT2 : Ajout de fonctionallités : importation des fichiers, infos du système de fichier iso9660.

Dernière modification par PierreR (Le 28/12/2005, à 22:13)

Hors ligne

#2 Le 29/12/2005, à 13:35

PierreR

Re : [Graveman] Importation des sessions précédentes

Le paquet était cassé, c'est réparé : http://simelec.aircraftcutaway.com/grav … 1_i386.deb.

Hors ligne

#3 Le 30/12/2005, à 10:21

thx1138

Re : [Graveman] Importation des sessions précédentes

Excellent!
Mais je me demande pourquoi tu postes cela ici au lieu d'envoyer le patch directement aux développeurs ?


They did not know it was impossible, so they did it - Mark Twain

Hors ligne

#4 Le 30/12/2005, à 12:20

cassidy

Re : [Graveman] Importation des sessions précédentes

J'appuie la remarque de thx1138.

Et utilise svn di pour faire tes patchs, il utilisera diff -up qui fournit un output beaucoup plus lisibile pour le review.


"I came for the quality. I stayed for the freedom." - Sean Neakums

Hors ligne

#5 Le 30/12/2005, à 20:20

PierreR

Re : [Graveman] Importation des sessions précédentes

Ben je lui ai transmis aussi (à Sylvain Cresto, l'auteur) mais je voulais aussi avoir un retour, savoir s'il y a des bugs, des choses à modifier/ajouter ou des choses qui seraient écrites d'une façon pas très saine si jamais quelqu'un avait eu le courage de regarder le code.

Voila le patch de SVN, merci cassidy, c''est beaucoup plus pratique et aussi infiniment plus facile à générer : http://simelec.aircraftcutaway.com/grav … ions.patch.

EDIT : affichage d'un message dans la barre de status.

Dernière modification par PierreR (Le 31/12/2005, à 01:38)

Hors ligne

#6 Le 07/01/2006, à 16:12

PierreR

Re : [Graveman] Importation des sessions précédentes

Ça fait prés de trois semaines que j'ai écrit au développeur et je n'ai toujours pas de réponse. Suis je trop impatient ?
J'avoue que pour ma première contribution à un logiciel libre, je suis un peu blasé :-(.

Hors ligne

#7 Le 07/01/2006, à 17:21

thx1138

Re : [Graveman] Importation des sessions précédentes

Trois semaines c'est beaucoup, trop même. Mais peut-être est-il en vacances, qui sait ?
Non tu n'es pas trop impatient, du tout. Je dirais même que tu es très patient ...
Renvoye-lui un mail pour lui demander quoi.
Et s'il ne répond toujours pas ... change de logiciel de gravure (GnomeBaker par exemple).


They did not know it was impossible, so they did it - Mark Twain

Hors ligne

#8 Le 08/01/2006, à 19:34

PierreR

Re : [Graveman] Importation des sessions précédentes

Bon, d'après yeKim qui le connait (c'est l'auteur du logo de graveman) l'explication est beaucoup plus originale et moins amusante que des vacances, l'auteur a -- tout betement -- de grosses difficultés avec sa connection internet d'où son mutisme.

Hors ligne

#9 Le 08/01/2006, à 22:09

cassidy

Re : [Graveman] Importation des sessions précédentes

Bah si je devais m'emballer pour chaque patch dont j'ai toujours pas de review après 3 semaines ...

Le mieux est d'envoyer sur le bugzilla et/ou mailing list du projet afin que, même si le développeur principale n'a pas le temps, d'autres personnes puissent éventuellement s'occuper de ta contribution.
Mais en pratique, les développeurs sont des gens tellement occupés que les reviews des contributions sont parfois très (trop) long. :\


"I came for the quality. I stayed for the freedom." - Sean Neakums

Hors ligne

#10 Le 22/01/2006, à 12:24

PierreR

Re : [Graveman] Importation des sessions précédentes

Désolé si j'ai pu donner l'impression de m'emballer mais c'est un relativement petit projet donc le développeur principal est seul et il est semble t-il vraiment injoignable.
Sachant que c'était le premier patch que j'écriveais et que j'y ai passé une part non negligeable de mes vacances de Noël, ça me parait normal d'être un peu déçu !

Hors ligne

#11 Le 24/12/2006, à 17:57

www.rzr.online.fr

Re : [Graveman] Importation des sessions précédentes

Un peu HS mais je me demandais comment restaurer les sessions precedentes au cas ou des fichiers auraient ete dereferencés
...
Je prends des notes a http://rzr.online.fr/q/Samsung


# http://identi.ca/rzr # tel mobiles sous linux ca rulez ! (maemo, openmoko, android etc)
# http://rzr.online.fr/q/apt # svp testez mes .deb's         
# http://rzr.online.fr/q/unicorn.fr # BeWan USB gris : (marche sur dapper)
# http://go.cur.lv/files# files to be shared or email me

Hors ligne

#12 Le 24/12/2006, à 18:08

PierreR

Re : [Graveman] Importation des sessions précédentes

Heu, pas tous compris là. De toute façon, je n'ai plus le temps de m'occuper de ça et le projet semble vraiment totalement mort, il y a six mois que je n'ai plus la moindre nouvelle du développeur.

Hors ligne