Single-click selection of product.
It was clumsy to first select the product and then click the select button.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
@@ -164,16 +164,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="selectButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&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>
|
||||
|
||||
Reference in New Issue
Block a user