Reload color settings when changed by PCM
This commit is contained in:
parent
a71c669543
commit
527da0d18c
|
@ -294,6 +294,9 @@ void DIALOG_PCM::OnInstallFromFileClicked( wxCommandEvent& event )
|
||||||
|
|
||||||
if( !m_selectedRepositoryId.IsEmpty() )
|
if( !m_selectedRepositoryId.IsEmpty() )
|
||||||
setRepositoryData( m_selectedRepositoryId );
|
setRepositoryData( m_selectedRepositoryId );
|
||||||
|
|
||||||
|
if( task_manager.ColorSettingsChanged() )
|
||||||
|
Pgm().GetSettingsManager().ReloadColorSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -469,6 +472,9 @@ void DIALOG_PCM::OnApplyChangesClicked( wxCommandEvent& event )
|
||||||
|
|
||||||
if( !m_selectedRepositoryId.IsEmpty() )
|
if( !m_selectedRepositoryId.IsEmpty() )
|
||||||
setRepositoryData( m_selectedRepositoryId );
|
setRepositoryData( m_selectedRepositoryId );
|
||||||
|
|
||||||
|
if( task_manager.ColorSettingsChanged() )
|
||||||
|
Pgm().GetSettingsManager().ReloadColorSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -221,6 +221,9 @@ void PCM_TASK_MANAGER::installDownloadedPackage( const PCM_PACKAGE& aPackage,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( aPackage.type == PCM_PACKAGE_TYPE::PT_COLORTHEME )
|
||||||
|
m_color_themes_changed.store( true );
|
||||||
|
|
||||||
m_reporter->PCMReport(
|
m_reporter->PCMReport(
|
||||||
wxString::Format( _( "Removing downloaded archive '%s'." ), aFilePath.GetFullName() ),
|
wxString::Format( _( "Removing downloaded archive '%s'." ), aFilePath.GetFullName() ),
|
||||||
RPT_SEVERITY_INFO );
|
RPT_SEVERITY_INFO );
|
||||||
|
@ -421,6 +424,8 @@ void PCM_TASK_MANAGER::InstallFromFile( wxWindow* aParent, const wxString& aFile
|
||||||
m_reporter->KeepRefreshing( false );
|
m_reporter->KeepRefreshing( false );
|
||||||
m_reporter->Destroy();
|
m_reporter->Destroy();
|
||||||
m_reporter.reset();
|
m_reporter.reset();
|
||||||
|
|
||||||
|
m_color_themes_changed.store( package.type == PCM_PACKAGE_TYPE::PT_COLORTHEME );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -549,6 +554,9 @@ void PCM_TASK_MANAGER::Uninstall( const PCM_PACKAGE& aPackage )
|
||||||
|
|
||||||
m_pcm->MarkUninstalled( aPackage );
|
m_pcm->MarkUninstalled( aPackage );
|
||||||
|
|
||||||
|
if( aPackage.type == PCM_PACKAGE_TYPE::PT_COLORTHEME )
|
||||||
|
m_color_themes_changed.store( true );
|
||||||
|
|
||||||
m_reporter->PCMReport(
|
m_reporter->PCMReport(
|
||||||
wxString::Format( _( "Package %s uninstalled" ), aPackage.identifier ),
|
wxString::Format( _( "Package %s uninstalled" ), aPackage.identifier ),
|
||||||
RPT_SEVERITY_INFO );
|
RPT_SEVERITY_INFO );
|
||||||
|
@ -571,6 +579,8 @@ void PCM_TASK_MANAGER::RunQueue( wxWindow* aParent )
|
||||||
std::condition_variable condvar;
|
std::condition_variable condvar;
|
||||||
bool download_complete = false;
|
bool download_complete = false;
|
||||||
|
|
||||||
|
m_color_themes_changed.store( false );
|
||||||
|
|
||||||
std::thread download_thread(
|
std::thread download_thread(
|
||||||
[&]()
|
[&]()
|
||||||
{
|
{
|
||||||
|
@ -628,3 +638,9 @@ void PCM_TASK_MANAGER::RunQueue( wxWindow* aParent )
|
||||||
download_thread.join();
|
download_thread.join();
|
||||||
install_thread.join();
|
install_thread.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool PCM_TASK_MANAGER::ColorSettingsChanged() const
|
||||||
|
{
|
||||||
|
return m_color_themes_changed.load();
|
||||||
|
}
|
|
@ -104,6 +104,11 @@ public:
|
||||||
*/
|
*/
|
||||||
void InstallFromFile( wxWindow* aParent, const wxString& aFilePath );
|
void InstallFromFile( wxWindow* aParent, const wxString& aFilePath );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if color settings were installed or uninstalled by the most recent action
|
||||||
|
*/
|
||||||
|
bool ColorSettingsChanged() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* @brief Download URL to a file
|
* @brief Download URL to a file
|
||||||
|
@ -150,6 +155,7 @@ private:
|
||||||
SYNC_QUEUE<PCM_TASK> m_download_queue;
|
SYNC_QUEUE<PCM_TASK> m_download_queue;
|
||||||
SYNC_QUEUE<PCM_TASK> m_install_queue;
|
SYNC_QUEUE<PCM_TASK> m_install_queue;
|
||||||
std::shared_ptr<PLUGIN_CONTENT_MANAGER> m_pcm;
|
std::shared_ptr<PLUGIN_CONTENT_MANAGER> m_pcm;
|
||||||
|
std::atomic_bool m_color_themes_changed;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue