Skip to content

Commit 3143d2d

Browse files
committed
iOS: Suggest a file name with the settings suffix when saving the mixer setup
The iOS file dialog takes the suggested file name from the path passed to QFileDialog::getSaveFileName() and falls back to "Untitled" without an extension. The load dialog filters for *.jch, so a setup saved on iOS could not be loaded again without renaming the file first. Pass a default name that carries the suffix. The save dialog hides the known suffix from the text field, so the user still sees "MixerSetup", but the file is written as MixerSetup.jch.
1 parent 55b9aaa commit 3143d2d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎src/clientdlg.cpp‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,16 @@ void CClientDlg::OnLoadChannelSetup()
807807

808808
void CClientDlg::OnSaveChannelSetup()
809809
{
810-
QString strFileName = QFileDialog::getSaveFileName ( this, tr ( "Select Channel Setup File" ), "", QString ( "*." ) + MIX_SETTINGS_FILE_SUFFIX );
810+
#if defined( Q_OS_IOS )
811+
// the iOS file dialog only uses the file name as a suggestion, and the saved file
812+
// must keep the suffix, otherwise the load dialog will not show it again. This is a workaround.
813+
const QString strDefaultName = QString ( "MixerSetup." ) + MIX_SETTINGS_FILE_SUFFIX;
814+
#else
815+
const QString strDefaultName = "";
816+
#endif
817+
818+
QString strFileName =
819+
QFileDialog::getSaveFileName ( this, tr ( "Select Channel Setup File" ), strDefaultName, QString ( "*." ) + MIX_SETTINGS_FILE_SUFFIX );
811820

812821
if ( !strFileName.isEmpty() )
813822
{

0 commit comments

Comments
 (0)