mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-17 19:37:09 +02:00
Reset config widget data on Cancel
This commit is contained in:
@@ -136,6 +136,7 @@ DelegateConfigWrapper::closed( QAbstractButton* b )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_widget->fillDataInWidgets( m_initialData );
|
||||
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
|
||||
DelegateConfigWrapper::aboutClicked( bool )
|
||||
{
|
||||
|
@@ -55,6 +55,9 @@ public slots:
|
||||
signals:
|
||||
void closedWithDelete();
|
||||
|
||||
protected:
|
||||
void showEvent( QShowEvent * event ) override;
|
||||
|
||||
private slots:
|
||||
void aboutClicked( bool );
|
||||
void onConfigTestResult( Tomahawk::Accounts::ConfigTestResultType );
|
||||
@@ -70,6 +73,7 @@ private:
|
||||
QLabel* m_errorLabel;
|
||||
bool m_deleted;
|
||||
QVariantMap m_invalidData;
|
||||
QVariantMap m_initialData;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user