Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
919f5bc6
Commit
919f5bc6
authored
May 02, 2018
by
Jan Möbius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved plugin storage vector to a static
parent
fa468ff5
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
329 additions
and
143 deletions
+329
-143
Core/Core.cc
Core/Core.cc
+21
-13
Core/Core.hh
Core/Core.hh
+1
-4
Core/PluginCommunication.cc
Core/PluginCommunication.cc
+2
-2
Core/PluginLoader.cc
Core/PluginLoader.cc
+20
-17
Core/RPC.cc
Core/RPC.cc
+8
-8
Core/saveSettings.cc
Core/saveSettings.cc
+3
-0
Core/scripting.cc
Core/scripting.cc
+10
-10
common/FileTypes.cc
common/FileTypes.cc
+2
-4
common/FileTypes.hh
common/FileTypes.hh
+3
-6
common/PluginStorage.cc
common/PluginStorage.cc
+83
-0
common/PluginStorage.hh
common/PluginStorage.hh
+81
-0
widgets/coreWidget/About.cc
widgets/coreWidget/About.cc
+11
-9
widgets/coreWidget/ContextMenu.cc
widgets/coreWidget/ContextMenu.cc
+8
-8
widgets/coreWidget/CoreWidget.cc
widgets/coreWidget/CoreWidget.cc
+14
-7
widgets/coreWidget/CoreWidget.hh
widgets/coreWidget/CoreWidget.hh
+14
-7
widgets/coreWidget/CoreWidgetToolbar.cc
widgets/coreWidget/CoreWidgetToolbar.cc
+6
-9
widgets/coreWidget/keyHandling.cc
widgets/coreWidget/keyHandling.cc
+26
-26
widgets/coreWidget/viewMode.cc
widgets/coreWidget/viewMode.cc
+12
-12
widgets/loadWidget/FileOptionsDialog.hh
widgets/loadWidget/FileOptionsDialog.hh
+1
-1
widgets/loadWidget/loadWidget.hh
widgets/loadWidget/loadWidget.hh
+3
-0
No files found.
Core/Core.cc
View file @
919f5bc6
...
...
@@ -88,6 +88,8 @@
#include <OpenFlipper/widgets/messageBox/StaysOnTopMessageBox.hh>
#include <OpenFlipper/common/PluginStorage.hh>
#define WIDGET_HEIGHT 800
#define WIDGET_WIDTH 800
...
...
@@ -236,7 +238,7 @@ Core::init() {
Qt
::
AlignBottom
|
Qt
::
AlignLeft
,
Qt
::
white
);
}
coreWidget_
=
new
CoreWidget
(
viewModes_
,
plugins_
,
coreSlots_
);
coreWidget_
=
new
CoreWidget
(
viewModes_
,
coreSlots_
);
spinBoxEventFilter_
.
registerScrollArea
(
coreWidget_
->
getToolboxScrollArea
());
spinBoxEventFilter_
.
registerScrollArea
(
coreWidget_
->
getToolboxArea
());
...
...
@@ -718,6 +720,12 @@ Core::~Core()
//-----------------------------------------------------------------------------
std
::
vector
<
PluginInfo
>&
Core
::
plugins
()
{
return
PluginStorage
::
plugins
();
};
//-----------------------------------------------------------------------------
void
Core
::
slotMouseEventIdentify
(
QMouseEvent
*
_event
)
{
...
...
@@ -1169,8 +1177,8 @@ void Core::slotExit() {
clearAll
();
// Notify plugins of imminent exit.
for
(
uint
i
=
0
;
i
<
plugins
_
.
size
()
;
++
i
){
BaseInterface
*
basePlugin
=
qobject_cast
<
BaseInterface
*
>
(
plugins
_
[
i
].
plugin
);
for
(
uint
i
=
0
;
i
<
plugins
()
.
size
()
;
++
i
){
BaseInterface
*
basePlugin
=
qobject_cast
<
BaseInterface
*
>
(
plugins
()
[
i
].
plugin
);
// Dont call exit if we cannot get the Plugin
if
(
basePlugin
)
...
...
@@ -1178,7 +1186,7 @@ void Core::slotExit() {
}
// Delete Plugins to actually call their destructor
for
(
PluginInfo
p
:
plugins
_
)
for
(
PluginInfo
p
:
plugins
()
)
delete
p
.
plugin
;
// close the log file to ensure everything is writeen correctly
...
...
@@ -1300,9 +1308,9 @@ void Core::slotSetSlotDescription(QString _slotName, QString _slotDescrip
//find plugin
PluginInfo
*
pluginInfo
=
0
;
for
(
uint
i
=
0
;
i
<
plugins
_
.
size
();
i
++
)
if
(
plugins
_
[
i
].
plugin
==
sender
())
pluginInfo
=
&
plugins
_
[
i
];
for
(
uint
i
=
0
;
i
<
plugins
()
.
size
();
i
++
)
if
(
plugins
()
[
i
].
plugin
==
sender
())
pluginInfo
=
&
plugins
()
[
i
];
if
(
pluginInfo
==
0
){
emit
log
(
LOGERR
,
tr
(
"Unable to set slot-description. Plugin not found!"
));
...
...
@@ -1378,9 +1386,9 @@ void Core::slotGetDescription(QString _function, QString& _fnDescript
//find plugin
PluginInfo
*
pluginInfo
=
0
;
for
(
uint
i
=
0
;
i
<
plugins
_
.
size
();
i
++
)
if
(
plugins
_
[
i
].
rpcName
==
pluginName
)
pluginInfo
=
&
plugins
_
[
i
];
for
(
uint
i
=
0
;
i
<
plugins
()
.
size
();
i
++
)
if
(
plugins
()
[
i
].
rpcName
==
pluginName
)
pluginInfo
=
&
plugins
()
[
i
];
if
(
pluginInfo
==
0
){
emit
log
(
LOGERR
,
tr
(
"Unable to get slot-description. Plugin not found!"
));
...
...
@@ -1524,12 +1532,12 @@ void Core::writeVersionNumbers(QString _filename){
ini
.
add_entry
(
"Core"
,
"VersionLinux"
,
OpenFlipper
::
Options
::
coreVersion
()
);
//add pluginVersions
for
(
uint
i
=
0
;
i
<
plugins
_
.
size
();
i
++
){
for
(
uint
i
=
0
;
i
<
plugins
()
.
size
();
i
++
){
if
(
OpenFlipper
::
Options
::
isWindows
()
)
ini
.
add_entry
(
plugins
_
[
i
].
name
,
"VersionWindows"
,
plugins
_
[
i
].
version
);
ini
.
add_entry
(
plugins
()
[
i
].
name
,
"VersionWindows"
,
plugins
()
[
i
].
version
);
else
ini
.
add_entry
(
plugins
_
[
i
].
name
,
"VersionLinux"
,
plugins
_
[
i
].
version
);
ini
.
add_entry
(
plugins
()
[
i
].
name
,
"VersionLinux"
,
plugins
()
[
i
].
version
);
}
ini
.
disconnect
();
...
...
Core/Core.hh
View file @
919f5bc6
...
...
@@ -121,7 +121,6 @@
#include <OpenFlipper/threads/JobInfo.hh>
#include <OpenFlipper/common/FileTypes.hh>
#include <OpenFlipper/common/InformationPlugins.hh>
#include "SpinBoxEventFilter.hh"
...
...
@@ -1214,11 +1213,9 @@ private slots:
//===========================================================================
public
:
const
std
::
vector
<
PluginInfo
>
plugins
()
const
{
return
plugins_
;
}
;
std
::
vector
<
PluginInfo
>
&
plugins
();
private:
/// List of all loaded plugins_
std
::
vector
<
PluginInfo
>
plugins_
;
/// Index of Plugins toolbox widget
int
toolboxindex_
;
...
...
Core/PluginCommunication.cc
View file @
919f5bc6
...
...
@@ -467,11 +467,11 @@ void connectPlugins( Core* c, const std::vector<PluginInfo>& plugins_, QString _
}
void
Core
::
slotCrossPluginConnect
(
QString
_pluginName1
,
const
char
*
_signal
,
QString
_pluginName2
,
const
char
*
_slot
)
{
connectPlugins
(
this
,
plugins
_
,
_pluginName1
,
_signal
,
_pluginName2
,
_slot
,
false
);
connectPlugins
(
this
,
plugins
()
,
_pluginName1
,
_signal
,
_pluginName2
,
_slot
,
false
);
}
void
Core
::
slotCrossPluginConnectQueued
(
QString
_pluginName1
,
const
char
*
_signal
,
QString
_pluginName2
,
const
char
*
_slot
)
{
connectPlugins
(
this
,
plugins
_
,
_pluginName1
,
_signal
,
_pluginName2
,
_slot
,
true
);
connectPlugins
(
this
,
plugins
()
,
_pluginName1
,
_signal
,
_pluginName2
,
_slot
,
true
);
}
//========================================================================================
...
...
Core/PluginLoader.cc
View file @
919f5bc6
...
...
@@ -86,6 +86,9 @@
#include <ACG/QtWidgets/QtFileDialog.hh>
#include "OpenFlipper/widgets/PluginDialog/PluginDialog.hh"
#include <OpenFlipper/common/FileTypes.hh>
/**
* The number of plugins to load simultaneously.
...
...
@@ -555,7 +558,7 @@ void Core::loadPlugins()
emit
pluginsInitialized
();
emit
log
(
LOGOUT
,
tr
(
"Loaded %n Plugin(s)"
,
""
,
int
(
plugins
_
.
size
()))
);
emit
log
(
LOGOUT
,
tr
(
"Loaded %n Plugin(s)"
,
""
,
int
(
plugins
()
.
size
()))
);
}
/** @brief slot for loading Plugins
...
...
@@ -653,7 +656,7 @@ void Core::slotShowPlugins(){
while
(
ret
==
0
){
PluginDialog
*
dialog
=
new
PluginDialog
(
plugins
_
,
coreWidget_
);
PluginDialog
*
dialog
=
new
PluginDialog
(
plugins
()
,
coreWidget_
);
//connect signals
connect
(
dialog
,
SIGNAL
(
loadPlugin
()
),
this
,
SLOT
(
slotLoadPlugin
()
));
...
...
@@ -678,9 +681,9 @@ void Core::slotBlockPlugin(const QString &_name)
OpenFlipperSettings
().
setValue
(
"PluginControl/DontLoadNames"
,
dontLoadPlugins
);
}
for
(
size_t
i
=
0
;
i
<
plugins
_
.
size
();
++
i
)
if
(
plugins
_
[
i
].
name
==
_name
)
plugins
_
[
i
].
status
=
PluginInfo
::
BLOCKED
;
for
(
size_t
i
=
0
;
i
<
plugins
()
.
size
();
++
i
)
if
(
plugins
()
[
i
].
name
==
_name
)
plugins
()
[
i
].
status
=
PluginInfo
::
BLOCKED
;
}
void
Core
::
slotUnBlockPlugin
(
const
QString
&
_name
)
...
...
@@ -689,9 +692,9 @@ void Core::slotUnBlockPlugin(const QString &_name)
dontLoadPlugins
.
removeAll
(
_name
);
OpenFlipperSettings
().
setValue
(
"PluginControl/DontLoadNames"
,
dontLoadPlugins
);
for
(
size_t
i
=
0
;
i
<
plugins
_
.
size
();
++
i
)
if
(
plugins
_
[
i
].
name
==
_name
)
plugins
_
[
i
].
status
=
PluginInfo
::
UNLOADED
;
for
(
size_t
i
=
0
;
i
<
plugins
()
.
size
();
++
i
)
if
(
plugins
()
[
i
].
name
==
_name
)
plugins
()
[
i
].
status
=
PluginInfo
::
UNLOADED
;
}
...
...
@@ -756,9 +759,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// Check if a plugin has been loaded
PluginInfo
info
;
int
alreadyLoadedAt
=
-
1
;
for
(
unsigned
int
k
=
0
;
k
<
plugins
_
.
size
();
k
++
)
for
(
unsigned
int
k
=
0
;
k
<
plugins
()
.
size
();
k
++
)
{
if
(
plugins
_
[
k
].
path
==
_filename
)
if
(
plugins
()
[
k
].
path
==
_filename
)
alreadyLoadedAt
=
static_cast
<
int
>
(
k
);
}
info
.
status
=
PluginInfo
::
FAILED
;
...
...
@@ -788,15 +791,15 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
}
//Check if plugin is already loaded
for
(
unsigned
int
k
=
0
;
k
<
plugins
_
.
size
();
k
++
){
for
(
unsigned
int
k
=
0
;
k
<
plugins
()
.
size
();
k
++
){
QString
name_nospace
=
basePlugin
->
name
();
name_nospace
.
remove
(
" "
);
if
(
plugins
_
[
k
].
name
==
name_nospace
&&
plugins
_
[
k
].
path
!=
_filename
&&
plugins
_
[
k
].
status
==
PluginInfo
::
LOADED
){
if
(
plugins
()
[
k
].
name
==
name_nospace
&&
plugins
()
[
k
].
path
!=
_filename
&&
plugins
()
[
k
].
status
==
PluginInfo
::
LOADED
){
if
(
_silent
||
OpenFlipper
::
Options
::
nogui
()
){
//dont load the plugin
warnings
+=
tr
(
"Warning: Already loaded from %1"
).
arg
(
plugins
_
[
k
].
path
)
+
"
\n
"
;
warnings
+=
tr
(
"Warning: Already loaded from %1"
).
arg
(
plugins
()
[
k
].
path
)
+
"
\n
"
;
printPluginLoadLog
(
errors
,
warnings
);
...
...
@@ -807,11 +810,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
tr
(
"Plugin already loaded"
),
tr
(
"A Plugin with the same name was already loaded from %1.
\n
"
"You can only load the new plugin if you unload the existing one first.
\n\n
"
"Do you want to unload the existing plugin first?"
).
arg
(
plugins
_
[
k
].
path
),
"Do you want to unload the existing plugin first?"
).
arg
(
plugins
()
[
k
].
path
),
QMessageBox
::
Yes
|
QMessageBox
::
No
,
QMessageBox
::
No
);
if
(
ret
==
QMessageBox
::
No
)
{
warnings
+=
tr
(
"Warning: Already loaded from %1."
).
arg
(
plugins
_
[
k
].
path
)
+
"
\n
"
;
warnings
+=
tr
(
"Warning: Already loaded from %1."
).
arg
(
plugins
()
[
k
].
path
)
+
"
\n
"
;
printPluginLoadLog
(
errors
,
warnings
);
...
...
@@ -2288,10 +2291,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
info
.
warnings
=
warnings
;
if
(
alreadyLoadedAt
!=
-
1
)
{
plugins
_
[
alreadyLoadedAt
]
=
info
;
plugins
()
[
alreadyLoadedAt
]
=
info
;
}
else
plugins
_
.
push_back
(
info
);
plugins
()
.
push_back
(
info
);
printPluginLoadLog
(
errors
,
warnings
);
...
...
Core/RPC.cc
View file @
919f5bc6
...
...
@@ -68,8 +68,8 @@
void
Core
::
slotPluginExists
(
QString
_pluginName
,
bool
&
_exists
)
{
for
(
int
i
=
0
;
i
<
(
int
)
plugins
_
.
size
();
++
i
)
{
if
(
plugins
_
[
i
].
rpcName
==
_pluginName
)
{
for
(
int
i
=
0
;
i
<
(
int
)
plugins
()
.
size
();
++
i
)
{
if
(
plugins
()
[
i
].
rpcName
==
_pluginName
)
{
_exists
=
true
;
return
;
}
...
...
@@ -82,8 +82,8 @@ void Core::slotFunctionExists( QString _pluginName , QString _functionName , boo
//Find plugin
int
plugin
=
-
1
;
for
(
int
i
=
0
;
i
<
(
int
)
plugins
_
.
size
();
++
i
)
{
if
(
plugins
_
[
i
].
rpcName
==
_pluginName
)
{
for
(
int
i
=
0
;
i
<
(
int
)
plugins
()
.
size
();
++
i
)
{
if
(
plugins
()
[
i
].
rpcName
==
_pluginName
)
{
plugin
=
i
;
break
;
}
...
...
@@ -94,15 +94,15 @@ void Core::slotFunctionExists( QString _pluginName , QString _functionName , boo
return
;
}
_exists
=
plugins
_
[
plugin
].
rpcFunctions
.
contains
(
_functionName
);
_exists
=
plugins
()
[
plugin
].
rpcFunctions
.
contains
(
_functionName
);
}
void
Core
::
slotCall
(
QString
_pluginName
,
QString
_functionName
,
bool
&
_success
)
{
//Find plugin
int
plugin
=
-
1
;
for
(
int
i
=
0
;
i
<
(
int
)
plugins
_
.
size
();
++
i
)
{
if
(
plugins
_
[
i
].
rpcName
==
_pluginName
)
{
for
(
int
i
=
0
;
i
<
(
int
)
plugins
()
.
size
();
++
i
)
{
if
(
plugins
()
[
i
].
rpcName
==
_pluginName
)
{
plugin
=
i
;
break
;
}
...
...
@@ -114,7 +114,7 @@ void Core::slotCall( QString _pluginName , QString _functionName , bool& _succes
return
;
}
if
(
!
plugins
_
[
plugin
].
rpcFunctions
.
contains
(
_functionName
)
)
{
if
(
!
plugins
()
[
plugin
].
rpcFunctions
.
contains
(
_functionName
)
)
{
_success
=
false
;
emit
log
(
LOGERR
,
tr
(
"Unable to call function from Plugin : "
)
+
_pluginName
);
emit
log
(
LOGERR
,
tr
(
"Function "
)
+
_functionName
+
tr
(
" not found!"
));
...
...
Core/saveSettings.cc
View file @
919f5bc6
...
...
@@ -52,6 +52,9 @@
//#include <ObjectTypes/Light/Light.hh>
#include <OpenFlipper/common/FileTypes.hh>
/// Save Settings (slot is called from CoreWidget's File-Menu)
void
Core
::
saveSettings
(){
...
...
Core/scripting.cc
View file @
919f5bc6
...
...
@@ -231,13 +231,13 @@ void Core::setToolBoxSide(QString _side) {
//-----------------------------------------------------------------------------
QWidget
*
Core
::
getToolbox
(
QString
_pluginName
,
QString
_toolboxName
)
{
std
::
vector
<
PluginInfo
>::
const_iterator
pluginIt
=
plugins
_
.
end
();
for
(
std
::
vector
<
PluginInfo
>::
const_iterator
it
=
plugins
_
.
begin
(),
it_end
=
plugins
_
.
end
();
it
!=
it_end
;
++
it
)
{
std
::
vector
<
PluginInfo
>::
const_iterator
pluginIt
=
plugins
()
.
end
();
for
(
std
::
vector
<
PluginInfo
>::
const_iterator
it
=
plugins
()
.
begin
(),
it_end
=
plugins
()
.
end
();
it
!=
it_end
;
++
it
)
{
if
(
it
->
name
==
_pluginName
)
{
pluginIt
=
it
;
}
}
if
(
pluginIt
==
plugins
_
.
end
())
return
0
;
if
(
pluginIt
==
plugins
()
.
end
())
return
0
;
for
(
std
::
vector
<
std
::
pair
<
QString
,
QWidget
*>
>::
const_iterator
it
=
pluginIt
->
toolboxWidgets
.
begin
(),
it_end
=
pluginIt
->
toolboxWidgets
.
end
();
it
!=
it_end
;
++
it
)
{
...
...
@@ -266,8 +266,8 @@ void Core::addToolbox(QString _name ,QWidget* _widget, QIcon* _icon,
int
id
=
-
1
;
// Find the plugin which added this Toolbox
for
(
uint
i
=
0
;
i
<
plugins
_
.
size
();
++
i
)
{
if
(
plugins
_
[
i
].
plugin
==
sender
()
)
{
for
(
uint
i
=
0
;
i
<
plugins
()
.
size
();
++
i
)
{
if
(
plugins
()
[
i
].
plugin
==
sender
()
)
{
id
=
i
;
break
;
}
...
...
@@ -275,8 +275,8 @@ void Core::addToolbox(QString _name ,QWidget* _widget, QIcon* _icon,
// Find the scripting plugin because we assign this toolBox to it as we did not find the original sender
if
(
id
==
-
1
)
{
for
(
uint
i
=
0
;
i
<
plugins
_
.
size
();
++
i
)
{
if
(
plugins
_
[
i
].
name
==
"Scripting"
)
{
for
(
uint
i
=
0
;
i
<
plugins
()
.
size
();
++
i
)
{
if
(
plugins
()
[
i
].
name
==
"Scripting"
)
{
id
=
i
;
break
;
}
...
...
@@ -290,9 +290,9 @@ void Core::addToolbox(QString _name ,QWidget* _widget, QIcon* _icon,
}
spinBoxEventFilter_
.
hookUpToWidgetTree
(
_widget
);
plugins
_
[
id
].
toolboxWidgets
.
push_back
(
std
::
pair
<
QString
,
QWidget
*
>
(
_name
,
_widget
)
);
plugins
_
[
id
].
toolboxIcons
.
push_back
(
_icon
);
plugins
_
[
id
].
headerAreaWidgets
.
push_back
(
std
::
pair
<
QString
,
QWidget
*
>
(
_name
,
_headerAreaWidget
)
);
plugins
()
[
id
].
toolboxWidgets
.
push_back
(
std
::
pair
<
QString
,
QWidget
*
>
(
_name
,
_widget
)
);
plugins
()
[
id
].
toolboxIcons
.
push_back
(
_icon
);
plugins
()
[
id
].
headerAreaWidgets
.
push_back
(
std
::
pair
<
QString
,
QWidget
*
>
(
_name
,
_headerAreaWidget
)
);
// add widget name to viewMode 'all'
if
(
!
viewModes_
[
0
]
->
visibleToolboxes
.
contains
(
_name
)
){
...
...
common/FileTypes.cc
View file @
919f5bc6
...
...
@@ -58,7 +58,7 @@
/**
* \file FileTypes.cc
* This File contains the management
of file plugins.
* This File contains the
file type
management
vectors
*/
...
...
@@ -66,14 +66,12 @@
#include <OpenFlipper/common/FileTypes.hh>
// Stores information about file types supported by the file plugins.
static
std
::
vector
<
fileTypes
>
supportedTypes_
;
std
::
vector
<
fileTypes
>&
supportedTypes
()
{
return
supportedTypes_
;
}
//=============================================================================
//=============================================================================
common/FileTypes.hh
View file @
919f5bc6
...
...
@@ -58,12 +58,11 @@
/**
* \file FileTypes.hh
* This File contains the management
of file plugins.
* This File contains the
file type
management
vectors
*/
#ifndef FILETYPES_HH
#define FILETYPES_HH
#pragma once
#include <QString>
#include <OpenFlipper/common/GlobalDefines.hh>
...
...
@@ -84,10 +83,8 @@ struct fileTypes {
// Get vector of supported types
DLLEXPORT
std
::
vector
<
fileTypes
>&
supportedTypes
();
std
::
vector
<
fileTypes
>&
supportedTypes
();
//=============================================================================
#endif // FILETYPES_HH defined
//=============================================================================
common/PluginStorage.cc
0 → 100644
View file @
919f5bc6
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// Types
//
//=============================================================================
/**
* \file PluginStorage.cc
* This File contains the management of plugins.
*/
//== INCLUDES =================================================================
#include <OpenFlipper/common/PluginStorage.hh>
namespace
PluginStorage
{
/// reference to Core plugin list
static
std
::
vector
<
PluginInfo
>
plugins_
;
std
::
vector
<
PluginInfo
>&
plugins
()
{
return
plugins_
;
}
}
//=============================================================================
//=============================================================================
common/PluginStorage.hh
0 → 100644
View file @
919f5bc6
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// Types
//
//=============================================================================
/**
* \file PluginStorage.hh
* This File contains the management vector for the plugins.
*/
#pragma once
#include <OpenFlipper/Core/PluginInfo.hh>
//== INCLUDES =================================================================
namespace
PluginStorage
{
/// Get the vector of all PluginInfos
std
::
vector
<
PluginInfo
>&
plugins
();
}
//=============================================================================
//=============================================================================
widgets/coreWidget/About.cc
View file @
919f5bc6
...
...
@@ -61,8 +61,10 @@
#include <common/glew_wrappers.hh>
#include "CoreWidget.hh"
#include <OpenFlipper/common/PluginStorage.hh>
#include <OpenFlipper/common/FileTypes.hh>
#include <QGLFormat>
#ifndef WIN32
...
...
@@ -753,23 +755,23 @@ void CoreWidget::showAboutWidget( ) {
aboutWidget_
->
OpenFlipperAbout
->
append
(
tr
(
"Loaded Plugins:"
));
aboutWidget_
->
OpenFlipperAbout
->
setCurrentFont
(
standardFont
);
for
(
uint
i
=
0
;
i
<
plugins
_
.
size
()
;
++
i
)
{
for
(
uint
i
=
0
;
i
<
plugins
()
.
size
()
;
++
i
)
{
aboutWidget_
->
OpenFlipperAbout
->
setCurrentFont
(
boldFont
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t
"
+
plugins
_
[
i
].
name
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t
"
+
plugins
()
[
i
].
name
);
aboutWidget_
->
OpenFlipperAbout
->
setCurrentFont
(
standardFont
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Version:
\t\t
"
+
plugins
_
[
i
].
version
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Description:
\t
"
+
plugins
_
[
i
].
description
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Path
\t\t
"
+
plugins
_
[
i
].
path
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Version:
\t\t
"
+
plugins
()
[
i
].
version
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Description:
\t
"
+
plugins
()
[
i
].
description
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Path
\t\t
"
+
plugins
()
[
i
].
path
);
if
(
!
plugins
_
[
i
].
warnings
.
isEmpty
()
)
{
if
(
!
plugins
()
[
i
].
warnings
.
isEmpty
()
)
{
aboutWidget_
->
OpenFlipperAbout
->
setTextColor
(
Qt
::
darkYellow
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Warnings:
\t\t
"
+
plugins
_
[
i
].
warnings
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Warnings:
\t\t
"
+
plugins
()
[
i
].
warnings
);
aboutWidget_
->
OpenFlipperAbout
->
setTextColor
(
Qt
::
black
);
}
if
(
!
plugins
_
[
i
].
errors
.
isEmpty
()
)
{
if
(
!
plugins
()
[
i
].
errors
.
isEmpty
()
)
{
aboutWidget_
->
OpenFlipperAbout
->
setTextColor
(
Qt
::
darkRed
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Errors:
\t\t
"
+
plugins
_
[
i
].
errors
);
aboutWidget_
->
OpenFlipperAbout
->
append
(
"
\t\t
Errors:
\t\t
"
+
plugins
()
[
i
].
errors
);
aboutWidget_
->
OpenFlipperAbout
->
setTextColor
(
Qt
::
black
);
}
...
...
widgets/coreWidget/ContextMenu.cc
View file @
919f5bc6
...
...
@@ -58,7 +58,7 @@
//== INCLUDES =================================================================
// -------------------- mview