Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • alchemy/viewer
  • Miezhiko/alchemy-next
  • JennaHuntsman/xdg-integration
  • logue/alchemy-next
  • FelixWolf/alchemy-viewer
  • XenHat/xdg-integration
6 results
Show changes
Commits on Source (97)
Showing with 155 additions and 61 deletions
......@@ -2031,5 +2031,16 @@
<key>Value</key>
<string>1.0</string>
</map>
<key>MediaAutoPlayHuds</key>
<map>
<key>Comment</key>
<string>Auto play hud attached media.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
</map>
</llsd>
......@@ -55,11 +55,13 @@ function homedir_install()
prompt "Proceed with the installation? [Y/N]: "
if [[ $? == 0 ]]; then
exit 0
exit 0
fi
if [[ -d "$XDG_DATA_HOME" ]] ; then
install_to_prefix "$XDG_DATA_HOME/alchemy-install" #$XDG_DATA_HOME is a synonym for $HOME/.local/share/ unless the user has specified otherwise (unlikely).
else
install_to_prefix "$HOME/.local/share/alchemy-install" #XDG_DATA_HOME not set, so use default path as defined by XDG spec.
fi
install_to_prefix "$HOME/.local/share/alchemy-install"
$HOME/.local/share/alchemy-install/etc/refresh_desktop_app_entry.sh
}
function root_install()
......@@ -77,7 +79,6 @@ function root_install()
install_to_prefix "$install_prefix"
mkdir -p /usr/local/share/applications
${install_prefix}/etc/refresh_desktop_app_entry.sh
}
function install_to_prefix()
......@@ -124,6 +125,8 @@ function install_to_prefix()
rm "$1/bin/llplugin/.user_does_not_want_chrome_sandboxing_and_accepts_the_risks" 2> /dev/null
pkexec "$1/etc/chrome_sandboxing_permissions_setup.sh" || die "Failed to set permissions on chrome-sandbox"
fi
sh "$1/etc/refresh_desktop_app_entry.sh" || echo "Failed to integrate into DE via XDG."
set_slurl_handler "$1"
}
function backup_previous_installation()
......@@ -134,6 +137,16 @@ function backup_previous_installation()
mv "$1" "$backup_dir" || die "Failed to create backup of existing installation!"
}
function set_slurl_handler()
{
local install_dir=$1
prompt "Would you like to set Alchemy as your default SLurl handler? [Y/N]: "
if [[ $? == 0 ]]; then
exit 0
fi
"$install_dir"/etc/register_secondlifeprotocol.sh #Successful association comes with a notification to the user.
}
if [ "$UID" == "0" ]; then
root_install
......
#!/bin/bash
# Cannot get this CMake feature to work; fill in manually for now
#VIEWERNAME="@VIEWER_CHANNEL_BASE@" #This should be the viewer's canonical base name, e.g. Second Life, Firestorm, Alchemy, etc. Handled by cmake.
#CHANNELNAME="@VIEWER_CHANNEL_TYPE@ @VIEWER_PROJECT_CODENAME@" #Use cmake to autofill the channel type (alpha, beta, release), and any project codename.
VIEWERNAME="Alchemy" #This should be the viewer's canonical base name, e.g. Second Life, Firestorm, Alchemy, etc. Handled by cmake.
CHANNEL_TYPE=""
PROJECT_NAME=""
CHANNELNAME="${CHANNEL_TYPE} ${PROJECT_NAME}" #Use cmake to autofill the channel type (alpha, beta, release), and any project codename.
CHANNELNOBREAK=$(echo $CHANNELNAME | tr " " "-") #Store a version of the channel name without any spaces to prevent breakage with some functions. Not filled by cmake to ensure consistency in it's output.
SCRIPTSRC="$(readlink -f "$0" || echo "$0")"
RUN_PATH="$(dirname "${SCRIPTSRC}" || echo .)"
install_prefix="${RUN_PATH}"/..
install_prefix=$(builtin cd "${RUN_PATH}/.." || exit; pwd) #This is a cleaner way of getting the absolute path for the install directory.
function print() {
log_prefix="${VIEWERNAME} ${CHANNELNAME} Desktop Integration:"
echo -e "${log_prefix} $*"
}
function install_desktop_entry()
{
local installation_prefix="${1}"
local desktop_entries_dir="${2}"
local desktop_entry="\
[Desktop Entry]\n\
Name=Alchemy\n\
Comment=Client for the On-line Virtual World, Second Life\n\
Exec=${installation_prefix}/alchemy\n\
Icon=${installation_prefix}/alchemy_icon.png\n\
Terminal=false\n\
Type=Application\n\
Categories=Game;Simulation;\n\
StartupNotify=true\n\
StartupWMClass=Alchemy\n\
X-Desktop-File-Install-Version=3.0"
echo " - Installing menu entries in ${desktop_entries_dir}"
mkdir -vp "${desktop_entries_dir}"
echo -e "${desktop_entry}" > "${desktop_entries_dir}/alchemy-viewer.desktop" || "Failed to install application menu!"
desktoppath="${installation_prefix}/${VIEWERNAME,,}-${CHANNELNOBREAK,,}-viewer.desktop"
cat >"${desktoppath}" <<desktopfile || print "Warning: Could not write $desktoppath"s
[Desktop Entry]
Version=1.4
Name=${VIEWERNAME} ${CHANNELNAME}
GenericName=Second Life Viewer
Comment=Client for the Online Virtual World, Second Life
Exec=${installation_prefix}/${VIEWERNAME,,}
Icon=${VIEWERNAME}-${CHANNELNOBREAK}-Viewer
Terminal=false
Type=Application
Categories=Game;Simulation;
StartupNotify=true
StartupWMClass=${VIEWERNAME} ${CHANNELNAME}
PrefersNonDefaultGPU=true
Actions=DefaultGPU;AssociateMIME;
[Desktop Action DefaultGPU]
Exec=env __GLX_VENDOR_LIBRARY_NAME="" ${installation_prefix}/${VIEWERNAME,,}
Name=Launch on default GPU
[Desktop Action AssociateMIME]
Exec=${installation_prefix}/etc/register_secondlifeprotocol.sh
Name=Associate SLURLs
desktopfile
#The above adds some options when the shortcut is right-clicked, to launch on the default (usually integrated) GPU, and to force MIME type association.
#The "PrefersNonDefaultGPU" line should automatically run the viewer on the most powerful GPU in the system, if it is not default. If it is, this is ignored.
# NOTE: DO NOT CHANGE THE "GenericName" FIELD - ONLY CHANGE THE "Name" FIELD. (This is to ensure that searching "Second Life" will show all the viewers installed in a user's system, regardless of their canonical name.)
print "Installing menu entries via XDG..."
xdg-icon-resource install --novendor --size 256 "${install_prefix}/${VIEWERNAME,,}_icon.png" "${VIEWERNAME}"-"${CHANNELNOBREAK}"-Viewer
#NOTE: Above command takes the path to the icon to install && The name of the icon to be used by XDG. This should always be in the format of "x-Viewer" to avoid potential naming conflicts, as per XDG spec.
xdg-desktop-menu install --novendor "${installation_prefix}"/"${VIEWERNAME,,}"-"${CHANNELNOBREAK,,}"-viewer.desktop
}
CHANNELNAME=$(echo "${CHANNELNAME}" | xargs) #Trim leading and / or tailing whitespace from CHANNELNAME
if [ "$UID" == "0" ]; then
# system-wide
install_desktop_entry "${install_prefix}" /usr/local/share/applications
......
......@@ -24,7 +24,7 @@ chmod +x "$desired_handler"
if command -v xdg-mime query default x-scheme-handler/secondlife >/dev/null 2>&1; then
urlhandler=$(xdg-mime query default x-scheme-handler/secondlife)
localappdir="${HOME}/.local/share/applications"
newhandler="secondlifeprotocol_$(basename "$(dirname "${desired_handler}")").desktop"
newhandler="secondlifeprotocol_$(basename "${PWD%}").desktop"
handlerpath="${localappdir}/${newhandler}"
cat >"${handlerpath}" <<EOFnew || print "Warning: Did not register secondlife:// handler with xdg-mime: Could not write $newhandler"s
[Desktop Entry]
......@@ -49,7 +49,8 @@ EOFnew
#Clean up handlers from other viewers
if [ "${urlhandler}" != "${newhandler}" ]; then
print "Current SLURL Handler: ${urlhandler} - Setting ${newhandler} as the new default..."
mv "${localappdir}"/"${urlhandler}" "${localappdir}"/"${urlhandler}".bak
#mv "${localappdir}"/"${urlhandler}" "${localappdir}"/"${urlhandler}".bak #Old method, now replaced with XDG.
xdg-desktop-menu install --novendor "${localappdir}"/"$urlhandler"
else
print "SLURL Handler has not changed, leaving as-is."
fi
......@@ -75,3 +76,4 @@ else
fi
fi
fi
notify-send -t 5000 -i info "Second Life URL Handler" "SLURL association created"
......@@ -59,10 +59,12 @@ echo "Running from ${RUN_PATH}"
cd "${RUN_PATH}" || return
# Re-register the secondlife:// protocol handler every launch, for now.
./etc/register_secondlifeprotocol.sh
# NOTE: this should no longer be required with the new desktop shortcut, combined with XDG integration.
#./etc/register_secondlifeprotocol.sh
# Re-register the application with the desktop system every launch, for now.
./etc/refresh_desktop_app_entry.sh
# NOTE: this should no longer be required with XDG integration. App icon should be created at install time, not run time.
#./etc/refresh_desktop_app_entry.sh
## Before we mess with LD_LIBRARY_PATH, save the old one to restore for
## subprocesses that care.
......@@ -105,6 +107,11 @@ else
echo "Please install wine to enable full voice functionality."
fi
# Check if switcheroo is needed
if [[ -d /sys/class/drm/card1 ]] && command -v switcherooctl >/dev/null 2>&1 && [[ "$(switcherooctl)" == "" ]]; then
notify-send "Automatic GPU selection is not available" "Please enable switcheroo-control.service"
fi
# Run the program.
# Don't quote $LL_WRAPPER because, if empty, it should simply vanish from the
# command line. But DO quote "${ARGS[@]}": preserve separate args as
......
......@@ -257,6 +257,8 @@ BOOL LLStatusBar::postBuild()
mFilterEdit->setCommitCallback(boost::bind(&LLStatusBar::onUpdateFilterTerm, this));
collectSearchableItems();
gSavedSettings.getControl("MenuSearch")->getCommitSignal()->connect(boost::bind(&LLStatusBar::updateMenuSearchVisibility, this, _2));
gSavedSettings.getControl("ShowStatusBarTime")->getCommitSignal()->connect(boost::bind(&LLStatusBar::updateClock, this));
gSavedSettings.getControl("ShowStatusBarSeconds")->getCommitSignal()->connect(boost::bind(&LLStatusBar::updateClock, this));
if (search_panel_visible)
{
......@@ -280,24 +282,7 @@ void LLStatusBar::refresh()
{
mClockUpdateTimer.reset();
// Get current UTC time, adjusted for the user's clock
// being off.
time_t utc_time;
utc_time = time_corrected();
static const std::string timeStrTemplate = getString("time");
static const std::string timeStrSecondsTemplate = getString("timeSeconds");
std::string timeStr = show_clock_seconds ? timeStrSecondsTemplate : timeStrTemplate;
LLSD substitution;
substitution["datetime"] = (S32) utc_time;
LLStringUtil::format (timeStr, substitution);
mTextTime->setText(timeStr);
// set the tooltip to have the date
static const std::string dtStrTemplate = getString("timeTooltip");
std::string dtStr = dtStrTemplate;
LLStringUtil::format (dtStr, substitution);
mTextTime->setToolTip (dtStr);
updateClock();
}
LLRect r;
......@@ -789,6 +774,29 @@ void LLStatusBar::updateBalancePanelPosition()
mBalanceBG->setShape(balance_bg_rect);
}
void LLStatusBar::updateClock()
{
static LLCachedControl<bool> show_clock_seconds(gSavedSettings, "ShowStatusBarSeconds", false);
// Get current UTC time, adjusted for the user's clock
// being off.
time_t utc_time;
utc_time = time_corrected();
static const std::string timeStrTemplate = getString("time");
static const std::string timeStrSecondsTemplate = getString("timeSeconds");
std::string timeStr = show_clock_seconds ? timeStrSecondsTemplate : timeStrTemplate;
LLSD substitution;
substitution["datetime"] = (S32)utc_time;
LLStringUtil::format(timeStr, substitution);
mTextTime->setText(timeStr);
// set the tooltip to have the date
static const std::string dtStrTemplate = getString("timeTooltip");
std::string dtStr = dtStrTemplate;
LLStringUtil::format(dtStr, substitution);
mTextTime->setToolTip(dtStr);
}
// Implements secondlife:///app/balance/request to request a L$ balance
// update via UDP message system. JC
......
......@@ -126,6 +126,8 @@ class LLStatusBar final
void updateMenuSearchPosition(); // depends onto balance position
void updateBalancePanelPosition();
void updateClock();
void onAOStateChanged();
LLTextBox *mTextTime;
......
......@@ -264,7 +264,7 @@ viewer_media_t LLViewerMedia::newMediaImpl(
return media_impl;
}
viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const std::string& previous_url, bool update_from_self)
viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const std::string& previous_url, bool update_from_self, bool is_hud_attachment)
{
llassert(!gCubeSnapshot);
// Try to find media with the same media ID
......@@ -313,7 +313,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
// The current media URL is not empty.
// If (the media was already loaded OR the media was set to autoplay) AND this update didn't come from this agent,
// do a navigate.
bool auto_play = media_impl->isAutoPlayable();
bool auto_play = media_impl->isAutoPlayable(is_hud_attachment);
if((was_loaded || auto_play) && !update_from_self)
{
needs_navigate = url_changed;
......@@ -336,7 +336,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
media_impl->setHomeURL(media_entry->getHomeURL());
media_impl->mMediaAutoPlay = media_entry->getAutoPlay();
media_impl->mMediaEntryURL = media_entry->getCurrentURL();
if(media_impl->isAutoPlayable())
if(media_impl->isAutoPlayable(is_hud_attachment))
{
needs_navigate = true;
}
......@@ -3964,10 +3964,11 @@ void LLViewerMediaImpl::setTextureID(LLUUID id)
//////////////////////////////////////////////////////////////////////////////////////////
//
bool LLViewerMediaImpl::isAutoPlayable() const
bool LLViewerMediaImpl::isAutoPlayable(bool is_hud_attachment) const
{
static LLCachedControl<bool> hud_auto_play(gSavedSettings, "MediaAutoPlayHuds", true);
return (mMediaAutoPlay &&
gSavedSettings.getS32("ParcelMediaAutoPlayEnable") != 0 &&
((gSavedSettings.getS32("ParcelMediaAutoPlayEnable") != 0) || (hud_auto_play && (is_hud_attachment || isAttachedToHUD()))) &&
gSavedSettings.getBOOL("MediaTentativeAutoPlay"));
}
......
......@@ -97,7 +97,7 @@ class LLViewerMedia final : public LLSingleton<LLViewerMedia>
U8 media_auto_scale = false,
U8 media_loop = false);
viewer_media_t updateMediaImpl(LLMediaEntry* media_entry, const std::string& previous_url, bool update_from_self);
viewer_media_t updateMediaImpl(LLMediaEntry* media_entry, const std::string& previous_url, bool update_from_self, bool is_hud_attachment);
LLViewerMediaImpl* getMediaImplFromTextureID(const LLUUID& texture_id);
static std::string getCurrentUserAgent();
void updateBrowserUserAgent();
......@@ -435,7 +435,7 @@ class LLViewerMediaImpl
LLNotificationPtr getCurrentNotification() const;
private:
bool isAutoPlayable() const;
bool isAutoPlayable(bool is_hud_attachment = false) const;
bool shouldShowBasedOnClass() const;
bool isObscured() const;
static bool isObjectAttachedToAnotherAvatar(LLVOVolume *obj);
......
......@@ -2620,7 +2620,7 @@ void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool m
LLUUID updating_agent = LLTextureEntry::getAgentIDFromMediaVersionString(getMediaURL());
update_from_self = (updating_agent == gAgent.getID());
}
viewer_media_t media_impl = LLViewerMedia::getInstance()->updateMediaImpl(mep, previous_url, update_from_self);
viewer_media_t media_impl = LLViewerMedia::getInstance()->updateMediaImpl(mep, previous_url, update_from_self, isHUDAttachment());
addMediaImpl(media_impl, texture_index) ;
}
......
......@@ -382,16 +382,27 @@
top_pad="5"
left="20"/>
<check_box
name="media_auto_play_hud"
control_name="MediaAutoPlayHuds"
value="true"
follows="left|top"
layout="topleft"
height="15"
top_pad="5"
tool_tip="Uncheck this to hide media attached to other avatars nearby"
label="Auto Play media attached to my HUD"
left="20"
width="230"/>
<check_box
name="media_show_on_others_btn"
control_name="MediaShowOnOthers"
value="true"
follows="left|top"
layout="topleft"
height="15"
top_pad="5"
left_pad="5"
tool_tip="Uncheck this to hide media attached to other avatars nearby"
label="Play media attached to other avatars"
left="20"
width="230"/>
<text
follows="left|top"
......
......@@ -41,7 +41,10 @@
<radio_item label="カメラの位置" name="0"/>
<radio_item label="アバターの位置" name="1"/>
</radio_group>
<check_box name="media_show_on_others_btn" tool_tip="このチェックを外すと、近くにいる他のアバターに取り付けられたメディアを非表示にします。" label="他のアバターに取り付けられたメディアを再生する"/>
<check_box name="gesture_audio_play_btn" tool_tip="ジェスチャーからのサウンドを聞くにはこれを選択" label="ジェスチャーのサウンドを再生する"/>
<check_box name="sound_on_collisions" tool_tip="ここをチェックすると、オブジェクトやアバターにぶつかったときに衝突音がなります。" label="衝突音を再生する"/>
<check_box name="media_auto_play_hud" tool_tip="ここのチェックを外すと、自分のHUDに取り付けられたメディアが自動再生されなくなります。" label="自分のHUDに取り付けられたメディアを自動再生する"/>
<check_box name="media_show_on_others_btn" tool_tip="ここのチェックを外すと、近くにいる他のアバターに取り付けられたメディアを非表示にします。" label="近くにいるアバターに取り付けられたメディアを再生する"/>
<text name="media_autoplay_label">
メディアの自動再生
</text>
......@@ -57,10 +60,8 @@
<radio_item label="カメラの位置" name="0"/>
<radio_item label="アバターの位置" name="1"/>
</radio_group>
<check_box label="喋ときにアバターの口を動かす" name="enable_lip_sync"/>
<check_box label="喋ったときにアバターの口を動かす" name="enable_lip_sync"/>
<check_box label="ボイスチャットをトグルモードにする" name="push_to_talk_toggle_check" tool_tip="トグルモードでは、トリガーキーを押すことでマイクのオン/オフを切り替えます。そうでない場合は、トリガーキーを押している間だけマイクがオンになります。"/>
<check_box name="gesture_audio_play_btn" tool_tip="ジェスチャーからのサウンドを聞くにはこれを選択" label="ジェスチャーのサウンドを再生"/>
<check_box name="sound_on_collisions" tool_tip="これをチェックすると、オブジェクトやアバターとぶつかったときに音がなります。" label="ぶつかったときの音を再生する"/>
<button label="入出力機器の設定" name="device_settings_btn"/>
<panel name="device_settings_panel"/>
</panel>
</panel>
\ No newline at end of file