void ImageParameterDefinition::onCaptureClicked()
    {
        ScreenshotWizard screenshotWizard(mScript, false, mParent);

        screenshotWizard.setWindowFlags(screenshotWizard.windowFlags() | Qt::WindowContextHelpButtonHint);

        if(screenshotWizard.exec() == QDialog::Accepted)
        {
            switch(screenshotWizard.saveTarget())
            {
            case ScreenshotWizard::ResourceSaveTarget:
                fileEdit()->setText("$" + screenshotWizard.resourceOrFilename());
                break;
            case ScreenshotWizard::FileSaveTarget:
                fileEdit()->setText(screenshotWizard.resourceOrFilename());
                break;
            default:
                return;
            }
        }
    }
示例#2
0
void SectorEditDialog::OnOpenFile(void)
{
    DEFileDialog fileDialog(this);

    if (fileDialog.DoModal() == IDOK) {
        SectorFileEditDialog fileEdit(this, this);
        A2File* pFile;
        A2FileDescr* pOpenFile = NULL;
        DIError dierr;

        dierr = OpenFile(fileDialog.fName, fileDialog.fOpenRsrcFork != 0,
                    &pFile, &pOpenFile);
        if (dierr != kDIErrNone)
            return;

        fileEdit.SetupFile(fileDialog.fName, fileDialog.fOpenRsrcFork != 0,
            pFile, pOpenFile);
        fileEdit.SetPositionShift(8);
        (void) fileEdit.DoModal();

        pOpenFile->Close();
    }
}