| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #include "qg_dialogfactory.h" |
| |
|
| | #include <QFileDialog> |
| | #include <QImageReader> |
| | #include <QMessageBox> |
| | #include <QRegularExpression> |
| |
|
| | #include "lc_dlgdimension.h" |
| | #include "lc_dlgentityproperties.h" |
| | #include "lc_parabola.h" |
| | #include "qc_applicationwindow.h" |
| | #include "qg_blockdialog.h" |
| | #include "qg_commandwidget.h" |
| | #include "qg_dlgattributes.h" |
| | #include "qg_dlghatch.h" |
| | #include "qg_dlgmirror.h" |
| | #include "qg_dlgmove.h" |
| | #include "qg_dlgmoverotate.h" |
| | #include "qg_dlgmtext.h" |
| | #include "qg_dlgoptionsdrawing.h" |
| | #include "qg_dlgoptionsmakercam.h" |
| | #include "qg_dlgrotate.h" |
| | #include "qg_dlgrotate2.h" |
| | #include "qg_dlgscale.h" |
| | #include "qg_dlgtext.h" |
| | #include "qg_layerdialog.h" |
| | #include "qg_selectionwidget.h" |
| | #include "rs_blocklist.h" |
| | #include "rs_debug.h" |
| | #include "rs_dimension.h" |
| | #include "rs_hatch.h" |
| | #include "rs_layer.h" |
| | #include "rs_layerlist.h" |
| | #include "rs_patternlist.h" |
| | #include "rs_settings.h" |
| | #include "rs_system.h" |
| | #include "rs_text.h" |
| |
|
| |
|
| | |
| |
|
| | class LC_EntityPropertiesDlg; |
| | |
| | |
| | |
| | |
| | |
| | |
| | QG_DialogFactory::QG_DialogFactory(QWidget* parent, [[maybe_unused]]QToolBar* optionsToolbar, [[maybe_unused]] LC_SnapOptionsWidgetsHolder* snapOptionsHolder) |
| | : parent(parent){ |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | QG_DialogFactory::~QG_DialogFactory() { |
| | RS_DEBUG->print("QG_DialogFactory::~QG_DialogFactory"); |
| | RS_DEBUG->print("QG_DialogFactory::~QG_DialogFactory: OK"); |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | void QG_DialogFactory::requestWarningDialog(const QString& warning) { |
| | QMessageBox::information(parent, QMessageBox::tr("Warning"), |
| | warning, |
| | QMessageBox::Ok); |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | RS_Layer* QG_DialogFactory::requestNewLayerDialog(RS_LayerList* layerList) |
| | { |
| | RS_Layer* layer {nullptr}; |
| |
|
| | QString layer_name; |
| | QString newLayerName; |
| | if (nullptr != layerList) { |
| | layer_name = layerList->getActive()->getName(); |
| | if (layer_name.isEmpty() || !layer_name.compare("0") ) { |
| | layer_name = QObject::tr( "noname", "default layer name"); |
| | } |
| | newLayerName = layer_name; |
| |
|
| | QString sBaseLayerName( layer_name); |
| | QString sNumLayerName; |
| | int nlen {1}; |
| | int i {0}; |
| | QRegularExpression re("^(.*\\D+|)(\\d*)$"); |
| | auto match( re.match(layer_name)); |
| | if (match.hasMatch()) { |
| | sBaseLayerName = match.captured(1); |
| | if( 1 < match.lastCapturedIndex()) { |
| | sNumLayerName = match.captured(2); |
| | nlen = sNumLayerName.length(); |
| | i = sNumLayerName.toInt(); |
| | } |
| | } |
| |
|
| | while (layerList->find( newLayerName)) { |
| | newLayerName = QString("%1%2").arg( sBaseLayerName).arg( ++i, nlen, 10, QChar('0')); |
| | } |
| | } |
| |
|
| | |
| | layer = new RS_Layer(newLayerName); |
| |
|
| | QG_LayerDialog dlg(parent, "Layer Dialog"); |
| | dlg.setLayer(layer); |
| | dlg.setLayerList(layerList); |
| | dlg.getQLineEdit()->selectAll(); |
| | if (dlg.exec()) { |
| | dlg.updateLayer(); |
| | } else { |
| | delete layer; |
| | layer = nullptr; |
| | } |
| |
|
| | return layer; |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | RS_Layer* QG_DialogFactory::requestLayerRemovalDialog(RS_LayerList* layerList) { |
| |
|
| | RS_Layer* layer = nullptr; |
| | if (!layerList) { |
| | RS_DEBUG->print(RS_Debug::D_WARNING, |
| | "QG_DialogFactory::requestLayerRemovalDialog(): " |
| | "layerList is nullptr"); |
| | return nullptr; |
| | } |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | |
| | layer = layerList->getActive(); |
| |
|
| | if (layer) { |
| | if (layer->getName()!="0") { |
| | QMessageBox msgBox( |
| | QMessageBox::Warning, |
| | QMessageBox::tr("Remove Layer"), |
| | QMessageBox::tr("Layer \"%1\" and all " |
| | "entities on it will be removed.\n" |
| | "This action can NOT be undone.") |
| | .arg(layer->getName()), |
| | QMessageBox::Ok | QMessageBox::Cancel); |
| | if (msgBox.exec()==QMessageBox::Ok) {} |
| | else { |
| | layer = nullptr; |
| | } |
| | } else { |
| | QMessageBox::information(parent, |
| | QMessageBox::tr("Remove Layer"), |
| | QMessageBox::tr("Layer \"%1\" can never " |
| | "be removed.") |
| | .arg(layer->getName()), |
| | QMessageBox::Ok); |
| | } |
| | } |
| |
|
| | return layer; |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | QStringList QG_DialogFactory::requestSelectedLayersRemovalDialog( |
| | RS_LayerList* layerList) |
| | { |
| |
|
| | if (!layerList) { |
| | RS_DEBUG->print(RS_Debug::D_WARNING, |
| | "QG_DialogFactory::requestSelectedLayersRemovalDialog(): " |
| | "layerList is nullptr"); |
| | return QStringList(); |
| | } |
| |
|
| | QStringList names; |
| | bool layer_0_selected {false}; |
| |
|
| | |
| | for (auto layer: *layerList) { |
| | if (!layer) continue; |
| | if (!layer->isVisibleInLayerList()) continue; |
| | if (!layer->isSelectedInLayerList()) continue; |
| | if (layer->getName() == "0") { |
| | layer_0_selected = true; |
| | continue; |
| | } |
| | names << layer->getName(); |
| | } |
| |
|
| | |
| | |
| | if (names.isEmpty()) { |
| | RS_Layer* layer = layerList->getActive(); |
| | if (layer && layer->isVisibleInLayerList()) { |
| | if (layer->getName() == "0") { |
| | layer_0_selected = true; |
| | } else { |
| | names << layer->getName(); |
| | } |
| | } |
| | } |
| |
|
| | |
| | if (names.isEmpty()) { |
| | if (layer_0_selected) { |
| | QMessageBox::information( |
| | parent, |
| | QMessageBox::tr("Remove Layer"), |
| | QMessageBox::tr("Layer \"0\" can never be removed."), |
| | QMessageBox::Ok |
| | ); |
| | } |
| | return names; |
| | } |
| |
|
| | |
| |
|
| | QString title( |
| | QMessageBox::tr("Remove %n layer(s)", "", names.size()) |
| | ); |
| |
|
| | QStringList text_lines = { |
| | QMessageBox::tr("Listed layers and all entities on them will be removed."), |
| | "", |
| | QMessageBox::tr("Warning: this action can NOT be undone!"), |
| | }; |
| |
|
| | if (layer_0_selected) { |
| | text_lines << "" << |
| | QMessageBox::tr("Warning: layer \"0\" can never be removed."); |
| | } |
| |
|
| | QStringList detail_lines = { |
| | QMessageBox::tr("Layers for removal:"), |
| | "", |
| | }; |
| | detail_lines << names; |
| |
|
| | QMessageBox msgBox( |
| | QMessageBox::Warning, |
| | title, |
| | text_lines.join("\n"), |
| | QMessageBox::Ok | QMessageBox::Cancel |
| | ); |
| |
|
| | msgBox.setDetailedText(detail_lines.join("\n")); |
| |
|
| | if (msgBox.exec() == QMessageBox::Ok) { |
| | return names; |
| | } |
| |
|
| | return QStringList(); |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | RS_Layer* QG_DialogFactory::requestEditLayerDialog(RS_LayerList* layerList) { |
| |
|
| | RS_DEBUG->print("QG_DialogFactory::requestEditLayerDialog"); |
| |
|
| | RS_Layer* layer = nullptr; |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | if (!layerList) { |
| | RS_DEBUG->print(RS_Debug::D_WARNING, |
| | "QG_DialogFactory::requestEditLayerDialog(): " |
| | "layerList is nullptr"); |
| | return nullptr; |
| | } |
| |
|
| | |
| | if (layerList->getActive()) { |
| | layer = new RS_Layer(*layerList->getActive()); |
| |
|
| | QG_LayerDialog dlg(parent, QMessageBox::tr("Layer Dialog")); |
| | dlg.setLayer(layer); |
| | dlg.setLayerList(layerList); |
| | dlg.setEditLayer(true); |
| | if (dlg.exec()) { |
| | dlg.updateLayer(); |
| | } else { |
| | delete layer; |
| | layer = nullptr; |
| | } |
| | } |
| |
|
| | return layer; |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | RS_BlockData QG_DialogFactory::requestNewBlockDialog(RS_BlockList* blockList) { |
| | |
| | RS_BlockData ret; |
| | ret = RS_BlockData("", RS_Vector(false), false); |
| |
|
| | if (!blockList) { |
| | RS_DEBUG->print(RS_Debug::D_WARNING, |
| | "QG_DialogFactory::requestNewBlockDialog(): " |
| | "blockList is nullptr"); |
| | return ret; |
| | } |
| |
|
| | |
| | |
| |
|
| | QG_BlockDialog dlg(parent); |
| | dlg.setBlockList(blockList); |
| | if (dlg.exec()) { |
| | ret = dlg.getBlockData(); |
| | } |
| |
|
| | return ret; |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | RS_BlockData QG_DialogFactory::requestBlockAttributesDialog(RS_BlockList* blockList) { |
| | |
| | RS_BlockData ret; |
| | ret = RS_BlockData("", RS_Vector(false), false); |
| |
|
| | if (!blockList) { |
| | RS_DEBUG->print(RS_Debug::D_WARNING, |
| | "QG_DialogFactory::requestBlockAttributesDialog(): " |
| | "blockList is nullptr"); |
| | return ret; |
| | } |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | |
| | |
| |
|
| | |
| | QG_BlockDialog dlg(parent); |
| | dlg.setBlockList(blockList); |
| | if (dlg.exec()) { |
| | |
| | |
| | ret = dlg.getBlockData(); |
| | } |
| | |
| | |
| | |
| |
|
| | return ret; |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | RS_Block* QG_DialogFactory::requestBlockRemovalDialog(RS_BlockList* blockList) { |
| | RS_Block* block = nullptr; |
| |
|
| | if (!blockList) { |
| | RS_DEBUG->print(RS_Debug::D_WARNING, |
| | "QG_DialogFactory::requestBlockRemovalDialog(): " |
| | "blockList is nullptr"); |
| | return nullptr; |
| | } |
| |
|
| | |
| | block = blockList->getActive(); |
| |
|
| | if (block) { |
| | int remove = |
| | QMessageBox::warning(parent, |
| | QMessageBox::tr("Remove Block"), |
| | QMessageBox::tr("Block \"%1\" and all " |
| | "its entities will be removed.") |
| | .arg(block->getName()), |
| | QMessageBox::Ok | QMessageBox::Cancel, |
| | QMessageBox::Cancel); |
| | if (remove==QMessageBox::Ok) {} |
| | else { |
| | block = nullptr; |
| | } |
| | } |
| |
|
| | return block; |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | QList<RS_Block*> QG_DialogFactory::requestSelectedBlocksRemovalDialog( |
| | RS_BlockList* blockList) |
| | { |
| |
|
| | if (!blockList) { |
| | RS_DEBUG->print(RS_Debug::D_WARNING, |
| | "QG_DialogFactory::requestSelectedBlocksRemovalDialog(): " |
| | "blockList is nullptr"); |
| | return QList<RS_Block*>(); |
| | } |
| |
|
| | QList<RS_Block*> blocks; |
| |
|
| | |
| | for (auto block: *blockList) { |
| | if (!block) continue; |
| | if (!block->isVisibleInBlockList()) continue; |
| | if (!block->isSelectedInBlockList()) continue; |
| | blocks << block; |
| | } |
| |
|
| | |
| | |
| | if (blocks.isEmpty()) { |
| | RS_Block* block = blockList->getActive(); |
| | if (block && block->isVisibleInBlockList()) { |
| | blocks << block; |
| | } |
| | } |
| |
|
| | |
| | if (blocks.isEmpty()) { |
| | return blocks; |
| | } |
| |
|
| | |
| |
|
| | QString title(QMessageBox::tr("Remove %n block(s)", "", blocks.size())); |
| |
|
| | QString text(QMessageBox::tr("Listed blocks and all their entities will be removed.")); |
| |
|
| | QStringList detail_lines = { |
| | QMessageBox::tr("Blocks for removal:"), |
| | "", |
| | }; |
| | for (auto block: blocks) { |
| | detail_lines << block->getName(); |
| | } |
| |
|
| | QMessageBox msgBox( |
| | QMessageBox::Warning, |
| | title, |
| | text, |
| | QMessageBox::Ok | QMessageBox::Cancel |
| | ); |
| |
|
| | msgBox.setDetailedText(detail_lines.join("\n")); |
| |
|
| | if (msgBox.exec() == QMessageBox::Ok) { |
| | return blocks; |
| | } |
| |
|
| | return QList<RS_Block*>(); |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | QString QG_DialogFactory::requestImageOpenDialog(){ |
| | QString strFileName = ""; |
| |
|
| | |
| | LC_GROUP("Paths"); |
| | QString defDir = LC_GET_STR("OpenImage", RS_SYSTEM->getHomeDir()); |
| | QString defFilter = LC_GET_STR("ImageFilter", ""); |
| | LC_GROUP_END(); |
| |
|
| | QStringList filters; |
| | QString all = ""; |
| | bool haveJpeg= false; |
| | for(const QByteArray& format: QImageReader::supportedImageFormats()) { |
| | if (format.toUpper() == "JPG" || format.toUpper() == "JPEG" ){ |
| | if (!haveJpeg) { |
| | haveJpeg = true; |
| | filters.append("jpeg (*.jpeg *.jpg)"); |
| | all += " *.jpeg *.jpg"; |
| | } |
| | } else { |
| | filters.append(QString("%1 (*.%1)").arg(QString(format))); |
| | all += QString(" *.%1").arg(QString(format)); |
| | } |
| | } |
| | QString strAllImageFiles = QObject::tr("All Image Files (%1)").arg(all); |
| | filters.append(strAllImageFiles); |
| | filters.append(QObject::tr("All Files (*.*)")); |
| |
|
| | QFileDialog fileDlg(nullptr, ""); |
| | fileDlg.setModal(true); |
| | fileDlg.setFileMode(QFileDialog::ExistingFile); |
| | fileDlg.setWindowTitle(QObject::tr("Open Image")); |
| | fileDlg.setDirectory(defDir); |
| | fileDlg.setNameFilters(filters); |
| | if (defFilter.isEmpty()) |
| | defFilter = strAllImageFiles; |
| | fileDlg.selectNameFilter(defFilter); |
| |
|
| | if (QDialog::Accepted == fileDlg.exec()) { |
| | QStringList strSelectedFiles = fileDlg.selectedFiles(); |
| | if (!strSelectedFiles.isEmpty()) |
| | strFileName = strSelectedFiles.first(); |
| |
|
| | |
| | LC_GROUP_GUARD("Paths"); |
| | { |
| | LC_SET("OpenImage", QFileInfo(strFileName).absolutePath()); |
| | LC_SET("ImageFilter", fileDlg.selectedNameFilter()); |
| | } |
| | } |
| | return strFileName; |
| | } |
| |
|
| | |
| | |
| | |
| | bool QG_DialogFactory::requestAttributesDialog(RS_AttributesData& data, |
| | RS_LayerList& layerList) { |
| |
|
| | QG_DlgAttributes dlg(parent); |
| | dlg.setData(&data, layerList); |
| | if (dlg.exec()) { |
| | dlg.updateData(); |
| | return true; |
| | } |
| | return false; |
| | } |
| |
|
| | |
| | |
| | |
| | bool QG_DialogFactory::requestMoveDialog(RS_MoveData& data) { |
| | QG_DlgMove dlg(parent); |
| | dlg.setData(&data); |
| | if (dlg.exec()) { |
| | dlg.updateData(); |
| | return true; |
| | } |
| | return false; |
| | } |
| |
|
| | |
| | |
| | |
| | bool QG_DialogFactory::requestRotateDialog(RS_RotateData& data) { |
| | QG_DlgRotate dlg(parent); |
| | dlg.setData(&data); |
| | if (dlg.exec()) { |
| | dlg.updateData(); |
| | return true; |
| | } |
| | return false; |
| | } |
| |
|
| | |
| | |
| | |
| | bool QG_DialogFactory::requestScaleDialog(RS_ScaleData& data) { |
| | QG_DlgScale dlg(parent); |
| | dlg.setData(&data); |
| | if (dlg.exec()) { |
| | dlg.updateData(); |
| | return true; |
| | } |
| | return false; |
| | } |
| |
|
| | |
| | |
| | |
| | bool QG_DialogFactory::requestMirrorDialog(RS_MirrorData& data) { |
| | QG_DlgMirror dlg(parent); |
| | dlg.setData(&data); |
| | if (dlg.exec()) { |
| | dlg.updateData(); |
| | return true; |
| | } |
| | return false; |
| | } |
| |
|
| | |
| | |
| | |
| | bool QG_DialogFactory::requestMoveRotateDialog(RS_MoveRotateData& data) { |
| | QG_DlgMoveRotate dlg(parent); |
| | dlg.setData(&data); |
| | if (dlg.exec()) { |
| | dlg.updateData(); |
| | return true; |
| | } |
| | return false; |
| | } |
| |
|
| | |
| | |
| | |
| | bool QG_DialogFactory::requestRotate2Dialog(RS_Rotate2Data& data) { |
| | QG_DlgRotate2 dlg(parent); |
| | dlg.setData(&data); |
| | if (dlg.exec()) { |
| | dlg.updateData(); |
| | return true; |
| | } |
| | return false; |
| | } |
| |
|
| | |
| | |
| | |
| |
|
| | |
| | bool QG_DialogFactory::requestModifyEntityDialog(RS_Entity *entity, [[maybe_unused]]LC_GraphicViewport *viewport) { |
| | if (!entity) return false; |
| |
|
| | bool ret = false; |
| |
|
| | |
| | |
| | |
| | |
| | LC_EntityPropertiesDlg* editDialog; |
| | bool hasDialog = true; |
| |
|
| | switch (entity->rtti()) { |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | case RS2::EntityDimAligned: |
| | case RS2::EntityDimAngular: |
| | case RS2::EntityDimDiametric: |
| | case RS2::EntityDimRadial: |
| | case RS2::EntityDimArc: |
| | case RS2::EntityDimOrdinate: |
| | case RS2::EntityDimLinear: { |
| | editDialog = new LC_DlgDimension(parent, viewport, dynamic_cast<RS_Dimension*>(entity)); |
| | break; |
| | } |
| | case RS2::EntityMText: { |
| | editDialog = new QG_DlgMText(parent, viewport, dynamic_cast<RS_MText*>(entity), false); |
| | break; |
| | } |
| | case RS2::EntityText: { |
| | editDialog = new QG_DlgText(parent, viewport, dynamic_cast<RS_Text*>(entity), false); |
| | break; |
| | } |
| | case RS2::EntityHatch: { |
| | editDialog = new QG_DlgHatch(parent, viewport, dynamic_cast<RS_Hatch*>(entity), false); |
| | break; |
| | } |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | default: |
| | hasDialog = false; |
| | break; |
| | } |
| |
|
| | if (hasDialog){ |
| | if (editDialog->exec()) { |
| | editDialog->updateEntity(); |
| | ret = true; |
| | } |
| | delete editDialog; |
| | } |
| |
|
| | return ret; |
| | } |
| |
|
| | |
| | |
| | |
| | bool QG_DialogFactory::requestMTextDialog(RS_MText *text, LC_GraphicViewport *viewport) { |
| | if (!text) return false; |
| |
|
| | QG_DlgMText dlg(parent, viewport, text, true); |
| | if (dlg.exec()) { |
| | dlg.updateEntity(); |
| | return true; |
| | } |
| |
|
| | return false; |
| | } |
| |
|
| | |
| | |
| | |
| | bool QG_DialogFactory::requestTextDialog(RS_Text *text, LC_GraphicViewport *viewport) { |
| | if (!text) return false; |
| |
|
| | QG_DlgText dlg(parent, viewport, text, true); |
| | if (dlg.exec()) { |
| | dlg.updateEntity(); |
| | return true; |
| | } |
| |
|
| | return false; |
| | } |
| |
|
| | |
| | |
| | |
| | bool QG_DialogFactory::requestHatchDialog(RS_Hatch *hatch, LC_GraphicViewport *viewport) { |
| | if (!hatch) return false; |
| |
|
| | RS_PATTERNLIST->init(); |
| |
|
| | QG_DlgHatch dlg(parent, viewport, hatch, true); |
| | if (dlg.exec()) { |
| | dlg.updateEntity(); |
| | dlg.saveSettings(); |
| | return true; |
| | } |
| | return false; |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | int QG_DialogFactory::requestOptionsDrawingDialog(RS_Graphic& graphic, int tabIndex) { |
| | QG_DlgOptionsDrawing dlg(parent); |
| | dlg.setGraphic(&graphic); |
| | dlg.showInitialTab(tabIndex); |
| | int result = dlg.exec(); |
| | return result; |
| | } |
| |
|
| | bool QG_DialogFactory::requestOptionsMakerCamDialog() { |
| | QG_DlgOptionsMakerCam dlg(parent); |
| | return (dlg.exec() == QDialog::Accepted); |
| | } |
| |
|
| | QString QG_DialogFactory::requestFileSaveAsDialog(const QString& caption , |
| | const QString& dir , |
| | const QString& filter , |
| | QString* selectedFilter ) { |
| |
|
| | return QFileDialog::getSaveFileName(parent, caption, dir, filter, selectedFilter); |
| | } |
| |
|
| | void QG_DialogFactory::displayBlockName(const QString& blockName, const bool& display){ |
| | if (m_selectionWidget != nullptr) { |
| | m_selectionWidget->flashAuxData( QString("Block Name"), |
| | blockName, |
| | QC_ApplicationWindow::DEFAULT_STATUS_BAR_MESSAGE_TIMEOUT, |
| | display); |
| | } |
| | } |
| |
|
| | |
| | |
| | |
| | void QG_DialogFactory::commandMessage(const QString& message) { |
| | RS_DEBUG->print("QG_DialogFactory::commandMessage"); |
| | if (m_commandWidget) { |
| | m_commandWidget->appendHistory(message); |
| | } |
| | RS_DEBUG->print("QG_DialogFactory::commandMessage: OK"); |
| |
|
| | } |
| | void QG_DialogFactory::command(const QString& message) { |
| | RS_DEBUG->print("QG_DialogFactory::command"); |
| | if (m_commandWidget) { |
| | m_commandWidget->setInput(message); |
| | } |
| | RS_DEBUG->print("QG_DialogFactory::command: OK"); |
| | } |
| |
|
| | void QG_DialogFactory::commandPrompt(const QString& message) { |
| | RS_DEBUG->print("QG_DialogFactory::command"); |
| | if (m_commandWidget) { |
| | m_commandWidget->setCommand(message); |
| | } |
| | RS_DEBUG->print("QG_DialogFactory::command: OK"); |
| | } |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | QString QG_DialogFactory::extToFormat(const QString& ext) { |
| | QString e = ext.toLower(); |
| |
|
| | if (e=="bmp") { |
| | return QObject::tr("Windows Bitmap"); |
| | } else if (e=="jpeg" || e=="jpg") { |
| | return QObject::tr("Joint Photographic Experts Group"); |
| | } else if (e=="gif") { |
| | return QObject::tr("Graphics Interchange Format"); |
| | } else if (e=="mng") { |
| | return QObject::tr("Multiple-image Network Graphics"); |
| | } else if (e=="pbm") { |
| | return QObject::tr("Portable Bit Map"); |
| | } else if (e=="pgm") { |
| | return QObject::tr("Portable Grey Map"); |
| | } else if (e=="png") { |
| | return QObject::tr("Portable Network Graphic"); |
| | } else if (e=="ppm") { |
| | return QObject::tr("Portable Pixel Map"); |
| | } else if (e=="xbm") { |
| | return QObject::tr("X Bitmap Format"); |
| | } else if (e=="xpm") { |
| | return QObject::tr("X Pixel Map"); |
| | } else if (e=="svg") { |
| | return QObject::tr("Scalable Vector Graphics"); |
| | } else if (e=="bw") { |
| | return QObject::tr("SGI Black & White"); |
| | } else if (e=="eps") { |
| | return QObject::tr("Encapsulated PostScript"); |
| | } else if (e=="epsf") { |
| | return QObject::tr("Encapsulated PostScript Format"); |
| | } else if (e=="epsi") { |
| | return QObject::tr("Encapsulated PostScript Interchange"); |
| | } else if (e=="ico") { |
| | return QObject::tr("Windows Icon"); |
| | } else if (e=="jp2") { |
| | return QObject::tr("JPEG 2000"); |
| | } else if (e=="pcx") { |
| | return QObject::tr("ZSoft Paintbrush"); |
| | } else if (e=="pic") { |
| | return QObject::tr("PC Paint"); |
| | } else if (e=="rgb" || e=="rgba" || e=="sgi") { |
| | return QObject::tr("SGI-Bilddatei"); |
| | } else if (e=="tga") { |
| | return QObject::tr("Targa Image File"); |
| | } else if (e=="tif" || e=="tiff") { |
| | return QObject::tr("Tagged Image File Format"); |
| | } |
| | else { |
| | return ext.toUpper(); |
| | } |
| | } |
| |
|