Patch level :4.0 486

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :ennesime modifiche al buffo dizionario


git-svn-id: svn://10.65.10.50/trunk@14319 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2006-09-13 13:05:15 +00:00
parent 21618ef405
commit b96df0022b
3 changed files with 62 additions and 12 deletions

View File

@ -277,6 +277,10 @@ TPointer_array& TDictionary::sorted()
class TDictionary_mask : public TAutomask
{
TDictionary _dictionary;
bool _filtered;
bool _errors;
bool _new;
TToken_string _modules;
protected:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
@ -668,7 +672,7 @@ bool TDictionary_mask::good_translation(const TString & ita, const TString & eng
void TDictionary_mask::fill_chapter()
{
const char letter = get(F_ALFABETO)[0];
const bool errors_only = get_bool(F_ERRORS_ONLY);
const bool chk_modules = _modules.full();
TSheet_field& s = sfield(F_CAPITOLO);
s.destroy();
@ -680,8 +684,30 @@ void TDictionary_mask::fill_chapter()
if (toupper(e._ita[0]) == letter)
{
const bool good = good_translation(e._ita, e._eng, e._src);
if (errors_only && good)
continue;
if (_filtered)
{
if (_errors && good)
continue;
bool skip = false;
if (_new)
skip = !_errors && e._eng != "???";
else
skip = e._eng == "???";
if (!skip && chk_modules)
{
FOR_EACH_TOKEN(_modules, m)
{
const int p = e._src.find(m);
skip = p < 0 || (p > 0 && e._src[p - 1] != ',' && e._src[p] != '.');
if (!skip)
break;
}
}
if (skip)
continue;
}
TToken_string& row = s.row(-1);
row = e._ita;
row.add(e._eng);
@ -729,6 +755,25 @@ bool TDictionary_mask::on_field_event(TOperable_field& o, TField_event e, long j
if (e == fe_button)
_dictionary.write();
break;
case DLG_FILTER:
if (e == fe_button)
{
TMask m("ba2700b");
m.set(F_FILTER, _filtered);
m.set(F_ERRORS_ONLY, _errors);
m.set(F_NEW, _new);
m.set(F_MODULE, _modules);
if (m.run())
{
_filtered = m.get_bool(F_FILTER);
_errors = m.get_bool(F_ERRORS_ONLY);
_new = m.get_bool(F_NEW);
_modules = m.get(F_MODULE);
}
}
break;
case DLG_ELABORA:
if (e == fe_button)
build_dictionary();
@ -780,6 +825,7 @@ bool TDictionary_mask::on_field_event(TOperable_field& o, TField_event e, long j
}
TDictionary_mask::TDictionary_mask()
: _filtered(false), _errors(false), _new(false), _modules("", ',')
{
// Allarga numero di riga degli spreadsheet
TSheet_field::set_line_number_width(4);

View File

@ -2,12 +2,16 @@
#define F_ALFABETO 202
#define F_ENTRIES 203
#define F_TOTAL 204
#define F_ERRORS_ONLY 205
#define F_CAPITOLO 210
#define F_MODULE 201
#define F_DELETE_OBS 202
#define F_FILTER 202
#define F_ERRORS_ONLY 203
#define F_NEW 204
#define DLG_FILTER 99
#define F_ITA 101
#define F_ENG 102

View File

@ -4,20 +4,25 @@ TOOLBAR "" 0 -2 0 2
BUTTON DLG_SAVEREC 10 2
BEGIN
PROMPT -13 -11 ""
PROMPT -14 -11 ""
PICTURE BMP_SAVEREC
PICTURE BMP_SAVERECDN
END
BUTTON DLG_ELABORA 10 2
BEGIN
PROMPT -23 -11 "&Elabora"
PROMPT -24 -11 "&Elabora"
PICTURE BMP_ELABORA
END
BUTTON DLG_FILTER 10 2
BEGIN
PROMPT -34 -11 "&Filtro"
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -33 -11 ""
PROMPT -44 -11 ""
END
ENDPAGE
@ -39,11 +44,6 @@ BEGIN
PROMPT 2 2 "Iniziale "
END
BOOLEAN F_ERRORS_ONLY
BEGIN
PROMPT 16 2 "Solo righe errate"
END
NUMBER F_ENTRIES 6
BEGIN
PROMPT 37 2 "Elementi "