Exemplo n.º 1
0
// private slot
void GUI_Player::about(bool b)
{
    Q_UNUSED(b);

    QString version = m_settings->getVersion();
    QString link = Helper::createLink("http://www.lesbonscomptes.com/upplay");

    QMessageBox infobox(this);
    infobox.setParent(this);
    QPixmap p =  QPixmap(Helper::getIconPath("logo.png")).
        scaled(150, 150, Qt::KeepAspectRatio, Qt::SmoothTransformation);
    infobox.setIconPixmap(p);
    infobox.setWindowFlags(Qt::Dialog);
    infobox.setModal(true);

    infobox.setWindowTitle(tr("About Upplay"));
    infobox.setText("<b><font size=\"+2\">Upplay Player " + 
                    version + "</font></b>");
    infobox.setInformativeText(
        QString("") +
        UPnPP::LibUPnP::versionString().c_str() + "<br/>" +
        tr("Based on Sayonara, written by Lucio Carreras") + "<br />" +
        tr("License") + ": GPL<br />" +
        "Copyright 2011-2013<br /><br />" + link + "<br /><br />"
        );
    infobox.setStandardButtons(QMessageBox::Ok);
    infobox.button(QMessageBox::Ok)->setFocusPolicy(Qt::NoFocus);
    infobox.exec();
}
Exemplo n.º 2
0
boolean read_event_definitions (char *filename)
{
    char tmpbuf [128];

    initialize_events();

    s_elog_hfp = fopen (filename, "rt");
    if (s_elog_hfp == NULL) {
        sprintf (tmpbuf, "Couldn't open %s\n", filename);
        infobox ("Open Failed", tmpbuf);
        return(FALSE);
    }
    /* Presume "elog.h".  Note fallthrough... */
    if (read_header_files()) {
        sort_event_definitions();
        create_point_selector();
        recompute_ps_vscrollbar();
        fclose(s_elog_hfp);
        view1_display_when_idle();
        remove_needed = TRUE;
        return(TRUE);
    }
    fclose(s_elog_hfp);

    s_hfp = fopen (filename, "rt");
    if (s_hfp == NULL) {
        sprintf (tmpbuf, "Couldn't open %s\n", filename);
        infobox ("Read Event Definition Failure", tmpbuf);
        return(FALSE);
    }

    read_header_file();

    /* Happens if the user feeds us the wrong file, for example */
    if (g_neventdefs == 0) {
        sprintf (tmpbuf, "No event definitions found in %s\n", filename);
        infobox ("No Event Definitions?", tmpbuf);
        return(FALSE);
    }
    finalize_events();
    return(TRUE);
}
Exemplo n.º 3
0
static int dwiz_make_changes (DATASET *dwinfo, dw_opts *opts,
			      GtkWidget *dlg)
{
    gchar *setobs_cmd = NULL;
    gretlopt opt = OPT_NONE;
    int create = (opts->flags & DW_CREATE);
    int delmiss = (opts->flags & DW_DROPMISS);
    int delete_markers = 0;
    int err = 0;

#if DWDEBUG
    fprintf(stderr, "dwiz_make_changes: create = %d\n", create);
#endif

    /* preliminaries */
    if (time_series(dwinfo)) {
	ntodate(dwinfo->stobs, dwinfo->t1, dwinfo);
    } else if (known_panel(dwinfo)) {
	if (!dataset_is_panel(dataset)) {
	    /* Turning a subset of a non-panel dataset into a panel:
	       this change will be irreversible */
	    maybe_unrestrict_dataset();
	}
    }

    /* special: reorganizing dataset based on panel index vars */
    if (dwinfo->structure == PANEL_UNKNOWN) {
	int uv, tv;

	err = translate_panel_vars(opts, &uv, &tv);
	if (!err) {
	    err = set_panel_structure_from_vars(uv, tv, dataset);
	}
	if (!err) {
	    setobs_cmd = g_strdup_printf("setobs %s %s --panel-vars",
					 dataset->varname[uv],
					 dataset->varname[tv]);
	}
	goto finalize;
    }

    /* check for nothing to be done */
    if (dwinfo->structure == dataset->structure &&
	dwinfo->pd == dataset->pd &&
	strcmp(dwinfo->stobs, dataset->stobs) == 0) {
	if (create || delmiss) {
	    /* recording? */
	    goto finalize;
	} else {
	    infobox(_("No changes were made"));
	    return 0;
	}
    }

    /* if converting to time series, we probably don't want to
       retain any original observation-marker strings */
    if (dwinfo->structure == TIME_SERIES && 
	dataset->markers && !delmiss) {
	delete_markers = 1;
    }

    /* handle panel structure */
    if (known_panel(dwinfo)) {
	int nunits = dwinfo->t1;
	int nperiods = dataset->n / nunits;

	/* we don't offer a choice of "starting obs" */
	dwinfo->pd = (dwinfo->structure == STACKED_TIME_SERIES)? 
	    nperiods : nunits;
	strcpy(dwinfo->stobs, "1.1");
    } 

    /* handle conversion to cross-section */
    if (dwinfo->structure == CROSS_SECTION) {
	strcpy(dwinfo->stobs, "1");
    }

    if (dwinfo->structure == TIME_SERIES) {
	opt = OPT_T;
    } else if (dwinfo->structure == STACKED_TIME_SERIES) {
	opt = OPT_S;
    } else if (dwinfo->structure == STACKED_CROSS_SECTION) {
	opt = OPT_C;
    } else if (dwinfo->structure == CROSS_SECTION) {
	opt = OPT_X;
    } else if (dwinfo->structure == SPECIAL_TIME_SERIES) {
	opt = OPT_N;
    }

    err = simple_set_obs(dataset, dwinfo->pd, dwinfo->stobs, opt);

#if DWDEBUG
    fprintf(stderr, "pd=%d, stobs='%s', opt=%d; set_obs returned %d\n", 
	    dwinfo->pd, dwinfo->stobs, opt, err);
#endif

    if (!err && setobs_cmd == NULL) {
	setobs_cmd = g_strdup_printf("setobs %d %s%s",
				     dwinfo->pd, dwinfo->stobs, 
				     print_flags(opt, SETOBS));
    }

 finalize:

    if (!err && delmiss) {
	err = dataset_purge_missing_rows(dataset);
    }

    if (err) {
	gui_errmsg(err);
    } else if (create) {
	if (opts->flags & DW_SSHEET) {
	    gtk_widget_hide(dlg);
	    maybe_start_editing();
	} else {
	    register_data(NULLDATA_STARTED);
	    lib_command_sprintf("nulldata %d", dataset->n);
	    record_command_verbatim();
	}
    } else {
	if (delete_markers) {
	    dataset_destroy_obs_markers(dataset);
	}
	mark_dataset_as_modified();
    }

    if (!err && setobs_cmd != NULL) {
	lib_command_strcpy(setobs_cmd);
	record_command_verbatim();
    }

    g_free(setobs_cmd);

#if DWDEBUG
    fprintf(stderr, "dwiz_make_changes: returning %d\n", err);
#endif

    return err;
}