Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
geometrize::dialog::RunScriptDialog Class Reference

The RunScriptDialog class models the UI for picking scripts to run, and specifying script options. More...

#include <runscriptdialog.h>

Inheritance diagram for geometrize::dialog::RunScriptDialog:
Inheritance graph
[legend]
Collaboration diagram for geometrize::dialog::RunScriptDialog:
Collaboration graph
[legend]

Public Member Functions

 RunScriptDialog (QWidget *parent=nullptr)
 
virtual ~RunScriptDialog ()
 
QString getScriptFilepath ()
 

Protected Member Functions

void changeEvent (QEvent *) override
 

Private Slots

void on_scriptFileDialogButton_clicked ()
 
void on_buttonBox_accepted ()
 

Private Member Functions

void populateUi ()
 

Private Attributes

Ui::RunScriptDialog * ui
 

Detailed Description

The RunScriptDialog class models the UI for picking scripts to run, and specifying script options.

Constructor & Destructor Documentation

geometrize::dialog::RunScriptDialog::RunScriptDialog ( QWidget *  parent = nullptr)
explicit
16  :
17  QDialog(parent),
18  ui(new Ui::RunScriptDialog)
19 {
20  setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove question mark from title bar
21  ui->setupUi(this);
22  populateUi();
23 }
void populateUi()
Definition: runscriptdialog.cpp:64
Ui::RunScriptDialog * ui
Definition: runscriptdialog.h:41

Here is the call graph for this function:

geometrize::dialog::RunScriptDialog::~RunScriptDialog ( )
virtual
26 {
27  delete ui;
28 }
Ui::RunScriptDialog * ui
Definition: runscriptdialog.h:41

Member Function Documentation

void geometrize::dialog::RunScriptDialog::changeEvent ( QEvent *  event)
overrideprotected
56 {
57  if (event->type() == QEvent::LanguageChange) {
58  ui->retranslateUi(this);
59  populateUi();
60  }
61  QDialog::changeEvent(event);
62 }
void populateUi()
Definition: runscriptdialog.cpp:64
Ui::RunScriptDialog * ui
Definition: runscriptdialog.h:41

Here is the call graph for this function:

QString geometrize::dialog::RunScriptDialog::getScriptFilepath ( )
31 {
32  return ui->scriptPathEdit->text();
33 }
Ui::RunScriptDialog * ui
Definition: runscriptdialog.h:41

Here is the caller graph for this function:

void geometrize::dialog::RunScriptDialog::on_buttonBox_accepted ( )
privateslot
45 {
46  const std::string scriptPath{getScriptFilepath().toStdString()};
47  if(!util::fileExists(scriptPath)) {
48  return;
49  }
50 
51  const std::string script{util::readFileAsString(scriptPath)};
53 }
bool fileExists(const std::string &filePath)
fileExists Checks if a file exists, returns true if it does.
Definition: util.cpp:87
std::string readFileAsString(const std::string &filePath)
readFileAsString Reads a file, returning a string containing the contents.
Definition: util.cpp:112
QString getScriptFilepath()
Definition: runscriptdialog.cpp:30
void runScript(const std::string &code, chaiscript::ChaiScript &runner)
runScript Evaluates the provided script code.
Definition: scriptrunner.cpp:16

Here is the call graph for this function:

void geometrize::dialog::RunScriptDialog::on_scriptFileDialogButton_clicked ( )
privateslot
36 {
37  const QString scriptPath{common::ui::openSelectScriptDialog(this)};
38  if(scriptPath.isEmpty()) {
39  return;
40  }
41  ui->scriptPathEdit->setText(scriptPath);
42 }
QString openSelectScriptDialog(QWidget *parent)
Definition: uiactions.cpp:189
Ui::RunScriptDialog * ui
Definition: runscriptdialog.h:41

Here is the call graph for this function:

void geometrize::dialog::RunScriptDialog::populateUi ( )
private
65 {
66 
67 }

Here is the caller graph for this function:

Member Data Documentation

Ui::RunScriptDialog* geometrize::dialog::RunScriptDialog::ui
private

The documentation for this class was generated from the following files: