예제 #1
0
// static 
void LLAlertDialog::onButtonPressed( void* userdata )
{
	ButtonData* button_data = (ButtonData*)userdata;
	LLAlertDialog* self = button_data->mSelf;

	self->mOptionChosen = button_data->mOption;
	self->close(); // deletes self
}
예제 #2
0
//static
LLAlertDialog* LLAlertDialog::showCritical( const LLString& desc, alert_callback_t callback, void *user_data)
{
	LLAlertDialogTemplate xml_template;
	LLString::format_map_t args;
	xml_template.mTitle = "Critical Error";
	xml_template.mMessage = desc;
	xml_template.mModal = TRUE;
	xml_template.mOptions.push_back("Quit");
	LLAlertDialog* dialog = new LLAlertDialog( &xml_template, args, callback, user_data);
	return dialog && dialog->show() ? dialog : NULL;
}
예제 #3
0
// static 
void LLAlertDialog::onButtonPressed( void* userdata )
{
	ButtonData* button_data = (ButtonData*)userdata;
	LLAlertDialog* self = button_data->mSelf;

	LLSD response = self->mNote->getResponseTemplate();
	if (self->mLineEditor)
	{
		response[self->mLineEditor->getName()] = self->mLineEditor->getValue();
	}
	response[button_data->mButton->getName()] = true;

	// If we declared a URL and chose the URL option, go to the url
	if (!button_data->mURL.empty() && sURLLoader != NULL)
	{
		sURLLoader->load(button_data->mURL);
	}

	self->mNote->respond(response); // new notification reponse
	self->close(); // deletes self
}
예제 #4
0
//static 
bool LLAlertDialog::onNewNotification(const LLSD& notify, bool is_modal)
{
	LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
	
	if(notification)
	{
		if (notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "load")
		{
			LLAlertDialog* dialog = new LLAlertDialog(notification, is_modal);
			dialog->show();
		}
		else if (notify["sigtype"].asString() == "change")
		{
			LLAlertDialog* dialog = getInstance(notification->getID());
			if (dialog)
			{
				dialog->show();
			}
			else
			{
				LLAlertDialog* dialog = new LLAlertDialog(notification, is_modal);
				dialog->show();
			}
		}
	}

	return false;
}
예제 #5
0
//static
LLAlertDialog* LLAlertDialog::showXml( const LLString& xml_desc, const LLString::format_map_t& args,
							 alert_callback_t callback, void *user_data)
{
	LLAlertDialog* dialog = createXml(xml_desc, args, callback, user_data);
	return dialog && dialog->show() ? dialog : NULL;
}