Prototype of VariableView and EditVariableDialog user interface.

This commit is contained in:
Jim Evins
2019-03-05 21:35:11 -05:00
parent b9b792272c
commit c9e26c45fb
11 changed files with 913 additions and 23 deletions
+62
View File
@@ -20,6 +20,8 @@
#include "VariablesView.h"
#include "EditVariableDialog.h"
#include <QtDebug>
@@ -55,8 +57,68 @@ namespace glabels
mModel = model;
mUndoRedoModel = undoRedoModel;
updateControls();
//connect( mModel, SIGNAL(variablesChanged()), this, SLOT(onVariablesChanged()) );
}
///
/// table Selection Changed
///
void VariablesView::onTableSelectionChanged()
{
updateControls();
}
///
/// addButton Clicked
///
void VariablesView::onAddButtonClicked()
{
EditVariableDialog dialog( this );
model::Variable v( model::Variable::TYPE_NUMERIC,
"x",
"0",
model::Variable::INCREMENT_NEVER,
"0" );
dialog.setVariable( v );
if ( dialog.exec() == QDialog::Accepted )
{
qDebug() << "Add OK.";
}
}
///
/// editButton Clicked
///
void VariablesView::onEditButtonClicked()
{
}
///
/// deleteButton Clicked
///
void VariablesView::onDeleteButtonClicked()
{
}
///
/// update controls
///
void VariablesView::updateControls()
{
bool hasSelection = !table->selectedItems().isEmpty();
editButton->setEnabled( hasSelection );
deleteButton->setEnabled( hasSelection );
}
} // namespace glabels