void configureIE::sPopulateMenu(QMenu* pMenu, QTreeWidgetItem* /* pItem */) { QAction *newAct = pMenu->addAction(tr("New...")); QAction *editAct = pMenu->addAction(tr("Edit...")); QAction *delAct = pMenu->addAction(tr("Delete")); if (sender() == _map) { newAct->setEnabled(xsltMap::userHasPriv()); editAct->setEnabled(xsltMap::userHasPriv()); delAct->setEnabled(xsltMap::userHasPriv()); connect(newAct, SIGNAL(triggered()), this, SLOT(sNewMap())); connect(editAct, SIGNAL(triggered()), this, SLOT(sEditMap())); connect(delAct, SIGNAL(triggered()), this, SLOT(sDeleteMap())); } else if (sender() == _atlasMap) { newAct->setEnabled(atlasMap::userHasPriv()); editAct->setEnabled(atlasMap::userHasPriv()); delAct->setEnabled(atlasMap::userHasPriv()); connect(newAct, SIGNAL(triggered()), this, SLOT(sNewAtlasMap())); connect(editAct, SIGNAL(triggered()), this, SLOT(sEditAtlasMap())); connect(delAct, SIGNAL(triggered()), this, SLOT(sDeleteAtlasMap())); } }
configureIE::configureIE(QWidget* parent, const char* name, bool /*modal*/, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { setupUi(this); if (name) setObjectName(name); connect(_atlasMap, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(sEditAtlasMap())); connect(_atlasMap, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_deleteAtlasMap, SIGNAL(clicked()), this, SLOT(sDeleteAtlasMap())); connect(_deleteMap, SIGNAL(clicked()), this, SLOT(sDeleteMap())); connect(_editAtlasMap, SIGNAL(clicked()), this, SLOT(sEditAtlasMap())); connect(_editMap, SIGNAL(clicked()), this, SLOT(sEditMap())); connect(_map, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(sEditMap())); connect(_map, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_newAtlasMap, SIGNAL(clicked()), this, SLOT(sNewAtlasMap())); connect(_newMap, SIGNAL(clicked()), this, SLOT(sNewMap())); _map->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "xsltmap_name"); _map->addColumn(tr("Document Type"), -1, Qt::AlignLeft, true, "xsltmap_doctype"); _map->addColumn(tr("System Identifier"),-1, Qt::AlignLeft, true, "xsltmap_system"); _map->addColumn(tr("Import XSLT File"), -1, Qt::AlignLeft, true, "xsltmap_import"); _map->addColumn(tr("Export XSLT File"), -1, Qt::AlignLeft, true, "xsltmap_export"); _atlasMap->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "atlasmap_name"); _atlasMap->addColumn(tr("Type"), -1, Qt::AlignLeft, true, "atlasmap_filtertype"); _atlasMap->addColumn(tr("Matches"), -1, Qt::AlignLeft, true, "atlasmap_filter"); _atlasMap->addColumn(tr("Atlas File"), -1, Qt::AlignLeft, true, "atlasmap_atlas"); _atlasMap->addColumn(tr("CSV Map"), -1, Qt::AlignLeft, true, "atlasmap_map"); // TODO: fix these when support for an internal XSLT processor is enabled _internal->setEnabled(false); _internal->setVisible(false); _external->setVisible(false); #ifdef Q_WS_WIN _os->setCurrentIndex(1); #endif #ifdef Q_WS_MAC _os->setCurrentIndex(2); #endif sPopulate(); }
configureIE::configureIE(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_atlasMap, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(sEditAtlasMap())); connect(_atlasMap, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_deleteAtlasMap, SIGNAL(clicked()), this, SLOT(sDeleteAtlasMap())); connect(_deleteMap, SIGNAL(clicked()), this, SLOT(sDeleteMap())); connect(_editAtlasMap, SIGNAL(clicked()), this, SLOT(sEditAtlasMap())); connect(_editMap, SIGNAL(clicked()), this, SLOT(sEditMap())); connect(_map, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(sEditMap())); connect(_map, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_newAtlasMap, SIGNAL(clicked()), this, SLOT(sNewAtlasMap())); connect(_newMap, SIGNAL(clicked()), this, SLOT(sNewMap())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _map->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "xsltmap_name"); _map->addColumn(tr("Document Type"), -1, Qt::AlignLeft, true, "xsltmap_doctype"); _map->addColumn(tr("System Identifier"),-1, Qt::AlignLeft, true, "xsltmap_system"); _map->addColumn(tr("Import XSLT File"), -1, Qt::AlignLeft, true, "xsltmap_import"); _map->addColumn(tr("Export XSLT File"), -1, Qt::AlignLeft, true, "xsltmap_export"); _atlasMap->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "atlasmap_name"); _atlasMap->addColumn(tr("Type"), -1, Qt::AlignLeft, true, "atlasmap_filtertype"); _atlasMap->addColumn(tr("Matches"), -1, Qt::AlignLeft, true, "atlasmap_filter"); _atlasMap->addColumn(tr("Atlas File"), -1, Qt::AlignLeft, true, "atlasmap_atlas"); _atlasMap->addColumn(tr("CSV Map"), -1, Qt::AlignLeft, true, "atlasmap_map"); // TODO: fix these when support for an internal XSLT processor is enabled _internal->setEnabled(false); _internal->setVisible(false); _external->setVisible(false); adjustSize(); sPopulate(); }