: QWidget(parent),
/* analysis(m), */
table(0),
- ok(0),
- cancel(0),
+ applyButton(0),
+ closeButton(0),
model(glseqs)
{
QGridLayout *parameterLayout = new QGridLayout;
- ok = new QPushButton(tr("&OK"), this);
- ok->setEnabled( false );
- connect(ok, SIGNAL(clicked()), this, SLOT(apply()));
+ applyButton = new QPushButton(tr("&Apply"), this);
+ applyButton->setFocusPolicy(Qt::StrongFocus);
+ applyButton->setEnabled( not model.empty() );
+ connect(applyButton, SIGNAL(clicked()), this, SLOT(apply()));
- cancel = new QPushButton(tr("Cancel"), this);
- connect(cancel, SIGNAL(clicked()), this, SLOT(cancel()));
+ closeButton = new QPushButton(tr("Close"), this);
+ connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
table = new QTableView(this);
table->setModel(&model);
// layout buttons
QHBoxLayout *buttonLayout = new QHBoxLayout;
- buttonLayout->addWidget(ok);
- buttonLayout->addWidget(cancel);
+ buttonLayout->addWidget(applyButton);
+ buttonLayout->addWidget(closeButton);
// layout verticle space
QVBoxLayout *verticalLayout = new QVBoxLayout;
return model;
}
-void PropertiesWindow::abort()
+void PropertiesWindow::close()
{
model.clear();
hide();
void PropertiesWindow::apply()
{
- std::cout << "implement PropertiesWindow::apply" << std::endl;
-
- for(SequencePropertiesModel::iterator itor = model.begin();
- itor != model.end();
- ++itor)
- {
- }
+ model.saveChanges();
+ emit propertiesChanged();
}
void PropertiesWindow::modelUpdated(const QModelIndex&, int, int )
{
// if the model is empty we shouldn't be able to click ok
- if (ok) ok->setEnabled(not model.empty());
+ if (applyButton) applyButton->setEnabled(not model.empty());
}
void PropertiesWindow::updateTitle()
{
- std::string title("Sequence Properites: ");
+ std::string title("Sequence Properties: ");
if (analysis) {
title += analysis->get_title();
}