ATLAS Offline Software
Classes | Public Member Functions | Protected Slots | Private Attributes | List of all members
VP1IncomingMessageDialog Class Reference

#include <VP1IncomingMessageDialog.h>

Inheritance diagram for VP1IncomingMessageDialog:
Collaboration diagram for VP1IncomingMessageDialog:

Classes

class  Imp
 

Public Member Functions

 VP1IncomingMessageDialog (const VP1ExternalRequest &, QQueue< VP1ExternalRequest > *, bool *blockallmessages, QList< QString > *messages_blockedsenders, QList< VP1ExternalRequest > *_messages_blockedexactmessages, VP1TabManager *, VP1ChannelManager *, QWidget *parent=0)
 
virtual ~VP1IncomingMessageDialog ()
 
void updatependinginfo ()
 

Protected Slots

void request_gothere ()
 
void request_allclear ()
 
void request_allblock ()
 
void request_senderclear ()
 
void request_senderblock ()
 
void request_messageblock ()
 
void request_messageclear ()
 

Private Attributes

Impm_d
 

Detailed Description

Definition at line 27 of file VP1IncomingMessageDialog.h.

Constructor & Destructor Documentation

◆ VP1IncomingMessageDialog()

VP1IncomingMessageDialog::VP1IncomingMessageDialog ( const VP1ExternalRequest r,
QQueue< VP1ExternalRequest > *  rq,
bool *  blockallmessages,
QList< QString > *  messages_blockedsenders,
QList< VP1ExternalRequest > *  _messages_blockedexactmessages,
VP1TabManager tm,
VP1ChannelManager cm,
QWidget *  parent = 0 
)

Definition at line 51 of file VP1IncomingMessageDialog.cxx.

59  : QDialog(parent), m_d(new Imp(r))
60 {
61  m_d->tabmanager= tm;
63  m_d->requestqueue = rq;
64  m_d->blockallmessages=blockallmessages;
65  m_d->messages_blockedsenders=messages_blockedsenders;
66  m_d->messages_blockedexactmessages=messages_blockedexactmessages;
67  Ui::VP1IncomingMessageForm ui;
68  ui.setupUi(this);
69 
70  m_d->pushButton_allclear = ui.pushButton_allclear;
71  m_d->pushButton_senderclear = ui.pushButton_senderclear;
72  m_d->pushButton_messageclear = ui.pushButton_messageclear;
73 
74  m_d->lcdNumber_pending = ui.lcdNumber_pending;
75  m_d->lcdNumber_pendingsender = ui.lcdNumber_pendingsender;
76  m_d->lcdNumber_pendingexactsame = ui.lcdNumber_pendingexactsame;
78 
79  connect(ui.pushButton_allclear,SIGNAL(clicked()),this,SLOT(request_allclear()));
80  connect(ui.pushButton_allblock,SIGNAL(clicked()),this,SLOT(request_allblock()));
81  connect(ui.pushButton_senderclear,SIGNAL(clicked()),this,SLOT(request_senderclear()));
82  connect(ui.pushButton_senderblock,SIGNAL(clicked()),this,SLOT(request_senderblock()));
83  connect(ui.pushButton_messageblock,SIGNAL(clicked()),this,SLOT(request_messageblock()));
84  connect(ui.pushButton_messageclear,SIGNAL(clicked()),this,SLOT(request_messageclear()));
85 
86  connect(ui.pushButton_showtab_gothere,SIGNAL(clicked()),this,SLOT(request_gothere()));
87 
88  ui.textBrowser_message->setText(m_d->request.message());
89  ui.label_header->setText(ui.label_header->text().replace("SENDERPLACEHOLDER",m_d->request.sender()));
91  ui.widget_showtab->hide();
93  ui.label_showtab->setText(ui.label_showtab->text().replace("DUMMYTABNAME",m_d->request.actioninfo()));
95  ui.label_showtaberror->hide();
96  } else {
97  ui.pushButton_showtab_gothere->hide();
98  }
100  ui.label_showtab->setText(ui.label_showtab->text().replace("tab","channel"));
101  ui.label_showtab->setText(ui.label_showtab->text().replace("DUMMYTABNAME",m_d->request.actioninfo()));
102 
104  ui.label_showtaberror->hide();
105  } else {
106  ui.label_showtaberror->setText(ui.label_showtaberror->text().replace("tab","channel"));
107  ui.pushButton_showtab_gothere->hide();
108  }
109 
110  } else {
111  assert(0&&"This should never happen unless you did not hardcode all action types!");
112  }
113 }

