28 #include "plugindialog.h"
36 #include <QVBoxLayout>
37 #include <QHBoxLayout>
39 #include <QDialogButtonBox>
40 #include <QPushButton>
43 using namespace Core::Internal;
47 , m_view(new ExtensionSystem::PluginView(ExtensionSystem::PluginManager::instance(), this))
49 QVBoxLayout *vl =
new QVBoxLayout(
this);
50 vl->addWidget(m_view);
52 m_detailsButton =
new QPushButton(tr(
"Details"),
this);
53 m_errorDetailsButton =
new QPushButton(tr(
"Error Details"),
this);
54 m_closeButton =
new QPushButton(tr(
"Close"),
this);
55 m_detailsButton->setEnabled(
false);
56 m_errorDetailsButton->setEnabled(
false);
57 m_closeButton->setEnabled(
true);
58 m_closeButton->setDefault(
true);
60 QHBoxLayout *hl =
new QHBoxLayout;
61 hl->addWidget(m_detailsButton);
62 hl->addWidget(m_errorDetailsButton);
64 hl->addWidget(m_closeButton);
69 setWindowTitle(tr(
"Installed Plugins"));
70 setWindowIcon(QIcon(
":/core/images/pluginicon.png"));
73 SLOT(updateButtons()));
76 connect(m_detailsButton, SIGNAL(clicked()),
this, SLOT(openDetails()));
77 connect(m_errorDetailsButton, SIGNAL(clicked()),
this, SLOT(openErrorDetails()));
78 connect(m_closeButton, SIGNAL(clicked()),
this, SLOT(accept()));
82 void PluginDialog::updateButtons()
86 m_detailsButton->setEnabled(
true);
87 m_errorDetailsButton->setEnabled(selectedSpec->
hasError());
89 m_detailsButton->setEnabled(
false);
90 m_errorDetailsButton->setEnabled(
false);
94 void PluginDialog::openDetails()
103 QDialog dialog(
this);
104 dialog.setWindowTitle(tr(
"Plugin Details of %1").arg(spec->
name()));
105 QVBoxLayout *layout =
new QVBoxLayout;
106 dialog.setLayout(layout);
108 layout->addWidget(details);
110 QDialogButtonBox *buttons =
111 new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, &dialog);
112 layout->addWidget(buttons);
113 connect(buttons, SIGNAL(accepted()), &dialog, SLOT(accept()));
114 connect(buttons, SIGNAL(rejected()), &dialog, SLOT(reject()));
115 dialog.resize(400, 500);
119 void PluginDialog::openErrorDetails()
124 QDialog dialog(
this);
125 dialog.setWindowTitle(tr(
"Plugin Errors of %1").arg(spec->
name()));
126 QVBoxLayout *layout =
new QVBoxLayout;
127 dialog.setLayout(layout);
129 layout->addWidget(errors);
131 QDialogButtonBox *buttons =
132 new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, &dialog);
133 layout->addWidget(buttons);
134 connect(buttons, SIGNAL(accepted()), &dialog, SLOT(accept()));
135 connect(buttons, SIGNAL(rejected()), &dialog, SLOT(reject()));
136 dialog.resize(500, 300);
PluginSpec * currentPlugin() const
void update(PluginSpec *spec)
void update(PluginSpec *spec)
Contains the information of the plugins xml description file and information about the plugin's curre...
PluginDialog(QWidget *parent)
Widget that displays the state and error message of a PluginSpec.
Widget that displays the contents of a PluginSpec.