Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
6b39edeb
Commit
6b39edeb
authored
May 02, 2018
by
Jan Möbius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a list of failed plugins to the about dialog
parent
919f5bc6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
0 deletions
+94
-0
Core/PluginLoader.cc
Core/PluginLoader.cc
+49
-0
common/PluginStorage.cc
common/PluginStorage.cc
+7
-0
common/PluginStorage.hh
common/PluginStorage.hh
+6
-0
widgets/coreWidget/About.cc
widgets/coreWidget/About.cc
+32
-0
No files found.
Core/PluginLoader.cc
View file @
6b39edeb
...
...
@@ -87,6 +87,7 @@
#include "OpenFlipper/widgets/PluginDialog/PluginDialog.hh"
#include <OpenFlipper/common/FileTypes.hh>
#include <OpenFlipper/common/PluginStorage.hh>
/**
...
...
@@ -804,6 +805,12 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
printPluginLoadLog
(
errors
,
warnings
);
info
.
description
=
basePlugin
->
description
()
+
tr
(
" *Already loaded.*"
);
info
.
errors
=
errors
;
info
.
warnings
=
warnings
;
PluginStorage
::
pluginsFailed
().
push_back
(
info
);
return
;
}
else
{
//ask the user
int
ret
=
QMessageBox
::
question
(
coreWidget_
,
...
...
@@ -819,6 +826,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
printPluginLoadLog
(
errors
,
warnings
);
info
.
description
=
basePlugin
->
description
()
+
tr
(
" *Already loaded.*"
);
info
.
errors
=
errors
;
info
.
warnings
=
warnings
;
PluginStorage
::
pluginsFailed
().
push_back
(
info
);
return
;
}
}
...
...
@@ -834,6 +846,12 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
printPluginLoadLog
(
errors
,
warnings
);
info
.
status
=
PluginInfo
::
BLOCKED
;
info
.
errors
=
errors
;
info
.
warnings
=
warnings
;
PluginStorage
::
pluginsFailed
().
push_back
(
info
);
return
;
}
...
...
@@ -859,6 +877,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
info
.
description
=
basePlugin
->
description
()
+
tr
(
" *Plugin access denied.*"
);
// Abort here, as the plugin will not do anything else until correct authentication.
info
.
errors
=
errors
;
info
.
warnings
=
warnings
;
PluginStorage
::
pluginsFailed
().
push_back
(
info
);
return
;
}
}
...
...
@@ -881,6 +904,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
printPluginLoadLog
(
errors
,
warnings
);
info
.
errors
=
errors
;
info
.
warnings
=
warnings
;
PluginStorage
::
pluginsFailed
().
push_back
(
info
);
return
;
}
...
...
@@ -894,6 +922,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
printPluginLoadLog
(
errors
,
warnings
);
info
.
errors
=
errors
;
info
.
warnings
=
warnings
;
PluginStorage
::
pluginsFailed
().
push_back
(
info
);
return
;
}
...
...
@@ -902,6 +935,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
printPluginLoadLog
(
errors
,
warnings
);
info
.
errors
=
errors
;
info
.
warnings
=
warnings
;
PluginStorage
::
pluginsFailed
().
push_back
(
info
);
return
;
}
...
...
@@ -2086,6 +2124,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
printPluginLoadLog
(
errors
,
warnings
);
info
.
errors
=
errors
;
info
.
warnings
=
warnings
;
PluginStorage
::
pluginsFailed
().
push_back
(
info
);
return
;
}
...
...
@@ -2144,6 +2187,12 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if
(
openGLCheck
!=
""
)
{
errors
+=
tr
(
"Error: Insufficient OpenGL capabilities in post processor Plugin "
)
+
postProcessorNameString
+
" !"
+
"
\n
"
;
errors
+=
openGLCheck
+
"
\n
"
;
info
.
errors
=
errors
;
info
.
warnings
=
warnings
;
PluginStorage
::
pluginsFailed
().
push_back
(
info
);
return
;
}
...
...
common/PluginStorage.cc
View file @
6b39edeb
...
...
@@ -72,11 +72,18 @@ namespace PluginStorage {
/// reference to Core plugin list
static
std
::
vector
<
PluginInfo
>
plugins_
;
/// reference to failed plugin list
static
std
::
vector
<
PluginInfo
>
pluginsFailed_
;
std
::
vector
<
PluginInfo
>&
plugins
()
{
return
plugins_
;
}
std
::
vector
<
PluginInfo
>&
pluginsFailed
()
{
return
pluginsFailed_
;
}
}
//=============================================================================
...
...
common/PluginStorage.hh
View file @
6b39edeb
...
...
@@ -63,6 +63,7 @@
#pragma once
#include <OpenFlipper/common/GlobalDefines.hh>
#include <OpenFlipper/Core/PluginInfo.hh>
...
...
@@ -72,8 +73,13 @@
namespace
PluginStorage
{
/// Get the vector of all PluginInfos
DLLEXPORT
std
::
vector
<
PluginInfo
>&
plugins
();
/// Get the vector of all PluginInfos for plugins that failed to load at startup
DLLEXPORT
std
::
vector
<
PluginInfo
>&
pluginsFailed
();
}
...
...
widgets/coreWidget/About.cc
View file @
6b39edeb
...
...
@@ -777,6 +777,38 @@ void CoreWidget::showAboutWidget( ) {
}
// =====================================================================================
// List failed Plugins
// =====================================================================================
aboutWidget_
->
OpenFlipperAbout
->
setCurrentFont
(
boldFont
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
tr
(
"Failed Plugins:"
));
aboutWidget_
->
OpenFlipperAbout
->
setCurrentFont
(
standardFont
);
for
(
unsigned
i
=
0
;
i
<
PluginStorage
::
pluginsFailed
().
size
()
;
++
i
)
{
aboutWidget_
->
OpenFlipperAbout
->
setCurrentFont
(
boldFont
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t
"
+
PluginStorage
::
pluginsFailed
()[
i
].
name
);
aboutWidget_
->
OpenFlipperAbout
->
setCurrentFont
(
standardFont
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Version:
\t\t
"
+
PluginStorage
::
pluginsFailed
()[
i
].
version
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Description:
\t
"
+
PluginStorage
::
pluginsFailed
()[
i
].
description
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Path
\t\t
"
+
PluginStorage
::
pluginsFailed
()[
i
].
path
);
if
(
!
PluginStorage
::
pluginsFailed
()[
i
].
warnings
.
isEmpty
()
)
{
aboutWidget_
->
OpenFlipperAbout
->
setTextColor
(
Qt
::
darkYellow
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Warnings:
\t\t
"
+
PluginStorage
::
pluginsFailed
()[
i
].
warnings
);
aboutWidget_
->
OpenFlipperAbout
->
setTextColor
(
Qt
::
black
);
}
if
(
!
PluginStorage
::
pluginsFailed
()[
i
].
errors
.
isEmpty
()
)
{
aboutWidget_
->
OpenFlipperAbout
->
setTextColor
(
Qt
::
darkRed
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Errors:
\t\t
"
+
PluginStorage
::
pluginsFailed
()[
i
].
errors
);
aboutWidget_
->
OpenFlipperAbout
->
setTextColor
(
Qt
::
black
);
}
}
// =====================================================================================
// List of build-in resources
// =====================================================================================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment