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()
|
void SelectProductDialog::onTemplatePickerSelectionChanged()
|
||||||
{
|
{
|
||||||
const glabels::Template *tmplate = templatePicker->selectedTemplate();
|
// Delay close. This should make the selection more apparent to the user.
|
||||||
|
mTimer.start( 125, this );
|
||||||
selectButton->setEnabled( tmplate != NULL );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Select Button Clicked Slot
|
|
||||||
///
|
|
||||||
void SelectProductDialog::onSelectButtonClicked()
|
|
||||||
{
|
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -129,3 +119,13 @@ void SelectProductDialog::onCancelButtonClicked()
|
|||||||
mCanceled = true;
|
mCanceled = true;
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Cancel Button Clicked Slot
|
||||||
|
///
|
||||||
|
void SelectProductDialog::timerEvent( QTimerEvent *event )
|
||||||
|
{
|
||||||
|
mTimer.stop();
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#define SelectProductDialog_h
|
#define SelectProductDialog_h
|
||||||
|
|
||||||
#include "ui_SelectProductDialog.h"
|
#include "ui_SelectProductDialog.h"
|
||||||
|
#include <QBasicTimer>
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -53,14 +54,21 @@ private slots:
|
|||||||
void onSearchClearButtonClicked();
|
void onSearchClearButtonClicked();
|
||||||
void onPageSizeCheckClicked();
|
void onPageSizeCheckClicked();
|
||||||
void onTemplatePickerSelectionChanged();
|
void onTemplatePickerSelectionChanged();
|
||||||
void onSelectButtonClicked();
|
|
||||||
void onCancelButtonClicked();
|
void onCancelButtonClicked();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Events
|
||||||
|
/////////////////////////////////
|
||||||
|
protected:
|
||||||
|
void timerEvent(QTimerEvent *event);
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
// Private data
|
// Private data
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
private:
|
private:
|
||||||
|
QBasicTimer mTimer;
|
||||||
bool mCanceled;
|
bool mCanceled;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -164,16 +164,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="selectButton">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>&Select</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -255,22 +245,6 @@
|
|||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</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>
|
<connection>
|
||||||
<sender>pageSizeIsoCheck</sender>
|
<sender>pageSizeIsoCheck</sender>
|
||||||
<signal>clicked()</signal>
|
<signal>clicked()</signal>
|
||||||
|
|||||||
Reference in New Issue
Block a user