From 147b2694843c541e324a9db35759ca237487c932 Mon Sep 17 00:00:00 2001 From: David Seikel Date: Thu, 21 Apr 2011 06:18:43 +1000 Subject: Half finished UI clean up for OTR, but it works. Hence all the commented out stuff that will be sorted out soon. I have a different idea about how that will work. --- linden/indra/newview/llimpanel.cpp | 99 +++++++++++----------- .../default/xui/en-us/floater_instant_message.xml | 20 +++++ 2 files changed, 70 insertions(+), 49 deletions(-) diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index de57225..4ea3a4c 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp @@ -1412,21 +1412,21 @@ BOOL LLFloaterIMPanel::postBuild() #if USE_OTR // [$PLOTR$] if (!gOTR) OTR_Wrapper::init(); if (gOTR && (IM_NOTHING_SPECIAL == mDialog)) - { - LLComboBox *combo = getChild("otr_combo"); - if (!combo) - { - llwarns << "$PLOTR$ Can't find OTR control/status" << llendl; - } - else - { - llinfos << "$PLOTR$ found OTR control/status" << llendl; - combo->setCommitCallback(onClickOtr); - combo->setCallbackUserData(this); - combo->setAllowTextEntry(FALSE, 0, FALSE); - showOtrStatus(); - } - } + { + LLComboBox *combo = getChild("otr_btn"); + if (!combo) + { + llwarns << "$PLOTR$ Can't find OTR control/status" << llendl; + } + else + { + llinfos << "$PLOTR$ found OTR control/status" << llendl; + combo->setCommitCallback(onClickOtr); + combo->setCallbackUserData(this); + combo->setAllowTextEntry(FALSE, 0, FALSE); + showOtrStatus(); + } + } #endif // USE_OTR // [/$PLOTR$] setDefaultBtn("send_btn"); @@ -2417,11 +2417,12 @@ void LLFloaterIMPanel::doOtrAuth() } } + void LLFloaterIMPanel::doOtrMenu() { if (gOTR && (IM_NOTHING_SPECIAL == mDialog)) { - LLComboBox *combo = getChild("otr_combo"); + LLComboBox *combo = getChild("otr_btn"); if (!combo) { llwarns << "$PLOTR$ Can't find OTR control/status" << llendl; @@ -2429,26 +2430,26 @@ void LLFloaterIMPanel::doOtrMenu() else { std::string choice = combo->getSimple(); - if ((getString("otr_start") == choice) || - (getString("otr_restart") == choice) || - (getString("otr_refresh") == choice)) + if ((combo->getValue().asString() == "otr_start_entry") || + (combo->getValue().asString() == "otr_restart_entry") || + (combo->getValue().asString() == "otr_refresh_entry")) { doOtrStart(); } - else if (getString("otr_stop") == choice) + else if (combo->getValue().asString() == "otr_stop_entry") { doOtrStop(); } - else if (getString("otr_auth") == choice) + else if (combo->getValue().asString() == "otr_auth_entry") { doOtrAuth(); } - else if (getString("otr_help") == choice) + else if (combo->getValue().asString() == "otr_help_entry") { llinfos << "$PLOTR$ otr help" << llendl; LLWeb::loadURL("http://www.cypherpunks.ca/otr/"); } - else if (getString("otr_levels") == choice) + else if (combo->getValue().asString() == "otr_levels_entry") { llinfos << "$PLOTR$ otr levels help" << llendl; LLWeb::loadURL("http://www.cypherpunks.ca/otr/help/3.2.0/levels.php"); @@ -2502,10 +2503,10 @@ void LLFloaterIMPanel::showOtrStatus() { if (gOTR && (IM_NOTHING_SPECIAL == mDialog)) { - LLComboBox *combo = getChild("otr_combo"); + LLFlyoutButton *combo = (LLFlyoutButton *) getChild("otr_btn"); if (!combo) { - llwarns << "$PLOTR$ Can't find OTR control/status" << llendl; + llerrs << "$PLOTR$ Can't find OTR control/status" << llendl; } else { @@ -2518,22 +2519,22 @@ void LLFloaterIMPanel::showOtrStatus() { doOtrStop(); } - combo->removeall(); - combo->add(getString("otr_start"), ADD_BOTTOM, TRUE); // to tell them where to turn it back on - combo->add(getString("otr_stop"), ADD_BOTTOM, FALSE); - combo->add(getString("otr_auth"), ADD_BOTTOM, FALSE); - combo->add(getString("otr_help"), ADD_BOTTOM, TRUE); - combo->add(getString("otr_levels"), ADD_BOTTOM, TRUE); +// combo->removeall(); +// combo->add(getString("otr_start_entry"), ADD_BOTTOM, TRUE); // to tell them where to turn it back on +// combo->add(getString("otr_stop_entry"), ADD_BOTTOM, FALSE); +// combo->add(getString("otr_auth_entry"), ADD_BOTTOM, FALSE); +// combo->add(getString("otr_help_entry"), ADD_BOTTOM, TRUE); +// combo->add(getString("otr_levels_entry"), ADD_BOTTOM, TRUE); combo->setLabel(getString("otr_not_private")); } else if (context && (OTRL_MSGSTATE_ENCRYPTED == context->msgstate)) { - combo->removeall(); - combo->add(getString("otr_refresh"), ADD_BOTTOM, TRUE); - combo->add(getString("otr_stop"), ADD_BOTTOM, TRUE); - combo->add(getString("otr_auth"), ADD_BOTTOM, TRUE); - combo->add(getString("otr_help"), ADD_BOTTOM, TRUE); - combo->add(getString("otr_levels"), ADD_BOTTOM, TRUE); +// combo->removeall(); +// combo->add(getString("otr_refresh_entry"), ADD_BOTTOM, TRUE); +// combo->add(getString("otr_stop_entry"), ADD_BOTTOM, TRUE); +// combo->add(getString("otr_auth_entry"), ADD_BOTTOM, TRUE); +// combo->add(getString("otr_help_entry"), ADD_BOTTOM, TRUE); +// combo->add(getString("otr_levels_entry"), ADD_BOTTOM, TRUE); if (otherIsOtrAuthenticated()) combo->setLabel(getString("otr_private")); else @@ -2548,22 +2549,22 @@ void LLFloaterIMPanel::showOtrStatus() else otrLogMessageGetstringName("otr_prog_they_stop_unverified"); } - combo->removeall(); - combo->add(getString("otr_restart"), ADD_BOTTOM, TRUE); - combo->add(getString("otr_stop"), ADD_BOTTOM, TRUE); - combo->add(getString("otr_auth"), ADD_BOTTOM, FALSE); - combo->add(getString("otr_help"), ADD_BOTTOM, TRUE); - combo->add(getString("otr_levels"), ADD_BOTTOM, TRUE); +// combo->removeall(); +// combo->add(getString("otr_restart_entry"), ADD_BOTTOM, TRUE); +// combo->add(getString("otr_stop_entry"), ADD_BOTTOM, TRUE); +// combo->add(getString("otr_auth_entry"), ADD_BOTTOM, FALSE); +// combo->add(getString("otr_help_entry"), ADD_BOTTOM, TRUE); +// combo->add(getString("otr_levels_entry"), ADD_BOTTOM, TRUE); combo->setLabel(getString("otr_finished")); } else // OTRL_MSGSTATE_PLAINTEXT, or no context yet { - combo->removeall(); - combo->add(getString("otr_start"), ADD_BOTTOM, TRUE); - combo->add(getString("otr_stop"), ADD_BOTTOM, FALSE); - combo->add(getString("otr_auth"), ADD_BOTTOM, FALSE); - combo->add(getString("otr_help"), ADD_BOTTOM, TRUE); - combo->add(getString("otr_levels"), ADD_BOTTOM, TRUE); +// combo->removeall(); +// combo->add(getString("otr_start_entry"), ADD_BOTTOM, TRUE); +// combo->add(getString("otr_stop_entry"), ADD_BOTTOM, FALSE); +// combo->add(getString("otr_auth_entry"), ADD_BOTTOM, FALSE); +// combo->add(getString("otr_help_entry"), ADD_BOTTOM, TRUE); +// combo->add(getString("otr_levels_entry"), ADD_BOTTOM, TRUE); combo->setLabel(getString("otr_not_private")); } if (context) diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_instant_message.xml b/linden/indra/newview/skins/default/xui/en-us/floater_instant_message.xml index 5ad564a..22875d7 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_instant_message.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_instant_message.xml @@ -95,6 +95,26 @@ image_overlay="icn_voice-call-end.tga" image_overlay_alignment="left" label="End Call" left_delta="0" name="end_call_btn" pad_right="10" visible="false" width="100" /> + + + + Start private conversation + + + End private conversation + + + Authenticate buddy + + + What is OTR? + + + What is this? + + + -- cgit v1.1