From 688c2a73cdf982a4fe5ee0bfea0a52135fc461ef Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 8 Oct 2010 15:56:34 -0700 Subject: made progressbar derive from lluictrl and take percentage as llsd value --- indra/llui/llprogressbar.cpp | 6 +++--- indra/llui/llprogressbar.h | 8 ++++---- indra/newview/llpanelprimmediacontrols.cpp | 2 +- indra/newview/llprogressview.cpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/llui/llprogressbar.cpp b/indra/llui/llprogressbar.cpp index aaa328754d..ead22686bc 100644 --- a/indra/llui/llprogressbar.cpp +++ b/indra/llui/llprogressbar.cpp @@ -50,7 +50,7 @@ LLProgressBar::Params::Params() LLProgressBar::LLProgressBar(const LLProgressBar::Params& p) -: LLView(p), +: LLUICtrl(p), mImageBar(p.image_bar), mImageFill(p.image_fill), mColorBackground(p.color_bg()), @@ -80,7 +80,7 @@ void LLProgressBar::draw() mImageFill->draw(progress_rect, bar_color); } -void LLProgressBar::setPercent(const F32 percent) +void LLProgressBar::setValue(const LLSD& value) { - mPercentDone = llclamp(percent, 0.f, 100.f); + mPercentDone = llclamp((F32)value.asReal(), 0.f, 100.f); } diff --git a/indra/llui/llprogressbar.h b/indra/llui/llprogressbar.h index 13297f7493..3f308e7496 100644 --- a/indra/llui/llprogressbar.h +++ b/indra/llui/llprogressbar.h @@ -27,14 +27,14 @@ #ifndef LL_LLPROGRESSBAR_H #define LL_LLPROGRESSBAR_H -#include "llview.h" +#include "lluictrl.h" #include "llframetimer.h" class LLProgressBar - : public LLView + : public LLUICtrl { public: - struct Params : public LLInitParam::Block + struct Params : public LLInitParam::Block { Optional image_bar, image_fill; @@ -47,7 +47,7 @@ public: LLProgressBar(const Params&); virtual ~LLProgressBar(); - void setPercent(const F32 percent); + void setValue(const LLSD& value); /*virtual*/ void draw(); diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index de2428feed..614700fb0a 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -519,7 +519,7 @@ void LLPanelPrimMediaControls::updateShape() if(LLPluginClassMediaOwner::MEDIA_LOADING == media_plugin->getStatus()) { mMediaProgressPanel->setVisible(true); - mMediaProgressBar->setPercent(media_plugin->getProgressPercent()); + mMediaProgressBar->setValue(media_plugin->getProgressPercent()); } else { diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index e9504cbba0..db02d76139 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -207,7 +207,7 @@ void LLProgressView::setText(const std::string& text) void LLProgressView::setPercent(const F32 percent) { - mProgressBar->setPercent(percent); + mProgressBar->setValue(percent); } void LLProgressView::setMessage(const std::string& msg) -- cgit v1.2.3 From 77d1fa974ad6cc9be0b84e574b455693bfa7f702 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 8 Oct 2010 17:37:38 -0700 Subject: added "FastQuit" option for forceful termination, default is off --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 14 ++++++++++++++ indra/newview/llappviewer.h | 1 + indra/newview/llappviewerwin32.cpp | 6 ++++++ 4 files changed, 32 insertions(+) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 142378b540..bc06078928 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2962,6 +2962,17 @@ Boolean Value 0 + + FastQuit + + Comment + Quits as quickly as possible, only sending logout request before forcefully terminating. Use with care, as this might result in data corruption or loss. + Persist + 1 + Type + Boolean + Value + 0 FeatureManagerHTTPTable diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e6661e4c9a..91fae709df 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2879,8 +2879,22 @@ void LLAppViewer::forceQuit() LLApp::setQuitting(); } +void LLAppViewer::fastQuit() +{ + if (LLStartUp::getStartupState() >= STATE_STARTED) + { + sendLogoutRequest(); + } + _exit(isError()); +} + void LLAppViewer::requestQuit() { + if (gSavedSettings.getBOOL("FastQuit")) + { + fastQuit(); + } + llinfos << "requestQuit" << llendl; LLViewerRegion* region = gAgent.getRegion(); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index b0f8c1dc3d..62ebd0712e 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -66,6 +66,7 @@ public: // Application control void forceQuit(); // Puts the viewer into 'shutting down without error' mode. + void fastQuit(); // Shuts down the viewer immediately after sending a logout message void requestQuit(); // Request a quit. A kinder, gentler quit. void userQuit(); // The users asks to quit. Confirm, then requestQuit() void earlyExit(const std::string& name, diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index d328567a0e..2c6f014d17 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -175,6 +175,12 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, viewer_app_ptr->mainLoop(); } + if (gSavedSettings.getBOOL("FastQuit")) + { + viewer_app_ptr->fastQuit(); + } + + if (!LLApp::isError()) { // -- cgit v1.2.3