Commit 91e2b37b authored by Claes Sjofors's avatar Claes Sjofors

Translation and utf8 conversion of search condition in EventLog window fixed

parent 450572be
......@@ -148,4 +148,7 @@
090930 cs ge Java compile problems for subgraphs with multiple annotations fixed.
091020 cs xtt Bugfix in System Messages, zip-files >= version 10 was not opened in the correct order in next/prev file.
091029 cs xtt Bugfix in xtt logging, restore on attributes of attributeobject didn't work.
091029 cs xtt Bugfix in xtt logging, if showfile was activate before logging was terminated, xtt could segfault.
\ No newline at end of file
091029 cs xtt Bugfix in xtt logging, if showfile was activate before logging was terminated, xtt could segfault.
091102 cs ge Menu entry to create subgraphs added.
091102 cs ge Menu items for connections changed to radio items.
091103 cs xtt Translation and utf8 conversion of search condition in EventLog window fixed.
......@@ -678,10 +678,10 @@ void HistGtk::set_search_string( const char *s1, const char *s2,
const char *s3, const char *s4)
{
gtk_label_set_text( GTK_LABEL(this->search_string_lbl_w), s1);
gtk_label_set_text( GTK_LABEL(this->search_string2_lbl_w), s2);
gtk_label_set_text( GTK_LABEL(this->search_string3_lbl_w), s3);
gtk_label_set_text( GTK_LABEL(this->search_string4_lbl_w), s4);
gtk_label_set_text( GTK_LABEL(this->search_string_lbl_w), CoWowGtk::convert_utf8(s1));
gtk_label_set_text( GTK_LABEL(this->search_string2_lbl_w), CoWowGtk::convert_utf8(s2));
gtk_label_set_text( GTK_LABEL(this->search_string3_lbl_w), CoWowGtk::convert_utf8(s3));
gtk_label_set_text( GTK_LABEL(this->search_string4_lbl_w), CoWowGtk::convert_utf8(s4));
}
......
......@@ -313,15 +313,7 @@ void Hist::get_hist_list()
dcli_translate_filename( dbName, DATABASE);
switch(Lng::lang)
{
case lng_eLanguage_sv_se:
printSearchStr_sv_se();
break;
default:
printSearchStr_en_us();
break;
}
printSearchStr();
/*create the database if it's not already created*/
if((ret = db_create(&dataBaseP, NULL, 0)) != 0)
......@@ -658,36 +650,36 @@ int Hist::compareStr(char *ev, char *usr)
return sts;
}
void Hist::printSearchStr_en_us()
void Hist::printSearchStr()
{
//return;
bool addAnd = false;
bool prioPrinted = false;
int i = 0;
string searchStr[4];
searchStr[0] = " All events";
searchStr[0] = Lng::translate(" All events");
searchStr[1] = "";
searchStr[2] = "";
searchStr[3] = "";
if((minTime_str != NULL) && (strlen(minTime_str) > 0) )
{
searchStr[i] += " From ";
searchStr[i] += Lng::translate(" from ");
searchStr[i] += minTime_str;
addAnd = true;
}
if((maxTime_str != NULL) && (strlen(maxTime_str) > 0) )
{
searchStr[i] += " To ";
searchStr[i] += Lng::translate(" to ");
searchStr[i] += maxTime_str;
addAnd = true;
}
if(eventPrio_A || eventPrio_B || eventPrio_C || eventPrio_D)
{
if(addAnd) searchStr[i] += " and";
if(addAnd) searchStr[i] += Lng::translate(" and");
i++;
prioPrinted = true;
searchStr[i] += " with prio ";
searchStr[i] += Lng::translate(" with prio ");
if(eventPrio_A)
searchStr[i] += "A";
if(eventPrio_B)
......@@ -700,33 +692,39 @@ void Hist::printSearchStr_en_us()
}
if(eventType_Ack || eventType_Alarm || eventType_Info || eventType_Return)
{
if(addAnd) searchStr[i] += " and";
if(addAnd) searchStr[i] += Lng::translate(" and");
if(!prioPrinted)
i++;
searchStr[i] += " with type ";
if(eventType_Ack)
searchStr[i] += "Ack ";
if(eventType_Alarm)
searchStr[i] += "Active ";
if(eventType_Info)
searchStr[i] += "Info ";
searchStr[i] += Lng::translate(" with type ");
if(eventType_Ack) {
searchStr[i] += Lng::translate("Ack");
searchStr[i] += " ";;
}
if(eventType_Alarm) {
searchStr[i] += Lng::translate("Active");
searchStr[i] += " ";;
}
if(eventType_Info) {
searchStr[i] += Lng::translate("Info");
searchStr[i] += " ";;
}
if(eventType_Return)
searchStr[i] += "Return";
searchStr[i] += Lng::translate("Return");
addAnd = true;
}
if((eventName_str != NULL) && (strlen(eventName_str) > 0) )
{
if(addAnd) searchStr[i] += " and";
if(addAnd) searchStr[i] += Lng::translate(" and");
i++;
searchStr[i] += " with EventName ";
searchStr[i] += Lng::translate(" with EventName ");
searchStr[i] += eventName_str;
addAnd = true;
}
if((eventText_str != NULL) && (strlen(eventText_str) > 0) )
{
if(addAnd) searchStr[i] += " and";
if(addAnd) searchStr[i] += Lng::translate(" and");
i++;
searchStr[i] += " with EventText ";
searchStr[i] += Lng::translate(" with EventText ");
searchStr[i] += eventText_str;
}
......@@ -734,82 +732,6 @@ void Hist::printSearchStr_en_us()
searchStr[2].c_str(), searchStr[3].c_str());
}
void Hist::printSearchStr_sv_se()
{
//return;
bool addAnd = false;
bool prioPrinted = false;
int i = 0;
string searchStr[4];
searchStr[0] = " Alla hndelser";
searchStr[1] = "";
searchStr[2] = "";
searchStr[3] = "";
if((minTime_str != NULL) && (strlen(minTime_str) > 0) )
{
searchStr[i] += " Frn ";
searchStr[i] += minTime_str;
addAnd = true;
}
if((maxTime_str != NULL) && (strlen(maxTime_str) > 0) )
{
searchStr[i] += " till ";
searchStr[i] += maxTime_str;
addAnd = true;
}
if(eventPrio_A || eventPrio_B || eventPrio_C || eventPrio_D)
{
if(addAnd) searchStr[i] += " och";
prioPrinted = true;
i++;
searchStr[i] += " med prio ";
if(eventPrio_A)
searchStr[i] += "A";
if(eventPrio_B)
searchStr[i] += "B";
if(eventPrio_C)
searchStr[i] += "C";
if(eventPrio_D)
searchStr[i] += "D";
addAnd = true;
}
if(eventType_Ack || eventType_Alarm || eventType_Info || eventType_Return)
{
if(addAnd) searchStr[i] += " och";
if(!prioPrinted)
i++;
searchStr[i] += " med typ ";
if(eventType_Ack)
searchStr[i] += "Kvittens ";
if(eventType_Alarm)
searchStr[i] += "Aktiv ";
if(eventType_Info)
searchStr[i] += "Info ";
if(eventType_Return)
searchStr[i] += "Retur";
addAnd = true;
}
if((eventName_str != NULL) && (strlen(eventName_str) > 0) )
{
if(addAnd) searchStr[i] += " och";
i++;
searchStr[i] += " med Hndelsenamn ";
searchStr[i] += eventName_str;
addAnd = true;
}
if((eventText_str != NULL) && (strlen(eventText_str) > 0) )
{
if(addAnd) searchStr[i] += " och";
i++;
searchStr[i] += " med hndelsetext ";
searchStr[i] += eventText_str;
}
set_search_string( searchStr[0].c_str(), searchStr[1].c_str(),
searchStr[2].c_str(), searchStr[3].c_str());
}
/************************************************************************
......
......@@ -92,8 +92,7 @@ class Hist {
pwr_tStatus hist_clear_histlist();
int check_conditions(sEvent *evp);
int compareStr(char *, char *);
void printSearchStr_en_us();
void printSearchStr_sv_se();
void printSearchStr();
virtual void set_num_of_events( int nrOfEvents) {}
virtual void set_search_string( const char *s1, const char *s2,
......
......@@ -185,6 +185,14 @@ E 1.9.23 "Last Month"
E 1.9.24 "All "
E 1.9.25 "Time"
E 1.9.26 "Search Condition"
E 1.9.27 " All events"
E 1.9.28 " from "
E 1.9.29 " to "
E 1.9.30 " and"
E 1.9.31 " with prio "
E 1.9.32 " with type "
E 1.9.33 " with EventName "
E 1.9.34 " with EventText "
#
# Ge Curve
E 1.10.1 "_Refresh"
......
......@@ -185,6 +185,14 @@ E 1.9.23 "F
E 1.9.24 "Allt "
E 1.9.25 "Tid"
E 1.9.26 "Skvillkor"
E 1.9.27 " Alla hndelser"
E 1.9.28 " frn "
E 1.9.29 " till "
E 1.9.30 " och"
E 1.9.31 " med prio "
E 1.9.32 " med typ "
E 1.9.33 " med Hndelsenamn "
E 1.9.34 " med Hndelsetext "
#
# Ge Curve
E 1.10.1 "_Uppdatera"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment