source: mmcs/formloadmatrix.C @ 96b0c4a

matrices
Last change on this file since 96b0c4a was 96b0c4a, checked in by rboet <rboet@…>, 9 years ago

agregada comparacion de escenarios del modelo no clasico

  • Property mode set to 100644
File size: 1.3 KB
Line 
1#include "formloadmatrix.H"
2#include "ui_formLoadMatrix.h"
3
4void FormLoadMatrix::closeEvent(QCloseEvent *)
5{
6    emit formClosed();
7}
8
9FormLoadMatrix::FormLoadMatrix(QWidget * parent)
10    : QWidget(parent, Qt::Tool)
11{
12    ui.setupUi(this);
13
14    int x = parent->pos().x() + parent->width()/2 - this->width()/2;
15    int y = parent->pos().y() + parent->height()/2 - this->height()/2;
16    this->move(x, y);
17
18    connect(ui.buttonSearch, SIGNAL(clicked()),this,SLOT(slotLoadMatrixFile()));
19    connect(ui.buttonCancel, SIGNAL(clicked()),this,SLOT(close()));
20    connect(ui.buttonOpen, SIGNAL(clicked()), this,
21            SLOT(slotButtonAcceptClicked()));
22
23}
24
25void FormLoadMatrix::slotLoadMatrixFile() {
26    QString filename = QFileDialog::getOpenFileName(this,
27            "Seleccione archivo de Matriz", QDir::homePath(),"*.csv");
28
29    if(filename.isEmpty()) return;
30    ui.editFilePath->setText(filename);
31}
32
33void FormLoadMatrix::slotButtonAcceptClicked()
34{
35    if (ui.editFilePath->text().isEmpty())
36    {
37        QMessageBox::critical(this, "Faltan datos",
38                              "Debe seleccionar un archivo");
39
40        ui.editFilePath->setFocus();
41        return;
42    }
43
44    emit formAccepted(ui.editFilePath->text(), ui.spinNumber->value(),ui.spinBox->value());
45
46    close();
47}
Note: See TracBrowser for help on using the repository browser.