Ejemplo n.º 1
0
KexiWindowData* KexiReportPart::createWindowData(KexiWindow* window)
{
    kDebug();
    const QString document( loadReport(window->partItem()->name()) );
    KexiReportPart::TempData *td = new KexiReportPart::TempData(window);
    td->document = document;
    td->name = window->partItem()->name();
    return td;
}
Ejemplo n.º 2
0
std::vector<UInt8>* BattleReport::operator[]( UInt32 id )
{
	FastMutex::ScopedLock lk(_mutex);
	std::map<UInt32, std::vector<UInt8> >::iterator it = _reports.find(id);
	if(it == _reports.end())
    {
        std::vector<UInt8> v;
        loadReport(id, v);
        if(!v.empty())
            _reports[id] = v;
        return &(_reports[id]);
    }
    else if(it->second.empty())
	{
		loadReport(id, it->second);
		if(it->second.empty())
		{
			_reports.erase(it);
			return NULL;
		}
	}
	return &it->second;
}
Ejemplo n.º 3
0
int main(int argc, char *argv[]) {
    bool useGui = true;
#if defined(Q_OS_UNIX) && defined(Q_WS_X11)
    useGui = (XOpenDisplay(NULL) != NULL);
#endif

    QApplication a(argc, argv, useGui);
    Q_UNUSED(a);

#ifdef Q_OS_MAC
    // A workaround to avoid using non-bundled plugins
    QCoreApplication::removeLibraryPath(QLibraryInfo::location(QLibraryInfo::PluginsPath));
    QCoreApplication::addLibraryPath("../PlugIns");
#endif

    const QString message = loadReport(argc, argv);
    const QString dumpUrl = Utils::getDumpUrl();
    bool silentSending = Utils::hasSilentModeFlag();

    if (silentSending) {
        ReportSender sender(true);
        sender.setFailedTest(Utils::getFailedTestName());
        sender.parse(message, dumpUrl);
        sender.send("", dumpUrl);
        return 0;
    }


    if (useGui) {
        SendReportDialog dlg(message, dumpUrl);
        dlg.setWindowIcon(QIcon(":ugenem/images/crash_icon.png"));
        dlg.exec();
    } else {
        QTextStream stream(stdin);
        printf("UGENE crashed. Would you like to send crash report to developer team? (y/n)\n");
        const QString str = stream.readLine();
        printf("\n%s", str.toUtf8().data());

        if (str == "y" || str == "Y") {
            ReportSender sender;
            sender.parse(message, dumpUrl);
            sender.send("", dumpUrl);
        }
    }

    return 0;
}
Ejemplo n.º 4
0
void CrashHandler::loadReport(void)
{
    QFileDialog file_dlg;

    try
    {
        file_dlg.setNameFilter(trUtf8("pgModeler crash report (*.crash);;All files (*.*)"));
        file_dlg.setWindowIcon(QPixmap(QString(":/icones/icones/pgsqlModeler48x48.png")));
        file_dlg.setWindowTitle(trUtf8("Load report"));
        file_dlg.setFileMode(QFileDialog::ExistingFiles);
        file_dlg.setAcceptMode(QFileDialog::AcceptOpen);

        if(file_dlg.exec()==QFileDialog::Accepted)
            loadReport(file_dlg.selectedFiles().at(0));
    }
    catch(Exception &e)
    {
        Messagebox msgbox;
        msgbox.show(e);
    }
}
Ejemplo n.º 5
0
void CrashHandlerForm::loadReport(void)
{
  QFileDialog file_dlg;

	try
	{
    file_dlg.setNameFilter(trUtf8("pgModeler bug report (*.bug);;All files (*.*)"));
		file_dlg.setWindowTitle(trUtf8("Load report"));
		file_dlg.setFileMode(QFileDialog::ExistingFiles);
		file_dlg.setAcceptMode(QFileDialog::AcceptOpen);

		if(file_dlg.exec()==QFileDialog::Accepted)
    {
			loadReport(file_dlg.selectedFiles().at(0));
      input_edt->setText(file_dlg.selectedFiles().at(0));
    }
	}
	catch(Exception &e)
	{
		Messagebox msgbox;
		msgbox.show(e);
  }
}