From ec65e9070eb177ca9d2a4deeb14ed73f8e685343 Mon Sep 17 00:00:00 2001
From: David Seikel
Date: Tue, 19 Apr 2011 03:33:16 +1000
Subject: Apparently there is a wrong client tag for Firestorm out in the wild.
Adding both, to be sure, and I've not seen anyone using it anyway.
---
linden/indra/newview/app_settings/client_list.xml | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/linden/indra/newview/app_settings/client_list.xml b/linden/indra/newview/app_settings/client_list.xml
index 5aaf3f4..183326c 100644
--- a/linden/indra/newview/app_settings/client_list.xml
+++ b/linden/indra/newview/app_settings/client_list.xml
@@ -1138,6 +1138,18 @@
name
Firestorm
+ 46697265-7374-6f72-6d00-000000000000
+
+ color
+
+ -0.04313725490196099882078684
+ -0.6862745098039200186690323
+ -0.3647058823529399917973137
+ 1
+
+ name
+ Firestorm
+
d3eb4a5f-aec5-4bcb-b007-cce9efe89d37
color
--
cgit v1.1
From ff2e6b18e238ca58ff21e9c36c339a7794708ec3 Mon Sep 17 00:00:00 2001
From: David Seikel
Date: Tue, 19 Apr 2011 12:53:32 +1000
Subject: Move tho OTR preferences to their own floater, with a button in the
IM tab.
This brings that part in line with the general impy look and feel.
---
linden/indra/newview/CMakeLists.txt | 2 +
linden/indra/newview/floaterotr.cpp | 102 +++++++++++++++++++++
linden/indra/newview/floaterotr.h | 57 ++++++++++++
linden/indra/newview/llfloaterpreference.cpp | 17 ----
linden/indra/newview/llprefsadvanced.cpp | 18 ----
linden/indra/newview/llprefsadvanced.h | 4 -
linden/indra/newview/llprefsim.cpp | 10 ++
.../default/xui/en-us/floater_otr_options.xml | 44 +++++++++
.../xui/en-us/panel_preferences_advanced.xml | 42 ---------
.../default/xui/en-us/panel_preferences_im.xml | 3 +
10 files changed, 218 insertions(+), 81 deletions(-)
create mode 100644 linden/indra/newview/floaterotr.cpp
create mode 100644 linden/indra/newview/floaterotr.h
create mode 100644 linden/indra/newview/skins/default/xui/en-us/floater_otr_options.xml
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 299164d..a68b745 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -104,6 +104,7 @@ set(viewer_SOURCE_FILES
floatergriddefault.cpp
floatergridmanager.cpp
floaterlocalassetbrowse.cpp
+ floaterotr.cpp
floatervoicelicense.cpp
hbfloatergrouptitles.cpp
hippogridmanager.cpp
@@ -566,6 +567,7 @@ set(viewer_HEADER_FILES
floatergriddefault.h
floatergridmanager.h
floaterlocalassetbrowse.h
+ floaterotr.h
floatervoicelicense.h
hbfloatergrouptitles.h
hippogridmanager.h
diff --git a/linden/indra/newview/floaterotr.cpp b/linden/indra/newview/floaterotr.cpp
new file mode 100644
index 0000000..a655fd7
--- /dev/null
+++ b/linden/indra/newview/floaterotr.cpp
@@ -0,0 +1,102 @@
+/**
+* @file floaterotr.cpp
+* @brief Custom OTR settings for meta-impy
+*
+* $LicenseInfo:firstyear=2009&license=viewergpl$
+*
+* Copyright (c) 2011, David Seikel
+*
+* meta-impy Viewer Source Code
+* The source code in this file ("Source Code") is provided to you
+* under the terms of the GNU General Public License, version 2.0
+* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
+* this distribution, or online at
+* http://secondlifegrid.net/programs/open_source/licensing/gplv2
+*
+* There are special exceptions to the terms and conditions of the GPL as
+* it is applied to this Source Code. View the full text of the exception
+* in the file doc/FLOSS-exception.txt in this software distribution, or
+* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
+*
+* By copying, modifying or distributing this software, you acknowledge
+* that you have read and understood your obligations described above,
+* and agree to abide by those obligations.
+*
+* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
+* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+* COMPLETENESS OR PERFORMANCE.
+* $/LicenseInfo$
+*
+* Copied from floaterbusy.cpp, originally by McCabe Maxsted from Imprudence.
+*/
+
+#include "llviewerprecompiledheaders.h"
+
+#include "floaterotr.h"
+
+#include "llinventorymodel.h"
+#include "llstartup.h"
+#include "lltexteditor.h"
+#include "lluictrlfactory.h"
+#include "llviewercontrol.h"
+#include "llviewerinventory.h"
+#include "llweb.h"
+#include "otr_wrapper.h"
+
+FloaterOTR::FloaterOTR(const LLSD& seed) : LLFloater("floater_busy")
+{
+ LLUICtrlFactory::getInstance()->buildFloater(this, "floater_otr_options.xml");
+}
+
+BOOL FloaterOTR::postBuild()
+{
+ childSetAction("btn_ok", onClickOK, this);
+ childSetAction("btn_cancel", onClickCancel, this);
+
+ childSetValue("EmeraldUseOTR", LLSD((S32)gSavedSettings.getU32("EmeraldUseOTR")));
+ childSetValue("EmeraldUseOTRInTypingStop", gSavedSettings.getBOOL("EmeraldUseOTRInTypingStop"));
+ getChild("otr_help_btn")->setClickedCallback(onClickOtrHelp, this);
+
+ return TRUE;
+}
+
+FloaterOTR::~FloaterOTR()
+{
+}
+
+// static
+void FloaterOTR::onClickOK(void* userdata)
+{
+ FloaterOTR* self = (FloaterOTR*)userdata;
+ self->apply();
+ self->close();
+}
+
+// static
+void FloaterOTR::onClickCancel(void* userdata)
+{
+ FloaterOTR* self = (FloaterOTR*)userdata;
+ self->cancel();
+}
+
+void FloaterOTR::cancel()
+{
+ close();
+}
+
+void FloaterOTR::apply()
+{
+ U32 otrpref = childGetValue("EmeraldUseOTR").asReal();
+
+ gSavedSettings.setU32("EmeraldUseOTR", otrpref);
+ gSavedSettings.setBOOL("EmeraldUseOTRInTypingStop", childGetValue("EmeraldUseOTRInTypingStop").asBoolean());
+ // otrpref: 0 == Require OTR, 1 == Request OTR, 2 == Accept OTR, 3 == Decline OTR
+ if (3 == otrpref)
+ OTR_Wrapper::stopAll();
+}
+
+void FloaterOTR::onClickOtrHelp(void* userdata)
+{
+ LLWeb::loadURL("http://www.cypherpunks.ca/otr/");
+}
+
diff --git a/linden/indra/newview/floaterotr.h b/linden/indra/newview/floaterotr.h
new file mode 100644
index 0000000..a42700f
--- /dev/null
+++ b/linden/indra/newview/floaterotr.h
@@ -0,0 +1,57 @@
+/**
+* @file floaterotr.h
+* @brief Custom OTR settings for meta-impy
+*
+* $LicenseInfo:firstyear=2009&license=viewergpl$
+*
+* Copyright (c) 2011, David Seikel
+*
+* meta-impy Viewer Source Code
+* The source code in this file ("Source Code") is provided to you
+* under the terms of the GNU General Public License, version 2.0
+* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
+* this distribution, or online at
+* http://secondlifegrid.net/programs/open_source/licensing/gplv2
+*
+* There are special exceptions to the terms and conditions of the GPL as
+* it is applied to this Source Code. View the full text of the exception
+* in the file doc/FLOSS-exception.txt in this software distribution, or
+* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
+*
+* By copying, modifying or distributing this software, you acknowledge
+* that you have read and understood your obligations described above,
+* and agree to abide by those obligations.
+*
+* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
+* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+* COMPLETENESS OR PERFORMANCE.
+* $/LicenseInfo$
+*
+* Copied from floaterbusy.h, originally by McCabe Maxsted from Imprudence.
+*/
+
+#ifndef FLOATEROTR_H
+#define FLOATEROTR_H
+
+#include "llfloater.h"
+
+class LLViewerInventoryItem;
+
+class FloaterOTR : public LLFloater, public LLFloaterSingleton
+{
+public:
+ FloaterOTR(const LLSD& seed);
+ virtual ~FloaterOTR();
+
+ BOOL postBuild();
+
+ void apply();
+ void cancel();
+
+private:
+ static void onClickOK(void* userdata);
+ static void onClickCancel(void* userdata);
+ static void onClickOtrHelp(void* userdata);
+};
+
+#endif // FLOATEROTR_H
diff --git a/linden/indra/newview/llfloaterpreference.cpp b/linden/indra/newview/llfloaterpreference.cpp
index 40f18e8..6a97c38 100644
--- a/linden/indra/newview/llfloaterpreference.cpp
+++ b/linden/indra/newview/llfloaterpreference.cpp
@@ -427,11 +427,6 @@ LLFloaterPreference::~LLFloaterPreference()
void LLFloaterPreference::apply()
{
this->mPreferenceCore->apply();
-#if USE_OTR // [$PLOTR$]
- U32 otrpref = gSavedSettings.getU32("EmeraldUseOTR");
- // otrpref: 0 == Require OTR, 1 == Request OTR, 2 == Accept OTR, 3 == Decline OTR
- if (3 == otrpref) OTR_Wrapper::stopAll();
-#endif // USE_OTR // [/$PLOTR$]
}
@@ -502,13 +497,6 @@ void LLFloaterPreference::onBtnOK( void* userdata )
if (fp->canClose())
{
fp->apply();
-
-#if USE_OTR // [$PLOTR$]
- U32 otrpref = gSavedSettings.getU32("EmeraldUseOTR");
- // otrpref: 0 == Require OTR, 1 == Request OTR, 2 == Accept OTR, 3 == Decline OTR
- if (3 == otrpref) OTR_Wrapper::stopAll();
-#endif // USE_OTR // [/$PLOTR$]
-
fp->close(false);
gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE );
@@ -540,11 +528,6 @@ void LLFloaterPreference::onBtnApply( void* userdata )
}
}
fp->apply();
-#if USE_OTR // [$PLOTR$]
- U32 otrpref = gSavedSettings.getU32("EmeraldUseOTR");
- // otrpref: 0 == Require OTR, 1 == Request OTR, 2 == Accept OTR, 3 == Decline OTR
- if (3 == otrpref) OTR_Wrapper::stopAll();
-#endif // USE_OTR // [/$PLOTR$]
LLPanelLogin::refreshLocation( false );
}
diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp
index 38e6745..49dd058 100644
--- a/linden/indra/newview/llprefsadvanced.cpp
+++ b/linden/indra/newview/llprefsadvanced.cpp
@@ -47,10 +47,6 @@
#include "boost/algorithm/string.hpp"
-#if USE_OTR // [$PLOTR$]
-#include "llweb.h"
-#endif // USE_OTR // [/$PLOTR$]
-
LLPrefsAdvanced* LLPrefsAdvanced::sInstance;
LLPrefsAdvanced::LLPrefsAdvanced()
@@ -119,10 +115,6 @@ BOOL LLPrefsAdvanced::postBuild()
initHelpBtn("EmeraldHelp_SpellCheck", "EmeraldHelp_SpellCheck");
-#if USE_OTR // [$PLOTR$]
- childSetValue("EmeraldUseOTR", LLSD((S32)gSavedSettings.getU32("EmeraldUseOTR")));
- getChild("otr_help_btn")->setClickedCallback(onClickOtrHelp, this);
-#endif // USE_OTR // [/$PLOTR$]
refresh();
@@ -210,9 +202,6 @@ void LLPrefsAdvanced::apply()
LLComboBox* crash_behavior_combobox = getChild("crash_behavior_combobox");
gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior_combobox->getCurrentIndex());
-#if USE_OTR // [$PLOTR$]
- gSavedSettings.setU32("EmeraldUseOTR", (U32)childGetValue("EmeraldUseOTR").asReal());
-#endif // USE_OTR // [/$PLOTR$]
}
void LLPrefsAdvanced::cancel()
@@ -342,10 +331,3 @@ void LLPrefsAdvanced::onClickCommandLine(void* data)
FloaterCommandLine::getInstance()->open();
FloaterCommandLine::getInstance()->center();
}
-
-#if USE_OTR // [$PLOTR$]
-void LLPrefsAdvanced::onClickOtrHelp(void* data)
-{
- LLWeb::loadURL("http://www.cypherpunks.ca/otr/");
-}
-#endif // USE_OTR // [/$PLOTR$]
diff --git a/linden/indra/newview/llprefsadvanced.h b/linden/indra/newview/llprefsadvanced.h
index d75dcd3..d76e602 100644
--- a/linden/indra/newview/llprefsadvanced.h
+++ b/linden/indra/newview/llprefsadvanced.h
@@ -59,10 +59,6 @@ private:
static void onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata);
static void onAutoCorrectButton(void * data);
-#if USE_OTR // [$PLOTR$]
- static void onClickOtrHelp(void* data);
-#endif // USE_OTR // [/$PLOTR$]
-
protected:
void initHelpBtn(const std::string& name, const std::string& xml_alert);
static void onClickHelp(void* data);
diff --git a/linden/indra/newview/llprefsim.cpp b/linden/indra/newview/llprefsim.cpp
index 5ac2bb2..c2659b8 100644
--- a/linden/indra/newview/llprefsim.cpp
+++ b/linden/indra/newview/llprefsim.cpp
@@ -36,6 +36,7 @@
#include "llprefsim.h"
#include "floaterbusy.h"
+#include "floaterotr.h"
#include "llpanel.h"
#include "llcheckboxctrl.h"
#include "llstring.h"
@@ -73,6 +74,7 @@ public:
static void onCommitLogging(LLUICtrl* ctrl, void* user_data);
static void onClickBusyAdvanced(void* user_data);
+ static void onClickOTRAdvanced(void* user_data);
protected:
@@ -131,6 +133,7 @@ BOOL LLPrefsIMImpl::postBuild()
childSetCommitCallback("log_instant_messages",onCommitLogging,this);
childSetAction("busy_adv_btn", onClickBusyAdvanced, this);
+ childSetAction("otr_adv_btn", onClickOTRAdvanced, this);
preparePerAccountPrefs(LLStartUp::isLoggedIn());
@@ -328,6 +331,13 @@ void LLPrefsIMImpl::onClickBusyAdvanced(void* user_data)
}
// static
+void LLPrefsIMImpl::onClickOTRAdvanced(void* user_data)
+{
+ FloaterOTR::getInstance()->open();
+ FloaterOTR::getInstance()->center();
+}
+
+// static
void LLPrefsIMImpl::onClickLogPath(void* user_data)
{
LLPrefsIMImpl* self=(LLPrefsIMImpl*)user_data;
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_otr_options.xml b/linden/indra/newview/skins/default/xui/en-us/floater_otr_options.xml
new file mode 100644
index 0000000..9f0d798
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_otr_options.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+ Require use of OTR in IMs
+ Request OTR if available
+ Accept OTR requests
+ Decline use of OTR
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml
index a3961bb..a8ecedc 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml
@@ -178,47 +178,5 @@ To use spellcheck, right-click a misspelled word
bottom_delta="-50" width="180" height="20" font="SansSerifSmall" follows="left|top"/>
-
-
-
-
- Require use of OTR in IMs
- Request OTR if available
- Accept OTR requests
- Decline use of OTR
-
-
-
-
-
-
-
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml
index fe17e7a..2c71998 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml
@@ -68,6 +68,9 @@
+
setLabel(name);
+}
+
diff --git a/linden/indra/llui/llcombobox.h b/linden/indra/llui/llcombobox.h
index 596f659..18e4379 100644
--- a/linden/indra/llui/llcombobox.h
+++ b/linden/indra/llui/llcombobox.h
@@ -224,6 +224,8 @@ public:
static void onActionButtonClick(void *userdata);
static void onSelectAction(LLUICtrl* ctrl, void *userdata);
+ void setLabel(const LLStringExplicit& name);
+
protected:
LLButton* mActionButton;
LLPointer mActionButtonImage;
--
cgit v1.1
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
From ade2ddb7b9d44167611d1573d4d3334b2b905623 Mon Sep 17 00:00:00 2001
From: David Seikel
Date: Thu, 21 Apr 2011 10:36:53 +1000
Subject: The next part of the UI changes for OTR.
Might be some corner cases left over, but I'm generally happy with this.
---
linden/indra/newview/llimpanel.cpp | 70 ++++++++++------------
.../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()
if (!gOTR) OTR_Wrapper::init();
if (gOTR && (IM_NOTHING_SPECIAL == mDialog))
{
+ childSetCommitCallback("otr_btn", onClickOtr, this);
LLComboBox *combo = getChild("otr_btn");
if (!combo)
{
@@ -2429,20 +2430,16 @@ void LLFloaterIMPanel::doOtrMenu()
}
else
{
- std::string choice = combo->getSimple();
- if ((combo->getValue().asString() == "otr_start_entry") ||
- (combo->getValue().asString() == "otr_restart_entry") ||
- (combo->getValue().asString() == "otr_refresh_entry"))
+ ConnContext *context = getOtrContext();
+ U32 otrpref = gSavedSettings.getU32("EmeraldUseOTR");
+ if (combo->getValue().asString() == "otr_auth_entry")
{
- doOtrStart();
- }
- else if (combo->getValue().asString() == "otr_stop_entry")
- {
- doOtrStop();
- }
- else if (combo->getValue().asString() == "otr_auth_entry")
- {
- doOtrAuth();
+ // Instant crash when doing this with someone that has no OTR capability.
+ // So guard it if no encryption is happening.
+ if (context && (OTRL_MSGSTATE_ENCRYPTED == context->msgstate))
+ {
+ doOtrAuth();
+ }
}
else if (combo->getValue().asString() == "otr_help_entry")
{
@@ -2454,9 +2451,28 @@ void LLFloaterIMPanel::doOtrMenu()
llinfos << "$PLOTR$ otr levels help" << llendl;
LLWeb::loadURL("http://www.cypherpunks.ca/otr/help/3.2.0/levels.php");
}
- else
+ else // Clicked the flyout itself. Sort out what level to put them in based on the old level.
{
- llwarns << "$PLOTR$ unknown menu item" << llendl;
+ // otrpref: 0 == Require OTR, 1 == Request OTR, 2 == Accept OTR, 3 == Decline OTR
+ if (3 == otrpref)
+ {
+ if (context && (OTRL_MSGSTATE_ENCRYPTED == context->msgstate))
+ {
+ doOtrStop();
+ }
+ }
+ else if (context && (OTRL_MSGSTATE_ENCRYPTED == context->msgstate))
+ {
+ doOtrStop();
+ }
+ else if (context && (OTRL_MSGSTATE_FINISHED == context->msgstate))
+ {
+ doOtrStop();
+ }
+ else // OTRL_MSGSTATE_PLAINTEXT, or no context yet
+ {
+ doOtrStart();
+ }
}
}
}
@@ -2519,22 +2535,10 @@ void LLFloaterIMPanel::showOtrStatus()
{
doOtrStop();
}
-// 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_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
@@ -2549,22 +2553,10 @@ void LLFloaterIMPanel::showOtrStatus()
else
otrLogMessageGetstringName("otr_prog_they_stop_unverified");
}
-// 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_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 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 @@
visible="false" width="100" />
-
- Start private conversation
-
-
- End private conversation
-
+ list_position="below" mouse_opaque="true" name="otr_btn"
+ tool_tip="Click to change OTR status, or dropdown for other options." >
Authenticate buddy
@@ -128,10 +123,6 @@
image_unselected="icn_speaker_dark.tga" label="" left_delta="56"
name="mute_btn" tool_tip="Mute voice" width="25" />
-
-
-