Skip to content

Commit

Permalink
Refs #4173: restored read-only-ness of some peak columns
Browse files Browse the repository at this point in the history
also indentation fix to SortDialog
  • Loading branch information
Janik Zikovsky committed Dec 6, 2011
1 parent 0048b2e commit 45acb35
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
7 changes: 7 additions & 0 deletions Code/Mantid/Framework/DataObjects/src/PeakColumn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,14 @@ namespace DataObjects
/** @return true if the column is read-only */
bool PeakColumn::getReadOnly() const
{
if (
(m_name == "h") || (m_name == "k") || (m_name == "l") ||
(m_name == "RunNumber")
)
return false;
else
// Default to true for most columns
return true;
}


Expand Down
14 changes: 7 additions & 7 deletions Code/Mantid/MantidPlot/src/SortDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ SortDialog::SortDialog( QWidget* parent, Qt::WFlags fl )

topLayout->addWidget( new QLabel( tr("Order")), 1, 0 );
boxOrder = new QComboBox();
boxOrder->addItem(tr("Ascending"));
boxOrder->addItem(tr("Ascending"));
boxOrder->addItem(tr("Descending"));
topLayout->addWidget(boxOrder, 1, 1 );

Expand All @@ -64,19 +64,19 @@ SortDialog::SortDialog( QWidget* parent, Qt::WFlags fl )
topLayout->setRowStretch(3, 1);

buttonOk = new QPushButton(tr("&Sort"));
buttonOk->setDefault( true );
buttonOk->setDefault( true );
hl->addWidget(buttonOk);

buttonCancel = new QPushButton(tr("&Close"));
buttonCancel = new QPushButton(tr("&Close"));
hl->addWidget(buttonCancel);

QVBoxLayout * mainlayout = new QVBoxLayout(this);
mainlayout->addWidget(groupBox1);
mainlayout->addWidget(groupBox1);
mainlayout->addLayout(hl);

connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
connect( boxType, SIGNAL( activated(int) ), this, SLOT(changeType(int)));
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
connect( boxType, SIGNAL( activated(int) ), this, SLOT(changeType(int)));
}

void SortDialog::accept()
Expand Down
24 changes: 12 additions & 12 deletions Code/Mantid/MantidPlot/src/SortDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,26 @@ class QComboBox;
//! Sorting options dialog
class SortDialog : public QDialog
{
Q_OBJECT
Q_OBJECT

public:
SortDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
void insertColumnsList(const QStringList& cols);
SortDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
void insertColumnsList(const QStringList& cols);

private slots:
void accept();
void changeType(int index);
void accept();
void changeType(int index);

signals:
void sort(int, int, const QString&);
void sort(int, int, const QString&);

private:
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonHelp;
QComboBox* boxType;
QComboBox* boxOrder;
QComboBox *columnsList;
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonHelp;
QComboBox* boxType;
QComboBox* boxOrder;
QComboBox *columnsList;
};

#endif

0 comments on commit 45acb35

Please sign in to comment.