Esempio n. 1
0
void EditMetadataCommon::showSaveMenu()
{
    updateMetadata();

    if (!hasMetadataChanged())
    {
        Close();
        return;
    }

    QString label = tr("Save Changes?");

    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");

    MythDialogBox *menu = new MythDialogBox(label, popupStack, "savechangesmenu");

    if (!menu->Create())
    {
        delete menu;
        return;
    }

    menu->SetReturnEvent(this, "savechangesmenu");

    if (metadataOnly)
        menu->AddButton(tr("Save Changes"), SLOT(saveToMetadata()));
    else
        menu->AddButton(tr("Save Changes"), SLOT(saveAll()));

    menu->AddButton(tr("Exit/Do Not Save"), SLOT(cleanupAndClose()));
    menu->AddButton(tr("Cancel"));

    popupStack->AddScreen(menu);
}
Esempio n. 2
0
void EditMetadataCommon::saveAll()
{
    if (GetMythDB()->GetNumSetting("AllowTagWriting", 0))
    {
        MetaIO *tagger = m_metadata->getTagger();

        if (tagger)
            tagger->write(m_metadata);
    }

    saveToDatabase();

    cleanupAndClose();
}
// Reset all the values for the parcel in preparation for a sale
void LLFloaterAuction::doSellToAnyone()
{
	LLParcel* parcelp = mParcelp->getParcel();
	LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();

	if (parcelp
		&& region
		&& !mParcelUpdateCapUrl.empty())
	{
		LLSD body;
		std::string empty;

		// request new properties update from simulator
		U32 message_flags = 0x01;
		body["flags"] = ll_sd_from_U32(message_flags);

		// Set all the default parcel properties for auction
		body["local_id"] = parcelp->getLocalID();

		// Set 'for sale' flag
		U32 parcel_flags = parcelp->getParcelFlags() | PF_FOR_SALE;
		// Ensure objects not included
		parcel_flags &= ~PF_FOR_SALE_OBJECTS;
		body["parcel_flags"] = ll_sd_from_U32(parcel_flags);
		
		body["sale_price"] = parcelp->getArea();	// Sell for L$1 per square meter
		body["auth_buyer_id"] = LLUUID::null;		// To anyone
// <FS:AW opensim currency support>
//		llinfos << "Sending parcel update to sell to anyone for L$1 via capability to: "
		llinfos << Tea::wrapCurrency("Sending parcel update to sell to anyone for L$1 via capability to: ")
// <FS:AW opensim currency support>
			<< mParcelUpdateCapUrl << llendl;
		LLHTTPClient::post(mParcelUpdateCapUrl, body, new LLHTTPClient::Responder());

		// clean up floater, and get out
		cleanupAndClose();
	}
}
Esempio n. 4
0
void EditMetadataCommon::saveToMetadata()
{
    *m_sourceMetadata = *m_metadata;
    emit metadataChanged();
    cleanupAndClose();
}