diff options
author | David Seikel | 2011-04-21 10:36:53 +1000 |
---|---|---|
committer | David Seikel | 2011-04-21 10:36:53 +1000 |
commit | ade2ddb7b9d44167611d1573d4d3334b2b905623 (patch) | |
tree | 64ed3254b5efe530fdee3771f805e49061afff1a | |
parent | Half finished UI clean up for OTR, but it works. (diff) | |
download | meta-impy-ade2ddb7b9d44167611d1573d4d3334b2b905623.zip meta-impy-ade2ddb7b9d44167611d1573d4d3334b2b905623.tar.gz meta-impy-ade2ddb7b9d44167611d1573d4d3334b2b905623.tar.bz2 meta-impy-ade2ddb7b9d44167611d1573d4d3334b2b905623.tar.xz |
The next part of the UI changes for OTR.
Might be some corner cases left over, but I'm generally happy with this.
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llimpanel.cpp | 70 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_instant_message.xml | 13 |
2 files changed, 33 insertions, 50 deletions
diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index 4ea3a4c..7ccf49c 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp | |||
@@ -1413,6 +1413,7 @@ BOOL LLFloaterIMPanel::postBuild() | |||
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 | childSetCommitCallback("otr_btn", onClickOtr, this); | ||
1416 | LLComboBox *combo = getChild<LLComboBox>("otr_btn"); | 1417 | LLComboBox *combo = getChild<LLComboBox>("otr_btn"); |
1417 | if (!combo) | 1418 | if (!combo) |
1418 | { | 1419 | { |
@@ -2429,20 +2430,16 @@ void LLFloaterIMPanel::doOtrMenu() | |||
2429 | } | 2430 | } |
2430 | else | 2431 | else |
2431 | { | 2432 | { |
2432 | std::string choice = combo->getSimple(); | 2433 | ConnContext *context = getOtrContext(); |
2433 | if ((combo->getValue().asString() == "otr_start_entry") || | 2434 | U32 otrpref = gSavedSettings.getU32("EmeraldUseOTR"); |
2434 | (combo->getValue().asString() == "otr_restart_entry") || | 2435 | if (combo->getValue().asString() == "otr_auth_entry") |
2435 | (combo->getValue().asString() == "otr_refresh_entry")) | ||
2436 | { | 2436 | { |
2437 | doOtrStart(); | 2437 | // Instant crash when doing this with someone that has no OTR capability. |
2438 | } | 2438 | // So guard it if no encryption is happening. |
2439 | else if (combo->getValue().asString() == "otr_stop_entry") | 2439 | if (context && (OTRL_MSGSTATE_ENCRYPTED == context->msgstate)) |
2440 | { | 2440 | { |
2441 | doOtrStop(); | 2441 | doOtrAuth(); |
2442 | } | 2442 | } |
2443 | else if (combo->getValue().asString() == "otr_auth_entry") | ||
2444 | { | ||
2445 | doOtrAuth(); | ||
2446 | } | 2443 | } |
2447 | else if (combo->getValue().asString() == "otr_help_entry") | 2444 | else if (combo->getValue().asString() == "otr_help_entry") |
2448 | { | 2445 | { |
@@ -2454,9 +2451,28 @@ void LLFloaterIMPanel::doOtrMenu() | |||
2454 | llinfos << "$PLOTR$ otr levels help" << llendl; | 2451 | llinfos << "$PLOTR$ otr levels help" << llendl; |
2455 | LLWeb::loadURL("http://www.cypherpunks.ca/otr/help/3.2.0/levels.php"); | 2452 | LLWeb::loadURL("http://www.cypherpunks.ca/otr/help/3.2.0/levels.php"); |
2456 | } | 2453 | } |
2457 | else | 2454 | else // Clicked the flyout itself. Sort out what level to put them in based on the old level. |
2458 | { | 2455 | { |
2459 | llwarns << "$PLOTR$ unknown menu item" << llendl; | 2456 | // otrpref: 0 == Require OTR, 1 == Request OTR, 2 == Accept OTR, 3 == Decline OTR |
2457 | if (3 == otrpref) | ||
2458 | { | ||
2459 | if (context && (OTRL_MSGSTATE_ENCRYPTED == context->msgstate)) | ||
2460 | { | ||
2461 | doOtrStop(); | ||
2462 | } | ||
2463 | } | ||
2464 | else if (context && (OTRL_MSGSTATE_ENCRYPTED == context->msgstate)) | ||
2465 | { | ||
2466 | doOtrStop(); | ||
2467 | } | ||
2468 | else if (context && (OTRL_MSGSTATE_FINISHED == context->msgstate)) | ||
2469 | { | ||
2470 | doOtrStop(); | ||
2471 | } | ||
2472 | else // OTRL_MSGSTATE_PLAINTEXT, or no context yet | ||
2473 | { | ||
2474 | doOtrStart(); | ||
2475 | } | ||
2460 | } | 2476 | } |
2461 | } | 2477 | } |
2462 | } | 2478 | } |
@@ -2519,22 +2535,10 @@ void LLFloaterIMPanel::showOtrStatus() | |||
2519 | { | 2535 | { |
2520 | doOtrStop(); | 2536 | doOtrStop(); |
2521 | } | 2537 | } |
2522 | // combo->removeall(); | ||
2523 | // combo->add(getString("otr_start_entry"), ADD_BOTTOM, TRUE); // to tell them where to turn it back on | ||
2524 | // combo->add(getString("otr_stop_entry"), ADD_BOTTOM, FALSE); | ||
2525 | // combo->add(getString("otr_auth_entry"), ADD_BOTTOM, FALSE); | ||
2526 | // combo->add(getString("otr_help_entry"), ADD_BOTTOM, TRUE); | ||
2527 | // combo->add(getString("otr_levels_entry"), ADD_BOTTOM, TRUE); | ||
2528 | combo->setLabel(getString("otr_not_private")); | 2538 | combo->setLabel(getString("otr_not_private")); |
2529 | } | 2539 | } |
2530 | else if (context && (OTRL_MSGSTATE_ENCRYPTED == context->msgstate)) | 2540 | else if (context && (OTRL_MSGSTATE_ENCRYPTED == context->msgstate)) |
2531 | { | 2541 | { |
2532 | // combo->removeall(); | ||
2533 | // combo->add(getString("otr_refresh_entry"), ADD_BOTTOM, TRUE); | ||
2534 | // combo->add(getString("otr_stop_entry"), ADD_BOTTOM, TRUE); | ||
2535 | // combo->add(getString("otr_auth_entry"), ADD_BOTTOM, TRUE); | ||
2536 | // combo->add(getString("otr_help_entry"), ADD_BOTTOM, TRUE); | ||
2537 | // combo->add(getString("otr_levels_entry"), ADD_BOTTOM, TRUE); | ||
2538 | if (otherIsOtrAuthenticated()) | 2542 | if (otherIsOtrAuthenticated()) |
2539 | combo->setLabel(getString("otr_private")); | 2543 | combo->setLabel(getString("otr_private")); |
2540 | else | 2544 | else |
@@ -2549,22 +2553,10 @@ void LLFloaterIMPanel::showOtrStatus() | |||
2549 | else | 2553 | else |
2550 | otrLogMessageGetstringName("otr_prog_they_stop_unverified"); | 2554 | otrLogMessageGetstringName("otr_prog_they_stop_unverified"); |
2551 | } | 2555 | } |
2552 | // combo->removeall(); | ||
2553 | // combo->add(getString("otr_restart_entry"), ADD_BOTTOM, TRUE); | ||
2554 | // combo->add(getString("otr_stop_entry"), ADD_BOTTOM, TRUE); | ||
2555 | // combo->add(getString("otr_auth_entry"), ADD_BOTTOM, FALSE); | ||
2556 | // combo->add(getString("otr_help_entry"), ADD_BOTTOM, TRUE); | ||
2557 | // combo->add(getString("otr_levels_entry"), ADD_BOTTOM, TRUE); | ||
2558 | combo->setLabel(getString("otr_finished")); | 2556 | combo->setLabel(getString("otr_finished")); |
2559 | } | 2557 | } |
2560 | else // OTRL_MSGSTATE_PLAINTEXT, or no context yet | 2558 | else // OTRL_MSGSTATE_PLAINTEXT, or no context yet |
2561 | { | 2559 | { |
2562 | // combo->removeall(); | ||
2563 | // combo->add(getString("otr_start_entry"), ADD_BOTTOM, TRUE); | ||
2564 | // combo->add(getString("otr_stop_entry"), ADD_BOTTOM, FALSE); | ||
2565 | // combo->add(getString("otr_auth_entry"), ADD_BOTTOM, FALSE); | ||
2566 | // combo->add(getString("otr_help_entry"), ADD_BOTTOM, TRUE); | ||
2567 | // combo->add(getString("otr_levels_entry"), ADD_BOTTOM, TRUE); | ||
2568 | combo->setLabel(getString("otr_not_private")); | 2560 | combo->setLabel(getString("otr_not_private")); |
2569 | } | 2561 | } |
2570 | if (context) | 2562 | 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 22875d7..96f8f1e 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 | |||
@@ -97,13 +97,8 @@ | |||
97 | visible="false" width="100" /> | 97 | visible="false" width="100" /> |
98 | 98 | ||
99 | <flyout_button bottom_delta="0" follows="left|top" height="20" label="OTR: Status" left_delta="5" width="150" | 99 | <flyout_button bottom_delta="0" follows="left|top" height="20" label="OTR: Status" left_delta="5" width="150" |
100 | list_position="below" mouse_opaque="true" name="otr_btn"> | 100 | list_position="below" mouse_opaque="true" name="otr_btn" |
101 | <flyout_button_item value="otr_start_entry" name="otr_start_entry"> | 101 | tool_tip="Click to change OTR status, or dropdown for other options." > |
102 | Start private conversation | ||
103 | </flyout_button_item> | ||
104 | <flyout_button_item value="otr_stop_entry" name="otr_stop_entry"> | ||
105 | End private conversation | ||
106 | </flyout_button_item> | ||
107 | <flyout_button_item value="otr_auth_entry" name="otr_auth_entry"> | 102 | <flyout_button_item value="otr_auth_entry" name="otr_auth_entry"> |
108 | Authenticate buddy | 103 | Authenticate buddy |
109 | </flyout_button_item> | 104 | </flyout_button_item> |
@@ -128,10 +123,6 @@ | |||
128 | image_unselected="icn_speaker_dark.tga" label="" left_delta="56" | 123 | image_unselected="icn_speaker_dark.tga" label="" left_delta="56" |
129 | name="mute_btn" tool_tip="Mute voice" width="25" /> | 124 | name="mute_btn" tool_tip="Mute voice" width="25" /> |
130 | </panel> | 125 | </panel> |
131 | <!--[$PLOTR$]--> | ||
132 | <combo_box bottom="-40" follows="top|right" left="-230" height="20" width="120" | ||
133 | label="OTR: Not Private" name="otr_combo"/> | ||
134 | <!--[/$PLOTR$]--> | ||
135 | <text_editor type="string" length="1" bg_readonly_color="ChatHistoryBgColor" bg_writeable_color="ChatHistoryBgColor" | 126 | <text_editor type="string" length="1" bg_readonly_color="ChatHistoryBgColor" bg_writeable_color="ChatHistoryBgColor" |
136 | bottom="30" embedded_items="false" enabled="false" | 127 | bottom="30" embedded_items="false" enabled="false" |
137 | follows="left|top|right|bottom" font="SansSerif" height="221" left="5" | 128 | follows="left|top|right|bottom" font="SansSerif" height="221" left="5" |