Ejemplo n.º 1
0
Allocations::Allocations(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Allocations)
{
    ui->setupUi(this);
    ui->dateEdit->setDateTime(QDateTime::currentDateTime());

    setEditMode(false);
    setAllocationId(0);
    setItemId(0);

    ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(false);

    items_model = 0;
    locations_model = 0;
    operators_model = 0;
    logger = 0;

    loadItems();
    loadLocations();
    loadOperators();

    ui->to_operator_comboBox->completer()->setCompletionMode(QCompleter::PopupCompletion);
    ui->to_location_comboBox->completer()->setCompletionMode(QCompleter::PopupCompletion);

    connect(ui->filter_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(setItemsFilter(QString)));
}
Ejemplo n.º 2
0
	void MenuItem::setProperty(const std::string& _key, const std::string& _value)
	{
		if (_key == "MenuItem_Id") setItemId(_value);
		else if (_key == "MenuItem_Type") setItemType(utility::parseValue<MenuItemType>(_value));
		else
		{
			Base::setProperty(_key, _value);
			return;
		}
		eventChangeProperty(this, _key, _value);
	}
Ejemplo n.º 3
0
void UIItem::onStyleApply(const std::string& styleName, const OTMLNodePtr& styleNode)
{
    UIWidget::onStyleApply(styleName, styleNode);

    for(const OTMLNodePtr& node : styleNode->children()) {
        if(node->tag() == "item-id")
            setItemId(node->value<int>());
        else if(node->tag() == "item-count")
            setItemCount(node->value<int>());
        else if(node->tag() == "item-visible")
            setItemVisible(node->value<bool>());
        else if(node->tag() == "virtual")
            setVirtual(node->value<bool>());
	else if(node->tag() == "show-id")
	    m_showId = node->value<bool>();
    }
}
Ejemplo n.º 4
0
	void MenuItem::setPropertyOverride(const std::string& _key, const std::string& _value)
	{
		/// @wproperty{MenuItem, MenuItemId, string} Идентификатор строки меню.
		if (_key == "MenuItemId")
			setItemId(_value);

		/// @wproperty{MenuItem, MenuItemType, MenuItemType} Тип строки меню.
		else if (_key == "MenuItemType")
			setItemType(utility::parseValue<MenuItemType>(_value));

		/// @wproperty{MenuItem, MenuItemChecked, bool} Отмеченное состояние строки меню.
		else if (_key == "MenuItemChecked")
			setItemChecked(utility::parseValue<bool>(_value));

		else
		{
			Base::setPropertyOverride(_key, _value);
			return;
		}

		eventChangeProperty(this, _key, _value);
	}
Ejemplo n.º 5
0
void Allocations::setItemFilter(const int item_id)
{
    setItemId(item_id);
    items_model->setFilter(QString("items.id = %1").arg(item_id));
    ui->item_treeView->selectionModel()->setCurrentIndex(items_model->index(0,0), QItemSelectionModel::Toggle | QItemSelectionModel::Rows);
}
Ejemplo n.º 6
0
void Creature::_LoadGoods()
{
    
    itemcount = 0;

    
    std::stringstream query;
    query << "SELECT * FROM vendors WHERE vendorGuid=" << GetGUIDLow();

    QueryResult *result = sDatabase.Query( query.str().c_str() );

	
	if(!result)
	{
		std::stringstream query7;
		query7 << "SELECT * FROM vendors WHERE vendorGuid=" << GetNameID();

		result = sDatabase.Query( query7.str().c_str() );

		if (result)
			Log::getSingleton( ).outError( "Vendor %u has items.", GetNameID() );
	}

	if(!result)
	{
		std::stringstream query2;
		query2 << "SELECT * FROM vendors WHERE vendorGuid=" << uint64(GetGUIDLow()+1);

		result = sDatabase.Query( query2.str().c_str() );
	}

	if(!result)
	{
		std::stringstream query5;
		query5 << "SELECT * FROM vendors WHERE vendorGuid=" << uint64(GetGUIDLow()-10);

		result = sDatabase.Query( query5.str().c_str() );
	}

	if(!result)
	{
		std::stringstream query3;
		query3 << "SELECT * FROM vendors WHERE vendorGuid=" << uint64(GetGUID());

		result = sDatabase.Query( query3.str().c_str() );
	}

	if(!result)
	{
		std::stringstream query4;
		query4 << "SELECT * FROM vendors WHERE vendorGuid=" << uint64(GetGUID()+1);

		result = sDatabase.Query( query4.str().c_str() );
	}

	if(!result)
	{
		std::stringstream query6;
		query6 << "SELECT * FROM vendors WHERE vendorGuid=" << uint64(GetGUID()-10);

		result = sDatabase.Query( query6.str().c_str() );
	}

    if(result)
    {
        do
        {
            Field *fields = result->Fetch();

            if (getItemCount() >= MAX_CREATURE_ITEMS)
            {
                
                
                Log::getSingleton( ).outError( "Vendor %u has too many items (%u >= %i). Check the DB!", GetNameID(), getItemCount(), MAX_CREATURE_ITEMS );
                break;
            }

            setItemId(getItemCount() , fields[1].GetUInt32());
            setItemAmount(getItemCount() , fields[2].GetUInt32());
            increaseItemCount();

        }
        while( result->NextRow() );

        delete result;
    }
}
    bool CCPurchaseWithVirtualItem::init(cocos2d::CCString *itemId, cocos2d::CCInteger *amount) {
        setItemId(itemId);
        setAmount(amount);

        return true;
    }
PushHistoryItem::PushHistoryItem(const QString &itemId, int seqNum)
{
    setItemId(itemId);
    setSeqNum(seqNum);
}
Ejemplo n.º 9
0
void LotserialLineEdit::clear()
{
  VirtualClusterLineEdit::clear();
  setItemId(-1);
}