Example #1
0
static int real_display_gpage (void)
{
    char *fname;
    int err = 0;

    if (gpage.term == GP_TERM_PDF) {
	fname = gpage_fname(".pdf", 0);
    } else {
	fname = gpage_fname(".ps", 0);
    }

#if defined(G_OS_WIN32)
    err = win32_open_file(fname);
#elif defined(OS_OSX)
    err = osx_open_file(fname);
#else
    if (gpage.term == GP_TERM_PDF) {
	err = gretl_fork("viewpdf", fname, NULL);
    } else {
	err = gretl_fork("viewps", fname, NULL);
    }
#endif

    return err;
}
Example #2
0
int CaptureFileDialog::exec() {
    GString *file_name = g_string_new(m_fileName.toUtf8().constData());
    GString *display_filter = g_string_new(m_displayFilter.toUtf8().constData());
    gboolean wof_status;

    wof_status = win32_open_file(parentWidget()->effectiveWinId(), file_name, display_filter);
    m_fileName.clear();
    m_fileName.append(QString::fromUtf8(file_name->str));
    m_displayFilter.clear();
    m_displayFilter.append(QString::fromUtf8(display_filter->str));

    g_string_free(file_name, TRUE);
    g_string_free(display_filter, TRUE);

    return (int) wof_status;
}