/// <summary> /// Update graphic objects with language file values /// </summary> private void UpdateGraphicObjects() { // Main Window Title this.WindowTitle = MainClass.AppNameVer + " [" + GlobalObj.AppNameVer + "]"; // Update menu and toolbar mainwindow_Ui.menu_File.Title = GlobalObj.LMan.GetString("filemenulbl").Replace("_", "&"); mainwindow_Ui.action_Open.Text = GlobalObj.LMan.GetString("openmenulbl").Replace("_", "&"); mainwindow_Ui.action_Open.IconText = GlobalObj.LMan.GetString("openlbl"); mainwindow_Ui.action_Close.Text = GlobalObj.LMan.GetString("closemenulbl").Replace("_", "&"); mainwindow_Ui.action_Close.IconText = GlobalObj.LMan.GetString("closelbl"); mainwindow_Ui.action_SerialSettings.Text = GlobalObj.LMan.GetString("settingsmenulbl"); mainwindow_Ui.action_SerialSettings.IconText = GlobalObj.LMan.GetString("settingslbl"); mainwindow_Ui.action_Exit.Text = GlobalObj.LMan.GetString("exitmenulbl").Replace("_", "&"); mainwindow_Ui.action_Exit.IconText = GlobalObj.LMan.GetString("exitlbl"); mainwindow_Ui.menu_Reader.Title = GlobalObj.LMan.GetString("readermenulbl").Replace("_", "&"); mainwindow_Ui.menu_About.Title = GlobalObj.LMan.GetString("helpmenulbl").Replace("_", "&"); mainwindow_Ui.action_Info.Text = GlobalObj.LMan.GetString("infomenulbl").Replace("_", "&"); mainwindow_Ui.action_Info.IconText = GlobalObj.LMan.GetString("infolbl"); mainwindow_Ui.action_ATR.IconText = GlobalObj.LMan.GetString("atrlbl"); mainwindow_Ui.FrameATR.Title = GlobalObj.LMan.GetString("atrframelbl"); mainwindow_Ui.FrameFile.Title = GlobalObj.LMan.GetString("commandfilelbl"); mainwindow_Ui.FrameExchange.Title = GlobalObj.LMan.GetString("cardframelbl"); mainwindow_Ui.LblCommand.Text = GlobalObj.LMan.GetString("cmdlbl"); mainwindow_Ui.LblResponse.Text = GlobalObj.LMan.GetString("resplbl"); mainwindow_Ui.BtnSend.Text = GlobalObj.LMan.GetString("sendlbl"); // Update font for command list if (GlobalObj.IsWindows()) { mainwindow_Ui.LstCommands.Font = new QFont("Courier New", 10); } else { mainwindow_Ui.LstCommands.Font = new QFont("Fixed", 10); } // loop for each managed readers type foreach(IReader rdr in GlobalObj.ReaderManager.Values) { allReaders.AddRange(rdr.Readers); } // Update readers list on gui QAction action_Reader; QActionGroup readersGrp = new QActionGroup(this); for (int r=0; r<allReaders.Count; r++) { action_Reader = new QAction(allReaders[r], mainwindow_Ui.menu_Reader); action_Reader.ObjectName = "action_Reader_" + r.ToString(); action_Reader.SetVisible(true); action_Reader.IconVisibleInMenu = false; action_Reader.Checkable = true; action_Reader.SetActionGroup(readersGrp); if (r==0) { action_Reader.SetChecked(true); } else { action_Reader.SetChecked(false); } mainwindow_Ui.menu_Reader.AddAction(action_Reader); Connect( action_Reader, SIGNAL("activated()"), this, SLOT("ActionChangeReader()")); } // check for available readers if (allReaders.Count > 0) { // select first reader GlobalObj.SelectedReader = allReaders[0]; } // LANGUAGE STATUS TIP // mainwindow_Ui.action_Open.StatusTip = ""; // status bar desc // LANGUAGE TOOL TIP // mainwindow_Ui.action_Open.ToolTip = ""; // tool tip text }
/// <summary> /// Update graphic objects with language file values /// </summary> private void UpdateGraphicObjects() { // Main Window Title this.WindowTitle = MainClass.AppNameVer + " [" + GlobalObj.AppNameVer + "]"; // Set tool tip text for toolbutton mainwindow_Ui.MenuFileItem.Title = GlobalObjUI.LMan.GetString("filemenulbl").Replace("_", "&"); mainwindow_Ui.MenuFileNew.ToolTip = GlobalObjUI.LMan.GetString("newfileact").Replace("_", ""); mainwindow_Ui.MenuFileNew.Text = GlobalObjUI.LMan.GetString("newfileact").Replace("_", "&"); mainwindow_Ui.MenuFileOpen.ToolTip = GlobalObjUI.LMan.GetString("openfileact").Replace("_", ""); mainwindow_Ui.MenuFileOpen.Text = GlobalObjUI.LMan.GetString("openfileact").Replace("_", "&"); mainwindow_Ui.MenuFileSaveFile.ToolTip = GlobalObjUI.LMan.GetString("savefileact").Replace("_", ""); mainwindow_Ui.MenuFileSaveFile.Text = GlobalObjUI.LMan.GetString("savefileact").Replace("_", "&"); mainwindow_Ui.MenuFileSaveSim.ToolTip = GlobalObjUI.LMan.GetString("savefilesimact").Replace("_", ""); mainwindow_Ui.MenuFileSaveSim.Text = GlobalObjUI.LMan.GetString("savefilesimact").Replace("_", "&"); mainwindow_Ui.MenuFileClose.ToolTip = GlobalObjUI.LMan.GetString("closefileact").Replace("_", ""); mainwindow_Ui.MenuFileClose.Text = GlobalObjUI.LMan.GetString("closefileact").Replace("_", "&"); mainwindow_Ui.MenuFileSettings.ToolTip = GlobalObjUI.LMan.GetString("settingsact").Replace("_", ""); mainwindow_Ui.MenuFileSettings.Text = GlobalObjUI.LMan.GetString("settingsact").Replace("_", "&"); mainwindow_Ui.MenuFileExit.ToolTip = GlobalObjUI.LMan.GetString("exitact").Replace("_", ""); mainwindow_Ui.MenuFileExit.Text = GlobalObjUI.LMan.GetString("exitact").Replace("_", "&"); mainwindow_Ui.MenuSimItem.Title = GlobalObjUI.LMan.GetString("simmenulbl").Replace("_", "&"); mainwindow_Ui.MenuSimConnect.ToolTip = GlobalObjUI.LMan.GetString("opensimact").Replace("_", ""); mainwindow_Ui.MenuSimConnect.Text = GlobalObjUI.LMan.GetString("opensimact").Replace("_", "&"); mainwindow_Ui.MenuSimPin.ToolTip = GlobalObjUI.LMan.GetString("pinsimact").Replace("_", ""); mainwindow_Ui.MenuSimPin.Text = GlobalObjUI.LMan.GetString("pinsimact").Replace("_", "&"); mainwindow_Ui.MenuSimSaveFile.ToolTip = GlobalObjUI.LMan.GetString("savesimfileact").Replace("_", ""); mainwindow_Ui.MenuSimSaveFile.Text = GlobalObjUI.LMan.GetString("savesimfileact").Replace("_", "&"); mainwindow_Ui.MenuSimSaveSim.ToolTip = GlobalObjUI.LMan.GetString("savesimact").Replace("_", ""); mainwindow_Ui.MenuSimSaveSim.Text = GlobalObjUI.LMan.GetString("savesimact").Replace("_", "&"); mainwindow_Ui.MenuSimDeleteAll.Text = GlobalObjUI.LMan.GetString("deletesimact").Replace("_", "&"); mainwindow_Ui.MenuSimDisconnect.ToolTip = GlobalObjUI.LMan.GetString("closesimact").Replace("_", ""); mainwindow_Ui.MenuSimDisconnect.Text = GlobalObjUI.LMan.GetString("closesimact").Replace("_", "&"); mainwindow_Ui.MenuReaderItem.Title = GlobalObjUI.LMan.GetString("readermenulbl").Replace("_", "&"); mainwindow_Ui.MenuAboutItem.Title = GlobalObjUI.LMan.GetString("helpmenulbl").Replace("_", "&"); mainwindow_Ui.MenuAboutInfo.ToolTip = GlobalObjUI.LMan.GetString("infoact").Replace("_", ""); mainwindow_Ui.MenuAboutInfo.Text = GlobalObjUI.LMan.GetString("infoact").Replace("_", "&"); // Frame labels mainwindow_Ui.FrameFile.Title = GlobalObjUI.LMan.GetString("framefile"); mainwindow_Ui.FrameSim.Title = GlobalObjUI.LMan.GetString("framesim"); // Setup column headers List<string> columnHeaders = new List<string>(); columnHeaders.Add(" "); columnHeaders.Add(GlobalObjUI.LMan.GetString("descnumber")); columnHeaders.Add(GlobalObjUI.LMan.GetString("phonenumber")); mainwindow_Ui.LstFileContacts.SetHeaderLabels(columnHeaders); mainwindow_Ui.LstFileContacts.SetColumnWidth(1, 150); mainwindow_Ui.LstFileContacts.SetColumnWidth(2, 150); mainwindow_Ui.LstSimContacts.SetHeaderLabels(columnHeaders); mainwindow_Ui.LstSimContacts.SetColumnWidth(1, 150); mainwindow_Ui.LstSimContacts.SetColumnWidth(2, 150); mainwindow_Ui.LstFileContacts.HideColumn(0); mainwindow_Ui.LstSimContacts.HideColumn(0); // loop for each managed readers type foreach(IReader rdr in GlobalObj.ReaderManager.Values) { allReaders.AddRange(rdr.Readers); } // Update readers list on gui QAction action_Reader; QActionGroup readersGrp = new QActionGroup(this); for (int r=0; r<allReaders.Count; r++) { action_Reader = new QAction(allReaders[r], mainwindow_Ui.MenuReaderItem); action_Reader.ObjectName = "action_Reader_" + r.ToString(); action_Reader.SetVisible(true); action_Reader.IconVisibleInMenu = false; action_Reader.Checkable = true; action_Reader.SetActionGroup(readersGrp); if (r==0) { action_Reader.SetChecked(true); } else { action_Reader.SetChecked(false); } mainwindow_Ui.MenuReaderItem.AddAction(action_Reader); Connect( action_Reader, SIGNAL("activated()"), this, SLOT("ActionChangeReader()")); } // check for available readers if (allReaders.Count > 0) { // select first reader GlobalObj.SelectedReader = allReaders[0]; } // Add progressbar to statusbar PBar = new QProgressBar(mainwindow_Ui.StatusBar); PBar.SetFixedWidth(180); PBar.SetFixedHeight(20); PBar.SetVisible(false); mainwindow_Ui.StatusBar.AddPermanentWidget(PBar); CreateFileMenu(); CreateSimMenu(); }