[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Graveman-cvs] Changes to graveman/current/src/matos.c
From: |
sylvain cresto |
Subject: |
[Graveman-cvs] Changes to graveman/current/src/matos.c |
Date: |
Thu, 21 Apr 2005 20:04:36 -0400 |
Index: graveman/current/src/matos.c
diff -u graveman/current/src/matos.c:1.29 graveman/current/src/matos.c:1.30
--- graveman/current/src/matos.c:1.29 Tue Apr 12 23:12:52 2005
+++ graveman/current/src/matos.c Fri Apr 22 00:04:33 2005
@@ -539,39 +539,55 @@
return Lstatus;
}
-void set_waitwindow_title(gboolean Ainsert, gint Atypecd, Tgrave *Awaitg)
-{
- gchar Lcd[_BUF_SIZE];
- gchar Ltitle[_BUF_SIZE];
- Tdriveinfo *Ldevice = (Tdriveinfo *)sc_grave_get_data(Awaitg, "device1");
- GtkLabel *Llabel = GTK_LABEL(sc_grave_get_widget(Awaitg, "label1"));
- *Ltitle=0;
- *Lcd = 0;
+gchar* get_media_label(gint Atypecd, gchar *Abuf, gint Alen) {
+ *Abuf = 0;
+
if (Atypecd & _MEDIA_BLANKORAPPENDABLE) {
- g_snprintf(Lcd, sizeof(Lcd)-1, _("a CDR/RW"));
+ g_snprintf(Abuf, Alen, _("a CDR/RW"));
} else if ((Atypecd & _MEDIA_DVDPRW) || (Atypecd & _MEDIA_DVDMRW)) {
- g_snprintf(Lcd, sizeof(Lcd)-1, _("a DVDRW"));
+ g_snprintf(Abuf, Alen, _("a DVDRW"));
} else if (Atypecd & _MEDIA_DVDRew) {
- g_snprintf(Lcd, sizeof(Lcd)-1, _("a DVDR/RW"));
+ g_snprintf(Abuf, Alen, _("a DVDR/RW"));
} else if ((Atypecd & _MEDIA_DVDRP) || (Atypecd & _MEDIA_DVDRM)) {
- g_snprintf(Lcd, sizeof(Lcd)-1, _("a DVDR"));
+ g_snprintf(Abuf, Alen, _("a DVDR"));
} else if (Atypecd & _MEDIA_DVD) {
- g_snprintf(Lcd, sizeof(Lcd)-1, _("a DVD"));
+ g_snprintf(Abuf, Alen, _("a DVD"));
} else if (Atypecd & _MEDIA_CDRW) {
- g_snprintf(Lcd, sizeof(Lcd)-1, _("a CDRW"));
+ g_snprintf(Abuf, Alen, _("a CDRW"));
} else if (Atypecd & _MEDIA_CDR) {
- g_snprintf(Lcd, sizeof(Lcd)-1, _("a CDR"));
+ g_snprintf(Abuf, Alen, _("a CDR"));
} else if (Atypecd & _MEDIA_CD) {
- g_snprintf(Lcd, sizeof(Lcd)-1, _("a CD"));
+ g_snprintf(Abuf, Alen, _("a CD"));
+ } else if (Atypecd == _MEDIA_NONE) {
+ g_snprintf(Abuf, Alen, _("no media"));
}
+ return Abuf;
+}
+
+void set_waitwindow_title(gboolean Ainsert, gint Atypecd, gint Acurrent,
Tgrave *Awaitg)
+{
+ gchar Lcd[_BUF_SIZE];
+ gchar Ltitle[_BUF_SIZE];
+ Tdriveinfo *Ldevice = (Tdriveinfo *)sc_grave_get_data(Awaitg, "device1");
+ GtkLabel *Llabel = GTK_LABEL(sc_grave_get_widget(Awaitg, "label1"));
+ *Ltitle=0;
+
+ get_media_label(Atypecd, Lcd, sizeof(Lcd)-1);
+
if (Ainsert) {
g_snprintf(Ltitle, sizeof(Ltitle)-1, _("Please insert %s in drive %s to
continue..."), Lcd, Ldevice->name);
} else {
g_snprintf(Ltitle, sizeof(Ltitle)-1, _("Ok there is %s in drive %s."),
Lcd, Ldevice->name);
}
-
gtk_label_set_text(Llabel, Ltitle);
+
+ if (Ainsert) {
+ Llabel = GTK_LABEL(sc_grave_get_widget(Awaitg, "label2"));
+ g_snprintf(Ltitle, sizeof(Ltitle)-1, _("Currently: %s"),
+ Acurrent > -1 ? get_media_label(Acurrent, Lcd, sizeof(Lcd)-1) :
_("Initialization..."));
+ gtk_label_set_text(Llabel, Ltitle);
+ }
}
@@ -597,27 +613,18 @@
Lmedialu = 0;
if (Linitdisp && *Linitdisp) {
- set_waitwindow_title(Lstatusmedia, *Lmediatitle, Lg);
+ set_waitwindow_title(Lstatusmedia, *Lmediatitle, -1, Lg);
gtk_widget_show(GTK_WIDGET(sc_grave_get_data(Lg, "window")));
gdk_flush ();
*Linitdisp = FALSE;
}
-/* if (*Lrequis & _MEDIA_IS_DVD) {*/
Lmedialu += get_dvdinfo(Lg, Ldrive, NULL);
-/* }*/
-/* if (*Lrequis & _MEDIA_IS_CD) {*/
+
Lmedialu += get_cdinfo(Lg, Ldrive, NULL);
-/* }*/
if (Ldetect) *Ldetect = Lmedialu;
-/* Lstatusmedia = (!(_MEDIA_CMP_CD(*Lrequis, Lmedialu) ||
_MEDIA_CMP_DVD(*Lrequis, Lmedialu))) ||
- ((*Lrequis & _MEDIA_BLANKORAPPENDABLE) &&
- ((!(Lmedialu & _MEDIA_BLANK)) && (!(Lmedialu &
_MEDIA_APPENDABLE)))) ||
- ((*Lrequis & _MEDIA_BLANK) && (Lmedialu &
_MEDIA_NOBLANK)) ||
- ((*Lrequis & _MEDIA_NOBLANK) && (Lmedialu &
_MEDIA_BLANK)) ||
- ((*Lrequis & _MEDIA_APPENDABLE) && (!(Lmedialu &
_MEDIA_APPENDABLE)));
- if (Lstatusmedia) LnewCont = TRUE;*/
+
for (Lcur = Lrequis; Lcur; Lcur = g_slist_next(Lcur)) {
Lmediatest = (int ) Lcur->data;
if ((Lmediatest & Lmedialu) == Lmediatest) {
@@ -626,7 +633,7 @@
break;
}
}
- set_waitwindow_title(Lstatusmedia, *Lmediatitle, Lg);
+ set_waitwindow_title(Lstatusmedia, *Lmediatitle, Lmedialu, Lg);
gdk_flush ();
@@ -665,7 +672,7 @@
sc_grave_set_data(Lwaitg, &Atitle, "mediatitle1");
sc_grave_set_data(Lwaitg, Arequiscd1, "devicerequis1");
- set_waitwindow_title(TRUE, Atitle, Lwaitg);
+ set_waitwindow_title(TRUE, Atitle, -1, Lwaitg);
}
gtk_window_set_transient_for(GTK_WINDOW(Lwindow), GTK_WINDOW(Lparent));