| 235 |
} |
} |
| 236 |
|
|
| 237 |
/* renommer un element (fichier ou repertoire) */ |
/* renommer un element (fichier ou repertoire) */ |
| 238 |
void gtk_data_renommerelement(GtkWidget *Abtn, gpointer Adata) |
void callbacks_data_renameitem(GtkWidget *Abtn, gpointer Adata) |
| 239 |
{ |
{ |
| 240 |
Tgrave *Lg = (Tgrave *)Adata; |
Tgrave *Lg = (Tgrave *)Adata; |
| 241 |
GtkTreeView *Lliste = GTK_TREE_VIEW(sc_grave_get_data(Lg, "_current_list")); |
GtkTreeView *Lliste = GTK_TREE_VIEW(sc_grave_get_data(Lg, "_current_list")); |
| 715 |
GtkEntry *Ldevicename = GTK_ENTRY(sc_grave_get_widget(Ldialoghash, "devicename")); |
GtkEntry *Ldevicename = GTK_ENTRY(sc_grave_get_widget(Ldialoghash, "devicename")); |
| 716 |
gchar *Lbus = (gchar *)gtk_entry_get_text(Ldevicebus); |
gchar *Lbus = (gchar *)gtk_entry_get_text(Ldevicebus); |
| 717 |
Tdriveinfo *Ldrive = g_malloc0(sizeof(Tdriveinfo)); |
Tdriveinfo *Ldrive = g_malloc0(sizeof(Tdriveinfo)); |
| 718 |
|
|
| 719 |
maj_drive_info(Ldrive, Lbus, NULL); |
proc_init_cdrominfo(NULL); |
| 720 |
|
matos_maj_drive_info(Ldrive, Lbus, NULL); |
| 721 |
|
proc_free_cdrominfo(); |
| 722 |
|
|
| 723 |
if (Ldrive->type == 0) { |
if (Ldrive->type == 0) { |
| 724 |
Lmessage = gtk_message_dialog_new(GTK_WINDOW(Lparent), |
Lmessage = gtk_message_dialog_new(GTK_WINDOW(Lparent), |
| 910 |
GSList *Llmediarequis = g_slist_append(NULL, GINT_TO_POINTER(_MEDIA_CDR + _MEDIA_NOBLANK + _MEDIA_APPENDABLE)); |
GSList *Llmediarequis = g_slist_append(NULL, GINT_TO_POINTER(_MEDIA_CDR + _MEDIA_NOBLANK + _MEDIA_APPENDABLE)); |
| 911 |
gboolean Lstatus; |
gboolean Lstatus; |
| 912 |
|
|
| 913 |
Lstatus = waiting_for_user(_MEDIA_TITLE_BLANKORAPPENDABLE, Lg, Llmediarequis, NULL, get_drive_info(Lg, "dstothercombo")); |
Lstatus = waiting_for_user(_MEDIA_TITLE_BLANKORAPPENDABLE, Lg, Llmediarequis, NULL, matos_get_drive_info(Lg, "dstothercombo")); |
| 914 |
g_slist_free(Llmediarequis); |
g_slist_free(Llmediarequis); |
| 915 |
|
|
| 916 |
if (Lstatus==FALSE) return; |
if (Lstatus==FALSE) return; |
| 988 |
GtkWidget *Lconfirm; |
GtkWidget *Lconfirm; |
| 989 |
GSList *Llmediarequis = g_slist_append(NULL, GINT_TO_POINTER(_MEDIA_CDRW + _MEDIA_NOBLANK)); |
GSList *Llmediarequis = g_slist_append(NULL, GINT_TO_POINTER(_MEDIA_CDRW + _MEDIA_NOBLANK)); |
| 990 |
gboolean Lstatus; |
gboolean Lstatus; |
| 991 |
Lstatus = waiting_for_user(_MEDIA_TITLE_BLANKORAPPENDABLE, Lg, Llmediarequis, NULL, get_drive_info(Lg, "dstothercombo")); |
Lstatus = waiting_for_user(_MEDIA_TITLE_BLANKORAPPENDABLE, Lg, Llmediarequis, NULL, matos_get_drive_info(Lg, "dstothercombo")); |
| 992 |
g_slist_free(Llmediarequis); |
g_slist_free(Llmediarequis); |
| 993 |
|
|
| 994 |
if (Lstatus==FALSE) return; |
if (Lstatus==FALSE) return; |
| 1055 |
} |
} |
| 1056 |
Ltxt = _("Do you really want to create an audio cd ?"); |
Ltxt = _("Do you really want to create an audio cd ?"); |
| 1057 |
Ltitle = _("Writing audio cd in progress..."); |
Ltitle = _("Writing audio cd in progress..."); |
| 1058 |
Ldevicename1 = get_drive_info(Lg, "dstaudiocombo"); |
Ldevicename1 = matos_get_drive_info(Lg, "dstaudiocombo"); |
| 1059 |
Llmediarequis1 = manage_mediarequis(NULL, |
Llmediarequis1 = manage_mediarequis(NULL, |
| 1060 |
_MEDIA_CDR + _MEDIA_BLANK, _MEDIA_CDR + _MEDIA_APPENDABLE, |
_MEDIA_CDR + _MEDIA_BLANK, _MEDIA_CDR + _MEDIA_APPENDABLE, |
| 1061 |
_MEDIA_CDRW + _MEDIA_BLANK, _MEDIA_CDRW + _MEDIA_APPENDABLE, |
_MEDIA_CDRW + _MEDIA_BLANK, _MEDIA_CDRW + _MEDIA_APPENDABLE, |
| 1083 |
} |
} |
| 1084 |
|
|
| 1085 |
if (Loperation == WRITE_CD) { |
if (Loperation == WRITE_CD) { |
| 1086 |
Ldevicename1 = get_drive_info(Lg, "dstdatacombo"); |
Ldevicename1 = matos_get_drive_info(Lg, "dstdatacombo"); |
| 1087 |
Liso = !Ldevicename1; |
Liso = !Ldevicename1; |
| 1088 |
if (Liso) { |
if (Liso) { |
| 1089 |
Ltxt = _("Do you really want to create an iso image ?"); |
Ltxt = _("Do you really want to create an iso image ?"); |
| 1104 |
Ltitle = _("Writing iso image in progress..."); |
Ltitle = _("Writing iso image in progress..."); |
| 1105 |
} |
} |
| 1106 |
} else { |
} else { |
| 1107 |
Ldevicename1 = get_drive_info(Lg, "dstdvddatacombo"); |
Ldevicename1 = matos_get_drive_info(Lg, "dstdvddatacombo"); |
| 1108 |
Liso = !Ldevicename1; |
Liso = !Ldevicename1; |
| 1109 |
if (!Liso) { |
if (!Liso) { |
| 1110 |
Ltxt = _("Do you really want to create a data dvd ?"); |
Ltxt = _("Do you really want to create a data dvd ?"); |
| 1126 |
|
|
| 1127 |
Ltxt = _("Do you really want to start the copy ?"); |
Ltxt = _("Do you really want to start the copy ?"); |
| 1128 |
Ltitle = _("Copying in progress..."); |
Ltitle = _("Copying in progress..."); |
| 1129 |
Ldevicename1 = get_drive_info(Lg, "srccopycombo"); |
Ldevicename1 = matos_get_drive_info(Lg, "srccopycombo"); |
| 1130 |
Liso = !Ldevicename1; |
Liso = !Ldevicename1; |
| 1131 |
if (!Liso) { |
if (!Liso) { |
| 1132 |
Llmediarequis1 = manage_mediarequis(NULL, _MEDIA_CD + _MEDIA_NOBLANK, -1); |
Llmediarequis1 = manage_mediarequis(NULL, _MEDIA_CD + _MEDIA_NOBLANK, -1); |
| 1133 |
Lmediatitle1 = _MEDIA_CD; |
Lmediatitle1 = _MEDIA_CD; |
| 1134 |
} |
} |
| 1135 |
Ldevicename2 = get_drive_info(Lg, "dstcopycombo"); |
Ldevicename2 = matos_get_drive_info(Lg, "dstcopycombo"); |
| 1136 |
|
|
| 1137 |
if (Ldevicename2) { |
if (Ldevicename2) { |
| 1138 |
Llmediarequis2 = manage_mediarequis(NULL, |
Llmediarequis2 = manage_mediarequis(NULL, |
| 1308 |
gtk_data_addfile(NULL, Lg); |
gtk_data_addfile(NULL, Lg); |
| 1309 |
return TRUE; |
return TRUE; |
| 1310 |
} |
} |
| 1311 |
} else if (Aevent->keyval == GDK_plus) { |
/* } else if (Aevent->keyval == GDK_plus) {*/ |
| 1312 |
/* appuis sur la touche plus */ |
/* appuis sur la touche plus */ |
| 1313 |
} else if (Aevent->keyval == GDK_minus) { |
/* } else if (Aevent->keyval == GDK_minus) {*/ |
| 1314 |
/* appuis sur la touche moins */ |
/* appuis sur la touche moins */ |
| 1315 |
|
} else if ((Aevent->keyval >= GDK_exclam && Aevent->keyval <= GDK_EuroSign) || |
| 1316 |
|
(Aevent->keyval >= GDK_KP_0 && Aevent->keyval <= GDK_KP_9)) { |
| 1317 |
|
guint Lkey = Aevent->keyval >=GDK_KP_0 ? Aevent->keyval - 0xFF80 : Aevent->keyval; |
| 1318 |
|
|
| 1319 |
|
callbacks_try_to_select(Lkey, GTK_TREE_VIEW(Aliste), Lg); |
| 1320 |
} |
} |
| 1321 |
|
|
| 1322 |
return FALSE; |
return FALSE; |
| 1608 |
gtk_widget_show(Lwin); |
gtk_widget_show(Lwin); |
| 1609 |
Ltimeout = g_timeout_add(500, encours_callback, Lg); |
Ltimeout = g_timeout_add(500, encours_callback, Lg); |
| 1610 |
|
|
| 1611 |
scan_for_drives(Lg, NULL); |
cdrecord_scan_for_drives(Lg, NULL); |
| 1612 |
|
|
| 1613 |
if (Labort == FALSE) { |
if (Labort == FALSE) { |
| 1614 |
|
proc_init_cdrominfo(NULL); |
| 1615 |
for (Lcur = Glistdrives; Lcur; Lcur = Lcur ? g_slist_next(Lcur) : Lnext) { |
for (Lcur = Glistdrives; Lcur; Lcur = Lcur ? g_slist_next(Lcur) : Lnext) { |
| 1616 |
Ldrive = (Tdriveinfo *)Lcur->data; |
Ldrive = (Tdriveinfo *)Lcur->data; |
| 1617 |
if (g_slist_length(Ldrive->dev)>0) { |
if (g_slist_length(Ldrive->dev)>0) { |
| 1619 |
gtk_label_set_text(GTK_LABEL(sc_grave_get_widget(Lg, "labelava")), Ltxt); g_free(Ltxt); |
gtk_label_set_text(GTK_LABEL(sc_grave_get_widget(Lg, "labelava")), Ltxt); g_free(Ltxt); |
| 1620 |
while(gtk_events_pending()) gtk_main_iteration(); |
while(gtk_events_pending()) gtk_main_iteration(); |
| 1621 |
|
|
| 1622 |
maj_drive_info(Ldrive, (gchar *)g_slist_nth_data(Ldrive->dev, 0), NULL); |
/* matos_maj_drive_info(Ldrive, (gchar *)g_slist_nth_data(Ldrive->dev, 0), NULL);*/ |
| 1623 |
|
matos_maj_drive_info(Ldrive, NULL, NULL); |
| 1624 |
|
|
| 1625 |
/* on n'ajoute que les lecteurs/graveurs */ |
/* on n'ajoute que les lecteurs/graveurs */ |
| 1626 |
if (Ldrive->type == 0) { |
if (Ldrive->type == 0) { |
| 1631 |
} |
} |
| 1632 |
} |
} |
| 1633 |
} |
} |
| 1634 |
|
proc_free_cdrominfo(); |
| 1635 |
} |
} |
| 1636 |
|
|
| 1637 |
/* on attend la fin d'execution de la popup d'attente */ |
/* on attend la fin d'execution de la popup d'attente */ |
| 2084 |
gtk_widget_set_sensitive(GTK_WIDGET(Lspin), ! Lact); |
gtk_widget_set_sensitive(GTK_WIDGET(Lspin), ! Lact); |
| 2085 |
} |
} |
| 2086 |
|
|
| 2087 |
|
/* select items begining with key user has pressed */ |
| 2088 |
|
gboolean callbacks_try_to_select(guint Akey, GtkTreeView *Aliste, Tgrave *Ag) |
| 2089 |
|
{ |
| 2090 |
|
GtkTreeModel *Ltreemodel = gtk_tree_view_get_model(GTK_TREE_VIEW(Aliste)); |
| 2091 |
|
GtkTreePath *Lpath = NULL; |
| 2092 |
|
gchar *Lname; |
| 2093 |
|
GtkTreeIter Liter; |
| 2094 |
|
gboolean Ltrouve = FALSE; |
| 2095 |
|
gboolean Lfirstiteration = TRUE; |
| 2096 |
|
gboolean Lskip = FALSE; |
| 2097 |
|
|
| 2098 |
|
gtk_tree_view_get_cursor(Aliste, &Lpath, NULL); |
| 2099 |
|
if (!Lpath) return FALSE; |
| 2100 |
|
|
| 2101 |
|
while (1) { |
| 2102 |
|
while (1) { |
| 2103 |
|
if (Lskip == FALSE) { |
| 2104 |
|
gtk_tree_path_next(Lpath); |
| 2105 |
|
} else { |
| 2106 |
|
Lskip = FALSE; |
| 2107 |
|
} |
| 2108 |
|
if (!gtk_tree_model_get_iter(Ltreemodel, &Liter, Lpath)) break; |
| 2109 |
|
|
| 2110 |
|
gtk_tree_model_get(Ltreemodel, &Liter, 2, &Lname, -1); |
| 2111 |
|
if (!Lname) continue; |
| 2112 |
|
|
| 2113 |
|
if (*(tools_next_no_char(Lname, (gchar ) GDK_space)) == Akey) { |
| 2114 |
|
Ltrouve = TRUE; |
| 2115 |
|
break; |
| 2116 |
|
} |
| 2117 |
|
} |
| 2118 |
|
|
| 2119 |
|
if (Lfirstiteration == FALSE || Ltrouve == TRUE) { |
| 2120 |
|
break; |
| 2121 |
|
} else { |
| 2122 |
|
Lfirstiteration = FALSE; |
| 2123 |
|
while (gtk_tree_path_prev(Lpath)) ; |
| 2124 |
|
Lskip = TRUE; |
| 2125 |
|
} |
| 2126 |
|
} |
| 2127 |
|
|
| 2128 |
|
if (Ltrouve) { |
| 2129 |
|
gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(Aliste), Lpath, NULL, FALSE, 0, 0); |
| 2130 |
|
gtk_tree_view_set_cursor(GTK_TREE_VIEW(Aliste), Lpath, NULL, TRUE); |
| 2131 |
|
} |
| 2132 |
|
|
| 2133 |
|
gtk_tree_path_free(Lpath); |
| 2134 |
|
|
| 2135 |
|
return Ltrouve; |
| 2136 |
|
} |
| 2137 |
|
|
| 2138 |
/* gestion des tris */ |
/* gestion des tris */ |
| 2139 |
void gtk_data_asksort(GtkWidget *Abtn, gpointer Adata) |
void callbacks_data_asksort(GtkWidget *Abtn, gpointer Adata) |
| 2140 |
{ |
{ |
| 2141 |
Tgrave *Lg = (Tgrave *)Adata; |
Tgrave *Lg = (Tgrave *)Adata; |
| 2142 |
GtkTreeView *Lliste = GTK_TREE_VIEW(sc_grave_get_data(Lg, "_current_list")); |
GtkTreeView *Lliste = GTK_TREE_VIEW(sc_grave_get_data(Lg, "_current_list")); |
| 2143 |
GtkTreeModel *Ltreemodel = gtk_tree_view_get_model(GTK_TREE_VIEW(Lliste)); |
GtkTreeModel *Ltreemodel = gtk_tree_view_get_model(GTK_TREE_VIEW(Lliste)); |
| 2144 |
GtkTreeSortable *Lsort = NULL; |
GtkTreeSortable *Lsort = NULL; |
| 2145 |
gint Lcolid; |
/* gint Lcolid; |
| 2146 |
GtkSortType Lorder; |
GtkSortType Lorder;*/ |
| 2147 |
const gchar *Lname; |
const gchar *Lname; |
| 2148 |
|
|
| 2149 |
if (!GTK_IS_WIDGET(Abtn) || !GTK_IS_WIDGET(Lliste)) return; |
if (!GTK_IS_WIDGET(Abtn) || !GTK_IS_WIDGET(Lliste)) return; |