void CorrectClearanceBatchOutputWidget::exportAll()
{
    // 外部做判断,并选择文件夹
    /*int result = QMessageBox::warning(this,tr("警告"), tr("确认导出全部?"),
                                        QMessageBox::Yes | QMessageBox::No);
    if (result == QMessageBox::No)
        return;
    else if (result == QMessageBox::Yes)*/
    {
        int tmp;
        switch(group->checkedId())
        {
        case 0:
            tmp = 500;
            break;
        case 1:
            tmp = 1000;
            break;
        case 2:
            tmp = 2000;
            break;
        case 3:
            tmp = 5000;
            break;
        case 4:
            tmp = 10000;
            break;
        default:
            tmp = 500;
            break;

        }
        emit exportAll(tmp);
    }
}
/**
 * 图形修正界面——EXCEL批量输出
 * @author 范翔
 * @version 1.0.0
 * @date 2015-10-07
 */
CorrectClearanceBatchOutputWidget::CorrectClearanceBatchOutputWidget(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CorrectClearanceBatchOutputWidget)
{
    ui->setupUi(this);

    connect(ui->cancelButton,SIGNAL(clicked()),this,SLOT(close()));

    connect(ui->exportButton, SIGNAL(clicked()), this, SLOT(exportAll()));

    group = new QButtonGroup(this);
    group->addButton(ui->radioButton_500mm);
    group->addButton(ui->radioButton_1000mm);
    group->addButton(ui->radioButton_2000mm);
    group->addButton(ui->radioButton_5000mm);
    group->addButton(ui->radioButton_10000mm);

    group->setId(ui->radioButton_500mm, 0);
    group->setId(ui->radioButton_1000mm, 1);
    group->setId(ui->radioButton_2000mm, 2);
    group->setId(ui->radioButton_5000mm, 3);
    group->setId(ui->radioButton_10000mm, 4);

    ui->progressBar->setVisible(false);
}
Beispiel #3
0
MStatus polyExporter::writer(const MFileObject& file,
							 const MString& /*options*/,
							 MPxFileTranslator::FileAccessMode mode) 
//Summary:	saves a file of a type supported by this translator by traversing
//			the all or selected objects (depending on mode) in the current
//			Maya scene, and writing a representation to the given file
//Args   :	file - object containing the pathname of the file to be written to
//			options - a string representation of any file options 
//			mode - the method used to write the file - export, or export active
//				   are valid values; method will fail for any other values 
//Returns:	MStatus::kSuccess if the export was successful;
//			MStatus::kFailure otherwise
{
	#if defined (OSMac_)
		char nameBuffer[MAXPATHLEN];
		strcpy (nameBuffer, file.fullName().asChar());
		const MString fileName(nameBuffer);
	#else
		const MString fileName = file.fullName();
	#endif

	ofstream newFile(fileName.asChar(), ios::out);
	if (!newFile) {
		MGlobal::displayError(fileName + ": could not be opened for reading");
		return MS::kFailure;
	}
	newFile.setf(ios::unitbuf);

	writeHeader(newFile);

	//check which objects are to be exported, and invoke the corresponding
	//methods; only 'export all' and 'export selection' are allowed
	//
	if (MPxFileTranslator::kExportAccessMode == mode) {
		if (MStatus::kFailure == exportAll(newFile)) {
			return MStatus::kFailure;
		}
	} else if (MPxFileTranslator::kExportActiveAccessMode == mode) {
		if (MStatus::kFailure == exportSelection(newFile)) {
			return MStatus::kFailure;
		}
	} else {
		return MStatus::kFailure;
	}

	writeFooter(newFile);
	newFile.flush();
	newFile.close();

	MGlobal::displayInfo("Export to " + fileName + " successful!");
	return MS::kSuccess;
}
bool FiletransferPlugin::command(QString command, QList<QString> params)
{
    if(command.compare("export", Qt::CaseInsensitive) == 0)
    {
        if(params.length() != 1)
        {
            errorText = "Need one parameter, path to save to.";
            return false;
        }
        QDir f(params.at(0));
        if(!f.exists() && !f.mkpath("."))
        {
            errorText = "Failed to create directory " + params.at(0);
            return false;
        }
        return exportAll(params.at(0));
    }
    errorText = "Unknown command " + command;
    return false;
}
Beispiel #5
0
PopupEditorWidget::PopupEditorWidget(QWidget * par)
    : QWidget(par)
{
	m_bSaving = false;

	QGridLayout * l = new QGridLayout(this);
	QSplitter * spl = new QSplitter(Qt::Horizontal, this);
	spl->setObjectName("popupeditor_horizontal_splitter");
	spl->setChildrenCollapsible(false);
	l->addWidget(spl, 0, 0);

	KviTalVBox * box = new KviTalVBox(spl);

	m_pTreeWidget = new QTreeWidget(box);
	m_pTreeWidget->setHeaderLabel(__tr2qs_ctx("Popup", "editor"));
	m_pTreeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
	m_pTreeWidget->header()->setSortIndicatorShown(true);

	QPushButton * pb = new QPushButton(__tr2qs_ctx("&Export All to...", "editor"), box);
	connect(pb, SIGNAL(clicked()), this, SLOT(exportAll()));
	QPushButton * gn = new QPushButton(__tr2qs_ctx("&Export Selected to...", "editor"), box);
	connect(gn, SIGNAL(clicked()), this, SLOT(exportSelected()));

	m_pEditor = new SinglePopupEditor(spl);

	m_bOneTimeSetupDone = false;
	m_pLastEditedItem = nullptr;

	m_pContextPopup = new QMenu(this);
	m_pEmptyContextPopup = new QMenu(this);

	spl->setStretchFactor(0, 20);
	spl->setStretchFactor(1, 80);

	currentItemChanged(nullptr, nullptr);
}
Beispiel #6
0
bool Arguments::exportMeta() const
{
	return _parser.isSet("export-meta") || exportAll();
}
Beispiel #7
0
bool Arguments::exportPalettes() const
{
	return _parser.isSet("export-palette") || exportAll();
}