mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-18 20:04:00 +02:00
Reset config widget data on Cancel
This commit is contained in:
@@ -136,6 +136,7 @@ DelegateConfigWrapper::closed( QAbstractButton* b )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
m_widget->fillDataInWidgets( m_initialData );
|
||||||
closeDialog( QDialog::Rejected );
|
closeDialog( QDialog::Rejected );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,6 +158,15 @@ DelegateConfigWrapper::updateSizeHint()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DelegateConfigWrapper::showEvent(QShowEvent* event)
|
||||||
|
{
|
||||||
|
// TODO: would be cool to load the data only on show event instead of on widget creation
|
||||||
|
m_initialData = m_widget->readData();
|
||||||
|
|
||||||
|
QDialog::showEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DelegateConfigWrapper::aboutClicked( bool )
|
DelegateConfigWrapper::aboutClicked( bool )
|
||||||
{
|
{
|
||||||
|
@@ -55,6 +55,9 @@ public slots:
|
|||||||
signals:
|
signals:
|
||||||
void closedWithDelete();
|
void closedWithDelete();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void showEvent( QShowEvent * event ) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void aboutClicked( bool );
|
void aboutClicked( bool );
|
||||||
void onConfigTestResult( Tomahawk::Accounts::ConfigTestResultType );
|
void onConfigTestResult( Tomahawk::Accounts::ConfigTestResultType );
|
||||||
@@ -70,6 +73,7 @@ private:
|
|||||||
QLabel* m_errorLabel;
|
QLabel* m_errorLabel;
|
||||||
bool m_deleted;
|
bool m_deleted;
|
||||||
QVariantMap m_invalidData;
|
QVariantMap m_invalidData;
|
||||||
|
QVariantMap m_initialData;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user