28 #include "plugindialog.h"
34 #include <QtGui/QVBoxLayout>
35 #include <QtGui/QHBoxLayout>
36 #include <QtGui/QDialog>
37 #include <QtGui/QDialogButtonBox>
38 #include <QtGui/QApplication>
42 : m_view(new ExtensionSystem::PluginView(manager, this))
44 QVBoxLayout *vl =
new QVBoxLayout(
this);
47 vl->addWidget(m_view);
49 QHBoxLayout *hl =
new QHBoxLayout;
53 m_detailsButton =
new QPushButton(tr(
"Details"),
this);
54 m_errorDetailsButton =
new QPushButton(tr(
"Error Details"),
this);
55 m_detailsButton->setEnabled(
false);
56 m_errorDetailsButton->setEnabled(
false);
57 hl->addWidget(m_detailsButton);
58 hl->addWidget(m_errorDetailsButton);
61 setWindowTitle(tr(
"Installed Plugins"));
64 this, SLOT(updateButtons()));
67 connect(m_detailsButton, SIGNAL(clicked()),
this, SLOT(openDetails()));
68 connect(m_errorDetailsButton, SIGNAL(clicked()),
this, SLOT(openErrorDetails()));
71 void PluginDialog::updateButtons()
75 m_detailsButton->setEnabled(
true);
76 m_errorDetailsButton->setEnabled(selectedSpec->
hasError());
78 m_detailsButton->setEnabled(
false);
79 m_errorDetailsButton->setEnabled(
false);
84 void PluginDialog::openDetails()
94 dialog.setWindowTitle(tr(
"Plugin Details of %1").arg(spec->
name()));
95 QVBoxLayout *layout =
new QVBoxLayout;
96 dialog.setLayout(layout);
98 layout->addWidget(details);
100 QDialogButtonBox *buttons =
new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, &dialog);
101 layout->addWidget(buttons);
102 connect(buttons, SIGNAL(accepted()), &dialog, SLOT(accept()));
103 connect(buttons, SIGNAL(rejected()), &dialog, SLOT(reject()));
104 dialog.resize(400, 500);
108 void PluginDialog::openErrorDetails()
113 QDialog dialog(
this);
114 dialog.setWindowTitle(tr(
"Plugin Errors of %1").arg(spec->
name()));
115 QVBoxLayout *layout =
new QVBoxLayout;
116 dialog.setLayout(layout);
118 layout->addWidget(errors);
120 QDialogButtonBox *buttons =
new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, &dialog);
121 layout->addWidget(buttons);
122 connect(buttons, SIGNAL(accepted()), &dialog, SLOT(accept()));
123 connect(buttons, SIGNAL(rejected()), &dialog, SLOT(reject()));
124 dialog.resize(500, 300);
128 int main(
int argc,
char *argv[])
131 QApplication app(argc, argv);
133 manager.setPluginPaths(QStringList() <<
"plugins");
134 manager.loadPlugins();
PluginSpec * currentPlugin() const
void update(PluginSpec *spec)
Core plugin system that manages the plugins, their life cycle and their registered objects...
PluginDialog(ExtensionSystem::PluginManager *manager)
void update(PluginSpec *spec)
Contains the information of the plugins xml description file and information about the plugin's curre...
int main(int argc, char *argv[])
Widget that displays the state and error message of a PluginSpec.
Widget that displays the contents of a PluginSpec.