MainWindow::MainWindow(QWidget *parent):QMainWindow(parent),ui(new Ui::MainWindow) { ui->setupUi(this); ui->label_GenerationTime->setText("Current Generation Time: 00:00:00"); ui->progressBar->setValue(0); ui->progressBar->setAlignment(Qt::AlignRight); ui->list_LevelSet->setContextMenuPolicy(Qt::CustomContextMenu); ui->lineEdit_GeneratorSeed->setValidator(new QIntValidator(0,999999999,this)); ui->lineEdit_GeneratorSeed->setText(0000000000); ui->spin_TimeLimit->setValue(1.00); connect(&Generator, SIGNAL(changeProgressBar(float)), this, SLOT(changeProgressBar(float))); connect(&Generator, SIGNAL(addToList(int)), this, SLOT(addToList(int))); connect(&Generator, SIGNAL(regenFinished(int)), this, SLOT(displayLevel(int))); connect(&Generator, SIGNAL(regenFinished(int)), this, SLOT(displayLevelGenTime(int))); connect(&thread, SIGNAL(finished()), this, SLOT(stopTimer())); connect(&timer, SIGNAL(timeout()), this, SLOT(updateTimer())); connect(&Generator, SIGNAL(resetGUI()), this, SLOT(resetGUI())); connect(ui->list_LevelSet, SIGNAL(currentRowChanged(int)), this, SLOT(displayLevel(int))); connect(ui->combo_RoomH, SIGNAL(currentTextChanged(QString)), this, SLOT(disable3by3(QString))); connect(ui->combo_RoomW, SIGNAL(currentTextChanged(QString)), this, SLOT(disable3by3(QString))); connect(ui->list_LevelSet, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(rightClickMenu(QPoint))); connect(&Generator, SIGNAL(displayGenSeed()), this, SLOT(displayGenSeed())); scene = new QGraphicsScene(this); ui->graphicsView->setScene(scene); Generator.setupForThread(thread); Generator.moveToThread(&thread); }
//-------------------------------------------------------------- void aRotationGui::guiEvent(ofxUIEventArgs &e) { string name = e.widget->getName(); int kind = e.widget->getKind(); //get the track number from the name. vector<string> result=ofSplitString(name, "_"); int row = ofToInt(result[0]); if (name == ofToString("CLEAR ALL")) { ofxUILabelButton *clearBut = (ofxUILabelButton *)Rotation_gui_1->getWidget("CLEAR ALL"); if(clearBut->getValue()){ resetGUI(28, row,true); } } else if (ofIsStringInString(name, "TRK_CLR")) { ofxUIImageButton *clearBut = (ofxUIImageButton *)Rotation_gui_1->getWidget(util::dDigiter(row)+"_TRK_CLR"); if(clearBut->getValue()){ resetGUI(row,row,false); } } else if (name == ofToString(util::dDigiter(row)+"_rX")) { ofxUINumberDialer *oriX = (ofxUINumberDialer *)Rotation_gui_1->getWidget(ofToString(util::dDigiter(row)+"_rX")); ((ofApp*)ofGetAppPtr())->abcModels[row].abcOrientation.x = oriX->getValue(); } else if (name == ofToString(util::dDigiter(row)+"_rY")) { ofxUINumberDialer *oriY = (ofxUINumberDialer *)Rotation_gui_1->getWidget(ofToString(util::dDigiter(row)+"_rY")); ((ofApp*)ofGetAppPtr())->abcModels[row].abcOrientation.y = oriY->getValue(); } else if (name == ofToString(util::dDigiter(row)+"_rZ")) { ofxUINumberDialer *oriZ = (ofxUINumberDialer *)Rotation_gui_1->getWidget(ofToString(util::dDigiter(row)+"_rZ")); ((ofApp*)ofGetAppPtr())->abcModels[row].abcOrientation.z = oriZ->getValue(); } }
PreferencesDialog::PreferencesDialog(QWidget *parent) : QDialog(parent), ui(new Ui::PreferencesDialog) { //Setup Initial state of GUI objects and connect signal/slots ui->setupUi(this); //load the main UI from designer //Setup the dialog icons //ui->push_pbioutdir->setIcon(Backend::icon("load")); //ui->push_sigfile->setIcon(Backend::icon("file")); ui->push_moduledir->setIcon(Backend::icon("load")); ui->push_icondir->setIcon(Backend::icon("load")); ui->push_defaulticon->setIcon(Backend::icon("file")); ui->push_suutility->setIcon(Backend::icon("file")); //ui->push_makeport->setIcon(Backend::icon("file")); //ui->push_pbicreate->setIcon(Backend::icon("file")); ui->push_resetutils->setIcon(Backend::icon("refresh")); //Setup the internal settings structure settings = new Config(); settings->scanForExternalUtilities(); settings->loadSettingsFile(); //Put the current settings into the GUI resetGUI(); }
void MainWindow::on_actionNew_triggered() { Generator.solver.setThreadStop(true); if(thread.isFinished()){ resetGUI(); } }