◆ ~VP1IncomingMessageDialog()

VP1IncomingMessageDialog::~VP1IncomingMessageDialog ( )
virtual

Definition at line 116 of file VP1IncomingMessageDialog.cxx.

117 {
118  delete m_d; m_d=0;
119 }

Member Function Documentation

◆ request_allblock

void VP1IncomingMessageDialog::request_allblock ( )
protectedslot

Definition at line 162 of file VP1IncomingMessageDialog.cxx.

163 {
164  int ret = QMessageBox::question(this, "VP1 - Block all incoming messages?",
165  "This will block all incoming messages to the application.\nProceed?",
166  QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel );
167  if (ret!=QMessageBox::Ok)
168  return;
169  *(m_d->blockallmessages)=true;
171 }

◆ request_allclear

void VP1IncomingMessageDialog::request_allclear ( )
protectedslot

Definition at line 155 of file VP1IncomingMessageDialog.cxx.

156 {
157  m_d->requestqueue->clear();
159 }

◆ request_gothere

void VP1IncomingMessageDialog::request_gothere ( )
protectedslot

◆ request_messageblock

void VP1IncomingMessageDialog::request_messageblock ( )
protectedslot

Definition at line 209 of file VP1IncomingMessageDialog.cxx.

210 {
213 }

◆ request_messageclear

void VP1IncomingMessageDialog::request_messageclear ( )
protectedslot

Definition at line 195 of file VP1IncomingMessageDialog.cxx.

196 {
197  QList<VP1ExternalRequest> tmp;
198  for (VP1ExternalRequest er : *(m_d->requestqueue)) {
199  if (!tmp.contains(er)&&er==m_d->request)
200  tmp<<er;
201  }
202  for (VP1ExternalRequest er : tmp) {
203  m_d->requestqueue->removeAll(er);
204  }
206 }

◆ request_senderblock

void VP1IncomingMessageDialog::request_senderblock ( )
protectedslot

Definition at line 188 of file VP1IncomingMessageDialog.cxx.

189 {
192 }

◆ request_senderclear

void VP1IncomingMessageDialog::request_senderclear ( )
protectedslot

Definition at line 174 of file VP1IncomingMessageDialog.cxx.

175 {
176  QList<VP1ExternalRequest> tmp;
177  for (VP1ExternalRequest er : *(m_d->requestqueue)) {
178  if (!tmp.contains(er)&&er.sender()==m_d->request.sender())
179  tmp<<er;
180  }
181  for (VP1ExternalRequest er : tmp) {
182  m_d->requestqueue->removeAll (er);
183  }
185 }

◆ updatependinginfo()

void VP1IncomingMessageDialog::updatependinginfo ( )

Definition at line 132 of file VP1IncomingMessageDialog.cxx.

133 {
134  m_d->lcdNumber_pending->display(m_d->requestqueue->count());
135  int nsender(0);
136  for (VP1ExternalRequest er : *(m_d->requestqueue)) {
137  if (er.sender()==m_d->request.sender())
138  ++nsender;
139  }
140  m_d->lcdNumber_pendingsender->display(nsender);
141  int nequal(0);
142  for (VP1ExternalRequest er : *(m_d->requestqueue)) {
143  if (m_d->request==er)
144  ++nequal;
145  }
146  m_d->lcdNumber_pendingexactsame->display(nequal);
147 
148 
149  m_d->pushButton_allclear->setEnabled(m_d->requestqueue->count()>0);
150  m_d->pushButton_senderclear->setEnabled(nsender>0);
151  m_d->pushButton_messageclear->setEnabled(nequal>0);
152 }

Member Data Documentation

◆ m_d

Imp* VP1IncomingMessageDialog::m_d
private

Definition at line 55 of file VP1IncomingMessageDialog.h.


