// // Save // ==== // // Save the information for this object to the AuditDataFile // bool CLocaleScanner::SaveData (CAuditDataFile* pAuditDataFile) { CLogFile log; log.Write("CLocaleScanner::SaveData Start" ,true); CString strValue; // Add the Category for memory CAuditDataFileCategory category(HARDWARE_CLASS); // Each audited item gets added an a CAuditDataFileItem to the category CAuditDataFileItem l1(V_LOCALE_CODEPAGE ,m_iCodePage); CAuditDataFileItem l2(V_LOCALE_CALENDARTYPE ,m_strCalendarType); CAuditDataFileItem l3(V_LOCALE_COUNTRY ,m_strCountry); CAuditDataFileItem l4(V_LOCALE_COUNTRYCODE ,m_iCountryCode); CAuditDataFileItem l5(V_LOCALE_CURRENCY ,m_strCurrency); CAuditDataFileItem l6(V_LOCALE_DATEFORMAT ,m_strDateFormat); CAuditDataFileItem l7(V_LOCALE_LANGUAGE ,m_strLanguage); CAuditDataFileItem l8(V_LOCALE_LOCALLANGUAGE ,m_strLocaleLocalLanguage); CAuditDataFileItem l9(V_LOCALE_OEM_CODEPAGE ,m_iOEMCodePage); CAuditDataFileItem l10(V_LOCALE_TIMEFORMAT ,m_strTimeFormat); CAuditDataFileItem l11(V_LOCALE_TIMEFORMATSPECIFIER ,m_strTimeFormatSpecifier); CAuditDataFileItem l12(V_LOCALE_TIMEZONE ,m_strLocaleTimeZone); // Add the items to the category category.AddItem(l1); category.AddItem(l2); category.AddItem(l3); category.AddItem(l4); category.AddItem(l5); category.AddItem(l6); category.AddItem(l7); category.AddItem(l8); category.AddItem(l9); category.AddItem(l10); category.AddItem(l11); category.AddItem(l12); // ...and add the category to the AuditDataFile pAuditDataFile->AddAuditDataFileItem(category); // we always need to get the default browser details so do here CAuditDataFileCategory browserCategory("Internet|Browsers|Default Browser", FALSE, TRUE); CAuditDataFileItem b1("Path", GetRegValue("HKEY_CLASSES_ROOT\\http\\shell\\open\\command", "")); browserCategory.AddItem(b1); pAuditDataFile->AddInternetItem(browserCategory); log.Write("CLocaleScanner::SaveData End" ,true); return true; }
/*! \internal */ int QDesignerWidgetBoxInterface::findOrInsertCategory(const QString &categoryName) { int count = categoryCount(); for (int index=0; index<count; ++index) { Category c = category(index); if (c.name() == categoryName) return index; } addCategory(Category(categoryName)); return count; }
void MainController::newMedia(QString name) { if(!medias().contains(qMakePair(m_mw->currentCategory(),name))) { MediaSPointer zeus(new Media); zeus->setName(name); zeus->setCategory(AbstractController::category(m_mw->currentCategory()).data()); category(m_mw->currentCategory())->addAssociations(zeus); addMedia(zeus); setCurrentTable(m_mw->currentCategory()); m_mw->setCurrentMedia(name); } }
void TTSStyleActions::generateActions(QVector<int> & styles, const int current) { category()->setText(QCoreApplication::tr("Style")); actions_.clear(); QVector<int>::const_iterator begin = styles.begin(); QVector<int>::const_iterator end = styles.end(); for(QVector<int>::const_iterator iter = begin; iter != end; ++iter) { // The text QString text; QString icon_name(":/images/style_item.png"); switch ( *iter ) { case SPEAK_STYLE_CLEAR: text = QCoreApplication::tr("Clear"); icon_name = ":/images/tts_clear.png"; break; case SPEAK_STYLE_NORMAL: text = QCoreApplication::tr("Normal"); icon_name = ":/images/tts_normal.png"; break; case SPEAK_STYLE_PLAIN: text = QCoreApplication::tr("Plain"); icon_name = ":/images/tts_plain.png"; break; case SPEAK_STYLE_VIVID: text = QCoreApplication::tr("Vivid"); icon_name = ":/images/tts_vivid.png"; break; default: text = QCoreApplication::tr("Invalid Speed"); break; } // Add to category automatically. shared_ptr<QAction> act(new QAction(text, exclusiveGroup())); // Change font and make it as checkable. act->setCheckable(true); act->setData(*iter); act->setIcon(QIcon(QPixmap(icon_name))); if ( *iter == current ) { act->setChecked(true); } actions_.push_back(act); } }
/// Function to return all of the categories that contain this algorithm const std::vector<std::string> AlgorithmProxy::categories() const { Poco::StringTokenizer tokenizer(category(), categorySeparator(), Poco::StringTokenizer::TOK_TRIM | Poco::StringTokenizer::TOK_IGNORE_EMPTY); std::vector<std::string> res(tokenizer.begin(), tokenizer.end()); const DeprecatedAlgorithm *depo = dynamic_cast<const DeprecatedAlgorithm *>(this); if (depo != nullptr) { res.emplace_back("Deprecated"); } return res; }
int iswspace_l (wint_t c, struct __locale_t *locale) { #ifdef _MB_CAPABLE c = _jp2uc_l (c, locale); enum category cat = category (c); // exclude "<noBreak>"? return cat == CAT_Zs || cat == CAT_Zl || cat == CAT_Zp // Line/Paragraph Separator || (c >= 0x9 && c <= 0xD); #else return c < 0x100 ? isspace (c) : 0; #endif /* _MB_CAPABLE */ }
/// Function to return all of the categories that contain this function const std::vector<std::string> IFunction::categories() const { std::vector < std::string > res; Poco::StringTokenizer tokenizer(category(), categorySeparator(), Poco::StringTokenizer::TOK_TRIM | Poco::StringTokenizer::TOK_IGNORE_EMPTY); Poco::StringTokenizer::Iterator h = tokenizer.begin(); for (; h != tokenizer.end(); ++h) { res.push_back(*h); } return res; }
static void render_contact_method(G_GNUC_UNUSED GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, G_GNUC_UNUSED gpointer data) { GValue value = G_VALUE_INIT; gtk_tree_model_get_value(model, iter, 0, &value); auto cm = (ContactMethod *)g_value_get_pointer(&value); gchar *number = nullptr; if (cm && cm->category()) { // try to get the number category, eg: "home" number = g_strdup_printf("(%s) %s", cm->category()->name().toUtf8().constData(), cm->uri().toUtf8().constData()); } else if (cm) { number = g_strdup_printf("%s", cm->uri().toUtf8().constData()); } g_object_set(G_OBJECT(cell), "text", number, NULL); g_free(number); }
void CIniImpl::parse() { TRACE_FUN( Routine, "CIniImpl::parse" ); CLexScaner scaner( &stream() ); CCategoryParserDriver driver( file(), scaner, category(), synchronization(), errorRepository() ); parser theParser( driver ); theParser.parse(); }
void MessageReceived(BMessage* msg) { switch(msg->what) { case SAVE_TASK: { BString category("ALL"); int32 selection=categories->CurrentSelection(); if(selection>=0) { Category* cat=dynamic_cast<Category*>(categories->ItemAt(selection)); category=cat->GetName(); } bool rc=manager->AddTask(title->Text(),description->Text(),category); if(!rc) { BAlert* error=new BAlert("SAVING ERROR", "Oops, we can't save that in database", "OK",NULL,NULL,B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_STOP_ALERT); error->Go(); } //SEND RELOAD MESSAGE int32 count=be_app->CountWindows(); for(int32 i=0;i<count;i++) { be_app->WindowAt(i)->PostMessage(new BMessage(RELOAD)); } } case CANCEL: { Quit(); } case CREATE_CATEGORY: { CreateCategory* create=new CreateCategory(manager); create->Show(); PostMessage(new BMessage(RELOAD)); } case RELOAD_CATEGORIES: { categories->MakeEmpty(); manager->LoadCategories(categories); } default: BWindow::MessageReceived(msg); } }
void TTSSpeedActions::generateActions(QVector<int> & speeds, const int current) { category()->setText(QCoreApplication::tr("Speed")); actions_.clear(); QVector<int>::const_iterator begin = speeds.begin(); QVector<int>::const_iterator end = speeds.end(); for(QVector<int>::const_iterator iter = begin; iter != end; ++iter) { // The text QString text; switch ( *iter ) { case 0: text = QCoreApplication::tr("Very Slow"); break; case 1: text = QCoreApplication::tr("Slow"); break; case 2: text = QCoreApplication::tr("Medium"); break; case 3: text = QCoreApplication::tr("Fast"); break; case 4: text = QCoreApplication::tr("Very Fast"); break; default: text = QCoreApplication::tr("Invalid Speed"); break; } // Add to category automatically. shared_ptr<QAction> act(new QAction(text, exclusiveGroup())); // Change font and make it as checkable. act->setCheckable(true); act->setData(*iter); act->setIcon(QIcon(QPixmap(":/images/speed_item.png"))); if ( *iter == current ) { act->setChecked(true); } actions_.push_back(act); } }
JNIEXPORT jint JNICALL Java_org_geuz_onelab_Gmsh_setStringOption (JNIEnv *env, jobject obj, jstring c, jstring n, jstring v) { const char* tmp; tmp = env->GetStringUTFChars(v, NULL); const std::string value(tmp, strlen(tmp)); env->ReleaseStringUTFChars(v, tmp); tmp = env->GetStringUTFChars(n, NULL); const std::string name(tmp, strlen(tmp)); env->ReleaseStringUTFChars(n, tmp); tmp = env->GetStringUTFChars(c, NULL); std::string category(tmp, strlen(tmp)); env->ReleaseStringUTFChars(c, tmp); GmshSetOption(category, name, value, 0); }
/// Generate all supported font family here. void FontFamilyActions::generateActions(const QString &font_family, bool scan_others) { category()->setFont(actionFont()); category()->setText(QCoreApplication::tr("Font Family")); actions_.clear(); QFontDatabase fdb; if (scan_others) { // Scan both internal flash and sd card. loadExternalFonts(&fonts_); } QStringList list; list = fdb.families(); foreach (QString family, list) { // Add to category automatically. shared_ptr<QAction> act(new QAction(family, exclusiveGroup())); // Change font and set it as checkable. act->setFont(QFont(family)); act->setCheckable(true); act->setData(family); act->setIcon(QIcon(QPixmap(":/images/font_family_item.png"))); if (family == font_family) { act->setChecked(true); font_family_ = font_family; } actions_.push_back(act); }
bool internal_node::equal(const node& other) const { if (other.is_leaf() || category() != other.category()) return false; const auto& internal = other.as<internal_node>(); if (num_children() != internal.num_children()) return false; bool ret = true; for (size_t i = 0; i < num_children(); ++i) ret &= children_[i]->equal(*internal.children_[i]); return ret; }
void SatellitesMSCItem::setDescription() { QString description = QObject::tr( "Object name: %1 <br />" "Category: %2 <br />" "Pericentre: %3 km<br />" "Apocentre: %4 km<br />" "Inclination: %5 Degree<br />" "Revolutions per day (24h): %6" ) .arg( name(), category(), QString::number( m_perc, 'f', 2 ), QString::number( m_apoc, 'f', 2 ), QString::number( m_inc, 'f', 2 ), QString::number( m_n0, 'f', 2 ) ); placemark()->setDescription( description ); }
IseServerInspector::CommandItems PredefinedInspector::getItems() const { typedef IseServerInspector::CommandItem CommandItem; typedef IseServerInspector::CommandItems CommandItems; string category("proc"); CommandItems items; items.push_back(CommandItem(category, "basic_info", PredefinedInspector::getBasicInfo, "show the basic info.")); items.push_back(CommandItem(category, "status", PredefinedInspector::getProcStatus, "print /proc/self/status.")); items.push_back(CommandItem(category, "opened_file_count", PredefinedInspector::getOpenedFileCount, "count /proc/self/fd.")); items.push_back(CommandItem(category, "thread_count", PredefinedInspector::getThreadCount, "count /proc/self/task.")); return items; }
/// Function to return all of the categories that contain this algorithm const std::vector<std::string> AlgorithmProxy::categories() const { Mantid::Kernel::StringTokenizer tokenizer( category(), categorySeparator(), Mantid::Kernel::StringTokenizer::TOK_TRIM | Mantid::Kernel::StringTokenizer::TOK_IGNORE_EMPTY); auto res = tokenizer.asVector(); const DeprecatedAlgorithm *depo = dynamic_cast<const DeprecatedAlgorithm *>(this); if (depo != nullptr) { res.emplace_back("Deprecated"); } return res; }
void KviActionManager::listActionsByCategory(const QString &szCatName,KviPointerList<KviAction> * pBuffer) { loadAllAvailableActions(); KviActionCategory * pCat = category(szCatName); pBuffer->setAutoDelete(false); pBuffer->clear(); if(!pCat)return; KviPointerHashTableIterator<QString,KviAction> it(*m_pActions); while(KviAction * a = it.current()) { if(a->category() == pCat) pBuffer->append(a); ++it; } }
void MainController::editMedia() { QString ares; //category name QString athena; //media name MediaSPointer gaia; if(m_mw->currentCategory() == tr("Search...")) { ares = m_mw->currentMedia().split("/").last(); athena = m_mw->currentMedia().split("/").first(); foreach(auto artemis, m_search.results()) if(artemis->name() == athena && artemis->category()->name() == ares) gaia = artemis; }
QMap<int, QVariant> Package::itemData() const { QMap<int, QVariant> map = TransferItem::itemData(); map[CategoryRole] = category(); map[CreateSubfolderRole] = createSubfolder(); map[ErrorStringRole] = errorString(); map[IdRole] = id(); map[NameRole] = name(); map[PriorityRole] = priority(); map[PriorityStringRole] = priorityString(); map[ProgressRole] = progress(); map[ProgressStringRole] = progressString(); map[StatusRole] = status(); map[StatusStringRole] = statusString(); map[SuffixRole] = suffix(); return map; }
SmartPointer<CommandCategory> CommandManager::GetCategory(const std::string& categoryId) { if (categoryId.empty()) { return this->GetCategory(AUTOGENERATED_CATEGORY_ID); } this->CheckId(categoryId); CommandCategory::Pointer category(categoriesById[categoryId]); if (!category) { category = new CommandCategory(categoryId); categoriesById[categoryId] = category; category->AddCategoryListener(categoryListener); } return category; }
QVariantMap Package::itemDataWithRoleNames() const { QVariantMap map = TransferItem::itemDataWithRoleNames(); map[roleNames().value(CategoryRole)] = category(); map[roleNames().value(CreateSubfolderRole)] = createSubfolder(); map[roleNames().value(ErrorStringRole)] = errorString(); map[roleNames().value(IdRole)] = id(); map[roleNames().value(NameRole)] = name(); map[roleNames().value(PriorityRole)] = priority(); map[roleNames().value(PriorityStringRole)] = priorityString(); map[roleNames().value(ProgressRole)] = progress(); map[roleNames().value(ProgressStringRole)] = progressString(); map[roleNames().value(StatusRole)] = status(); map[roleNames().value(StatusStringRole)] = statusString(); map[roleNames().value(SuffixRole)] = suffix(); return map; }
void ExplorerPane::updateMetadata(const QString &rml, const QString &uri, const QString& hostAddress) { // Parse RML and extract the metadata QXmlStreamReader reader(rml); while (!reader.atEnd()) { reader.readNext(); if (!reader.isStartElement()) continue; //qDebug() << "start-element=" << reader.name(); if (reader.name() == "manufacturer") labelDevManf->setText(reader.readElementText()); else if (reader.name() == "mmodel") labelDevMmod->setText(reader.readElementText()); else if (reader.name() == "nickname") { // >>> KLUDGE get the language specified in the ENV reader.readNextStartElement(); // <localetitle> reader.readNextStartElement(); // <en> if (reader.name() == "en") labelDevNick->setText(reader.readElementText()); // << KLUDGE get the language specified in the ENV } else if (reader.name() == "category") { XPCategory category(rmlCachePath, hostAddress); QIcon icon = category.getIcon(reader.readElementText(), 72); if (icon.isNull()) icon = QIcon(":/images/unknown-device"); labelDevIcon->setPixmap(icon.pixmap(48,48)); } } if (reader.hasError()) { qDebug() << "ExplorerPane::updateMetadata RML error=" << reader.errorString(); } // Update the RML file information labelFileName->setText(QString("File:\t%1").arg(uri)); labelFileSize->setText(QString("Size:\t%1").arg(rml.length())); // >>> KLUDGE Actually gZip the file and get the correct size labelFileZsize->setText(QString("Zip size:\t%1").arg(rml.length()/2)); //TODO gzip file and get size // <<< KLUDGE Actually gZip the file and get the correct size }
bool CAbstractRegistryDriver::Write( const std::string& aKey, const CVariant& aValue ) { TRACE_FUN( Frequently, "CAbstractRegistryDriver::Write" ); CMutexLocker locker( synchronization().mutex() ); bool ret( false ); CCategoryKeyParser keyParser( aKey ); if( ret = category()->Write( keyParser, aValue ) ) { _isModified = true; } return ret; }
/** * 板一覧情報を収集しSQLiteに格納する */ void ExtractBoardList::FindBoardInfo(xmlNode*& element) { wxString lsCategory; wxString lsName; wxString lsUrl; // 板一覧の配列 for (htmlNodePtr node = element; node != NULL; node = node->next) { if (node->type == XML_ELEMENT_NODE) { /** もしノードの中身が「B」タグだったら:カテゴリ名 */ if (xmlStrcasecmp(node->name, (const xmlChar*) "B") == 0) { // 配列に要素を詰め込む if (sizeof(node->children->content) > 0) { // wx-2.8ではキャストの方法がこれしかない wxString category((const char*) node->children->content,wxConvUTF8); if (category == excludeCategory1 || category == excludeCategory2) continue; lsCategory = category; } } /** もしノードの中身が「A」タグだったら:板名 */ if (xmlStrcasecmp(node->name, (const xmlChar*) "A") == 0) { for (xmlAttrPtr attr = node->properties; attr != NULL; attr = attr->next) { if (xmlStrcasecmp(attr->name, (const xmlChar*) "HREF") == 0) { // 配列に要素を詰め込む if (sizeof(node->children->content) > 0 && sizeof(node->properties[0].children->content) > 0) { // wx-2.8ではキャストの方法がこれしかない wxString name((const char*) node->children->content, wxConvUTF8); wxString url((const char*) node->properties[0].children->content, wxConvUTF8); lsName = name; lsUrl = url; // 格納した情報をMetakitに配置する this->SetBoardInfo(lsCategory, lsName, lsUrl); } } } } // 再帰的に処理する if (node->children != NULL) { ExtractBoardList::FindBoardInfo(node->children); } } } }
ChooseGeneralDialog::ChooseGeneralDialog(const QStringList &general_names, QWidget *parent) :QDialog(parent), free_chooser(NULL) { setWindowTitle(tr("Choose general")); QString lord_name; QList<const General *> generals; foreach(QString general_name, general_names){ if(general_name.contains("(lord)")) { general_name.chop(6); lord_name = general_name; continue; } const General *general = Sanguosha->getGeneral(general_name); generals << general; } QSignalMapper *mapper = new QSignalMapper(this); QList<OptionButton *> buttons; QString category("card"); QSize icon_size(200*0.8, 290*0.8); if(generals.length() > 10){ category = "big"; icon_size = QSize(94, 96); } foreach(const General *general, generals){ QString icon_path = general->getPixmapPath(category); QString caption = Sanguosha->translate(general->objectName()); OptionButton *button = new OptionButton(icon_path, caption); button->setToolTip(general->getSkillDescription()); button->setIconSize(icon_size); buttons << button; mapper->setMapping(button, general->objectName()); connect(button, SIGNAL(double_clicked()), mapper, SLOT(map())); connect(button, SIGNAL(double_clicked()), this, SLOT(accept())); // special case if(Self->getRoleEnum() == Player::Lord && general->objectName() == "shencaocao"){ button->setEnabled(false); } }
void ContentBlockingDialog::updateProfile(const QString &name) { ContentBlockingProfile *profile(ContentBlockingManager::getProfile(name)); if (!profile) { return; } for (int i = 0; i < m_ui->profilesViewWidget->getRowCount(); ++i) { const QModelIndex categoryIndex(m_ui->profilesViewWidget->getIndex(i)); for (int j = 0; j < m_ui->profilesViewWidget->getRowCount(categoryIndex); ++j) { const QModelIndex entryIndex(m_ui->profilesViewWidget->getIndex(j, 0, categoryIndex)); if (entryIndex.data(Qt::UserRole).toString() == name) { ContentBlockingProfile *profile(ContentBlockingManager::getProfile(name)); ContentBlockingProfile::ProfileCategory category(profile->getCategory()); QString title(profile->getTitle()); if (category == ContentBlockingProfile::RegionalCategory) { const QList<QLocale::Language> languages(profile->getLanguages()); QStringList languageNames; for (int k = 0; k < languages.count(); ++k) { languageNames.append(QLocale::languageToString(languages.at(k))); } title = QStringLiteral("%1 [%2]").arg(title).arg(languageNames.join(QLatin1String(", "))); } m_ui->profilesViewWidget->setData(entryIndex, title, Qt::DisplayRole); m_ui->profilesViewWidget->setData(entryIndex.sibling(j, 2), Utils::formatDateTime(profile->getLastUpdate()), Qt::DisplayRole); return; } } } }
/// Function to return all of the categories that contain this algorithm const std::vector<std::string> AlgorithmProxy::categories() const { std::vector<std::string> res; Poco::StringTokenizer tokenizer(category(), categorySeparator(), Poco::StringTokenizer::TOK_TRIM | Poco::StringTokenizer::TOK_IGNORE_EMPTY); Poco::StringTokenizer::Iterator h = tokenizer.begin(); for (; h != tokenizer.end(); ++h) { res.push_back(*h); } const DeprecatedAlgorithm *depo = dynamic_cast<const DeprecatedAlgorithm *>(this); if (depo != NULL) { res.push_back("Deprecated"); } return res; }
BOOST_FOREACH(int endUse,endUses) { EndUseCategoryType category(endUse); row1.push_back(TableElement(category.valueDescription(),loadString)); numMonths = 0; BOOST_FOREACH(int month,months) { OptionalDouble value = sqlFile.energyConsumptionByMonth(fuelType,category,MonthOfYear(month)); if (!value) { row1.push_back(TableElement(0.0)); } else { row1.push_back(TableElement(*value)); allNull = false; } ++numMonths; if (numMonths == 12) { break; } }
void LogControlModule::confirmation_received(GstDebugger::Command* cmd) { if (!cmd->has_hook_request() || !cmd->hook_request().has_log()) return; auto confirmation = cmd->hook_request().log(); if (cmd->hook_request().action() == GstDebugger::ADD) { Gtk::TreeModel::Row row = *(hooks_model->append()); row[hooks_model_columns.str1] = gst_debug_level_get_name (static_cast<GstDebugLevel>(confirmation.level())); row[hooks_model_columns.int1] = confirmation.level(); row[hooks_model_columns.str2] = confirmation.category(); } else { remove_confirmation_hook(confirmation); } }