void SoundsDialogHandler::loadOptions( )
{

	HWND hwnd = dialogData->getHwnd();

	setComboBoxSelection( GetDlgItem( hwnd, IDC_SCOMBO1 ), manager.getTheOneInUse( "SpeakerType" ) );
	setComboBoxSelection( GetDlgItem( hwnd, IDC_SCOMBO2 ), manager.getTheOneInUse( "MixingRate" ) );

	setCheckBox( hwnd, IDC_SCHECK1, manager.getTheOneInUse("Sounds") );
	setCheckBox( hwnd, IDC_SCHECK2, manager.getTheOneInUse("Hardware3D") );
	setCheckBox( hwnd, IDC_SCHECK3, manager.getTheOneInUse("Eax") );

}
Exemple #2
0
void MainWindow::downloadList()
{
    QSettings settings;
    QString oldVersion = settings.value("updates/version", "0.0").toString();

    delete _model;
    _model = new BamModel;
    ui->addonList->setModel(_model);

    //_model->downloadList(QUrl("http://127.0.0.1:8000/bam/addon_pack/" + oldVersion + "/"));
    _model->downloadList(QUrl("http://hh.unit22.org/bam/addon_pack/" + oldVersion + "/"));

    connect(_model, SIGNAL(xmlProcessed()),
            this, SLOT(resizeView()));
    connect(ui->addonList ,SIGNAL(clicked(QModelIndex)),
            _model, SLOT(setCheckBox(QModelIndex)), Qt::UniqueConnection );
    connect(ui->install, SIGNAL(clicked()),
            _model, SLOT(installChecked()));
    connect(_model, SIGNAL(newVersionFound(bool, QString, QString)),
            this, SLOT(setNewVersionInfo(bool, QString, QString)));
    connect(_model, SIGNAL(totalFilesSizeChanged(int)),
            this, SLOT(setTotalFilesSize(int)));
    connect(_model, SIGNAL(runGame()),
            this, SLOT(runGame()));
}
Exemple #3
0
LLAlertDialog::LLAlertDialog( const LLAlertDialogTemplate* xml_template,
							  const LLString::format_map_t& args,
							  alert_callback_t callback, void *user_data)
	:	LLModalDialog( xml_template->mTitle, 100, 100, xml_template->mModal ),  // dummy size.  Will reshape below.
		mCallback( callback ),
		mUserData( user_data ),
		mNumOptions( 0 ),
		mDefaultOption( 0 ),
		mOptionChosen( -1 ),
		mCheck(NULL),
		mCaution(xml_template->mCaution),
		mUnique(xml_template->mUnique),
		mIgnorable(xml_template->mIgnorable),
		mLabel(xml_template->mLabel),
		mIgnoreLabel(xml_template->mIgnoreLabel),
		mButtonData(NULL),
		mLineEditor(NULL),
		mTextCallback(NULL),
		mURLOption(0)
{
	mURL = xml_template->mURL;
	mURLOption = xml_template->mURLOption;
	createDialog(&(xml_template->mOptions), xml_template->mDefaultOption,
				 xml_template->mMessage, args,
				 xml_template->mEditLineText);
	setTitle(xml_template->mTitle);
	if (xml_template->mIgnorable)
	{
		if (xml_template->mIgnorable == IGNORE_USE_DEFAULT)
		{
			setCheckBox(sStringSkipNextTime, xml_template->mIgnoreLabel);
		}
		else // xml_template->mIgnorable == IGNORE_USE_SAVED
		{
			setCheckBox(sStringAlwaysChoose, xml_template->mIgnoreLabel);
		}
	}
}
bool WiimotePrefs::Activate(const QString &ID, bool init)
{
  QString sec;
  initializing = init;
  if(PREF.getFirstDeviceSection(QString::fromUtf8("Wiimote"), sec)){
    QString currentDev, currentSection;
    deviceType_t devType;
    if(!PREF.getActiveDevice(devType, currentDev, currentSection) || (sec !=currentSection)){
      PREF.activateDevice(sec);
    }
  }else{
    sec = QString::fromUtf8("Wiimote");
    initializing = false;
    if(PREF.createSection(sec)){
      PREF.addKeyVal(sec, QString::fromUtf8("Capture-device"), QString::fromUtf8("Wiimote"));
      PREF.addKeyVal(sec, QString::fromUtf8("Capture-device-id"), ID);
      PREF.addKeyVal(sec, QString::fromUtf8("Running-indication"), QString::fromUtf8("0100"));
      PREF.addKeyVal(sec, QString::fromUtf8("Paused-indication"), QString::fromUtf8("0010"));
      PREF.activateDevice(sec);
    }
  }
  ltr_int_wii_init_prefs();
  QString indication;
  bool d1, d2, d3, d4;
  if(ltr_int_get_run_indication(&d1, &d2, &d3, &d4)){
    setCheckBox(ui.Wii_r1, d1);
    setCheckBox(ui.Wii_r2, d2);
    setCheckBox(ui.Wii_r3, d3);
    setCheckBox(ui.Wii_r4, d4);
  }  
  if(ltr_int_get_pause_indication(&d1, &d2, &d3, &d4)){
    setCheckBox(ui.Wii_p1, d1);
    setCheckBox(ui.Wii_p2, d2);
    setCheckBox(ui.Wii_p3, d3);
    setCheckBox(ui.Wii_p4, d4);
  }
  initializing = false;
  return true;
}
Exemple #5
0
void PreferencesDialog::updateDialog()
{
	int err = 0;
	char s[10];

	setCheckBox(IDC_PREFS_AUTO_INDENT,			info.autoIndent);
	setCheckBox(IDC_PREFS_PAREN_MATCHING,		info.parenthesesMatching);
	setCheckBox(IDC_PREFS_PROT_MOUSE_MOVE,		info.autoPrototypeOnMouseMove);
	setCheckBox(IDC_PREFS_PROT_KEY_DOWN,		info.autoPrototypeOnKeyDown);
	setCheckBox(IDC_PREFS_APPEND_LISP_OUTPUT,	info.appendLispOutputToEnd);
	setCheckBox(IDC_REPLACE_TABS_WITH_SPACES,	info.replaceTabsWithSpaces);
	setCheckBox(IDC_REMEMBER_OPEN_DOCUMENTS,	info.rememberOpenDocuments);
	setCheckBox(IDC_REMEMBER_DOCUMENT_POSITIONS,info.rememberDocumentPositions);
	setCheckBox(IDC_FULL_PATH_IN_TITLE,			info.fullPathInTitle);
	setCheckBox(IDC_AUTO_COLORIZE,				info.autoColorize);

	err = _itoa_s(info.tab, s, sizeof(s), 10);
	setText(IDC_TAB, s);
	err = _itoa_s(info.charSize, s, sizeof(s), 10);
	setText(IDC_CHAR_SIZE, s);
	setText(IDC_FONT_NAME,						info.fontName);
	setCheckBox(IDC_PREFS_BOLD,					info.charBold);
	setCheckBox(IDC_PREFS_ITALIC,				info.charItalic);

	textColorWnd->InvalidateRect(NULL, FALSE);
	highlightTextColorWnd->InvalidateRect(NULL, FALSE);
	outputTextColorWnd->InvalidateRect(NULL, FALSE);
	hintBackgroundColorWnd->InvalidateRect(NULL, FALSE);
}
void GraphicsDialogHandler::loadOptions( )
{
	HWND hwnd = dialogData->getHwnd();

	setComboBoxSelection( GetDlgItem( hwnd, IDC_COMBO1 ), manager.getTheOneInUse( "Fake Shadows Texture Quality" ) );
	setComboBoxSelection( GetDlgItem( hwnd, IDC_COMBO2 ), manager.getTheOneInUse( "Misc" ) );
	setComboBoxSelection( GetDlgItem( hwnd, IDC_COMBO3 ), manager.getTheOneInUse( "Lighting Level" ) );
	setComboBoxSelection( GetDlgItem( hwnd, IDC_COMBO4 ), manager.getTheOneInUse( "Anisotropic Filtering" ) );
	setComboBoxSelection( GetDlgItem( hwnd, IDC_COMBO5 ), manager.getTheOneInUse( "Lighting Texture Quality" ) );
	setComboBoxSelection( GetDlgItem( hwnd, IDC_COMBO6 ), manager.getTheOneInUse( "Antialiasing" ) );
	setComboBoxSelection( GetDlgItem( hwnd, IDC_COMBO7 ), manager.getTheOneInUse( "Particle Effects Level" ) );
	setComboBoxSelection( GetDlgItem( hwnd, IDC_COMBO8 ), manager.getTheOneInUse( "Shadows Texture Quality" ) );
	setComboBoxSelection( GetDlgItem( hwnd, IDC_COMBO9 ), manager.getTheOneInUse( "Shadows Level" ) );
	setComboBoxSelection( GetDlgItem( hwnd, IDC_COMBO10), manager.getTheOneInUse( "Texture Detail Level" ) );

	setCheckBox( hwnd, IDC_CHECK1, manager.getTheOneInUse("Fullscreen") );
	setCheckBox( hwnd, IDC_CHECK2, manager.getTheOneInUse("Weather Effects") );
	setCheckBox( hwnd, IDC_CHECK3, manager.getTheOneInUse("High Quality Lightmap") );
	setCheckBox( hwnd, IDC_CHECK4, manager.getTheOneInUse("Extra Gamma Effects") );
	setCheckBox( hwnd, IDC_CHECK5, manager.getTheOneInUse("Render Glow") );
	setCheckBox( hwnd, IDC_CHECK6, manager.getTheOneInUse("DistortionEffects") );
	setCheckBox( hwnd, IDC_CHECK7, manager.getTheOneInUse("CorpseDisappear") );
	setCheckBox( hwnd, IDC_CHECK8, manager.getTheOneInUse("High Quality Video") );
	setCheckBox( hwnd, IDC_CHECK9, manager.getTheOneInUse("ResetAfterLoad") );
	setCheckBox( hwnd, IDC_CHECK10,manager.getTheOneInUse("EnableMenuVideo") );
	setCheckBox( hwnd, IDC_CHECK11,manager.getTheOneInUse("VSync") );

}
Exemple #7
0
LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal)
	  : LLToastPanel(notification),
		mDefaultOption( 0 ),
		mCheck(NULL),
		mCaution(notification->getPriority() >= NOTIFICATION_PRIORITY_HIGH),
		mLabel(notification->getName()),
		mLineEditor(NULL)
{
	const LLFontGL* font = LLFontGL::getFontSansSerif();
	const S32 LINE_HEIGHT = llfloor(font->getLineHeight() + 0.99f);
	const S32 EDITOR_HEIGHT = 20;

	LLNotificationFormPtr form = mNotification->getForm();
	std::string edit_text_name;
	std::string edit_text_contents;
	S32 edit_text_max_chars = 0;
	bool is_password = false;

	LLToastPanel::setBackgroundVisible(FALSE);
	LLToastPanel::setBackgroundOpaque(TRUE);


	typedef std::vector<std::pair<std::string, std::string> > options_t;
	options_t supplied_options;

	// for now, get LLSD to iterator over form elements
	LLSD form_sd = form->asLLSD();

	S32 option_index = 0;
	for (LLSD::array_const_iterator it = form_sd.beginArray(); it != form_sd.endArray(); ++it)
	{
		std::string type = (*it)["type"].asString();
		if (type == "button")
		{
			if((*it)["default"])
			{
				mDefaultOption = option_index;
			}

			supplied_options.push_back(std::make_pair((*it)["name"].asString(), (*it)["text"].asString()));

			ButtonData data;
			if (option_index == mNotification->getURLOption())
			{
				data.mURL = mNotification->getURL();
				data.mURLExternal = mNotification->getURLOpenExternally();
			}

			mButtonData.push_back(data);
			option_index++;
		}
		else if (type == "text")
		{
			edit_text_contents = (*it)["value"].asString();
			edit_text_name = (*it)["name"].asString();
			edit_text_max_chars = (*it)["max_length_chars"].asInteger();
		}
		else if (type == "password")
		{
			edit_text_contents = (*it)["value"].asString();
			edit_text_name = (*it)["name"].asString();
			is_password = true;
		}
	}

	// Buttons
	options_t options;
	if (supplied_options.empty())
	{
		options.push_back(std::make_pair(std::string("close"), LLNotifications::instance().getGlobalString("implicitclosebutton")));

		// add data for ok button.
		ButtonData ok_button;
		mButtonData.push_back(ok_button);
		mDefaultOption = 0;
	}
	else
	{
		options = supplied_options;
	}

	S32 num_options = options.size();

	// Calc total width of buttons
	S32 button_width = 0;
	S32 sp = font->getWidth(std::string("OO"));
	for( S32 i = 0; i < num_options; i++ )
	{
		S32 w = S32(font->getWidth( options[i].second ) + 0.99f) + sp + 2 * LLBUTTON_H_PAD;
		button_width = llmax( w, button_width );
	}
	S32 btn_total_width = button_width;
	if( num_options > 1 )
	{
		btn_total_width = (num_options * button_width) + ((num_options - 1) * BTN_HPAD);
	}

	// Message: create text box using raw string, as text has been structure deliberately
	// Use size of created text box to generate dialog box size
	std::string msg = mNotification->getMessage();
	llwarns << "Alert: " << msg << llendl;
	LLTextBox::Params params;
	params.name("Alert message");
	params.font(font);
	params.tab_stop(false);
	params.wrap(true);
	params.follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP);
	params.allow_scroll(true);

	LLTextBox * msg_box = LLUICtrlFactory::create<LLTextBox> (params);
	// Compute max allowable height for the dialog text, so we can allocate
	// space before wrapping the text to fit.
	S32 max_allowed_msg_height = 
			gFloaterView->getRect().getHeight()
			- LINE_HEIGHT			// title bar
			- 3*VPAD - BTN_HEIGHT;
	// reshape to calculate real text width and height
	msg_box->reshape( MAX_ALLOWED_MSG_WIDTH, max_allowed_msg_height );
	msg_box->setValue(msg);

	S32 pixel_width = msg_box->getTextPixelWidth();
	S32 pixel_height = msg_box->getTextPixelHeight();

	// We should use some space to prevent set textbox's scroller visible when it is unnecessary.
	msg_box->reshape( llmin(MAX_ALLOWED_MSG_WIDTH,pixel_width + 2 * msg_box->getHPad() + HPAD),
		llmin(max_allowed_msg_height,pixel_height + 2 * msg_box->getVPad())  ) ;

	const LLRect& text_rect = msg_box->getRect();
	S32 dialog_width = llmax( btn_total_width, text_rect.getWidth() ) + 2 * HPAD;
	S32 dialog_height = text_rect.getHeight() + 3 * VPAD + BTN_HEIGHT;

	if (hasTitleBar())
	{
		dialog_height += LINE_HEIGHT; // room for title bar
	}

	// it's ok for the edit text body to be empty, but we want the name to exist if we're going to draw it
	if (!edit_text_name.empty())
	{
		dialog_height += EDITOR_HEIGHT + VPAD;
		dialog_width = llmax(dialog_width, (S32)(font->getWidth( edit_text_contents ) + 0.99f));
	}

	if (mCaution)
	{
		// Make room for the caution icon.
		dialog_width += 32 + HPAD;
	}

	LLToastPanel::reshape( dialog_width, dialog_height, FALSE );

	S32 msg_y = LLToastPanel::getRect().getHeight() - VPAD;
	S32 msg_x = HPAD;
	if (hasTitleBar())
	{
		msg_y -= LINE_HEIGHT; // room for title
	}

	static LLUIColor alert_caution_text_color = LLUIColorTable::instance().getColor("AlertCautionTextColor");
	if (mCaution)
	{
		LLIconCtrl* icon = LLUICtrlFactory::getInstance()->createFromFile<LLIconCtrl>("alert_icon.xml", this, LLPanel::child_registry_t::instance());
		if(icon)
		{
			icon->setRect(LLRect(msg_x, msg_y, msg_x+32, msg_y-32));
			LLToastPanel::addChild(icon);
		}
		
		msg_x += 32 + HPAD;
		msg_box->setColor( alert_caution_text_color );
	}

	LLRect rect;
	rect.setLeftTopAndSize( msg_x, msg_y, text_rect.getWidth(), text_rect.getHeight() );
	msg_box->setRect( rect );
	LLToastPanel::addChild(msg_box);

	// (Optional) Edit Box	
	if (!edit_text_name.empty())
	{
		S32 y = VPAD + BTN_HEIGHT + VPAD/2;
		mLineEditor = LLUICtrlFactory::getInstance()->createFromFile<LLLineEditor>("alert_line_editor.xml", this, LLPanel::child_registry_t::instance());
	
		if (mLineEditor)
		{
			LLRect leditor_rect = LLRect( HPAD, y+EDITOR_HEIGHT, dialog_width-HPAD, y);
			mLineEditor->setName(edit_text_name);
			mLineEditor->reshape(leditor_rect.getWidth(), leditor_rect.getHeight());
			mLineEditor->setRect(leditor_rect);
			mLineEditor->setMaxTextChars(edit_text_max_chars);
			mLineEditor->setText(edit_text_contents);

			// decrease limit of line editor of teleport offer dialog to avoid truncation of
			// location URL in invitation message, see EXT-6891
			if ("OfferTeleport" == mNotification->getName())
			{
				mLineEditor->setMaxTextLength(gSavedSettings.getS32(
						"teleport_offer_invitation_max_length"));
			}
			else
			{
				mLineEditor->setMaxTextLength(STD_STRING_STR_LEN - 1);
			}

			LLToastPanel::addChild(mLineEditor);

			mLineEditor->setDrawAsterixes(is_password);

			setEditTextArgs(notification->getSubstitutions());

			mLineEditor->setFollowsLeft();
			mLineEditor->setFollowsRight();

			// find form text input field
			LLSD form_text;
			for (LLSD::array_const_iterator it = form_sd.beginArray(); it != form_sd.endArray(); ++it)
			{
				std::string type = (*it)["type"].asString();
				if (type == "text")
				{
					form_text = (*it);
				}
			}

			// if form text input field has width attribute
			if (form_text.has("width"))
			{
				// adjust floater width to fit line editor
				S32 editor_width = form_text["width"];
				LLRect editor_rect =  mLineEditor->getRect();
				U32 width_delta = editor_width  - editor_rect.getWidth();
				LLRect toast_rect = getRect();
				reshape(toast_rect.getWidth() +  width_delta, toast_rect.getHeight());
			}
		}
	}

	// Buttons
	S32 button_left = (LLToastPanel::getRect().getWidth() - btn_total_width) / 2;

	for( S32 i = 0; i < num_options; i++ )
	{
		LLRect button_rect;

		LLButton* btn = LLUICtrlFactory::getInstance()->createFromFile<LLButton>("alert_button.xml", this, LLPanel::child_registry_t::instance());
		if(btn)
		{
			btn->setName(options[i].first);
			btn->setRect(button_rect.setOriginAndSize( button_left, VPAD, button_width, BTN_HEIGHT ));
			btn->setLabel(options[i].second);
			btn->setFont(font);

			btn->setClickedCallback(boost::bind(&LLToastAlertPanel::onButtonPressed, this, _2, i));

			mButtonData[i].mButton = btn;

			LLToastPanel::addChild(btn);

			if( i == mDefaultOption )
			{
				btn->setFocus(TRUE);
			}
		}
		button_left += button_width + BTN_HPAD;
	}

	std::string ignore_label;

	if (form->getIgnoreType() == LLNotificationForm::IGNORE_WITH_DEFAULT_RESPONSE)
	{
		setCheckBox(LLNotifications::instance().getGlobalString("skipnexttime"), ignore_label);
	}
	else if (form->getIgnoreType() == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE)
	{
		setCheckBox(LLNotifications::instance().getGlobalString("alwayschoose"), ignore_label);
	}

	// *TODO: check necessity of this code
	//gFloaterView->adjustToFitScreen(this, FALSE);
	if (mLineEditor)
	{
		mLineEditor->selectAll();
	}
	if(mDefaultOption >= 0)
	{
		// delay before enabling default button
		mDefaultBtnTimer.start();
		mDefaultBtnTimer.setTimerExpirySec(DEFAULT_BUTTON_DELAY);
	}

	LLTransientFloaterMgr::instance().addControlView(
			LLTransientFloaterMgr::GLOBAL, this);
}
LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal)
	:	LLModalDialog( notification->getLabel(), 100, 100, modal ),  // dummy size.  Will reshape below.
		LLInstanceTracker<LLAlertDialog, LLUUID>(notification->getID()),
		mDefaultButton( NULL ),
		mCheck(NULL),
		mCaution(notification->getPriority() >= NOTIFICATION_PRIORITY_HIGH),
		mLabel(notification->getName()),
		mLineEditor(NULL),
		mNote(notification)
{
	const LLFontGL* font = LLResMgr::getInstance()->getRes( FONT_NAME );
	const S32 LINE_HEIGHT = llfloor(font->getLineHeight() + 0.99f);
	const S32 EDITOR_HEIGHT = 20;

	LLNotificationFormPtr form = mNote->getForm();
	std::string edit_text_name;
	std::string edit_text_contents;
	bool is_password = false;

	setBackgroundVisible(TRUE);
	setBackgroundOpaque(TRUE);

	typedef std::list<ButtonData> options_t;
	options_t options;

	// for now, get LLSD to iterator over form elements
	LLSD form_sd = form->asLLSD();

	for (LLSD::array_const_iterator it = form_sd.beginArray(); it != form_sd.endArray(); ++it)
	{
		std::string type = (*it)["type"].asString();
		if (type == "button")
		{
			options.push_back(ButtonData());
			ButtonData& button_data = options.back();
			button_data.mName = (*it)["name"].asString();
			button_data.mText = (*it)["text"].asString();
			button_data.mDefault = (*it)["default"].asBoolean();
			if(options.size()-1 == mNote->getURLOption())
				button_data.mUrl = mNote->getURL();
		}
		else if (type == "text")
		{
			edit_text_contents = (*it)["value"].asString();
			edit_text_name = (*it)["name"].asString();
		}
		else if (type == "password")
		{
			edit_text_contents = (*it)["value"].asString();
			edit_text_name = (*it)["name"].asString();
			is_password = true;
		}
	}
	// Buttons
	if (options.empty())
	{
		options.push_back(ButtonData());
		ButtonData& button_data = options.back();
		button_data.mName = "close";
		button_data.mText = "Close";
		button_data.mDefault = true;
	}

	S32 num_options = options.size();

	// Calc total width of buttons
	S32 button_width = 0;
	S32 sp = font->getWidth(std::string("OO"));
	for( options_t::iterator it = options.begin(); it != options.end(); it++ )
	{
		S32 w = S32(font->getWidth( it->mText ) + 0.99f) + sp + 2 * LLBUTTON_H_PAD;
		button_width = llmax( w, button_width );
	}
	S32 btn_total_width = button_width;
	if( num_options > 1 )
	{
		btn_total_width = (num_options * button_width) + ((num_options - 1) * BTN_HPAD);
	}

	// Message: create text box using raw string, as text has been structure deliberately
	// Use size of created text box to generate dialog box size
	std::string msg = mNote->getMessage();
	llwarns << "Alert: " << msg << llendl;
	LLTextBox* msg_box = new LLTextBox( std::string("Alert message"), msg, (F32)MAX_ALLOWED_MSG_WIDTH, font );

	const LLRect& text_rect = msg_box->getRect();
	S32 dialog_width = llmax( btn_total_width, text_rect.getWidth() ) + 2 * HPAD;
	S32 dialog_height = text_rect.getHeight() + 3 * VPAD + BTN_HEIGHT;

	if (hasTitleBar())
	{
		dialog_height += LINE_HEIGHT; // room for title bar
	}

	// it's ok for the edit text body to be empty, but we want the name to exist if we're going to draw it
	if (!edit_text_name.empty())
	{
		dialog_height += EDITOR_HEIGHT + VPAD;
		dialog_width = llmax(dialog_width, (S32)(font->getWidth( edit_text_contents ) + 0.99f));
	}

	if (mCaution)
	{
		// Make room for the caution icon.
		dialog_width += 32 + HPAD;
	}

	reshape( dialog_width, dialog_height, FALSE );

	S32 msg_y = getRect().getHeight() - VPAD;
	S32 msg_x = HPAD;
	if (hasTitleBar())
	{
		msg_y -= LINE_HEIGHT; // room for title
	}

	if (mCaution)
	{
		LLIconCtrl* icon = new LLIconCtrl(std::string("icon"), LLRect(msg_x, msg_y, msg_x+32, msg_y-32), std::string("notify_caution_icon.tga"));
		icon->setMouseOpaque(FALSE);
		addChild(icon);
		msg_x += 32 + HPAD;
		msg_box->setColor( LLUI::sColorsGroup->getColor( "AlertCautionTextColor" ) );
	}
	else
	{
		msg_box->setColor( LLUI::sColorsGroup->getColor( "AlertTextColor" ) );
	}

	LLRect rect;
	rect.setLeftTopAndSize( msg_x, msg_y, text_rect.getWidth(), text_rect.getHeight() );
	msg_box->setRect( rect );
	addChild(msg_box);

	// Buttons	
	S32 button_left = (getRect().getWidth() - btn_total_width) / 2;

	for( options_t::iterator it = options.begin(); it != options.end(); it++ )
	{
		LLRect button_rect;
		button_rect.setOriginAndSize( button_left, VPAD, button_width, BTN_HEIGHT );

		ButtonData& button_data = *it;

		LLButton* btn = new LLButton(
			button_data.mName, button_rect,
			"","", "", 
			NULL,
			font,
			button_data.mText, 
			button_data.mText);

		btn->setClickedCallback(boost::bind(&LLAlertDialog::onButtonPressed, this, _1, button_data.mUrl));

		addChild(btn);

		if(!mDefaultButton || button_data.mDefault)
		{
			mDefaultButton = btn;
		}

		button_left += button_width + BTN_HPAD;
	}

	llassert(mDefaultButton); //'options' map should never be empty, thus mDefaultButton should always get set in the above loop.
	mDefaultButton->setFocus(TRUE);


	// (Optional) Edit Box	
	if (!edit_text_name.empty())
	{
		S32 y = VPAD + BTN_HEIGHT + VPAD/2;
		mLineEditor = new LLLineEditor(edit_text_name,
			LLRect( HPAD, y+EDITOR_HEIGHT, dialog_width-HPAD, y),
			edit_text_contents,
			LLFontGL::getFontSansSerif(),
			STD_STRING_STR_LEN);

		// make sure all edit keys get handled properly (DEV-22396)
		mLineEditor->setHandleEditKeysDirectly(TRUE);

		addChild(mLineEditor);
	}
	
	if (mLineEditor)
	{
		mLineEditor->setDrawAsterixes(is_password);

		setEditTextArgs(notification->getSubstitutions());
	}

	std::string ignore_label;

	if (form->getIgnoreType() == LLNotificationForm::IGNORE_WITH_DEFAULT_RESPONSE)
	{
		setCheckBox(LLNotificationTemplates::instance().getGlobalString("skipnexttime"), ignore_label);
	}
	else if (form->getIgnoreType() == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE)
	{
		setCheckBox(LLNotificationTemplates::instance().getGlobalString("alwayschoose"), ignore_label);
	}
}
	void initDialog( HWND hwnd )
	{
		addComboItems( GetDlgItem( hwnd, IDC_COMBOLANGUAGE ), manager.getOptionNames( "Language" ), manager.getTheOneInUse( "Language" ) );
		addComboItems( GetDlgItem( hwnd, IDC_COMBORESOLUTION ), manager.getOptionNames( "Resolution" ), manager.getTheOneInUse( "Resolution" ) );
		addComboItems( GetDlgItem( hwnd, IDC_COMBOGFXDETAIL ), manager.getOptionNames( "GraphicsDetail" ), manager.getTheOneInUse( "GraphicsDetail" ) );
		addComboItems( GetDlgItem( hwnd, IDC_COMBOSPEAKERTYPE ), manager.getOptionNames( "SpeakerType" ), manager.getTheOneInUse( "SpeakerType" ) );
		addComboItems( GetDlgItem( hwnd, IDC_COMBOMIXINGRATE ), manager.getOptionNames( "MixingRate" ), manager.getTheOneInUse( "MixingRate" ) );
		addComboItems( GetDlgItem( hwnd, IDC_COMBOPHYSICSDETAIL ),	manager.getOptionNames( "Physics Quality" ),	manager.getTheOneInUse( "Physics Quality" ) );
		addComboItems( GetDlgItem( hwnd, IDC_COMBOCONTROLTYPE ),	manager.getOptionNames( "ClawControlType" ),	manager.getTheOneInUse( "ClawControlType" ) );
	   // IDC_COMBOCONTROLTYPE	
		setCheckBox( hwnd, IDC_CHECKSOUND, manager.getTheOneInUse( "Sounds" ) );
		setCheckBox( hwnd, IDC_CHECKHARDWARE3D, manager.getTheOneInUse( "Hardware3D" ) );
		setCheckBox( hwnd, IDC_CHECKENABLEMENUVIDEO, manager.getTheOneInUse( "EnableMenuVideo" ) );
		setCheckBox( hwnd, IDC_CHECKENABLEMENUVSYNC, manager.getTheOneInUse( "VSync" ) );
		setCheckBox( hwnd, IDC_CHECKEAX, manager.getTheOneInUse( "Eax" ) );

		//SendMessage( hwnd, CB_ADDSTRING, 0, ( LPARAM ) game::getLocaleGuiString( items[ i ].c_str() ) );
		//SendMessage( hwnd, CB_SELECTSTRING, -1, ( LPARAM )game::getLocaleGuiString( select.c_str() ) );

		// Mod stuff
		setDescriptionText( GetDlgItem( hwnd, IDC_MOD_HELP ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_LAUNCHER_MOD_SELECTION ) );
		{
			SendMessage( GetDlgItem( hwnd, IDC_COMBOMODSELECTION ), CB_RESETCONTENT, 0, 0);

#ifdef FB_RU_HAX
			std::wstring nomod = ::game::DHLocaleManager::getInstance()->getWideString(::game::DHLocaleManager::BANK_GUI, "launcher_no_mod");
			SendMessageW( GetDlgItem( hwnd, IDC_COMBOMODSELECTION ), CB_ADDSTRING, (WPARAM)0, (LPARAM) nomod.c_str() );

#else
			std::string nomod = game::getLocaleGuiString("launcher_no_mod");
			SendMessage( GetDlgItem( hwnd, IDC_COMBOMODSELECTION ), CB_ADDSTRING, 0, ( LPARAM ) nomod.c_str());
#endif

			for(int i = 0; i < modSelector.getModAmount(); ++i)
			{
				const std::string &desc = modSelector.getDescription(i);
				SendMessage( GetDlgItem( hwnd, IDC_COMBOMODSELECTION ), CB_ADDSTRING, 0, ( LPARAM ) desc.c_str());
			}

			int selection = modSelector.getActiveIndex();
			SendMessage( GetDlgItem( hwnd, IDC_COMBOMODSELECTION ), CB_SETCURSEL, selection + 1, 0);
			/*
			if(selection >= 0)
				SendMessage( GetDlgItem( hwnd, IDC_COMBOMODSELECTION ), CB_SETCURSEL, selection + 1, 0);
			else
				SendMessage( GetDlgItem( hwnd, IDC_COMBOMODSELECTION ), CB_SETCURSEL, 0, 0);
			*/

			/*
			const std::string root = "Mods";

			filesystem::StandardPackage files;
			filesystem::FileList fileList;
			files.findFiles(root, "*.zip", fileList);

			modList.clear();
			modStringList.clear();

			for(int i = 0; i < fileList.getFileAmount(root); ++i)
			{
				const std::string &zipFullName = fileList.getFileName(root, i);
				std::string zipName;
				int index = zipFullName.find_first_of("/\\");
				if(index != zipFullName.npos)
					zipName = zipFullName.substr(index + 1, zipFullName.size() - index - 1);

				filesystem::ZipPackage zip(zipFullName);
				filesystem::InputStream stream = zip.getFile("description.txt");
				if(stream.isEof())
					continue;

				editor::Parser parser;
				stream >> parser;

				const editor::ParserGroup &group = parser.getGlobals();
				if(group.getLineCount() < 1)
					continue;

				std::string name = group.getLine(0);
				if(name.size() < 4)
					continue;

				modList[name] = zipName;
				modStringList.push_back(name);
			}

			std::sort(modStringList.begin(), modStringList.end());

			// FIXME -- get key from locales
			SendMessage( GetDlgItem( hwnd, IDC_COMBOMODSELECTION ), CB_ADDSTRING, 0, ( LPARAM ) "Nothing. Zip. Nada");
			for(unsigned int i = 0; i < modStringList.size(); ++i)
				SendMessage( GetDlgItem( hwnd, IDC_COMBOMODSELECTION ), CB_ADDSTRING, 0, ( LPARAM ) modStringList[i].c_str());
			
			//if no mod selected
				SendMessage( GetDlgItem( hwnd, IDC_COMBOMODSELECTION ), CB_SETCURSEL, 0, 0);
			*/
		}

		// Editor things
		setDescriptionText( GetDlgItem( hwnd, IDC_EDITOR_HELP ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_LAUNCHER_EDITOR ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_EDITOR_MANUAL ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_EDITOR_LAUNCH ) );


		// buttons
		setDescriptionText( GetDlgItem( hwnd, IDOK ) );
		setDescriptionText( GetDlgItem( hwnd, IDCANCEL ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_BUTTONADVANCED ) );
		setDescriptionText( GetDlgItem( hwnd, IDCHECKUPDATES ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_ACTIVATEMOD ) );

		// language
		setDescriptionText( GetDlgItem( hwnd, IDC_CAPTION1 ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_CAPTION6 ) );
		
		// graphics detail
		setDescriptionText( GetDlgItem( hwnd, IDC_STATICGRAPHICSLEVEL ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_CAPTION2 ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_CAPTION3 ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_CHECKENABLEMENUVIDEO ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_CHECKENABLEMENUVSYNC ) );

		// physics
		setDescriptionText( GetDlgItem( hwnd, IDC_STATICPHYSICSLEVEL ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_AGEIAPROPAGANDA ) );


		// sounds
		setDescriptionText( GetDlgItem( hwnd, IDC_STATICSOUNDS ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_CHECKSOUND ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_CHECKHARDWARE3D ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_CAPTION4 ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_CAPTION5 ) );
		setDescriptionText( GetDlgItem( hwnd, IDC_CHECKEAX ) );

		
	}