void ReportWindow::setReportDescription(const QString & str) { if(_descr != str) { _descr = str; setModified(TRUE); } }
///////////////////////////////////////////////////////// // variable // void GEMglIndexdv :: cMess (t_float arg0) { // FUN c[0]=static_cast<GLdouble>(arg0); setModified(); }
void TabDeckEditor::finishedUpdatingPrices() { deckModel->pricesUpdated(); setModified(true); aUpdatePrices->setDisabled(false); }
void LayerVector::setView(QMatrix view) { myView = view; setModified(true); }
void GEMglTranslated :: zMess (t_float arg1) { // FUN z = static_cast<GLdouble>(arg1); setModified(); }
void TabDeckEditor::updateName(const QString &name) { deckModel->getDeckList()->setName(name); setModified(true); }
///////////////////////////////////////////////////////// // Variables // void GEMglColor3b :: redMess (t_float arg1) { // FUN red = static_cast<GLbyte>(arg1); setModified(); }
void GEMglVertex2s :: yMess (t_float arg1) // FUN { y = static_cast<GLshort>(arg1); setModified(); }
void GEMglTexParameterf :: paramMess (t_float arg1) { // FUN param = static_cast<GLfloat>(arg1); setModified(); }
void MdiChild::generalEdit() { GeneralEdit *t = new GeneralEdit(this, radioData, GetCurrentFirmware()/*firmware*/); connect(t, SIGNAL(modified()), this, SLOT(setModified())); t->show(); }
void GEMglTexParameterf :: pnameMess (t_float arg1) { // FUN pname = static_cast<GLenum>(arg1); setModified(); }
void GEMglPixelTransferf :: paramMess (t_float arg1) { // FUN param = static_cast<GLfloat>(arg1); setModified(); }
///////////////////////////////////////////////////////// // Variables // void GEMglPixelTransferf :: pnameMess (t_float arg1) { // FUN pname = static_cast<GLenum>(arg1); setModified(); }
void GEMglCopyPixels :: heightMess (t_float arg1) { // FUN height = static_cast<GLsizei>(arg1); setModified(); }
void GEMglColor3b :: greenMess (t_float arg1) { // FUN green = static_cast<GLbyte>(arg1); setModified(); }
void GEMglCopyPixels :: typeMess (t_float arg1) { // FUN type = static_cast<GLenum>(arg1); setModified(); }
void GEMglColor3b :: blueMess (t_float arg1) { // FUN blue = static_cast<GLbyte>(arg1); setModified(); }
void GEMglRects :: y2Mess (t_float arg1) { // FUN y2 = static_cast<GLshort>(arg1); setModified(); }
///////////////////////////////////////////////////////// // Variables // void GEMglFogi :: pnameMess (t_float arg1) { // FUN pname = static_cast<GLenum>(arg1); setModified(); }
/* ChasmBinArchive::open * Reads Chasm bin format data from a MemChunk * Returns true if successful, false otherwise *******************************************************************/ bool ChasmBinArchive::open(MemChunk& mc) { // Check given data is valid if (mc.getSize() < HEADER_SIZE) { return false; } // Read .bin header and check it char magic[4] = {}; mc.read(magic, sizeof magic); if ( magic[0] != 'C' || magic[1] != 'S' || magic[2] != 'i' || magic[3] != 'd') { wxLogMessage("ChasmBinArchive::open: Opening failed, invalid header"); Global::error = "Invalid Chasm bin header"; return false; } // Stop announcements (don't want to be announcing modification due to entries being added etc) setMuted(true); uint16_t num_entries = 0; mc.read(&num_entries, sizeof num_entries); num_entries = wxUINT16_SWAP_ON_BE(num_entries); // Read the directory theSplashWindow->setProgressMessage("Reading Chasm bin archive data"); for (uint16_t i = 0; i < num_entries; ++i) { // Update splash window progress theSplashWindow->setProgress(static_cast<float>(i) / num_entries); // Read entry info char name[NAME_SIZE] = {}; mc.read(name, sizeof name); uint32_t size; mc.read(&size, sizeof size); size = wxUINT32_SWAP_ON_BE(size); uint32_t offset; mc.read(&offset, sizeof offset); offset = wxUINT32_SWAP_ON_BE(offset); // Check offset+size if (offset + size > mc.getSize()) { wxLogMessage("ChasmBinArchive::open: Bin archive is invalid or corrupt (entry goes past end of file)"); Global::error = "Archive is invalid and/or corrupt"; setMuted(false); return false; } // Convert Pascal to zero-terminated string memmove(name, name + 1, sizeof name - 1); name[sizeof name - 1] = '\0'; // Create entry ArchiveEntry* const entry = new ArchiveEntry(name, size); entry->exProp("Offset") = static_cast<int>(offset); entry->setLoaded(false); entry->setState(0); getRoot()->addEntry(entry); } // Detect all entry types theSplashWindow->setProgressMessage("Detecting entry types"); vector<ArchiveEntry*> all_entries; getEntryTreeAsList(all_entries); MemChunk edata; for (size_t i = 0; i < all_entries.size(); ++i) { // Update splash window progress theSplashWindow->setProgress(static_cast<float>(i) / num_entries); // Get entry ArchiveEntry* const entry = all_entries[i]; // Read entry data if it isn't zero-sized if (entry->getSize() > 0) { // Read the entry data mc.exportMemChunk(edata, static_cast<int>(entry->exProp("Offset")), entry->getSize()); entry->importMemChunk(edata); } // Detect entry type EntryType::detectEntryType(entry); FixBrokenWave(entry); // Unload entry data if needed if (!archive_load_data) { entry->unloadData(); } // Set entry to unchanged entry->setState(0); } // Setup variables setMuted(false); setModified(false); announce("opened"); theSplashWindow->setProgressMessage(""); return true; }
void GEMglFogi :: paramMess (t_float arg1) { // FUN param = static_cast<GLint>(arg1); setModified(); }
void TabDeckEditor::updateComments() { deckModel->getDeckList()->setComments(commentsEdit->toPlainText()); setModified(true); }
void GEMglTranslatef :: yMess (t_float arg1) { // FUN y = static_cast<GLfloat>(arg1); setModified(); }
///////////////////////////////////////////////////////// // variable // void GEMglRasterPos2fv :: vMess (t_float arg0, t_float arg1) { // FUN v[0]=static_cast<GLfloat>(arg0); v[1]=static_cast<GLfloat>(arg1); setModified(); }
void GEMglCopyPixels :: yMess (t_float arg1) { // FUN y = static_cast<GLint>(arg1); setModified(); }
bool ReportWindow::saveToDb() { // do what we need to do DBFileDialog rptDiag; rptDiag.setCaption(tr("Save Report to Database")); if(!dbRecordName.isEmpty()) { rptDiag._name->setText(dbRecordName); } else { rptDiag._name->setText(reportName()); } rptDiag._grade->setValue(dbRecordGrade); if(rptDiag.exec() == QDialog::Accepted) { QString name = rptDiag.getName(); QString desc = reportDescription(); QString src = document().toString(); int grade = rptDiag.getGrade(); XSqlQuery q; XSqlQuery qry; q.prepare("SELECT report_id " " FROM report " " WHERE ((report_name=:report_name) " " AND (report_grade=:report_grade)); "); q.bindValue(":report_name", name); q.bindValue(":report_grade", grade); q.exec(); if(q.first()) { // update old record qry.prepare("UPDATE report " " SET report_source=:report_source, " " report_descrip=:report_descrip " " WHERE (report_id=:report_id);"); qry.bindValue(":report_source", src); qry.bindValue(":report_descrip", desc); qry.bindValue(":report_id", q.value("report_id").toInt()); } else { // insert new record qry.prepare("INSERT INTO report " " (report_name, report_source, report_descrip, report_grade) " "VALUES (:report_name, :report_source, :report_descrip, :report_grade);"); qry.bindValue(":report_name", name); qry.bindValue(":report_source", src); qry.bindValue(":report_descrip", desc); qry.bindValue(":report_grade", grade); } if(qry.exec()) { lastSaveToDb = TRUE; setModified(FALSE); dbRecordName = name; dbRecordGrade = grade; if(_handler) { q.exec(); if(q.first()) _handler->sReportsChanged(q.value("report_id").toInt(), true); else _handler->sReportsChanged(-1, true); } return TRUE; } else { // no good lets tell the user QSqlError sqlErr = qry.lastError(); QMessageBox::critical(this,tr("Error saving to database"),sqlErr.databaseText()); } } return FALSE; }
void GEMglCopyPixels :: widthMess (t_float arg1) { // FUN width = static_cast<GLsizei>(arg1); setModified(); }
void ReportWindow::setReportName(const QString & str) { if(_name != str) { _name = str; setModified(TRUE); } }
/* LfdArchive::open * Reads lfd format data from a MemChunk * Returns true if successful, false otherwise *******************************************************************/ bool LfdArchive::open(MemChunk& mc) { // Check data was given if (!mc.hasData()) return false; // Check size if (mc.getSize() < 16) return false; // Check magic header if (mc[0] != 'R' || mc[1] != 'M' || mc[2] != 'A' || mc[3] != 'P') return false; // Get directory length uint32_t dir_len = 0; mc.seek(12, SEEK_SET); mc.read(&dir_len, 4); dir_len = wxINT32_SWAP_ON_BE(dir_len); // Check size if ((unsigned)mc.getSize() < (dir_len) || dir_len % 16) return false; // Guess number of lumps uint32_t num_lumps = dir_len / 16; // Stop announcements (don't want to be announcing modification due to entries being added etc) setMuted(true); // Read each entry theSplashWindow->setProgressMessage("Reading lfd archive data"); size_t offset = dir_len + 16; size_t size = mc.getSize(); for (uint32_t d = 0; offset < size; d++) { // Update splash window progress theSplashWindow->setProgress(((float)d / (float)num_lumps)); // Read lump info uint32_t length = 0; char type[5] = ""; char name[9] = ""; mc.read(type, 4); // Type mc.read(name, 8); // Name mc.read(&length, 4); // Size name[8] = '\0'; type[4] = 0; // Move past the header offset += 16; // Byteswap values for big endian if needed length = wxINT32_SWAP_ON_BE(length); // If the lump data goes past the end of the file, // the gobfile is invalid if (offset + length > size) { wxLogMessage("LfdArchive::open: lfd archive is invalid or corrupt"); Global::error = "Archive is invalid and/or corrupt"; setMuted(false); return false; } // Create & setup lump wxFileName fn(name); fn.SetExt(type); ArchiveEntry* nlump = new ArchiveEntry(fn.GetFullName(), length); nlump->setLoaded(false); nlump->exProp("Offset") = (int)offset; nlump->setState(0); // Add to entry list getRoot()->addEntry(nlump); // Move to next entry offset += length; mc.seek(offset, SEEK_SET); } if (num_lumps != numEntries()) wxLogMessage("Warning: computed %i lumps, but actually %i entries", num_lumps, numEntries()); // Detect all entry types MemChunk edata; theSplashWindow->setProgressMessage("Detecting entry types"); for (size_t a = 0; a < numEntries(); a++) { // Update splash window progress theSplashWindow->setProgress((((float)a / (float)num_lumps))); // Get entry ArchiveEntry* entry = getEntry(a); // Read entry data if it isn't zero-sized if (entry->getSize() > 0) { // Read the entry data mc.exportMemChunk(edata, getEntryOffset(entry), entry->getSize()); entry->importMemChunk(edata); } // Detect entry type EntryType::detectEntryType(entry); // Unload entry data if needed if (!archive_load_data) entry->unloadData(); // Set entry to unchanged entry->setState(0); } // Setup variables setMuted(false); setModified(false); announce("opened"); theSplashWindow->setProgressMessage(""); return true; }