ctkHostAppExampleWidget.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #include "ctkHostAppExampleWidget.h"
  2. #include "ui_ctkHostAppExampleWidget.h"
  3. #include "ctkDicomExampleHost.h"
  4. #include <QDebug>
  5. #include <QFileDialog>
  6. ctkHostAppExampleWidget::ctkHostAppExampleWidget(QWidget *parent) :
  7. QWidget(parent),
  8. ui(new Ui::ctkHostAppExampleWidget)
  9. {
  10. qDebug() << "setup ui";
  11. ui->setupUi(this);
  12. this->host = new ctkDicomExampleHost();
  13. }
  14. ctkHostAppExampleWidget::~ctkHostAppExampleWidget()
  15. {
  16. delete ui;
  17. }
  18. void ctkHostAppExampleWidget::startButtonClicked()
  19. {
  20. qDebug() << "start button clicked";
  21. if (host)
  22. {
  23. // host->StartApplication(appFileName);
  24. }
  25. }
  26. void ctkHostAppExampleWidget::stopButtonClicked()
  27. {
  28. qDebug() << "stop button clicked";
  29. }
  30. void ctkHostAppExampleWidget::loadButtonClicked()
  31. {
  32. qDebug() << "load button clicked";
  33. this->appFileName = QFileDialog::getOpenFileName(this,"Choose hosted application",QApplication::applicationDirPath());
  34. if (QFile(this->appFileName).permissions() & QFile::ExeUser )
  35. {
  36. this->ui->applicationPathLabel->setText(this->appFileName);
  37. }
  38. else
  39. {
  40. this->ui->applicationPathLabel->setText(QString("<font color='red'>Not executable:</font>").append(this->appFileName));
  41. }
  42. }