Single-click selection of product.

It was clumsy to first select the product and then click the select
button.
This commit is contained in:
Jim Evins
2016-03-31 22:06:05 -04:00
parent c2aef0b738
commit 9f6697376d
3 changed files with 21 additions and 39 deletions
+12 -12
View File
@@ -106,18 +106,8 @@ void SelectProductDialog::onPageSizeCheckClicked()
///
void SelectProductDialog::onTemplatePickerSelectionChanged()
{
const glabels::Template *tmplate = templatePicker->selectedTemplate();
selectButton->setEnabled( tmplate != NULL );
}
///
/// Select Button Clicked Slot
///
void SelectProductDialog::onSelectButtonClicked()
{
close();
// Delay close. This should make the selection more apparent to the user.
mTimer.start( 125, this );
}
@@ -129,3 +119,13 @@ void SelectProductDialog::onCancelButtonClicked()
mCanceled = true;
close();
}
///
/// Cancel Button Clicked Slot
///
void SelectProductDialog::timerEvent( QTimerEvent *event )
{
mTimer.stop();
close();
}
+9 -1
View File
@@ -22,6 +22,7 @@
#define SelectProductDialog_h
#include "ui_SelectProductDialog.h"
#include <QBasicTimer>
///
@@ -53,14 +54,21 @@ private slots:
void onSearchClearButtonClicked();
void onPageSizeCheckClicked();
void onTemplatePickerSelectionChanged();
void onSelectButtonClicked();
void onCancelButtonClicked();
/////////////////////////////////
// Events
/////////////////////////////////
protected:
void timerEvent(QTimerEvent *event);
/////////////////////////////////
// Private data
/////////////////////////////////
private:
QBasicTimer mTimer;
bool mCanceled;
};
-26
View File
@@ -164,16 +164,6 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="selectButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&amp;Select</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@@ -255,22 +245,6 @@
</hint>
</hints>
</connection>
<connection>
<sender>selectButton</sender>
<signal>clicked()</signal>
<receiver>SelectProductDialog</receiver>
<slot>onSelectButtonClicked()</slot>
<hints>
<hint type="sourcelabel">
<x>955</x>
<y>648</y>
</hint>
<hint type="destinationlabel">
<x>687</x>
<y>682</y>
</hint>
</hints>
</connection>
<connection>
<sender>pageSizeIsoCheck</sender>
<signal>clicked()</signal>