The documentation for this class was generated from the following files:
VP1IncomingMessageDialog::request_allclear
void request_allclear()
Definition: VP1IncomingMessageDialog.cxx:155
VP1IncomingMessageDialog::Imp::requestqueue
QQueue< VP1ExternalRequest > * requestqueue
Definition: VP1IncomingMessageDialog.cxx:37
beamspotman.r
def r
Definition: beamspotman.py:676
VP1ExternalRequest::message
QString message() const
Definition: VP1ExternalRequest.h:33
VP1IncomingMessageDialog::request_senderblock
void request_senderblock()
Definition: VP1IncomingMessageDialog.cxx:188
VP1IncomingMessageDialog::Imp::pushButton_messageclear
QPushButton * pushButton_messageclear
Definition: VP1IncomingMessageDialog.cxx:45
VP1IncomingMessageDialog::request_gothere
void request_gothere()
Definition: VP1IncomingMessageDialog.cxx:122
VP1IncomingMessageDialog::Imp::lcdNumber_pendingsender
QLCDNumber * lcdNumber_pendingsender
Definition: VP1IncomingMessageDialog.cxx:40
VP1IncomingMessageDialog::m_d
Imp * m_d
Definition: VP1IncomingMessageDialog.h:54
VP1IncomingMessageDialog::Imp::tabmanager
VP1TabManager * tabmanager
Definition: VP1IncomingMessageDialog.cxx:35
VP1IncomingMessageDialog::Imp::pushButton_allclear
QPushButton * pushButton_allclear
Definition: VP1IncomingMessageDialog.cxx:43
VP1ExternalRequest::sender
QString sender() const
Definition: VP1ExternalRequest.h:34
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
VP1ChannelManager::channelWithBasenameIsLoaded
bool channelWithBasenameIsLoaded(QString basename) const
Definition: VP1ChannelManager.cxx:562
VP1IncomingMessageDialog::Imp::lcdNumber_pendingexactsame
QLCDNumber * lcdNumber_pendingexactsame
Definition: VP1IncomingMessageDialog.cxx:41
VP1TabManager::showFirstChannelWithGivenBasename
bool showFirstChannelWithGivenBasename(QString basename)
Definition: VP1TabManager.cxx:1427
VP1IncomingMessageDialog::request_allblock
void request_allblock()
Definition: VP1IncomingMessageDialog.cxx:162
VP1ExternalRequest::action
Action action() const
Definition: VP1ExternalRequest.h:31
VP1IncomingMessageDialog::Imp::request
VP1ExternalRequest request
Definition: VP1IncomingMessageDialog.cxx:38
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
VP1IncomingMessageDialog::Imp::messages_blockedexactmessages
QList< VP1ExternalRequest > * messages_blockedexactmessages
Definition: VP1IncomingMessageDialog.cxx:47
VP1IncomingMessageDialog::Imp::channelmanager
VP1ChannelManager * channelmanager
Definition: VP1IncomingMessageDialog.cxx:36
VP1TabManager::hasTab
bool hasTab(QString) const
Definition: VP1TabManager.cxx:1421
VP1IncomingMessageDialog::Imp::lcdNumber_pending
QLCDNumber * lcdNumber_pending
Definition: VP1IncomingMessageDialog.cxx:39
VP1ExternalRequest
Definition: VP1ExternalRequest.h:20
test_pyathena.parent
parent
Definition: test_pyathena.py:15
VP1ExternalRequest::SHOWCHANNEL
@ SHOWCHANNEL
Definition: VP1ExternalRequest.h:23
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
VP1IncomingMessageDialog::request_messageblock
void request_messageblock()
Definition: VP1IncomingMessageDialog.cxx:209
VP1IncomingMessageDialog::request_senderclear
void request_senderclear()
Definition: VP1IncomingMessageDialog.cxx:174
VP1TabManager::showTab
bool showTab(QString)
Definition: VP1TabManager.cxx:1078
VP1ExternalRequest::SHOWTAB
@ SHOWTAB
Definition: VP1ExternalRequest.h:23
VP1ExternalRequest::actioninfo
QString actioninfo() const
Definition: VP1ExternalRequest.h:32
VP1IncomingMessageDialog::Imp::messages_blockedsenders
QList< QString > * messages_blockedsenders
Definition: VP1IncomingMessageDialog.cxx:46
VP1IncomingMessageDialog::request_messageclear
void request_messageclear()
Definition: VP1IncomingMessageDialog.cxx:195
VP1ExternalRequest::SHOWMESSAGE
@ SHOWMESSAGE
Definition: VP1ExternalRequest.h:23
VP1IncomingMessageDialog::Imp::blockallmessages
bool * blockallmessages
Definition: VP1IncomingMessageDialog.cxx:42
VP1IncomingMessageDialog::updatependinginfo
void updatependinginfo()
Definition: VP1IncomingMessageDialog.cxx:132
VP1IncomingMessageDialog::Imp::pushButton_senderclear
QPushButton * pushButton_senderclear
Definition: VP1IncomingMessageDialog.cxx:44