1 #include "qui/seqbrowser/seqproperties/PropertiesWindow.hpp"
3 #include "mussa_exceptions.hpp"
4 #include "alg/mussa.hpp"
11 PropertiesWindow::PropertiesWindow(/* MussaRef m, */
12 SequencePropertiesModel::model_type glseqs,
21 QGridLayout *parameterLayout = new QGridLayout;
23 ok = new QPushButton(tr("&OK"), this);
24 ok->setEnabled( false );
25 connect(ok, SIGNAL(clicked()), this, SLOT(apply()));
27 cancel = new QPushButton(tr("Cancel"), this);
28 connect(cancel, SIGNAL(clicked()), this, SLOT(cancel()));
30 table = new QTableView(this);
31 table->setModel(&model);
34 QHBoxLayout *buttonLayout = new QHBoxLayout;
35 buttonLayout->addWidget(ok);
36 buttonLayout->addWidget(cancel);
38 // layout verticle space
39 QVBoxLayout *verticalLayout = new QVBoxLayout;
40 verticalLayout->addWidget(table);
41 verticalLayout->addLayout(buttonLayout);
42 setLayout(verticalLayout);
44 // now that we're all setup lets get notices when we're updated
45 connect(&model, SIGNAL(rowsInserted(const QModelIndex&, int, int)),
46 this, SLOT(modelUpdated(const QModelIndex&, int, int)));
47 connect(&model, SIGNAL(rowsRemoved(const QModelIndex&, int, int)),
48 this, SLOT(modelUpdated(const QModelIndex&, int, int)));
53 SequencePropertiesModel& PropertiesWindow::getModel()
58 void PropertiesWindow::abort()
64 void PropertiesWindow::apply()
66 std::cout << "implement PropertiesWindow::apply" << std::endl;
68 for(SequencePropertiesModel::iterator itor = model.begin();
75 void PropertiesWindow::modelUpdated(const QModelIndex&, int, int )
77 // if the model is empty we shouldn't be able to click ok
78 if (ok) ok->setEnabled(not model.empty());
81 void PropertiesWindow::updateTitle()
83 std::string title("Sequence Properites: ");
85 title += analysis->get_title();
87 setWindowTitle(title.c_str());