index : drakx | ||
Mageia Installer and base platform for many utilities | Thierry Vignaud [tv] |
summaryrefslogtreecommitdiffstats |
-rw-r--r-- | po/ar.po | 108 | ||||
-rw-r--r-- | po/ast.po | 100 | ||||
-rw-r--r-- | po/bg.po | 46 | ||||
-rw-r--r-- | po/br.po | 46 | ||||
-rw-r--r-- | po/ca.po | 46 | ||||
-rw-r--r-- | po/cs.po | 46 | ||||
-rw-r--r-- | po/da.po | 46 | ||||
-rw-r--r-- | po/de.po | 46 | ||||
-rw-r--r-- | po/el.po | 346 | ||||
-rw-r--r-- | po/en_CA.po | 46 | ||||
-rw-r--r-- | po/en_GB.po | 140 | ||||
-rw-r--r-- | po/eo.po | 46 | ||||
-rw-r--r-- | po/es.po | 46 | ||||
-rw-r--r-- | po/et.po | 46 | ||||
-rw-r--r-- | po/eu.po | 140 | ||||
-rw-r--r-- | po/fr.po | 46 | ||||
-rw-r--r-- | po/gl.po | 46 | ||||
-rw-r--r-- | po/he.po | 46 | ||||
-rw-r--r-- | po/hr.po | 108 | ||||
-rw-r--r-- | po/hu.po | 140 | ||||
-rw-r--r-- | po/id.po | 116 | ||||
-rw-r--r-- | po/isodumper.pot | 46 | ||||
-rw-r--r-- | po/it.po | 116 | ||||
-rw-r--r-- | po/ja.po | 46 | ||||
-rw-r--r-- | po/ka.po | 46 | ||||
-rw-r--r-- | po/ko.po | 46 | ||||
-rw-r--r-- | po/lt.po | 46 | ||||
-rw-r--r-- | po/lv.po | 46 | ||||
-rw-r--r-- | po/ms.po | 46 | ||||
-rw-r--r-- | po/nb.po | 46 | ||||
-rw-r--r-- | po/nl.po | 46 | ||||
-rw-r--r-- | po/pl.po | 124 | ||||
-rw-r--r-- | po/pt.po | 46 | ||||
-rw-r--r-- | po/pt_BR.po | 6 | ||||
-rw-r--r-- | po/ro.po | 46 | ||||
-rw-r--r-- | po/ru.po | 46 | ||||
-rw-r--r-- | po/sk.po | 46 | ||||
-rw-r--r-- | po/sl.po | 46 | ||||
-rw-r--r-- | po/sq.po | 46 | ||||
-rw-r--r-- | po/sr.po | 86 | ||||
-rw-r--r-- | po/sv.po | 46 | ||||
-rw-r--r-- | po/tg.po | 46 | ||||
-rw-r--r-- | po/tr.po | 46 | ||||
-rw-r--r-- | po/uk.po | 50 | ||||
-rw-r--r-- | po/zh_CN.po | 46 | ||||
-rw-r--r-- | po/zh_HK.po | 86 | ||||
-rw-r--r-- | po/zh_TW.po | 46 |
@@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Mageia\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-03-18 12:37+0100\n" +"POT-Creation-Date: 2018-10-07 20:45+0200\n" "PO-Revision-Date: 2016-07-18 07:29+0000\n" "Last-Translator: Yves Brungard\n" "Language-Team: Arabic (http://www.transifex.com/MageiaLinux/mageia/language/" @@ -148,7 +148,7 @@ msgid "" "The destination directory is too small to receive the backup (%s Mb needed)" msgstr "الحافظة المخصصة أصغر من أن تحتوي النسخة الاحتياطية (المطلوب %s م.ب.)" -#: lib/isodumper.py:250 lib/isodumper.py:484 lib/isodumper.py:650 +#: lib/isodumper.py:250 lib/isodumper.py:483 lib/isodumper.py:640 msgid "Backup to:" msgstr "" @@ -265,87 +265,87 @@ msgid "" "during the following operation." msgstr "" -#: lib/isodumper.py:471 +#: lib/isodumper.py:470 msgid "Device to work on:" msgstr "العمل على الجهاز:" -#: lib/isodumper.py:475 +#: lib/isodumper.py:474 msgid "Write Image:" msgstr "كتابة الصورة: " -#: lib/isodumper.py:481 +#: lib/isodumper.py:480 msgid "&Write to device" msgstr "" -#: lib/isodumper.py:490 +#: lib/isodumper.py:489 msgid "Backup the device" msgstr "" -#: lib/isodumper.py:494 +#: lib/isodumper.py:492 msgid "Format the device in FAT, NTFS or ext:" msgstr "تنسيق الجهاز بنظام الملفات FAT أو NTFS أو ext:" -#: lib/isodumper.py:496 +#: lib/isodumper.py:494 msgid "Format the device" msgstr "" -#: lib/isodumper.py:500 +#: lib/isodumper.py:497 msgid "Progress" msgstr "" -#: lib/isodumper.py:504 +#: lib/isodumper.py:501 msgid "Report" msgstr "تقرير" -#: lib/isodumper.py:509 lib/isodumper.py:619 +#: lib/isodumper.py:504 lib/isodumper.py:609 msgid "Refresh" msgstr "" -#: lib/isodumper.py:511 +#: lib/isodumper.py:506 msgid "About" msgstr "" -#: lib/isodumper.py:513 +#: lib/isodumper.py:508 msgid "Help" msgstr "" -#: lib/isodumper.py:515 +#: lib/isodumper.py:510 msgid "Quit" msgstr "" -#: lib/isodumper.py:521 +#: lib/isodumper.py:516 msgid "UDisks2 is not available on your system" msgstr "لايتوفر udisks2 لدى النظام" -#: lib/isodumper.py:542 +#: lib/isodumper.py:532 msgid "Label for the device:" msgstr "اسم الجهاز:" -#: lib/isodumper.py:546 +#: lib/isodumper.py:536 msgid "FAT 32 (Windows)" msgstr "نظام الملفات FAT32 (ويندوز)" -#: lib/isodumper.py:548 +#: lib/isodumper.py:538 msgid "NTFS (Windows)" msgstr "نظام الملفات NTFS (ويندوز)" -#: lib/isodumper.py:550 +#: lib/isodumper.py:540 msgid "ext4 (Linux)" msgstr "نظام الملفات ext4 (لينوكس)" -#: lib/isodumper.py:552 +#: lib/isodumper.py:542 msgid "Execute" msgstr "تنفيذ" -#: lib/isodumper.py:553 lib/isodumper.py:620 +#: lib/isodumper.py:543 lib/isodumper.py:610 msgid "Cancel" msgstr "إلغاء" -#: lib/isodumper.py:610 +#: lib/isodumper.py:600 msgid "A tool for writing ISO images to a device" msgstr "" -#: lib/isodumper.py:618 +#: lib/isodumper.py:608 msgid "" "Warning\n" "No target devices were found.\n" @@ -368,50 +368,50 @@ msgstr "" msgid "A GUI tool to write .img and .iso files to USB sticks" msgstr "" -#~ msgid "MD5 sum: " -#~ msgstr "نتيجة خوارزمية التشفير إم دي 5: " - -#~ msgid "SHA1 sum: " -#~ msgstr "نتيجة خوارزمية التشفير إس إيتش إيه 1: " +#~ msgid "Run Isodumper" +#~ msgstr "تنفيذ آيزودامبر" -#~ msgid " successfully written to " -#~ msgstr "تمَّت الكتابة بنجاح في" +#~ msgid "Authentication is required to run Isodumper" +#~ msgstr "يجب المواثقة لتنفيذ آيزودامبر" -#~ msgid "Wrote: " -#~ msgstr "تمَّ كتابة: " +#~ msgid "%r not known to UDisks2" +#~ msgstr "لايعرف برنامج udisks2 %r" -#~ msgid "Writing " -#~ msgstr "قيد الكتابة " +#~ msgid "Unmounting all partitions of " +#~ msgstr "فصل كافة تقسيمات " -#~ msgid "Could not read mtab !" -#~ msgstr "لم تتم قراءة ملف التقسيمات المربوطة!" +#~ msgid "Trying to unmount " +#~ msgstr "محاولة فصل " -#~ msgid "Execution failed: " -#~ msgstr "فشل التنفيذ: " +#~ msgid " was terminated by signal " +#~ msgstr " تم إنهائه بإشارة " -#~ msgid " returned " -#~ msgstr "خرج" +#~ msgid "Error, umount " +#~ msgstr "خطأ، فصل " #~ msgid " successfully unmounted" #~ msgstr " تم فصله بنجاح" -#~ msgid "Error, umount " -#~ msgstr "خطأ، فصل " +#~ msgid " returned " +#~ msgstr "خرج" -#~ msgid " was terminated by signal " -#~ msgstr " تم إنهائه بإشارة " +#~ msgid "Execution failed: " +#~ msgstr "فشل التنفيذ: " -#~ msgid "Trying to unmount " -#~ msgstr "محاولة فصل " +#~ msgid "Could not read mtab !" +#~ msgstr "لم تتم قراءة ملف التقسيمات المربوطة!" -#~ msgid "Unmounting all partitions of " -#~ msgstr "فصل كافة تقسيمات " +#~ msgid "Writing " +#~ msgstr "قيد الكتابة " -#~ msgid "%r not known to UDisks2" -#~ msgstr "لايعرف برنامج udisks2 %r" +#~ msgid "Wrote: " +#~ msgstr "تمَّ كتابة: " -#~ msgid "Authentication is required to run Isodumper" -#~ msgstr "يجب المواثقة لتنفيذ آيزودامبر" +#~ msgid " successfully written to " +#~ msgstr "تمَّت الكتابة بنجاح في" -#~ msgid "Run Isodumper" -#~ msgstr "تنفيذ آيزودامبر" +#~ msgid "SHA1 sum: " +#~ msgstr "نتيجة خوارزمية التشفير إس إيتش إيه 1: " + +#~ msgid "MD5 sum: " +#~ msgstr "نتيجة خوارزمية التشفير إم دي 5: " @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Mageia\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-03-18 12:37+0100\n" +"POT-Creation-Date: 2018-10-07 20:45+0200\n" "PO-Revision-Date: 2016-10-04 11:54+0000\n" "Last-Translator: Yves Brungard\n" "Language-Team: Asturian (http://www.transifex.com/MageiaLinux/mageia/" @@ -150,7 +150,7 @@ msgid "" "The destination directory is too small to receive the backup (%s Mb needed)" msgstr "" -#: lib/isodumper.py:250 lib/isodumper.py:484 lib/isodumper.py:650 +#: lib/isodumper.py:250 lib/isodumper.py:483 lib/isodumper.py:640 msgid "Backup to:" msgstr "" @@ -267,87 +267,87 @@ msgid "" "during the following operation." msgstr "" -#: lib/isodumper.py:471 +#: lib/isodumper.py:470 msgid "Device to work on:" msgstr "Preséu pa furrular en:" -#: lib/isodumper.py:475 +#: lib/isodumper.py:474 msgid "Write Image:" msgstr "Escribir imaxe:" -#: lib/isodumper.py:481 +#: lib/isodumper.py:480 msgid "&Write to device" msgstr "" -#: lib/isodumper.py:490 +#: lib/isodumper.py:489 msgid "Backup the device" msgstr "" -#: lib/isodumper.py:494 +#: lib/isodumper.py:492 msgid "Format the device in FAT, NTFS or ext:" msgstr "Formatear el preséu en FAT, NTFS o ext:" -#: lib/isodumper.py:496 +#: lib/isodumper.py:494 msgid "Format the device" msgstr "" -#: lib/isodumper.py:500 +#: lib/isodumper.py:497 msgid "Progress" msgstr "" -#: lib/isodumper.py:504 +#: lib/isodumper.py:501 msgid "Report" msgstr "Informar" -#: lib/isodumper.py:509 lib/isodumper.py:619 +#: lib/isodumper.py:504 lib/isodumper.py:609 msgid "Refresh" msgstr "" -#: lib/isodumper.py:511 +#: lib/isodumper.py:506 msgid "About" msgstr "" -#: lib/isodumper.py:513 +#: lib/isodumper.py:508 msgid "Help" msgstr "" -#: lib/isodumper.py:515 +#: lib/isodumper.py:510 msgid "Quit" msgstr "" -#: lib/isodumper.py:521 +#: lib/isodumper.py:516 msgid "UDisks2 is not available on your system" msgstr "UDisks2 nun ta disponible nel to sistema" -#: lib/isodumper.py:542 +#: lib/isodumper.py:532 msgid "Label for the device:" msgstr "Etiqueta pal preséu:" -#: lib/isodumper.py:546 +#: lib/isodumper.py:536 msgid "FAT 32 (Windows)" msgstr "FAT 32 (Windows)" -#: lib/isodumper.py:548 +#: lib/isodumper.py:538 msgid "NTFS (Windows)" msgstr "NTFS (Windows)" -#: lib/isodumper.py:550 +#: lib/isodumper.py:540 msgid "ext4 (Linux)" msgstr "ext4 (Linux)" -#: lib/isodumper.py:552 +#: lib/isodumper.py:542 msgid "Execute" msgstr "" -#: lib/isodumper.py:553 lib/isodumper.py:620 +#: lib/isodumper.py:543 lib/isodumper.py:610 msgid "Cancel" msgstr "Encaboxar" -#: lib/isodumper.py:610 +#: lib/isodumper.py:600 msgid "A tool for writing ISO images to a device" msgstr "" -#: lib/isodumper.py:618 +#: lib/isodumper.py:608 msgid "" "Warning\n" "No target devices were found.\n" @@ -370,44 +370,44 @@ msgstr "" msgid "A GUI tool to write .img and .iso files to USB sticks" msgstr "" -#~ msgid "&Quit" -#~ msgstr "&Colar" - -#~ msgid " successfully written to " -#~ msgstr " escritu con éxitu a" +#~ msgid "Run Isodumper" +#~ msgstr "Executar Isodumper" -#~ msgid "Wrote: " -#~ msgstr "Escritu: " +#~ msgid "Authentication is required to run Isodumper" +#~ msgstr "Requierse l'autenticación pa executar Isodumper" -#~ msgid "Writing " -#~ msgstr "Escribiendo " +#~ msgid "Unmounting all partitions of " +#~ msgstr "Desmontando toles particiones de " -#~ msgid "Could not read mtab !" -#~ msgstr "¡Nun pudo lleese mtab!" +#~ msgid "Trying to unmount " +#~ msgstr "Intentando desmontar " -#~ msgid "Execution failed: " -#~ msgstr "Falló la execución: " +#~ msgid " was terminated by signal " +#~ msgstr " terminóse pola señal " -#~ msgid " returned " -#~ msgstr " devueltu " +#~ msgid "Error, umount " +#~ msgstr "Fallu, desmontar " #~ msgid " successfully unmounted" #~ msgstr " desmontáu con ésitu" -#~ msgid "Error, umount " -#~ msgstr "Fallu, desmontar " +#~ msgid " returned " +#~ msgstr " devueltu " -#~ msgid " was terminated by signal " -#~ msgstr " terminóse pola señal " +#~ msgid "Execution failed: " +#~ msgstr "Falló la execución: " -#~ msgid "Trying to unmount " -#~ msgstr "Intentando desmontar " +#~ msgid "Could not read mtab !" +#~ msgstr "¡Nun pudo lleese mtab!" -#~ msgid "Unmounting all partitions of " -#~ msgstr "Desmontando toles particiones de " +#~ msgid "Writing " +#~ msgstr "Escribiendo " -#~ msgid "Authentication is required to run Isodumper" -#~ msgstr "Requierse l'autenticación pa executar Isodumper" +#~ msgid "Wrote: " +#~ msgstr "Escritu: " -#~ msgid "Run Isodumper" -#~ msgstr "Executar Isodumper" +#~ msgid " successfully written to " +#~ msgstr " escritu con éxitu a" + +#~ msgid "&Quit" +#~ msgstr "&Colar" @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Mageia\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-03-18 13:53+0200\n" +"POT-Creation-Date: 2018-10-07 20:43+0200\n" "PO-Revision-Date: 2018-09-09 12:54+0000\n" "Last-Translator: Georgi Georgiev <georgiev_1994@abv.bg>\n" "Language-Team: Bulgarian (http://www.transifex.com/MageiaLinux/mageia/" @@ -153,7 +153,7 @@ msgid "" msgstr "" "Директорията е твърде малка за да получи резервното копие (%s Мб са нужни)" -#: lib/isodumper.py:250 lib/isodumper.py:484 lib/isodumper.py:650 +#: lib/isodumper.py:250 lib/isodumper.py:483 lib/isodumper.py:640 msgid "Backup to:" msgstr "Резервно копие в:" @@ -303,87 +303,87 @@ msgstr "" "искате ли да продължите?\n" "В такъв случай, моля, <b>не изваждайте</b> по време на операцията." -#: lib/isodumper.py:471 +#: lib/isodumper.py:470 msgid "Device to work on:" msgstr "Устройство за работа:" -#: lib/isodumper.py:475 +#: lib/isodumper.py:474 msgid "Write Image:" msgstr "Образ за записване:" -#: lib/isodumper.py:481 +#: lib/isodumper.py:480 msgid "&Write to device" msgstr "&Запиши промените по устройството" -#: lib/isodumper.py:490 +#: lib/isodumper.py:489 msgid "Backup the device" msgstr "Направи резервно копие на устройството" -#: lib/isodumper.py:494 +#: lib/isodumper.py:492 msgid "Format the device in FAT, NTFS or ext:" msgstr "Форматирай устройството във FAT, NTFS или ext:" -#: lib/isodumper.py:496 +#: lib/isodumper.py:494 msgid "Format the device" msgstr "Форматирай устройството" -#: lib/isodumper.py:500 +#: lib/isodumper.py:497 msgid "Progress" msgstr "Напредък" -#: lib/isodumper.py:504 +#: lib/isodumper.py:501 msgid "Report" msgstr "Доклад" -#: lib/isodumper.py:509 lib/isodumper.py:619 +#: lib/isodumper.py:504 lib/isodumper.py:609 msgid "Refresh" msgstr "Опресни" -#: lib/isodumper.py:511 +#: lib/isodumper.py:506 msgid "About" msgstr "Относно" -#: lib/isodumper.py:513 +#: lib/isodumper.py:508 msgid "Help" msgstr "Помощ" -#: lib/isodumper.py:515 +#: lib/isodumper.py:510 msgid "Quit" msgstr "Затвори" -#: lib/isodumper.py:521 +#: lib/isodumper.py:516 msgid "UDisks2 is not available on your system" msgstr "UDisks2 не е наличен в системата ви" -#: lib/isodumper.py:542 +#: lib/isodumper.py:532 msgid "Label for the device:" msgstr "Етикет на устройството:" -#: lib/isodumper.py:546 +#: lib/isodumper.py:536 msgid "FAT 32 (Windows)" msgstr "FAT 32 (Windows)" -#: lib/isodumper.py:548 +#: lib/isodumper.py:538 msgid "NTFS (Windows)" msgstr "NTFS (Windows)" -#: lib/isodumper.py:550 +#: lib/isodumper.py:540 msgid "ext4 (Linux)" msgstr "ext4 (Linux)" -#: lib/isodumper.py:552 +#: lib/isodumper.py:542 msgid "Execute" msgstr "Изпълни" -#: lib/isodumper.py:553 lib/isodumper.py:620 +#: lib/isodumper.py:543 lib/isodumper.py:610 msgid "Cancel" msgstr "Отказ" -#: lib/isodumper.py:610 +#: lib/isodumper.py:600 msgid "A tool for writing ISO images to a device" msgstr "Инструмент за записване на ISO образи в дадено устройство" -#: lib/isodumper.py:618 +#: lib/isodumper.py:608 msgid "" "Warning\n" "No target devices were found.\n" @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Mageia\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-03-18 12:37+0100\n" +"POT-Creation-Date: 2018-10-07 20:43+0200\n" "PO-Revision-Date: 2016-07-18 07:29+0000\n" "Last-Translator: Yves Brungard\n" "Language-Team: Breton (http://www.transifex.com/MageiaLinux/mageia/language/" @@ -145,7 +145,7 @@ msgid "" "The destination directory is too small to receive the backup (%s Mb needed)" msgstr "" -#: lib/isodumper.py:250 lib/isodumper.py:484 lib/isodumper.py:650 +#: lib/isodumper.py:250 lib/isodumper.py:483 lib/isodumper.py:640 msgid "Backup to:" msgstr "" @@ -262,87 +262,87 @@ msgid "" "during the following operation." msgstr "" -#: lib/isodumper.py:471 +#: lib/isodumper.py:470 msgid "Device to work on:" msgstr "" -#: lib/isodumper.py:475 +#: lib/isodumper.py:474 msgid "Write Image:" msgstr "" -#: lib/isodumper.py:481 +#: lib/isodumper.py:480 msgid "&Write to device" msgstr "" -#: lib/isodumper.py:490 +#: lib/isodumper.py:489 msgid "Backup the device" msgstr "" -#: lib/isodumper.py:494 +#: lib/isodumper.py:492 msgid "Format the device in FAT, NTFS or ext:" msgstr "" -#: lib/isodumper.py:496 +#: lib/isodumper.py:494 msgid "Format the device" msgstr "" -#: lib/isodumper.py:500 +#: lib/isodumper.py:497 msgid "Progress" msgstr "" -#: lib/isodumper.py:504 +#: lib/isodumper.py:501 msgid "Report" msgstr "Dezrevell" -#: lib/isodumper.py:509 lib/isodumper.py:619 +#: lib/isodumper.py:504 lib/isodumper.py:609 msgid "Refresh" msgstr "" -#: lib/isodumper.py:511 +#: lib/isodumper.py:506 msgid "About" msgstr "" -#: lib/isodumper.py:513 +#: lib/isodumper.py:508 msgid "Help" msgstr "" -#: lib/isodumper.py:515 +#: lib/isodumper.py:510 msgid "Quit" msgstr ""
$o->ask_from($title, $message, [ map { my $h = $_; map { $h->{e}{$_} } @{$h->{list}} } @l ]) or return;
@l = map {
my $h = $_;
[ grep { ${$h->{e}{$_}{val}} } @{$h->{list}} ];
} @l;
wantarray() ? @l : $l[0];
}
sub ask_from_entry {
my ($o, $title, $message, %callback) = @_;
first(ask_from_entries($o, $title, $message, [''], %callback));
}
sub ask_from_entries {
my ($o, $title, $message, $l, %callback) = @_;
my @l = map { my $i = ''; { label => $_, val => \$i } } @$l;
$o->ask_from($title, $message, \@l, %callback) ?
map { ${$_->{val}} } @l :
undef;
}
sub ask_from__add_modify_remove {
my ($o, $title, $message, $l, %callback) = @_;
die "ask_from__add_modify_remove only handles one item" if @$l != 1;
$callback{$_} or internal_error("missing callback $_") foreach qw(Add Modify Remove);
if ($o->can('ask_from__add_modify_removeW')) {
$o->ask_from__add_modify_removeW($title, $message, $l, %callback);
} else {
my $e = $l->[0];
my $chosen_element;
put_in_hash($e, { allow_empty_list => 1, val => \$chosen_element, type => 'list' });
while (1) {
my $continue;
my @l = (@$l,
map { my $s = $_; { val => translate($_), clicked_may_quit => sub {
my $r = $callback{$s}->($chosen_element);
defined $r or return;
$continue = 1;
} } }
N_("Add"), if_(@{$e->{list}} > 0, N_("Modify"), N_("Remove")));
$o->ask_from_({ title => $title, messages => $message, callbacks => \%callback }, \@l) or return;
return 1 if !$continue;
}
}
}
#- can get a hash of callback: focus_out changed and complete
#- moreove if you pass a hash with a field list -> combo
#- if you pass a hash with a field hidden -> emulate stty -echo
sub ask_from {
my ($o, $title, $message, $l, %callback) = @_;
ask_from_($o, { title => $title, messages => $message, callbacks => \%callback }, $l);
}
sub ask_from_normalize {
my ($o, $common, $l) = @_;
ref($l) eq 'ARRAY' or internal_error('ask_from_normalize');
foreach my $e (@$l) {
if (my $li = $e->{list}) {
ref($e->{val}) =~ /SCALAR|REF/ or internal_error($e->{val} ? "field {val} must be a reference (it is $e->{val})" : "field {val} is mandatory"); #-#
if ($e->{sort} || @$li > 10 && !exists $e->{sort}) {
my @l2 = map { may_apply($e->{format}, $_) } @$li;
my @places = sort { $l2[$a] cmp $l2[$b] } 0 .. $#l2;
$e->{list} = $li = [ map { $li->[$_] } @places ];
}
$e->{type} = 'iconlist' if $e->{icon2f};
$e->{type} = 'treelist' if $e->{separator};
add2hash_($e, { not_edit => 1 });
$e->{type} ||= 'combo';
if (!$e->{not_edit}) {
die q(when using "not_edit" you must use strings, not a data structure) if ref(${$e->{val}}) || any { ref $_ } @$li;
}
if ($e->{type} ne 'combo' || $e->{not_edit}) {
${$e->{val}} = $li->[0] if !member(may_apply($e->{format}, ${$e->{val}}), map { may_apply($e->{format}, $_) } @$li);
}
} elsif ($e->{type} eq 'range') {
$e->{min} <= $e->{max} or die "bad range min $e->{min} > max $e->{max} (called from " . join(':', caller()) . ")";
${$e->{val}} = max($e->{min}, min(${$e->{val}}, $e->{max}));
} elsif ($e->{type} eq 'button' || $e->{clicked} || $e->{clicked_may_quit}) {
$e->{type} = 'button';
$e->{clicked_may_quit} ||= $e->{clicked} ? sub { $e->{clicked}(); 0 } : sub {};
$e->{val} = \ (my $_v = $e->{val}) if !ref($e->{val});
} elsif ($e->{type} eq 'label' || !ref($e->{val})) {
$e->{type} = 'label';
$e->{val} = \ (my $_v = $e->{val}) if !ref($e->{val});
} else {
$e->{type} ||= 'entry';
}
$e->{disabled} ||= sub { 0 };
}
#- don't display empty lists and one element lists
@$l = grep {
if ($_->{list} && $_->{not_edit} && !$_->{allow_empty_list}) {
if (!@{$_->{list}}) {
eval {
require 'log.pm'; #- "require log" causes some pb, perl thinking that "log" is the log() function
log::l("ask_from_normalize: empty list for $_->{label}\n" . backtrace());
};
}
@{$_->{list}} > 1;
} else {
1;
}
} @$l;
if (!$common->{title} && $::isStandalone) {
($common->{title} = $0) =~ s|.*/||;
}
$common->{interactive_help} ||= $o->{interactive_help};
$common->{interactive_help} ||= $common->{interactive_help_id} && $o->interactive_help_sub_get_id($common->{interactive_help_id});
$common->{advanced_label} ||= N("Advanced");
$common->{advanced_label_close} ||= N("Basic");
$common->{$_} = $common->{$_} ? [ deref($common->{$_}) ] : [] foreach qw(messages advanced_messages);
add2hash_($common->{callbacks} ||= {}, { changed => sub {}, focus_out => sub {}, complete => sub { 0 }, canceled => sub { 0 }, advanced => sub {} });
}
sub ask_from_ {
my ($o, $common, $l) = @_;
ask_from_normalize($o, $common, $l);
@$l or return 1;
$common->{cancel} = '' if !defined wantarray();
ask_from_real($o, $common, $l);
}
sub ask_from_no_check {
my ($o, $common, $l) = @_;
ask_from_normalize($o, $common, $l);
$common->{cancel} = '' if !defined wantarray();
my ($l1, $l2) = partition { !$_->{advanced} } @$l;
$o->ask_fromW($common, $l1, $l2);
}
sub ask_from_real {
my ($o, $common, $l) = @_;
my ($l1, $l2) = partition { !$_->{advanced} } @$l;
my $v = $o->ask_fromW($common, $l1, $l2);
%$common = ();
$v;
}
sub ask_browse_tree_info {
my ($o, $title, $message, $common) = @_;
$common->{interactive_help} ||= $common->{interactive_help_id} && $o->interactive_help_sub_get_id($common->{interactive_help_id});
add2hash_($common, { ok => $::isWizard ? ($::Wizard_finished ? N("Finish") : N("Next ->")) : N("Ok"),
cancel => $::isWizard ? N("<- Previous") : N("Cancel") });
add2hash_($common, { title => $title, message => $message });
add2hash_($common, { grep_allowed_to_toggle => sub { @_ },
grep_unselected => sub { grep { $common->{node_state}($_) eq 'unselected' } @_ },
check_interactive_to_toggle => sub { 1 },
toggle_nodes => sub {
my ($set_state, @nodes) = @_;
my $new_state = !$common->{grep_unselected}($nodes[0]) ? 'selected' : 'unselected';
$set_state->($_, $new_state) foreach @nodes;
},
});
$o->ask_browse_tree_info_refW($common);
}
sub ask_browse_tree_info_refW { #- default definition, do not use with too many items (memory consuming)
my ($o, $common) = @_;
my ($l, $v, $h) = ([], [], {});
$common->{build_tree}(sub {
my ($node) = $common->{grep_allowed_to_toggle}(@_);
if (my $state = $node && $common->{node_state}($node)) {
push @$l, $node;
$state eq 'selected' and push @$v, $node;
$h->{$node} = $state eq 'selected';
}
}, 'flat');
add2hash_($common, { list => $l, #- TODO interactivity of toggle is missing
values => $v,
help => sub { $common->{get_info}($_[0]) },
});
my ($new_v) = $o->ask_many_from_list($common->{title}, $common->{message}, $common) or return;
$common->{toggle_nodes}(sub {}, grep { ! delete $h->{$_} } @$new_v);
$common->{toggle_nodes}(sub {}, grep { $h->{$_} } keys %$h);
1;
}
sub wait_message {
my ($o, $title, $message, $b_temp) = @_;
my $w = $o->wait_messageW($title, [ N("Please wait"), deref($message) ]);
push @tempory::objects, $w if $b_temp;
my $b = before_leaving { $o->wait_message_endW($w) };
#- enable access through set
MDK::Common::Func::add_f4before_leaving(sub { $o->wait_message_nextW([ deref($_[1]) ], $w) }, $b, 'set');
$b;
}
sub kill() {}
sub helper_separator_tree_to_tree {
my ($separator, $list, $formatted_list) = @_;
my $sep = quotemeta $separator;
my $tree = {};
each_index {
my @l = split $sep;
my $leaf = pop @l;
my $node = $tree;
foreach (@l) {
$node = $node->{$_} ||= do {
my $r = {};
push @{$node->{_order_}}, $_;
$r;
};
}
push @{$node->{_leaves_}}, [ $leaf, $list->[$::i] ];
();
} @$formatted_list;
$tree;
}
sub interactive_help_has_id {
my ($_o, $id) = @_;
exists $help::{$id};
}
sub interactive_help_get_id {
my ($_o, @l) = @_;
@l = map {
join("\n\n", map { s/\n/ /mg; $_ } split("\n\n", translate($help::{$_}->())))
} grep { exists $help::{$_} } @l;
join("\n\n\n", @l);
}
sub interactive_help_sub_get_id {
my ($o, $id) = @_;
$o->interactive_help_has_id($id) && sub { $o->interactive_help_get_id($id) };
}
sub interactive_help_sub_display_id {
my ($o, $id) = @_;
$o->interactive_help_has_id($id) && sub { $o->ask_warn(N("Help"), $o->interactive_help_get_id($id)) };
}
1;
|