PluginDialog::PluginDialog(ExtensionSystem::PluginManager *manager) : m_view(new ExtensionSystem::PluginView(manager, this)) { QVBoxLayout *vl = new QVBoxLayout(this); vl->setMargin(0); vl->setSpacing(0); vl->addWidget(m_view); QHBoxLayout *hl = new QHBoxLayout; vl->addLayout(hl); hl->setMargin(0); hl->setSpacing(6); m_detailsButton = new QPushButton(tr("Details"), this); m_errorDetailsButton = new QPushButton(tr("Error Details"), this); m_detailsButton->setEnabled(false); m_errorDetailsButton->setEnabled(false); hl->addWidget(m_detailsButton); hl->addWidget(m_errorDetailsButton); hl->addStretch(5); resize(650, 300); setWindowTitle(tr("Installed Plugins")); connect(m_view, SIGNAL(currentPluginChanged(ExtensionSystem::PluginSpec*)), this, SLOT(updateButtons())); connect(m_view, SIGNAL(pluginActivated(ExtensionSystem::PluginSpec*)), this, SLOT(openDetails(ExtensionSystem::PluginSpec*))); connect(m_detailsButton, SIGNAL(clicked()), this, SLOT(openDetails())); connect(m_errorDetailsButton, SIGNAL(clicked()), this, SLOT(openErrorDetails())); }
void DisplayLabel::contextMenuEvent(QContextMenuEvent *event) { if (_slideshowimage == nullptr || _slideshowimage->path().isEmpty()) { return; } emit rightMouseSucces(true); QMenu menu(this); QAction *openFolderAction = new QAction(tr("Open &folder"), this); connect(openFolderAction, &QAction::triggered, this, [this]() {this->openFolder(true);}); menu.addAction(openFolderAction); QAction *openImageAction = new QAction(tr("Open &image"), this); openImageAction->setStatusTip(tr("Open image in the default viewer")); connect(openImageAction, &QAction::triggered, this, [this]() {this->openImage();}); menu.addAction(openImageAction); QAction *openDetailsAction = new QAction(tr("&Details"), this); //connect(openDetailsAction, &QAction::triggered, this, [this]() {qDebug() << "clicked open details";}); menu.addAction(openDetailsAction); QAction *result = menu.exec(event->globalPos()); if (!result) { // this starts the slideshow if no item was selected //emit rightMouseSucces(false); // it is not influenced by the fact that the slideshow was paused before the right click return; } else if (result == openDetailsAction) { emit openDetails(_slideshowimage); //DetailsDialog *detailsDialog = new DetailsDialog(); //detailsDialog->show(); //detailsDialog->setImage(_slideshowimage); } }
PluginDialog::PluginDialog(QWidget *parent) : QDialog(parent), m_view(new ExtensionSystem::PluginView(this)) { QVBoxLayout *vl = new QVBoxLayout(this); auto filterEdit = new Utils::FancyLineEdit(this); filterEdit->setFiltering(true); connect(filterEdit, &Utils::FancyLineEdit::filterChanged, m_view, &ExtensionSystem::PluginView::setFilter); vl->addWidget(filterEdit); vl->addWidget(m_view); m_detailsButton = new QPushButton(tr("Details"), this); m_errorDetailsButton = new QPushButton(tr("Error Details"), this); m_closeButton = new QPushButton(tr("Close"), this); m_detailsButton->setEnabled(false); m_errorDetailsButton->setEnabled(false); m_closeButton->setEnabled(true); m_closeButton->setDefault(true); m_restartRequired = new QLabel(tr("Restart required."), this); if (!s_isRestartRequired) m_restartRequired->setVisible(false); QHBoxLayout *hl = new QHBoxLayout; hl->addWidget(m_detailsButton); hl->addWidget(m_errorDetailsButton); hl->addSpacing(10); hl->addWidget(m_restartRequired); hl->addStretch(5); hl->addWidget(m_closeButton); vl->addLayout(hl); resize(650, 400); setWindowTitle(tr("Installed Plugins")); connect(m_view, &ExtensionSystem::PluginView::currentPluginChanged, this, &PluginDialog::updateButtons); connect(m_view, &ExtensionSystem::PluginView::pluginActivated, this, &PluginDialog::openDetails); connect(m_view, &ExtensionSystem::PluginView::pluginSettingsChanged, this, &PluginDialog::updateRestartRequired); connect(m_detailsButton, &QAbstractButton::clicked, [this] { openDetails(m_view->currentPlugin()); }); connect(m_errorDetailsButton, &QAbstractButton::clicked, this, &PluginDialog::openErrorDetails); connect(m_closeButton, &QAbstractButton::clicked, this, &PluginDialog::closeDialog); updateButtons(); }
void PluginDialog::openDetails() { openDetails(m_view->currentPlugin()); }
PluginDialog::PluginDialog(QWidget *parent) : QDialog(parent), m_view(new ExtensionSystem::PluginView(this)) { setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); QVBoxLayout *vl = new QVBoxLayout(this); auto filterLayout = new QHBoxLayout; vl->addLayout(filterLayout); auto filterEdit = new Utils::FancyLineEdit(this); filterEdit->setFiltering(true); connect(filterEdit, &Utils::FancyLineEdit::filterChanged, m_view, &ExtensionSystem::PluginView::setFilter); filterLayout->addWidget(filterEdit); m_view->setShowHidden(false); auto showHidden = new QCheckBox(tr("Show all")); showHidden->setToolTip(tr("Show all installed plugins, including base plugins " "and plugins that are not available on this platform.")); showHidden->setChecked(m_view->isShowingHidden()); connect(showHidden, &QCheckBox::stateChanged, m_view, &ExtensionSystem::PluginView::setShowHidden); filterLayout->addWidget(showHidden); vl->addWidget(m_view); m_detailsButton = new QPushButton(tr("Details"), this); m_errorDetailsButton = new QPushButton(tr("Error Details"), this); m_closeButton = new QPushButton(tr("Close"), this); m_detailsButton->setEnabled(false); m_errorDetailsButton->setEnabled(false); m_closeButton->setEnabled(true); m_closeButton->setDefault(true); m_restartRequired = new QLabel(tr("Restart required."), this); if (!s_isRestartRequired) m_restartRequired->setVisible(false); QHBoxLayout *hl = new QHBoxLayout; hl->addWidget(m_detailsButton); hl->addWidget(m_errorDetailsButton); hl->addSpacing(10); hl->addWidget(m_restartRequired); hl->addStretch(5); hl->addWidget(m_closeButton); vl->addLayout(hl); resize(650, 400); setWindowTitle(tr("Installed Plugins")); connect(m_view, &ExtensionSystem::PluginView::currentPluginChanged, this, &PluginDialog::updateButtons); connect(m_view, &ExtensionSystem::PluginView::pluginActivated, this, &PluginDialog::openDetails); connect(m_view, &ExtensionSystem::PluginView::pluginSettingsChanged, this, &PluginDialog::updateRestartRequired); connect(m_detailsButton, &QAbstractButton::clicked, [this] { openDetails(m_view->currentPlugin()); }); connect(m_errorDetailsButton, &QAbstractButton::clicked, this, &PluginDialog::openErrorDetails); connect(m_closeButton, &QAbstractButton::clicked, this, &PluginDialog::closeDialog); updateButtons(); }