mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-08 23:05:46 +00:00
Improve the workflow for extensions that fail on import
This commit is contained in:
@@ -476,6 +476,11 @@ PythonShell::PythonShell(ICaptureContext &ctx, QWidget *parent)
|
||||
updateRecentFiles(false);
|
||||
updateExtensionProjects();
|
||||
|
||||
// on first launch we could be creating the python shell before extensions are loaded while
|
||||
// initialising the UI. Refresh the extension projects after a short delay to pick up any
|
||||
// additional information on loading status.
|
||||
QTimer::singleShot(200, [this]() { updateExtensionProjects(); });
|
||||
|
||||
ui->projectExplorer->endUpdate();
|
||||
|
||||
ui->projectExplorer->expandItem(m_RecentFiles);
|
||||
@@ -729,12 +734,18 @@ void PythonShell::updateExtensionProjects()
|
||||
if(ext.hasChanges)
|
||||
name += tr(" (Reload required)");
|
||||
|
||||
if(ext.failedLoad)
|
||||
name += tr(" (Failed to load)");
|
||||
|
||||
RDTreeWidgetItem *root = new RDTreeWidgetItem({name});
|
||||
root->setData(0, Qt::UserRole + 1, ext.package);
|
||||
|
||||
if(ext.hasChanges)
|
||||
root->setItalic(true);
|
||||
|
||||
if(m_Ctx.Config().AlwaysLoad_Extensions.contains(ext.package))
|
||||
root->setBold(true);
|
||||
|
||||
addExtensionDirItems(root, QDir(ext.filePath));
|
||||
|
||||
m_UIExtensions->addChild(root);
|
||||
@@ -1949,7 +1960,7 @@ void PythonShell::projectExplorer_contextMenu(const QPoint &pos)
|
||||
{
|
||||
if(m.package == rdcstr(itemPath))
|
||||
{
|
||||
reloadExtension.setEnabled(m.hasChanges);
|
||||
reloadExtension.setEnabled(m.hasChanges || m.failedLoad);
|
||||
diskLocation = QFileInfo(m.filePath).absoluteFilePath();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user