308 |
return Lmenu; |
return Lmenu; |
309 |
} |
} |
310 |
|
|
311 |
|
/* menu popup sur le formatage d'un dvd */ |
312 |
|
GtkMenu *create_gtkpopupmenuformatdvd(GHashTable *Ahash) |
313 |
|
{ |
314 |
|
GtkMenu *Lmenu = GTK_MENU(g_hash_table_lookup(Ahash, "popupformatdvd")); |
315 |
|
|
316 |
|
return Lmenu; |
317 |
|
} |
318 |
|
|
319 |
/* menu popup sur les pistes audio */ |
/* menu popup sur les pistes audio */ |
320 |
GtkMenu *create_gtkpopupmenuaudio(GtkWidget *Aliste, GHashTable *Ahash) |
GtkMenu *create_gtkpopupmenuaudio(GtkWidget *Aliste, GHashTable *Ahash) |
321 |
{ |
{ |
552 |
g_signal_connect(G_OBJECT(glade_to_hash(Axml, Ahash, "popupdisp_hidestatusbar")), |
g_signal_connect(G_OBJECT(glade_to_hash(Axml, Ahash, "popupdisp_hidestatusbar")), |
553 |
"activate", G_CALLBACK(gtk_display_switchstatusbar), Ahash); |
"activate", G_CALLBACK(gtk_display_switchstatusbar), Ahash); |
554 |
|
|
555 |
|
/* popup formater un dvd */ |
556 |
|
glade_to_hash(Axml, Ahash, "popupformatdvd"); |
557 |
|
g_signal_connect(G_OBJECT(glade_to_hash(Axml, Ahash, "popupform_format")), |
558 |
|
"activate", G_CALLBACK(gtk_confirm_dvdoperation), Ahash); |
559 |
|
g_signal_connect(G_OBJECT(glade_to_hash(Axml, Ahash, "popupform_blank")), |
560 |
|
"activate", G_CALLBACK(gtk_confirm_dvdoperation), Ahash); |
561 |
|
g_signal_connect(G_OBJECT(glade_to_hash(Axml, Ahash, "popupform_blankfull")), |
562 |
|
"activate", G_CALLBACK(gtk_confirm_dvdoperation), Ahash); |
563 |
} |
} |
564 |
|
|
565 |
GtkAlignment *new_seliso(gchar *Aname, GtkWidget *Aparent) |
GtkAlignment *new_seliso(gchar *Aname, GtkWidget *Aparent) |
617 |
GtkNotebook *Lbodycdaudio, *Lbodycddata, *Lbodycdcopy, *Lbodycdother; |
GtkNotebook *Lbodycdaudio, *Lbodycddata, *Lbodycdcopy, *Lbodycdother; |
618 |
GtkHBox *Lmainbody; |
GtkHBox *Lmainbody; |
619 |
GtkComboBox *Lcombo; |
GtkComboBox *Lcombo; |
620 |
GtkButton *Lbtnerasecdrw; |
GtkButton *Lbtnerasecdrw, *Lbtnformatdvdrw; |
621 |
GtkTreeView *Ltreeaudio, *Ltreedata, *Ltopmenu; |
GtkTreeView *Ltreeaudio, *Ltreedata, *Ltopmenu; |
622 |
GHashTable *Lhash = _hash(); |
GHashTable *Lhash = _hash(); |
623 |
|
|
706 |
prepare_disable_when_iso(Lhash, "dstcopycombo", "nbrcdcopy", "copysimul", NULL); |
prepare_disable_when_iso(Lhash, "dstcopycombo", "nbrcdcopy", "copysimul", NULL); |
707 |
|
|
708 |
Lbtnerasecdrw = GTK_BUTTON(glade_to_hash(Lxml, Lhash, "btnerasecdrwother1")); |
Lbtnerasecdrw = GTK_BUTTON(glade_to_hash(Lxml, Lhash, "btnerasecdrwother1")); |
709 |
|
Lbtnformatdvdrw = GTK_BUTTON(glade_to_hash(Lxml, Lhash, "btnformatdvdrwother1")); |
710 |
prepare_combobox_graveur(Lxml, Lhash, "dstother"); |
prepare_combobox_graveur(Lxml, Lhash, "dstother"); |
711 |
prepare_disable_when_notcdrw(Lhash, "dstothercombo", "btnerasecdrwother1", NULL); |
prepare_disable_when(Lhash, "dstothercombo_notcdrw", "btnerasecdrwother1", NULL); |
712 |
|
prepare_disable_when(Lhash, "dstothercombo_notdvdrw", "btnformatdvdrwother1", NULL); |
713 |
|
|
714 |
update_combo_graveur(Lhash); |
update_combo_graveur(Lhash); |
715 |
|
|
742 |
|
|
743 |
/* boutons de la page "autres operations" */ |
/* boutons de la page "autres operations" */ |
744 |
g_signal_connect(G_OBJECT(Lbtnerasecdrw), "clicked", G_CALLBACK(confirm_erasecdrw), Lhash); |
g_signal_connect(G_OBJECT(Lbtnerasecdrw), "clicked", G_CALLBACK(confirm_erasecdrw), Lhash); |
745 |
|
g_signal_connect(G_OBJECT(Lbtnformatdvdrw), "clicked", G_CALLBACK(popup_formatdvdrw), Lhash); |
746 |
g_signal_connect(G_OBJECT(glade_xml_get_widget(Lxml, "btnfixcdother1")), "clicked", G_CALLBACK(confirm_fixcd), Lhash); |
g_signal_connect(G_OBJECT(glade_xml_get_widget(Lxml, "btnfixcdother1")), "clicked", G_CALLBACK(confirm_fixcd), Lhash); |
747 |
|
|
748 |
|
|
1214 |
} |
} |
1215 |
|
|
1216 |
/* objets a cacher lorsque l'on selectionne une image iso en tant que source ou destination */ |
/* objets a cacher lorsque l'on selectionne une image iso en tant que source ou destination */ |
1217 |
void prepare_disable_when_notcdrw(GHashTable *Ahash, gchar *Abasename, const gchar *Afirst, ...) |
void prepare_disable_when(GHashTable *Ahash, gchar *Abasename, const gchar *Afirst, ...) |
1218 |
{ |
{ |
1219 |
va_list Largs; |
va_list Largs; |
1220 |
gchar *Lbuf = (gchar *) Afirst; |
gchar *Lbuf = (gchar *) Afirst; |
1221 |
gint Lnbr = 0; |
gint Lnbr = 0; |
1222 |
gchar *Lname = g_strdup_printf("%s_notcdrwtodisabled%d", Abasename, Lnbr++); |
gchar *Lname = g_strdup_printf("%stodisabled%d", Abasename, Lnbr++); |
1223 |
gchar *Lcur; |
gchar *Lcur; |
1224 |
|
|
1225 |
g_hash_table_insert(Ahash, Lname, g_hash_table_lookup(Ahash, Afirst)); |
g_hash_table_insert(Ahash, Lname, g_hash_table_lookup(Ahash, Afirst)); |
1228 |
while (*Lbuf++) { |
while (*Lbuf++) { |
1229 |
if (!(Lcur = va_arg(Largs, gchar *))) break; |
if (!(Lcur = va_arg(Largs, gchar *))) break; |
1230 |
|
|
1231 |
Lname = g_strdup_printf("%s_notcdrwtodisabled%d", Abasename, Lnbr++); |
Lname = g_strdup_printf("%stodisabled%d", Abasename, Lnbr++); |
1232 |
g_hash_table_insert(Ahash, Lname, g_hash_table_lookup(Ahash, Lcur)); |
g_hash_table_insert(Ahash, Lname, g_hash_table_lookup(Ahash, Lcur)); |
1233 |
} |
} |
1234 |
|
|
1605 |
glade_to_hash_list(Lxml, Lhash, "sox", "soxlbl", "soxpara", NULL); |
glade_to_hash_list(Lxml, Lhash, "sox", "soxlbl", "soxpara", NULL); |
1606 |
glade_to_hash_list(Lxml, Lhash, "growisofs", "growisofslbl", "growisofspara", NULL); |
glade_to_hash_list(Lxml, Lhash, "growisofs", "growisofslbl", "growisofspara", NULL); |
1607 |
glade_to_hash_list(Lxml, Lhash, "dvd+rw-mediainfo", "dvd+rw-mediainfolbl", "dvd+rw-mediainfopara", NULL); |
glade_to_hash_list(Lxml, Lhash, "dvd+rw-mediainfo", "dvd+rw-mediainfolbl", "dvd+rw-mediainfopara", NULL); |
1608 |
|
glade_to_hash_list(Lxml, Lhash, "dvd+rw-format", "dvd+rw-formatlbl", "dvd+rw-formatpara", NULL); |
1609 |
glade_to_hash(Lxml, Lhash, "popupdevices"); |
glade_to_hash(Lxml, Lhash, "popupdevices"); |
1610 |
|
|
1611 |
/** onglet "Lecteurs" **/ |
/** onglet "Lecteurs" **/ |
1818 |
|
|
1819 |
if (Lerror) g_error_free(Lerror); |
if (Lerror) g_error_free(Lerror); |
1820 |
} |
} |
1821 |
|
|
1822 |
|
/* formater un dvd */ |
1823 |
|
void show_dvdformatwindow(GHashTable *Ahash, gchar *Atitle, Ttypeformatdvd Aoperation) |
1824 |
|
{ |
1825 |
|
GtkWidget *Lwindow1 = g_hash_table_lookup(Ahash, "window"); |
1826 |
|
GladeXML *Lxmlencours = create_window_encours(Lwindow1); |
1827 |
|
gint Lcont = 2; |
1828 |
|
gint Lpid; |
1829 |
|
gboolean Loperationstatus = FALSE; |
1830 |
|
gboolean Labort = FALSE; |
1831 |
|
GtkWidget *Lprogressbar; |
1832 |
|
GtkLabel *Llabel; |
1833 |
|
GtkWidget *Lcancel; |
1834 |
|
GtkWidget *Lwin; |
1835 |
|
GHashTable *Lformatdvdhash = _hash(); |
1836 |
|
GError *Lerror = NULL; |
1837 |
|
GtkWidget *Lstatusbox = NULL; |
1838 |
|
|
1839 |
|
Lwin = glade_xml_get_widget(Lxmlencours, "window_inprogress"); |
1840 |
|
Llabel = GTK_LABEL(glade_xml_get_widget(Lxmlencours, "labelava")); |
1841 |
|
gtk_label_set_text(Llabel, Atitle); |
1842 |
|
|
1843 |
|
|
1844 |
|
Lprogressbar = glade_xml_get_widget(Lxmlencours, "progress"); |
1845 |
|
g_hash_table_insert(Lformatdvdhash, "cont", &Lcont); |
1846 |
|
g_hash_table_insert(Lformatdvdhash, "pid", &Lpid); |
1847 |
|
g_hash_table_insert(Lformatdvdhash, "gabort", &Labort); |
1848 |
|
g_hash_table_insert(Lformatdvdhash, "gerror", &Lerror); |
1849 |
|
g_hash_table_insert(Lformatdvdhash, "operationstatus", &Loperationstatus); |
1850 |
|
g_hash_table_insert(Lformatdvdhash, "labelava", Llabel); |
1851 |
|
g_hash_table_insert(Lformatdvdhash, "progress", Lprogressbar); |
1852 |
|
g_hash_table_insert(Lformatdvdhash, "dstothercombo", g_hash_table_lookup(Ahash, "dstothercombo")); |
1853 |
|
|
1854 |
|
/* bouton annuler */ |
1855 |
|
Lcancel = glade_xml_get_widget(Lxmlencours, "cancelbtn"); |
1856 |
|
g_signal_connect(G_OBJECT(Lcancel), "clicked", G_CALLBACK(abort_encours), Lformatdvdhash); |
1857 |
|
g_signal_connect(G_OBJECT(Lwin), "delete-event", G_CALLBACK(delete_event_encours), Lformatdvdhash); |
1858 |
|
|
1859 |
|
gtk_widget_show(Lwin); |
1860 |
|
// g_timeout_add(500, encours_callback, Lformatdvdhash); |
1861 |
|
/* operation en elle meme */ |
1862 |
|
perform_format_dvd(Lformatdvdhash, Aoperation, &Lerror); |
1863 |
|
|
1864 |
|
if (Labort) { |
1865 |
|
Lstatusbox = gtk_message_dialog_new(GTK_WINDOW(Lwin), |
1866 |
|
GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, |
1867 |
|
_("Operation aborted by user !")); |
1868 |
|
} else if (Lerror) { |
1869 |
|
Lstatusbox = gtk_message_dialog_new(GTK_WINDOW(Lwin), |
1870 |
|
GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, |
1871 |
|
Lerror->message); |
1872 |
|
} else { |
1873 |
|
Lstatusbox = gtk_message_dialog_new(GTK_WINDOW(Lwin), |
1874 |
|
GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, |
1875 |
|
_("Operation successful")); |
1876 |
|
} |
1877 |
|
gtk_dialog_run(GTK_DIALOG(Lstatusbox)); |
1878 |
|
gtk_widget_destroy(Lstatusbox); |
1879 |
|
|
1880 |
|
gtk_widget_destroy(Lwin); |
1881 |
|
g_hash_table_destroy(Lformatdvdhash); |
1882 |
|
|
1883 |
|
if (Lerror) g_error_free(Lerror); |
1884 |
|
} |
1885 |
|
|
1886 |
/* |
/* |
1887 |
* vim:et:ts=8:sts=2:sw=2 |
* vim:et:ts=8:sts=2:sw=2 |