void ResTable::setRclMain(RclMain *m, bool ismain) { m_rclmain = m; m_ismainres = ismain; // We allow single selection only in the main table because this // may have a mix of file-level docs and subdocs and multisave // only works for subdocs if (m_ismainres) tableView->setSelectionMode(QAbstractItemView::SingleSelection); else tableView->setSelectionMode(QAbstractItemView::ExtendedSelection); if (!m_ismainres) { connect(new QShortcut(closeKeySeq, this), SIGNAL (activated()), this, SLOT (close())); connect(new QShortcut(quitKeySeq, this), SIGNAL (activated()), m_rclmain, SLOT (fileExit())); connect(this, SIGNAL(previewRequested(Rcl::Doc)), m_rclmain, SLOT(startPreview(Rcl::Doc))); connect(this, SIGNAL(docSaveToFileClicked(Rcl::Doc)), m_rclmain, SLOT(saveDocToFile(Rcl::Doc))); connect(this, SIGNAL(editRequested(Rcl::Doc)), m_rclmain, SLOT(startNativeViewer(Rcl::Doc))); } }
void ResTable::menuPreview() { if (m_detaildocnum >= 0) { if (m_ismainres) { emit docPreviewClicked(m_detaildocnum, m_detaildoc, 0); } else { emit previewRequested(m_detaildoc); } } }
void ResTable::menuPreviewParent() { if (m_detaildocnum >= 0 && m_model && m_model->getDocSource().isNotNull()) { Rcl::Doc pdoc = ResultPopup::getParent(m_model->getDocSource(), m_detaildoc); if (pdoc.mimetype == "inode/directory") { emit editRequested(pdoc); } else { emit previewRequested(pdoc); } } }
bool ArticleView::viewportEvent(QEvent * event) { if (event->type() == QEvent::ToolTip) { QHelpEvent * he = static_cast< QHelpEvent * >(event); QModelIndex index(indexAt(he->pos())); if (index.isValid()) { emit previewRequested(index); } return true; // Don't propagate } else { return QListView::viewportEvent(event); } }
void ImportIconView::activated(const CamItemInfo& info, Qt::KeyboardModifiers) { if (info.isNull()) { return; } if (ImportSettings::instance()->getItemLeftClickAction() == ImportSettings::ShowPreview) { emit previewRequested(info, false); } else { //TODO: openFile(info); } }