Пример #1
0
void mygeneral::setName(QString getname){
    if(getname==""){setDefaultName();return;}
    foreach(mygeneral *ip,getsys()->glist){
        if(ip==this){continue;}
        if(ip->name==getname){setDefaultName();return;}
    }
    name=getname;
}
Пример #2
0
void CreateEditPage::load(void)
{
	const Tag *tag = TagStorage::storage()->tag(m_tag);	

	if (m_tag == TagStorage::TEMPORARY_TAG) {
		setDefaultName(tr("Harvested tag"));
	} else {
		m_name->setContents(tag->name());
	}

	if (setupData(tag->message()) == false) {
		goto fail;
	} else {
		setContentValidity(true);
	}

	return;

fail:
	setupNewData();
	MMessageBox *box = new MMessageBox(tr("Cannot read the tag. "
					      "The tag contents may be "
					      "invalid. "));
	box->appear(MSceneWindow::DestroyWhenDismissed);	
}
Пример #3
0
void Font::initDefaults(const SharedFontState &sfs)
{
	std::vector<std::string> &names = FontPrivate::initialDefaultNames;

	switch (rgssVer)
	{
	case 1 :
		// FIXME: Japanese version has "MS PGothic" instead
		names.push_back("Arial");
		break;

	case 2 :
		names.push_back("UmePlus Gothic");
		names.push_back("MS Gothic");
		names.push_back("Courier New");
		break;

	default:
	case 3 :
		names.push_back("VL Gothic");
	}

	setDefaultName(names, sfs);

	FontPrivate::defaultOutline = (rgssVer >= 3 ? true : false);
	FontPrivate::defaultShadow  = (rgssVer == 2 ? true : false);
}
Пример #4
0
Thread::Thread(const ThreadFunc& func, const std::string& n)
: _started(false),
  _joined(false),
  _pthreadId(0),
  _tid(new pid_t(0)),
  _func(func),
  _name(n)
{
    setDefaultName();
}
Пример #5
0
DSX_Sensor::DSX_Sensor(uint8_t addr[8], OneWire *one, int32_t sensorId, char *sensorName) 
    : _one(one), _sensorID(sensorId)
{
    memcpy(&_addr[0], addr, 8);
    if (sensorName) {
        strncpy(_name, sensorName, sizeof(_name) - 1);
        _name[sizeof(_name)- 1] = '\0';
    } else {
        setDefaultName();
    }
}
Пример #6
0
bool CalendarPage::setupData(const QNdefMessage message)
{
	QOrganizerItem o = Util::organizerItemFromNdef(message);
	if (o.isEmpty() == true) {
		setCalendarItem(QOrganizerItem());
		return false;
	}

	setCalendarItem(o);
	if (isTemporary() == true) {
		setDefaultName(m_info.displayLabel());
	}
	return true;
}
Пример #7
0
void CalendarPage::setCalendarItemThroughAction(const QOrganizerItem item)
{
	setCalendarItem(item);
	setDefaultName(item.displayLabel());
}