Commit bfaf1052 authored by Claes Sjofors's avatar Claes Sjofors

Language selection added to webhandler

parent 8838a2a4
......@@ -45,18 +45,27 @@ public class JopOpWindow extends JPanel {
this.root = root;
en = session.getEngine();
// Set language
JopLang lng = new JopLang(session);
lng.set( JopLang.LANGUAGE_sv_SE);
JopLang.setDefault(lng);
// Get WebHandler object
CdhrObjid oretWebH = en.gdh.getClassList( Pwrb.cClass_WebHandler);
if ( oretWebH.evenSts()) return;
CdhrString sret = en.gdh.objidToName( oretWebH.objid, Cdh.mName_volumeStrict);
if ( sret.evenSts()) return;
String s = sret.str + ".Title";
// Set language
JopLang lng = new JopLang(session);
String s = sret.str + ".Language";
CdhrInt iret = en.gdh.getObjectInfoInt( s);
if ( iret.oddSts())
lng.set( iret.value);
JopLang.setDefault(lng);
if ( root instanceof JFrame)
((JFrame)root).setTitle( JopLang.transl("Operator Window"));
s = sret.str + ".Title";
CdhrString srettxt = en.gdh.getObjectInfoString( s);
if ( srettxt.evenSts()) return;
......@@ -81,12 +90,19 @@ public class JopOpWindow extends JPanel {
this.add( label);
OpWindButton button;
langButton = new OpWindButton( session, "", JopLang.transl("Language"),
OpWindButton.LANGUAGE);
this.add( langButton);
s = sret.str + ".EnableLanguage";
iret = en.gdh.getObjectInfoInt( s);
if ( iret.evenSts()) return;
if ( iret.value != 0) {
langButton = new OpWindButton( session, "", JopLang.transl("Language"),
OpWindButton.LANGUAGE);
this.add( langButton);
}
s = sret.str + ".EnableLogin";
CdhrInt iret = en.gdh.getObjectInfoInt( s);
iret = en.gdh.getObjectInfoInt( s);
if ( iret.evenSts()) return;
if ( iret.value != 0) {
......@@ -104,7 +120,7 @@ public class JopOpWindow extends JPanel {
iret = en.gdh.getObjectInfoInt( s);
if ( iret.evenSts()) return;
if ( iret.value != 0) {
if ( iret.value != 0 && !(root instanceof JFrame)) {
alarmButton = new OpWindButton( session, "", JopLang.transl("Alarm and Event List"),
OpWindButton.ALARMLIST);
this.add( alarmButton);
......@@ -114,7 +130,7 @@ public class JopOpWindow extends JPanel {
iret = en.gdh.getObjectInfoInt( s);
if ( iret.evenSts()) return;
if ( iret.value != 0) {
if ( iret.value != 0 && !(root instanceof JFrame)) {
eventLogButton = new OpWindButton( session, "", JopLang.transl("Event Log"),
OpWindButton.EVENTLOG);
this.add( eventLogButton);
......@@ -294,7 +310,9 @@ public class JopOpWindow extends JPanel {
}
public void setLanguage( int language) {
System.out.println( "Opwindow: Set language");
if ( root instanceof JFrame)
((JFrame)root).setTitle( JopLang.transl("Operator Window"));
if ( langButton != null)
langButton.setText( JopLang.transl("Language"));
......
......@@ -103,6 +103,14 @@ SObject pwrb:Class
EndBody
EndObject
!/**
! A language selection entry will be placed in the menu frame.
!*/
Object EnableLanguage $Attribute 14
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! @Summary A login entry will be placed in the menu frame.
! A login entry will be placed in the menu frame, that makes it possible
! to login as a proview user, and gain privileges to make changes to
......@@ -148,6 +156,14 @@ SObject pwrb:Class
EndBody
EndObject
!/**
! Specifies default language.
!*/
Object Language $Attribute 15
Body SysBody
Attr TypeRef = "pwrb:Type-LanguageEnum"
EndBody
EndObject
!/**
! @Summary css-file that will be used by generated html-files.
! css-file (Cascading Style Sheets) that will be used by
! generated html-files.
......
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