/*
* Title: tmsControlMainGui.cpp
* Author: M.Thomas BEAM Ltd
* Date: 2007-02-13
*
* Contents: Primary interface for Cern TMS system test/debug Gui
*
* Mod Rec:
*
*/
#include <qmenubar.h>
#include <qmessagebox.h>
#include <qlabel.h>
#include <qinputdialog.h>
#include <qimage.h>
#include <tmsControlMainWin.h>
#include <Globals.h>
#include <unistd.h>
TmsControlMainWin::TmsControlMainWin(Control& control) : ocontrol(control) {
}
TmsControlMainWin::~TmsControlMainWin(){
}
void TmsControlMainWin::initMenubar(){
QPopupMenu* m;
QAction* a;
m = new QPopupMenu();
a = addAction(m, tr("New Connection"), tr("&New Connection"), tr("Ctrl+N"), SLOT(slotNewConnection()), tr("Starts a new job"));
a = addAction(m, tr("Quit"), tr("&Quit"), tr("Ctrl+Q"), SLOT(slotQuit()), tr("Quits the application"));
menuBar()->insertItem(tr("&File"), m);
m = new QPopupMenu();
a = addAction(m, tr("Prefferences"), tr("&Prefferences"), tr("Ctrl+P"), SLOT(slotPrefferences()), tr("Setup prefferences"));
menuBar()->insertItem(tr("&Options"), m);
menuBar( )->insertSeparator(-1);
m = new QPopupMenu();
// a = addAction(m, tr("Whats This"), tr("&Whats This"), tr("Ctrl+W"), SLOT(slotEnterWhatsThis()), tr("Enter Whats This mode"));
a = addAction(m, tr("Manual"), tr("&Manual"), tr("Ctrl+M"), SLOT(slotManual()), tr("Online Manual"));
a = addAction(m, tr("TMS Manual"), tr("&TMS Manual"), tr("Ctrl+T"), SLOT(slotTmsManual()), tr("TMS System Manual"));
a = addAction(m, tr("About"), tr("&About"), tr("Ctrl+A"), SLOT(slotAbout()), tr("About the program"));
menuBar()->insertItem(tr("&Help"), m);
// setMinimumSize(QSize(1024,850));
}
void TmsControlMainWin::initMain(){
BError err;
QFont f;
BString host;
if (ghostName.len() > 0) {
host = ghostName;
}
else {
host = gconfig.findValue("DefaultServer:");
}
if (host.len() > 0)
ocontrol.setHost(host);
if (err = ocontrol.init()) { // System defaults to localhost