@@ -670,7 +670,7 @@ void PluginListBoxComponent::run()
670670 pluginName = pluginData[i].getProperty (" name" , var ()).toString ();
671671 label = pluginData[i].getProperty (" type" , " NULL" ).toString ();
672672 dispName = pluginData[i].getProperty (" display_name" , " NULL" ).toString ();
673-
673+
674674 pluginTextWidth = GlyphArrangement::getStringWidthInt (Font (listFont), dispName);
675675 if (pluginTextWidth > maxTextWidth)
676676 maxTextWidth = pluginTextWidth;
@@ -977,10 +977,28 @@ void PluginInfoComponent::setDownloadURL (const String& url)
977977
978978void PluginInfoComponent::showAlertOnMessageThread (MessageBoxIconType iconType, const String& title, const String& message)
979979{
980- MessageManager::callAsync ([iconType, title, message ]()
980+ MessageManager::callAsync ([= ]()
981981 { AlertWindow::showMessageBoxAsync (iconType, title, message); });
982982}
983983
984+ void PluginInfoComponent::updateUIOnMessageThread ()
985+ {
986+ MessageManager::callAsync ([this ]()
987+ {
988+ pInfo.installedVersion = pInfo.selectedVersion ;
989+ installedVerText.setText (pInfo.installedVersion , dontSendNotification);
990+ downloadButton.setEnabled (false );
991+ downloadButton.setButtonText (" Installed" );
992+ uninstallButton.setVisible (true );
993+
994+ if (pInfo.installedVersion .equalsIgnoreCase (pInfo.latestVersion ))
995+ {
996+ updatablePlugins.removeString (pInfo.pluginName );
997+ this ->getParentComponent ()->resized ();
998+ }
999+ });
1000+ }
1001+
9841002void PluginInfoComponent::run ()
9851003{
9861004 setProgress (-1.0 );
@@ -1095,17 +1113,7 @@ void PluginInfoComponent::run()
10951113
10961114 LOGC (" Download Successful!!" );
10971115
1098- pInfo.installedVersion = pInfo.selectedVersion ;
1099- installedVerText.setText (pInfo.installedVersion , dontSendNotification);
1100- downloadButton.setEnabled (false );
1101- downloadButton.setButtonText (" Installed" );
1102- uninstallButton.setVisible (true );
1103-
1104- if (pInfo.latestVersion .equalsIgnoreCase (pInfo.latestVersion ))
1105- {
1106- updatablePlugins.removeString (pInfo.pluginName );
1107- this ->getParentComponent ()->resized ();
1108- }
1116+ updateUIOnMessageThread ();
11091117 }
11101118 else if (dlReturnCode == ZIP_NOTFOUND)
11111119 {
@@ -1158,17 +1166,7 @@ void PluginInfoComponent::run()
11581166
11591167 LOGE (" Loading Plugin Failed!!" );
11601168
1161- pInfo.installedVersion = pInfo.selectedVersion ;
1162-
1163- const MessageManagerLock mmLock;
1164- downloadButton.setEnabled (false );
1165- downloadButton.setButtonText (" Installed" );
1166-
1167- if (pInfo.latestVersion .equalsIgnoreCase (pInfo.latestVersion ))
1168- {
1169- updatablePlugins.removeString (pInfo.pluginName );
1170- this ->getParentComponent ()->repaint ();
1171- }
1169+ updateUIOnMessageThread ();
11721170 }
11731171 else if (dlReturnCode == HTTP_ERR)
11741172 {
0 commit comments