Skip to content

Commit

Permalink
second commit to resolve the issue jamulussoftware#3233
Browse files Browse the repository at this point in the history
I followed the suggestions made py @pljones and I changed a size hint of a spacer in the UI to make sure that everything is evenly spaced.

TODO :

Allowing adding directory via enter key
  • Loading branch information
AdamGLIN committed Apr 5, 2024
1 parent 2780a48 commit 37d4c74
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 42 deletions.
16 changes: 8 additions & 8 deletions src/clientsettingsdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,9 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, CClientSettings* pNSet
cbxCustomDirectories->setWhatsThis ( strCustomDirectories );
cbxCustomDirectories->setAccessibleName ( tr ( "Custom Directories combo box" ) );

butDeleteCustomDirectories->setAccessibleName ( tr ( "Delete custom directory button" ) );
butDeleteCustomDirectories->setWhatsThis ( "<b>" + tr ( "Delete Custom Directory" ) + ":</b> " +
tr ( "Click the button to clear the currently selected custom directory "
"and delete it from the list of stored custom directories." ) );
butDeleteCustomDirectory->setAccessibleName ( tr ( "Delete custom directory button" ) );
butDeleteCustomDirectory->setWhatsThis ( "<b>" + tr ( "Delete Custom Directory" ) + ":</b> " +
tr ( "Click the button to delete the currently selected custom directory." ) );

// current connection status parameter
QString strConnStats = "<b>" + tr ( "Audio Upstream Rate" ) + ":</b> " +
Expand Down Expand Up @@ -694,17 +693,18 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, CClientSettings* pNSet
this,
&CClientSettingsDlg::OnMeterStyleActivated );

QObject::connect ( butDeleteCustomDirectories, &QPushButton::clicked, this, &CClientSettingsDlg::OnDeleteCustomDirectoriesClicked );

QObject::connect ( cbxCustomDirectories->lineEdit(), &QLineEdit::editingFinished, this, &CClientSettingsDlg::OnCustomDirectoriesEditingFinished );

// QObject::connect ( cbxCustomDirectories->lineEdit(), &QLineEdit::returnPressed, this, &CClientSettingsDlg::OnCustomDirectoriesEditingFinished );
// QObject::connect ( cbxCustomDirectories->lineEdit(), &QLineEdit::returnPressed, this, &CClientSettingsDlg::OnCustomDirectoriesEditingFinished
// );

// QObject::connect ( cbxCustomDirectories,
// static_cast<void ( QComboBox::* ) ( int )> ( &QComboBox::activated ),
// this,
// &CClientSettingsDlg::OnCustomDirectoriesEditingFinished );

QObject::connect ( butDeleteCustomDirectory, &QPushButton::clicked, this, &CClientSettingsDlg::OnDeleteCustomDirectoriesClicked );

QObject::connect ( cbxLanguage, &CLanguageComboBox::LanguageChanged, this, &CClientSettingsDlg::OnLanguageChanged );

QObject::connect ( cbxInputBoost,
Expand Down Expand Up @@ -1018,7 +1018,7 @@ void CClientSettingsDlg::OnFeedbackDetectionChanged ( int value ) { pSettings->b

void CClientSettingsDlg::OnDeleteCustomDirectoriesClicked()
{
if ( cbxCustomDirectories->currentText().isEmpty() )
if ( cbxCustomDirectories->currentText().isEmpty() && cbxCustomDirectories->currentData().isValid() )
{
return;
}
Expand Down
69 changes: 35 additions & 34 deletions src/clientsettingsdlgbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1039,39 +1039,40 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QComboBox" name="cbxCustomDirectories">
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="butDeleteCustomDirectories">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">⌫</string>
</property>
</widget>
</item>
</layout>
<layout class="QHBoxLayout">
<item>
<widget class="QComboBox" name="cbxCustomDirectories">
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="butDeleteCustomDirectory">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">⌫</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_4">
Expand All @@ -1081,7 +1082,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>13</height>
<height>40</height>
</size>
</property>
</spacer>
Expand Down

0 comments on commit 37d4c74

Please sign in to comment.