CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxWebServerWidgetBase.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #include "cxWebServerWidgetBase.h"
13 #include <QPushButton>
14 #include <QVBoxLayout>
15 #include <QLabel>
16 
17 namespace cx
18 {
19 
20 
22  QWidget(parent),
23  mServices(services),
24  mStartStopButton(new QPushButton(QIcon(":/icons/open_icon_library/media-playback-start-3.png"), "Start")),
25  mVerticalLayout(new QVBoxLayout(this))
26 {
27  mStartStopButton->setCheckable(true);
28 
29  mVerticalLayout->addWidget(new QLabel("Run Web Server"));
31  //mVerticalLayout->addStretch();
32 
33  connect(mStartStopButton, &QPushButton::clicked, this, &WebServerWidgetBase::startStopSlot);
34 }
35 
37 {
38 }
39 
41 {
42 // CX_LOG_DEBUG() << "WebServerWidgetBase::startStopSlot: " << checked;
43  if(checked)
44  {
45  this->startServer();
46  mStartStopButton->setIcon(QIcon(":/icons/open_icon_library/media-playback-stop-3.png"));
47  mStartStopButton->setText("Stop");
48  }
49  else
50  {
51  this->stopServer();
52  mStartStopButton->setIcon(QIcon(":/icons/open_icon_library/media-playback-start-3.png"));
53  mStartStopButton->setText("Start");
54  this->shutdownServer();
55  }
56 }
57 
58 }//cx
virtual void startServer()=0
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
WebServerWidgetBase(cx::VisServicesPtr services, QWidget *parent=0)
virtual void startStopSlot(bool checked)
virtual void stopServer()=0
Namespace for all CustusX production code.