5 #include "FPublisher.h"
6 #include "FSubscriber.h"
8 MainForm::MainForm(QWidget *parent)
14 void MainForm::about()
16 QMessageBox::about( this, "ORTE application demo",
17 "This application demonstrates usage of ORTE library\n\n"
18 "Petr Smolik (c) 2004-2008\n"
22 void MainForm::viewPublSource()
25 richtext=new MyRichText;
26 richtext->resize( 450, 350 );
27 richtext->setWindowTitle( "Publisher example");
28 richtext->setTextPublisher();
30 connect( this, SIGNAL( rejected() ), richtext, SLOT( close() ) );
33 void MainForm::viewSubsSource()
36 richtext=new MyRichText;
37 richtext->resize( 450, 350 );
38 richtext->setWindowTitle( "Subscriber example");
39 richtext->setTextSubscriber();
40 connect( this, SIGNAL( rejected() ), richtext, SLOT( close() ) );
44 void MainForm::addPublisher()
49 if (radioButton2_3->isChecked())
51 if (radioButton2_4->isChecked())
53 if (radioButton1->isChecked())
55 if (radioButton2->isChecked())
57 fp = new FPublisher();
58 if (!fp->initPublisher(color,rand()%3)) {
59 QMessageBox::critical(this, "ORTE error", "Publisher initialization failed");
63 connect( this, SIGNAL( rejected() ), fp, SLOT( destroy() ) );
64 fp->setWindowIcon(QPixmap(":/FPublisherIcon.png"));
68 void MainForm::addSubscriber()
72 connect( this, SIGNAL( rejected() ), fs, SLOT( destroy() ) );
73 if (!fs->initSubscribers(
78 clYellow->isChecked()))
80 QMessageBox::critical(this, "ORTE error", "Subscriber initialization failed");
84 fs->setWindowIcon(QPixmap(":/FSubscriberIcon.png"));