PreferencesDialog::PreferencesDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) { setupUi(this); // Setup buttons okButton = buttonBox->button(QDialogButtonBox::Ok); cancelButton = buttonBox->button(QDialogButtonBox::Cancel); applyButton = buttonBox->button(QDialogButtonBox::Apply); helpButton = buttonBox->button(QDialogButtonBox::Help); connect(applyButton, SIGNAL(clicked()), this, SLOT(apply())); connect(helpButton, SIGNAL(clicked()), this, SLOT(showHelp())); setWindowIcon(Images::icon("logo")); help_window = new QTextBrowser(this); help_window->setWindowFlags(Qt::Window); help_window->resize(300, 450); //help_window->adjustSize(); help_window->setWindowTitle(tr("SMPlayer2 - Help")); help_window->setWindowIcon(Images::icon("logo")); page_general = new PrefGeneral; addSection(page_general); page_drives = new PrefDrives; addSection(page_drives); page_performance = new PrefPerformance; addSection(page_performance); page_subtitles = new PrefSubtitles; addSection(page_subtitles); page_interface = new PrefInterface; addSection(page_interface); page_input = new PrefInput; addSection(page_input); page_playlist = new PrefPlaylist; addSection(page_playlist); page_tv = new PrefTV; addSection(page_tv); #if USE_ASSOCIATIONS page_associations = new PrefAssociations; addSection(page_associations); #endif page_advanced = new PrefAdvanced; addSection(page_advanced); sections->setCurrentRow(General); //adjustSize(); retranslateStrings(); }
seqan::ArgumentParser::ParseResult parseArgs(FxSamCoverageOptions & options, int argc, char const ** argv) { seqan::ArgumentParser parser("fx_sam_coverage"); setShortDescription(parser, "Read Coverage Computation."); setVersion(parser, "0.1"); setDate(parser, "August 2012"); addUsageLine(parser, "[\\fIOPTIONS\\fP] \\fB-o\\fP \\fIOUT.tsv\\fP \\fIGENOME.fa\\fP \\fIMAPPING.sam\\fP"); addDescription(parser, "Compute read coverage and C+G content for a genome."); // Two input files: Genome, and mapping. addArgument(parser, seqan::ArgParseArgument(seqan::ArgParseArgument::INPUTFILE)); setValidValues(parser, 0, "fasta fa"); addArgument(parser, seqan::ArgParseArgument(seqan::ArgParseArgument::INPUTFILE)); setValidValues(parser, 1, "sam"); // TODO(holtgrew): I want a custom help text! // addOption(parser, seqan::ArgParseOption("h", "help", "This helpful screen.")); addOption(parser, seqan::ArgParseOption("v", "verbose", "Verbose, log to STDERR.")); hideOption(parser, "verbose"); addOption(parser, seqan::ArgParseOption("vv", "very-verbose", "Very verbose, log to STDERR.")); hideOption(parser, "very-verbose"); addSection(parser, "Main Options"); addOption(parser, seqan::ArgParseOption("w", "window-size", "Set the size of the non-overlapping windows in base pairs.", seqan::ArgParseArgument::INTEGER, "NUM")); setDefaultValue(parser, "window-size", "10000"); addSection(parser, "Output Options"); addOption(parser, seqan::ArgParseOption("o", "out-path", "Path to the resulting file. If omitted, result is printed to stdout.", seqan::ArgParseArgument::OUTPUTFILE, "TSV")); setRequired(parser, "out-path"); setValidValues(parser, "out-path", "sam.coverage.tsv"); seqan::ArgumentParser::ParseResult res = parse(parser, argc, argv); if (res == seqan::ArgumentParser::PARSE_OK) { getArgumentValue(options.inGenomePath, parser, 0); getArgumentValue(options.inSamPath, parser, 1); getOptionValue(options.outPath, parser, "out-path"); if (isSet(parser, "verbose")) options.verbosity = 2; if (isSet(parser, "very-verbose")) options.verbosity = 3; } return res; }
//============================================================================== void PEFile::fixReservedData() { DWORD dirIndex = 0; for (dirIndex = 0; dirIndex < peHeaders.OptionalHeader.NumberOfRvaAndSizes; dirIndex++) { if (peHeaders.OptionalHeader.DataDirectory[dirIndex].VirtualAddress > 0 && peHeaders.OptionalHeader.DataDirectory[dirIndex].VirtualAddress >= reservedData.Offset && peHeaders.OptionalHeader.DataDirectory[dirIndex].VirtualAddress < reservedData.Size) { break; } } if (dirIndex == peHeaders.OptionalHeader.NumberOfRvaAndSizes) { return; } int sectionIndex = addSection(SECTION_RESERV, reservedData.Size, false); CopyMemory(sections[sectionIndex].RawData, reservedData.RawData, reservedData.Size); for (dirIndex = 0; dirIndex < peHeaders.OptionalHeader.NumberOfRvaAndSizes; dirIndex++) { if (peHeaders.OptionalHeader.DataDirectory[dirIndex].VirtualAddress > 0 && peHeaders.OptionalHeader.DataDirectory[dirIndex].VirtualAddress >= reservedData.Offset && peHeaders.OptionalHeader.DataDirectory[dirIndex].VirtualAddress < reservedData.Size) { peHeaders.OptionalHeader.DataDirectory[dirIndex].VirtualAddress += sectionTable[sectionIndex].VirtualAddress - reservedData.Offset; } } reservedData.Size = 0; }
//============================================================================== void PEFile::buildImportTable() { DWORD sizeDlls = 0; DWORD sizeFunctions = 0; DWORD sizeStrings = 0; DWORD newImportsSize = calcNewImportsSize(sizeDlls, sizeFunctions, sizeStrings); // we'll move the old dll list to the new import table, so we'll calc its size DWORD oldImportDllsSize = 0; PE_IMPORT_DLL* importDll = &this->importTable; while (importDll != NULL) { oldImportDllsSize += sizeof(IMAGE_IMPORT_DESCRIPTOR); importDll = importDll->Next; } // add a new section to handle the new import table int index = addSection(SECTION_IMPORT, oldImportDllsSize + newImportsSize, false); // copy old import dll list DWORD oldImportTableRVA = peHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress; DWORD oldImportTableOffset = rvaToOffset(oldImportTableRVA); CopyMemory(sections[index].RawData, peMemory + oldImportTableOffset, oldImportDllsSize); // copy new imports char* newImportsData = buildNewImports(sectionTable[index].VirtualAddress + oldImportDllsSize); CopyMemory(sections[index].RawData + oldImportDllsSize, newImportsData, newImportsSize); peHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress = sectionTable[index].VirtualAddress; peHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size = sectionTable[index].SizeOfRawData; peHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IAT].VirtualAddress = 0; peHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IAT].Size = 0; }
OptionsTiffImporter::OptionsTiffImporter(const QString &initialDirectory) : LabeledSectionGroup(NULL) { QWidget* pFileBrowserWidget = new QWidget(this); QLabel* pFileBrowserLabel = new QLabel("Select an ISD metadata file or leave blank for no ISD metadata:", pFileBrowserWidget); mpFilename = new FileBrowser(pFileBrowserWidget); mpFilename->setWhatsThis("<p>An ISD metadata file is an XML file shipped with some imagery such as Quickbird. " "It contains image metadata. If you have an ISD metadata file and would like to load " "it with the cube data, select it here. If you do not want to load an ISD metadata file, " "leave this field blank.</p>" "Currently, the following information is loaded from the ISD file:" "<ul><li>RPC00B" "<li>Image header information needed to use the RPC00B" "</ul>"); mpFilename->setBrowseCaption("ISD Metadata File"); mpFilename->setBrowseFileFilters("ISD Metadata Files (*.xml)"); mpFilename->setBrowseExistingFile(true); if (!initialDirectory.isEmpty()) { mpFilename->setBrowseDirectory(initialDirectory); } QGridLayout* pLayout = new QGridLayout(pFileBrowserWidget); pLayout->setMargin(0); pLayout->setSpacing(5); pLayout->addWidget(pFileBrowserLabel, 0, 0); pLayout->addWidget(mpFilename, 1, 0, 1, 2); pLayout->setColumnStretch(1, 5); LabeledSection* pFileBrowserSection = new LabeledSection(pFileBrowserWidget, "ISD Metadata File", this); // Initialization addSection(pFileBrowserSection); addStretch(10); setSizeHint(300, 50); }
HRESULT CCeeGen::getSectionCreate (const char *name, DWORD flags, CeeSection **section, short *sectionIdx) { if (strcmp(name, ".il") == 0) name = ".text"; else if (strcmp(name, ".meta") == 0) name = ".text"; else if (strcmp(name, ".rdata") == 0 && !m_encMode) name = ".text"; for (int i=0; i<m_numSections; i++) { if (strcmp((const char *)m_sections[i]->name(), name) == 0) { if (section) *section = m_sections[i]; if (sectionIdx) *sectionIdx = i; return S_OK; } } PESection *pewSect = NULL; HRESULT hr = m_peSectionMan->getSectionCreate(name, flags, &pewSect); TESTANDRETURNHR(hr); CeeSection *newSect = new CeeSection(*this, *pewSect); // if this fails, the PESection will get nuked in the destructor for CCeeGen TESTANDRETURN(newSect != NULL, E_OUTOFMEMORY); hr = addSection(newSect, sectionIdx); TESTANDRETURNHR(hr); if (section) *section = newSect; return S_OK; }
// If create is set to true, will create key if it does not exist bool CIniFile::SetValue(const string §ion, const string &key, const string &value, bool const create) { S32 sectionId = findSection(section); if(sectionId == noID) { if(create) sectionId = addSection(section); else return false; if(sectionId == noID) sectionId = findSection(section); if(sectionId == noID) // Fish in a tree? This should not be. return false; } S32 valueID = findKey(sectionId, key); if(valueID == noID) { if(!create) return false; sections[sectionId].keys.push_back(key); sections[sectionId].values.push_back(value); } else sections[sectionId].values[valueID] = value; return true; }
owl_section_handle OWLENTRY OWLSectionInit( owl_file_handle file, const char *name, owl_section_type type, owl_alignment align ) { //******************************************************************************************************************************** owl_section_handle section; section = _ClientAlloc( file, sizeof( owl_section_info ) ); section->file = file; section->name = OWLStringAdd( file->string_table, name ); section->type = type; section->align = align; section->buffer = ( type & OWL_SEC_ATTR_BSS ) ? NULL : OWLBufferInit( file ); section->linenum_buffer = NULL; section->num_linenums = 0; section->size = 0; section->location = 0; section->first_reloc = NULL; section->last_reloc = NULL; section->num_relocs = 0; section->comdat_sym = NULL; section->comdat_dep = NULL; addSection( file, section ); addSectionSymbol( section, name ); _Log(( file, "OWLSectionInit( %x, '%s', %x, %x ) -> %x\n", file, name, type, align, section )); return( section ); }
void Job::printSection(QString const& name, bool doPrint) { if (doPrint && m_sections.count(name) == 0) { // if we should print a section then there should be one there. addSection(KeywordSectionFactory(name)); } if (m_sections.count(name)) m_sections[name]->print(doPrint); }
SectionWidget* ContainerWidget::addSectionContent(const SectionContent::RefPtr& sc, SectionWidget* sw, DropArea area) { if (!sw) { if (_sections.isEmpty()) { // Create default section sw = newSectionWidget(); addSection(sw); } else if (area == CenterDropArea) // Use existing default section sw = _sections.first(); } // Drop it based on "area" InternalContentData data; data.content = sc; data.titleWidget = new SectionTitleWidget(sc, NULL); data.contentWidget = new SectionContentWidget(sc, NULL); #if QT_VERSION >= 0x050000 QObject::connect(data.titleWidget, &SectionTitleWidget::activeTabChanged, this, &ContainerWidget::onActiveTabChanged); #else QObject::connect(data.titleWidget, SIGNAL(activeTabChanged()), this, SLOT(onActiveTabChanged())); #endif return dropContent(data, sw, area, false); }
/** Writes a 'citation' node containing the metadata of one citation. @param sourceId: id of the article wich contains the citation @param referencedId: id of the referenced article/book @param context: context of the citation @param section: section where the citation is within the article */ void CitationsXMLGenerator::addCitation(int sourceId, int referencedId, const string &context, const CSection §ion) { addOpenningTag(aXMLFile, "citation"); addSourceArticleId(sourceId); addReferencedArticleId(referencedId); addContext(context); addSection(section); addClosingTag(aXMLFile, "citation"); }
void Job::copy(Job const& that) { destroy(); std::map<QString,KeywordSection*>::const_iterator iter; for (iter = that.m_sections.begin(); iter != that.m_sections.end(); ++iter) { addSection(iter->second->clone()); } // Make sure we have the necessary sections. std::map<QString,KeywordSection*>::iterator iter2; iter2 = m_sections.find("rem"); if (iter2 == m_sections.end()) addSection(new RemSection()); iter2 = m_sections.find("molecule"); if (iter2 == m_sections.end()) addSection(new MoleculeSection()); }
// Shared init code between derived classes, called by virtual Init() HRESULT CCeeGen::Init() // not-virtual, protected { // Public, Virtual init must create our SectionManager, and // Common init does the rest _ASSERTE(m_peSectionMan != NULL); HRESULT hr = S_OK; PESection *section = NULL; CeeSection *ceeSection = NULL; m_corHeader = NULL; m_numSections = 0; m_allocSections = 10; m_sections = new CeeSection * [ m_allocSections ]; if (m_sections == NULL) { hr = E_OUTOFMEMORY; goto LExit; } m_pTokenMap = NULL; m_fTokenMapSupported = FALSE; m_pRemapHandler = NULL; // These text section needs special support for handling string management now that we have // merged the sections together, so create it with an underlying CeeSectionString rather than the // more generic CeeSection hr = m_peSectionMan->getSectionCreate(".text", sdExecute, §ion); if (FAILED(hr)) { goto LExit; } ceeSection = new CeeSectionString(*this, *section); if (ceeSection == NULL) { hr = E_OUTOFMEMORY; goto LExit; } hr = addSection(ceeSection, &m_stringIdx); m_textIdx = m_stringIdx; m_metaIdx = m_textIdx; // meta section is actually in .text m_ilIdx = m_textIdx; // il section is actually in .text m_corHdrIdx = -1; m_encMode = FALSE; LExit: if (FAILED(hr)) { Cleanup(); } return hr; }
OptionsMovieExporter::OptionsMovieExporter() : LabeledSectionGroup(NULL) { // Resolution section mpResolutionWidget = new ViewResolutionWidget(this); mpResolutionWidget->setResolution(QSize(OptionsMovieExporter::getSettingWidth(), OptionsMovieExporter::getSettingHeight()), StringUtilities::fromXmlString<ResolutionType>( OptionsMovieExporter::getSettingResolutionType())); LabeledSection* pResolutionSection = new LabeledSection(mpResolutionWidget, "Output Resolution", this); // Playback section mpBitrateWidget = new BitrateWidget(this); mpBitrateWidget->setBitrate(OptionsMovieExporter::getSettingBitrate()); LabeledSection* pPlaybackSection = new LabeledSection(mpBitrateWidget, "Playback", this); // Advanced options section mpAdvancedWidget = new AdvancedOptionsWidget(this); mpAdvancedWidget->setMeMethod(OptionsMovieExporter::getSettingMeMethod()); mpAdvancedWidget->setGopSize(OptionsMovieExporter::getSettingGopSize()); mpAdvancedWidget->setQCompress(OptionsMovieExporter::getSettingQCompress()); mpAdvancedWidget->setQBlur(OptionsMovieExporter::getSettingQBlur()); mpAdvancedWidget->setQMinimum(OptionsMovieExporter::getSettingQMinimum()); mpAdvancedWidget->setQMaximum(OptionsMovieExporter::getSettingQMaximum()); mpAdvancedWidget->setQDiffMaximum(OptionsMovieExporter::getSettingQDiffMaximum()); mpAdvancedWidget->setMaxBFrames(OptionsMovieExporter::getSettingMaxBFrames()); mpAdvancedWidget->setBQuantFactor(OptionsMovieExporter::getSettingBQuantFactor()); mpAdvancedWidget->setBQuantOffset(OptionsMovieExporter::getSettingBQuantOffset()); mpAdvancedWidget->setDiaSize(OptionsMovieExporter::getSettingDiaSize()); mpAdvancedWidget->setOutputBufferSize(OptionsMovieExporter::getSettingOutputBufferSize()); mpAdvancedWidget->setFlags(OptionsMovieExporter::getSettingFlags()); LabeledSection* pAdvancedSection = new LabeledSection(mpAdvancedWidget, "Advanced Options", this); // Initialization addSection(pResolutionSection); addSection(pPlaybackSection); addSection(pAdvancedSection); addStretch(10); setSizeHint(450, 450); }
bool FQTermConfig::setItemValue(const QString &szSection, const QString &szItemName, const QString &szItemValue) { if (!hasSection(szSection)) if (!addSection(szSection)) { return false; } data[szSection][szItemName] = szItemValue; return true; }
/** Writes a 'section' node containing the metadata of one single section. @param section: section object with the metadata of a section */ void CitationsXMLGenerator::addSection(const CSection §ion) { addOpenningTag(aXMLFile, "section"); addSectionType(section.getSectionType()); addSectionTitle(section.getTitle()); if(section.getPSubSection()!=NULL) { addSection(*section.getPSubSection()); } addClosingTag(aXMLFile, "section"); }
MainPage::MainPage() : ui(new Ui::MainPage) { ui->setupUi(this); ui->sectionsTable->hideColumn(0); connect(ui->sectionsTable, SIGNAL(clicked(QModelIndex)), this, SLOT(showPhotos(QModelIndex))); connect(ui->photosList, SIGNAL(clicked(QModelIndex)), this, SLOT(showPhoto(QModelIndex))); connect(ui->addSectionButton, SIGNAL(clicked()), this, SIGNAL(addSection())); connect(ui->addPhotoButton, SIGNAL(clicked()), this, SIGNAL(addPhoto())); }
//returns the first section with a particular name void ConfFile::setEntry(const std::string& section, const std::string& key, const std::string& value) { ConfSection* sec = getSection(section); if(sec==0) { sec = addSection(section); } sec->setEntry(key, value); }
void IniFile::addValue(const std::string& Name, const std::string& Key, const std::string& Value) { addSection(Name); Section *S = (*this)[Name]; if(!isKey(Name, Key)) { S->insert(std::make_pair(Key, Value)); } else { (*S)[Key] = Value; } }
void QTodoLists::listMenuActivated(int id) { switch(id) { case MNID_ADD_SECTION: addSection(dynamic_cast<QTodoListViewItem*>(selectedItem())); break; default: break; } }
// For EnC mode, generate strings into .rdata section rather than .text section HRESULT CCeeGen::setEnCMode() { PESection *section = NULL; HRESULT hr = m_peSectionMan->getSectionCreate(".rdata", sdExecute, §ion); TESTANDRETURNHR(hr); CeeSection *ceeSection = new CeeSectionString(*this, *section); TESTANDRETURN(ceeSection != NULL, E_OUTOFMEMORY); hr = addSection(ceeSection, &m_stringIdx); if (SUCCEEDED(hr)) m_encMode = TRUE; return hr; }
bool ContainerWidget::showSectionContent(const SectionContent::RefPtr& sc) { // Search SC in floatings for (int i = 0; i < _floatings.count(); ++i) { FloatingWidget* fw = _floatings.at(i); const bool found = fw->content()->uid() == sc->uid(); if (!found) continue; fw->setVisible(true); fw->_titleWidget->setVisible(true); fw->_contentWidget->setVisible(true); emit sectionContentVisibilityChanged(sc, true); return true; } // Search SC in hidden sections // Try to show them in the last position, otherwise simply append // it to the first section (or create a new section?) if (_hiddenSectionContents.contains(sc->uid())) { const HiddenSectionItem hsi = _hiddenSectionContents.take(sc->uid()); hsi.data.titleWidget->setVisible(true); hsi.data.contentWidget->setVisible(true); SectionWidget* sw = NULL; if (hsi.preferredSectionId > 0 && (sw = SWLookupMapById(this).value(hsi.preferredSectionId)) != NULL) { sw->addContent(hsi.data, true); emit sectionContentVisibilityChanged(sc, true); return true; } else if (_sections.size() > 0 && (sw = _sections.first()) != NULL) { sw->addContent(hsi.data, true); emit sectionContentVisibilityChanged(sc, true); return true; } else { sw = newSectionWidget(); addSection(sw); sw->addContent(hsi.data, true); emit sectionContentVisibilityChanged(sc, true); return true; } } // Already visible? // TODO qWarning("Unable to show SectionContent, don't know where 8-/ (already visible?)"); return false; }
bool FQTermConfig::renameSection(const QString &szSection, const QString &szNewName) { if (hasSection(szNewName) || !hasSection(szSection)) { return false; } if (!addSection(szNewName)) { return false; } data[szNewName] = data[szSection]; return deleteSection(szSection); }
LayerAclMenu::LayerAclMenu(QWidget *parent) : QMenu(parent) { _lock = addAction(tr("Lock this layer")); _lock->setCheckable(true); addSection(tr("Exclusive access:")); _allusers = addAction(tr("Everyone can draw")); _allusers->setCheckable(true); _allusers->setChecked(true); connect(this, SIGNAL(triggered(QAction*)), this, SLOT(userClicked(QAction*))); }
MovieExportOptionsWidget::MovieExportOptionsWidget() : LabeledSectionGroup(NULL) { // Resolution section mpResolutionWidget = new ViewResolutionWidget(this); LabeledSection* pResolutionSection = new LabeledSection(mpResolutionWidget, "Output Resolution", this); // Playback section QWidget* pPlaybackWidget = new QWidget(this); mpBitrateWidget = new BitrateWidget(pPlaybackWidget); mpFramerateWidget = new FramerateWidget(pPlaybackWidget); QVBoxLayout* pPlaybackLayout = new QVBoxLayout(pPlaybackWidget); pPlaybackLayout->setMargin(0); pPlaybackLayout->setSpacing(10); pPlaybackLayout->addWidget(mpBitrateWidget); pPlaybackLayout->addWidget(mpFramerateWidget); LabeledSection* pPlaybackSection = new LabeledSection(pPlaybackWidget, "Playback", this); // Subset section mpSubsetWidget = new AnimationFrameSubsetWidget(this); LabeledSection* pSubsetSection = new LabeledSection(mpSubsetWidget, "Export Subset", this); // Advanced options section mpAdvancedWidget = new AdvancedOptionsWidget(this); LabeledSection* pAdvancedSection = new LabeledSection(mpAdvancedWidget, "Advanced Options", this); pAdvancedSection->collapse(); // Initialization addSection(pResolutionSection); addSection(pPlaybackSection); addSection(pSubsetSection); addSection(pAdvancedSection); addStretch(10); setSizeHint(455, 450); }
DevSettings::DevSettings() { s = this; layout_ = new QGridLayout(); numWidgets_ = 0; addSection("Cutting"); createCheckBox("reverse cut", false); createCheckBox("mobius cut", false); addSection("Inbetweening"); createCheckBox("inverse direction", false); addSection("Rendering"); createCheckBox("draw edge orientation", false); createSpinBox("num sub", 0, 10, 2); createDoubleSpinBox("ds", 0, 10, 2); setLayout(layout_); }
// Parse a single line of the INI file and break it into its component bits void CIniFile::processLine(string line) // Pass by value { string k, v; string key, value; string::size_type pLeft, pRight; // line = _TCHAR(l.c_str()); // To be compatible with Win32, check for existence of '\r'. // Win32 files have the '\r' at the end of a line, and Unix files don't. // Note that the '\r' will be written to INI files from // Unix so that the created INI file can be read under Win32 // without change. if((line.length() > 0) && line[line.length() - 1] == '\r') line = line.substr(0, line.length() - 1); if(line.length()) { if((pLeft = line.find_first_of(";#[=")) != string::npos) { switch (line[pLeft]) { case '[': // Section if((pRight = line.find_last_of("]")) != string::npos && pRight > pLeft) { section = line.substr(pLeft + 1, pRight - pLeft - 1); addSection(section); } break; case '=': // Key = Value pair key = line.substr(0, pLeft); value = line.substr(pLeft + 1); k = key.c_str(); v = value.c_str(); k = trim(k, " "); v = trim(v, " "); SetValue(section, k, v); break; case ';': // Comments case '#': if(!sectionNames.size()) headerComment(line.substr(pLeft + 1)); else sectionComment(section, line.substr(pLeft + 1)); break; } } } }
ServiceSection::ServiceSection(QWidget *parent) : QWidget(parent), ui(new Ui::ServiceSection) { ui->setupUi(this); this->setWindowFlags(Qt::Window | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::CustomizeWindowHint); this->setWindowTitle(tr("Услуги")); model = new QSqlTableModel(this); model->setTable("services"); model->setEditStrategy(QSqlTableModel::OnManualSubmit); this->selectData(); proxy = new QSortFilterProxyModel(this); proxy->setSourceModel(model); menu = new QMenu(); menu->addAction("Содержание...", this, SLOT(openSection()), Qt::Key_Enter); menu->addAction("Изменить...", this, SLOT(editSection()), Qt::CTRL + Qt::Key_U); menu->addAction("Добавить...", this, SLOT(addSection()), Qt::CTRL + Qt::Key_A); menu->addAction("Удалить...", this, SLOT(deleteSection()), Qt::CTRL + Qt::Key_D); connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(openSection())); settings = Settings::getInstance(); this->restoreGeometry(settings->value("serviceSectionDialog/geometry").toByteArray()); ui->tableView->setModel(proxy); ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows); ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection); ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->tableView->setContextMenuPolicy(Qt::CustomContextMenu); ui->tableView->setSortingEnabled(true); ui->tableView->sortByColumn(1, Qt::AscendingOrder); ui->tableView->resizeColumnsToContents(); ui->tableView->horizontalHeader()->setStretchLastSection(true); ui->tableView->verticalHeader()->hide(); ui->tableView->hideColumn(0); ui->tableView->hideColumn(2); ui->tableView->hideColumn(3); ui->tableView->selectRow(0); ui->tableView->setFocus(); }
OptionsTiffImporter::OptionsTiffImporter(QWidget* pParent) : LabeledSectionGroup(pParent), mpDescriptor(NULL) { QWidget* pFileBrowserWidget = new QWidget(this); QLabel* pFileBrowserLabel = new QLabel("Select an ISD metadata file or leave blank for no ISD metadata:", pFileBrowserWidget); mpFilename = new FileBrowser(pFileBrowserWidget); mpFilename->setWhatsThis("<p>An ISD metadata file is an XML file shipped with some imagery such as Quickbird. " "It contains image metadata. If you have an ISD metadata file and would like to load it with the cube data, " "select it here. If you do not want to load an ISD metadata file, leave this field blank.</p>" "Currently, the following information is loaded from the ISD file:" "<ul><li>RPC00B" "<li>Image header information needed to use the RPC00B" "</ul>"); mpFilename->setBrowseCaption("Select ISD Metadata File"); mpFilename->setBrowseFileFilters("ISD Metadata Files (*.xml)"); mpFilename->setBrowseExistingFile(true); QGridLayout* pLayout = new QGridLayout(pFileBrowserWidget); pLayout->setMargin(0); pLayout->setSpacing(5); pLayout->addWidget(pFileBrowserLabel, 0, 0); pLayout->addWidget(mpFilename, 1, 0, 1, 2); pLayout->setColumnStretch(1, 5); LabeledSection* pFileBrowserSection = new LabeledSection(pFileBrowserWidget, "ISD Metadata File", this); // Layout QWidget* pWidget = widget(); if (pWidget != NULL) { QLayout* pLayout = pWidget->layout(); if (pLayout != NULL) { pLayout->setMargin(10); } } // Initialization addSection(pFileBrowserSection); addStretch(10); setSizeHint(300, 50); // Connections VERIFYNR(connect(mpFilename, SIGNAL(filenameChanged(const QString&)), this, SLOT(loadIsdMetadata(const QString&)))); }
OptionsPngExporter::OptionsPngExporter() : LabeledSectionGroup(NULL) { // Resolution section mpResolutionWidget = new ResolutionWidget(this); LabeledSection* pResolutionSection = new LabeledSection(mpResolutionWidget, "Image Size", this); mpResolutionWidget->setAspectRatioLock(OptionsPngExporter::getSettingAspectRatioLock()); mpResolutionWidget->setResolution(OptionsPngExporter::getSettingOutputWidth(), OptionsPngExporter::getSettingOutputHeight()); mpResolutionWidget->setUseViewResolution(OptionsPngExporter::getSettingUseViewResolution()); // Initialization addSection(pResolutionSection); addStretch(10); setSizeHint(350, 150); }