aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llimpanel.cpp
diff options
context:
space:
mode:
authorDavid Seikel2011-04-21 06:18:43 +1000
committerDavid Seikel2011-04-21 06:18:43 +1000
commit147b2694843c541e324a9db35759ca237487c932 (patch)
tree977cc76a5fd6942d8c5487793ebd725abdb137a2 /linden/indra/newview/llimpanel.cpp
parentAllow changing the text on a flyout button. (diff)
downloadmeta-impy-147b2694843c541e324a9db35759ca237487c932.zip
meta-impy-147b2694843c541e324a9db35759ca237487c932.tar.gz
meta-impy-147b2694843c541e324a9db35759ca237487c932.tar.bz2
meta-impy-147b2694843c541e324a9db35759ca237487c932.tar.xz
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.
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llimpanel.cpp99
1 files changed, 50 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()
1412#if USE_OTR // [$PLOTR$] 1412#if USE_OTR // [$PLOTR$]
1413 if (!gOTR) OTR_Wrapper::init(); 1413 if (!gOTR) OTR_Wrapper::init();
1414 if (gOTR && (IM_NOTHING_SPECIAL == mDialog)) 1414 if (gOTR && (IM_NOTHING_SPECIAL == mDialog))
1415 { 1415 {
1416 LLComboBox *combo = getChild<LLComboBox>("otr_combo"); 1416 LLComboBox *combo = getChild<LLComboBox>("otr_btn");
1417 if (!combo) 1417 if (!combo)
1418 { 1418 {
1419 llwarns << "$PLOTR$ Can't find OTR control/status" << llendl; 1419 llwarns << "$PLOTR$ Can't find OTR control/status" << llendl;
1420 } 1420 }
1421 else 1421 else
1422 { 1422 {
1423 llinfos << "$PLOTR$ found OTR control/status" << llendl; 1423 llinfos << "$PLOTR$ found OTR control/status" << llendl;
1424 combo->setCommitCallback(onClickOtr); 1424 combo->setCommitCallback(onClickOtr);
1425 combo->setCallbackUserData(this); 1425 combo->setCallbackUserData(this);
1426 combo->setAllowTextEntry(FALSE, 0, FALSE); 1426 combo->setAllowTextEntry(FALSE, 0, FALSE);
1427 showOtrStatus(); 1427 showOtrStatus();
1428 } 1428 }
1429 } 1429 }
1430#endif // USE_OTR // [/$PLOTR$] 1430#endif // USE_OTR // [/$PLOTR$]
1431 1431
1432 setDefaultBtn("send_btn"); 1432 setDefaultBtn("send_btn");
@@ -2417,11 +2417,12 @@ void LLFloaterIMPanel::doOtrAuth()
2417 } 2417 }
2418} 2418}
2419 2419
2420
2420void LLFloaterIMPanel::doOtrMenu() 2421void LLFloaterIMPanel::doOtrMenu()
2421{ 2422{
2422 if (gOTR && (IM_NOTHING_SPECIAL == mDialog)) 2423 if (gOTR && (IM_NOTHING_SPECIAL == mDialog))
2423 { 2424 {
2424 LLComboBox *combo = getChild<LLComboBox>("otr_combo"); 2425 LLComboBox *combo = getChild<LLComboBox>("otr_btn");
2425 if (!combo) 2426 if (!combo)
2426 { 2427 {
2427 llwarns << "$PLOTR$ Can't find OTR control/status" << llendl; 2428 llwarns << "$PLOTR$ Can't find OTR control/status" << llendl;
@@ -2429,26 +2430,26 @@ void LLFloaterIMPanel::doOtrMenu()
2429 else 2430 else
2430 { 2431 {
2431 std::string choice = combo->getSimple(); 2432 std::string choice = combo->getSimple();
2432 if ((getString("otr_start") == choice) || 2433 if ((combo->getValue().asString() == "otr_start_entry") ||
2433 (getString("otr_restart") == choice) || 2434 (combo->getValue().asString() == "otr_restart_entry") ||
2434 (getString("otr_refresh") == choice)) 2435 (combo->getValue().asString() == "otr_refresh_entry"))
2435 { 2436 {
2436 doOtrStart(); 2437 doOtrStart();
2437 } 2438 }
2438 else if (getString("otr_stop") == choice) 2439 else if (combo->getValue().asString() == "otr_stop_entry")
2439 { 2440 {
2440 doOtrStop(); 2441 doOtrStop();
2441 } 2442 }
2442 else if (getString("otr_auth") == choice) 2443 else if (combo->getValue().asString() == "otr_auth_entry")
2443 { 2444 {
2444 doOtrAuth(); 2445 doOtrAuth();
2445 } 2446 }
2446 else if (getString("otr_help") == choice) 2447 else if (combo->getValue().asString() == "otr_help_entry")
2447 { 2448 {
2448 llinfos << "$PLOTR$ otr help" << llendl; 2449 llinfos << "$PLOTR$ otr help" << llendl;
2449 LLWeb::loadURL("http://www.cypherpunks.ca/otr/"); 2450 LLWeb::loadURL("http://www.cypherpunks.ca/otr/");
2450 } 2451 }
2451 else if (getString("otr_levels") == choice) 2452 else if (combo->getValue().asString() == "otr_levels_entry")
2452 { 2453 {
2453 llinfos << "$PLOTR$ otr levels help" << llendl; 2454 llinfos << "$PLOTR$ otr levels help" << llendl;
2454 LLWeb::loadURL("http://www.cypherpunks.ca/otr/help/3.2.0/levels.php"); 2455 LLWeb::loadURL("http://www.cypherpunks.ca/otr/help/3.2.0/levels.php");
@@ -2502,10 +2503,10 @@ void LLFloaterIMPanel::showOtrStatus()
2502{ 2503{
2503 if (gOTR && (IM_NOTHING_SPECIAL == mDialog)) 2504 if (gOTR && (IM_NOTHING_SPECIAL == mDialog))
2504 { 2505 {
2505 LLComboBox *combo = getChild<LLComboBox>("otr_combo"); 2506 LLFlyoutButton *combo = (LLFlyoutButton *) getChild<LLComboBox>("otr_btn");
2506 if (!combo) 2507 if (!combo)
2507 { 2508 {
2508 llwarns << "$PLOTR$ Can't find OTR control/status" << llendl; 2509 llerrs << "$PLOTR$ Can't find OTR control/status" << llendl;
2509 } 2510 }
2510 else 2511 else
2511 { 2512 {
@@ -2518,22 +2519,22 @@ void LLFloaterIMPanel::showOtrStatus()
2518 { 2519 {
2519 doOtrStop(); 2520 doOtrStop();
2520 } 2521 }
2521 combo->removeall(); 2522// combo->removeall();
2522 combo->add(getString("otr_start"), ADD_BOTTOM, TRUE); // to tell them where to turn it back on 2523// combo->add(getString("otr_start_entry"), ADD_BOTTOM, TRUE); // to tell them where to turn it back on
2523 combo->add(getString("otr_stop"), ADD_BOTTOM, FALSE); 2524// combo->add(getString("otr_stop_entry"), ADD_BOTTOM, FALSE);
2524 combo->add(getString("otr_auth"), ADD_BOTTOM, FALSE); 2525// combo->add(getString("otr_auth_entry"), ADD_BOTTOM, FALSE);
2525 combo->add(getString("otr_help"), ADD_BOTTOM, TRUE); 2526// combo->add(getString("otr_help_entry"), ADD_BOTTOM, TRUE);
2526 combo->add(getString("otr_levels"), ADD_BOTTOM, TRUE); 2527// combo->add(getString("otr_levels_entry"), ADD_BOTTOM, TRUE);
2527 combo->setLabel(getString("otr_not_private")); 2528 combo->setLabel(getString("otr_not_private"));
2528 } 2529 }
2529 else if (context && (OTRL_MSGSTATE_ENCRYPTED == context->msgstate)) 2530 else if (context && (OTRL_MSGSTATE_ENCRYPTED == context->msgstate))
2530 { 2531 {
2531 combo->removeall(); 2532// combo->removeall();
2532 combo->add(getString("otr_refresh"), ADD_BOTTOM, TRUE); 2533// combo->add(getString("otr_refresh_entry"), ADD_BOTTOM, TRUE);
2533 combo->add(getString("otr_stop"), ADD_BOTTOM, TRUE); 2534// combo->add(getString("otr_stop_entry"), ADD_BOTTOM, TRUE);
2534 combo->add(getString("otr_auth"), ADD_BOTTOM, TRUE); 2535// combo->add(getString("otr_auth_entry"), ADD_BOTTOM, TRUE);
2535 combo->add(getString("otr_help"), ADD_BOTTOM, TRUE); 2536// combo->add(getString("otr_help_entry"), ADD_BOTTOM, TRUE);
2536 combo->add(getString("otr_levels"), ADD_BOTTOM, TRUE); 2537// combo->add(getString("otr_levels_entry"), ADD_BOTTOM, TRUE);
2537 if (otherIsOtrAuthenticated()) 2538 if (otherIsOtrAuthenticated())
2538 combo->setLabel(getString("otr_private")); 2539 combo->setLabel(getString("otr_private"));
2539 else 2540 else
@@ -2548,22 +2549,22 @@ void LLFloaterIMPanel::showOtrStatus()
2548 else 2549 else
2549 otrLogMessageGetstringName("otr_prog_they_stop_unverified"); 2550 otrLogMessageGetstringName("otr_prog_they_stop_unverified");
2550 } 2551 }
2551 combo->removeall(); 2552// combo->removeall();
2552 combo->add(getString("otr_restart"), ADD_BOTTOM, TRUE); 2553// combo->add(getString("otr_restart_entry"), ADD_BOTTOM, TRUE);
2553 combo->add(getString("otr_stop"), ADD_BOTTOM, TRUE); 2554// combo->add(getString("otr_stop_entry"), ADD_BOTTOM, TRUE);
2554 combo->add(getString("otr_auth"), ADD_BOTTOM, FALSE); 2555// combo->add(getString("otr_auth_entry"), ADD_BOTTOM, FALSE);
2555 combo->add(getString("otr_help"), ADD_BOTTOM, TRUE); 2556// combo->add(getString("otr_help_entry"), ADD_BOTTOM, TRUE);
2556 combo->add(getString("otr_levels"), ADD_BOTTOM, TRUE); 2557// combo->add(getString("otr_levels_entry"), ADD_BOTTOM, TRUE);
2557 combo->setLabel(getString("otr_finished")); 2558 combo->setLabel(getString("otr_finished"));
2558 } 2559 }
2559 else // OTRL_MSGSTATE_PLAINTEXT, or no context yet 2560 else // OTRL_MSGSTATE_PLAINTEXT, or no context yet
2560 { 2561 {
2561 combo->removeall(); 2562// combo->removeall();
2562 combo->add(getString("otr_start"), ADD_BOTTOM, TRUE); 2563// combo->add(getString("otr_start_entry"), ADD_BOTTOM, TRUE);
2563 combo->add(getString("otr_stop"), ADD_BOTTOM, FALSE); 2564// combo->add(getString("otr_stop_entry"), ADD_BOTTOM, FALSE);
2564 combo->add(getString("otr_auth"), ADD_BOTTOM, FALSE); 2565// combo->add(getString("otr_auth_entry"), ADD_BOTTOM, FALSE);
2565 combo->add(getString("otr_help"), ADD_BOTTOM, TRUE); 2566// combo->add(getString("otr_help_entry"), ADD_BOTTOM, TRUE);
2566 combo->add(getString("otr_levels"), ADD_BOTTOM, TRUE); 2567// combo->add(getString("otr_levels_entry"), ADD_BOTTOM, TRUE);
2567 combo->setLabel(getString("otr_not_private")); 2568 combo->setLabel(getString("otr_not_private"));
2568 } 2569 }
2569 if (context) 2570 if (context)