MAINT-8427 Make snapshot path consistant over sessions
parent
eedf3e7f46
commit
869c8728bc
|
|
@ -392,5 +392,27 @@
|
|||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>SnapshotBaseDir</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Path to last snapshot save location</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>SnapshotBaseName</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Pattern for naming snapshots</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>Snapshot</string>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
|
|
|||
|
|
@ -261,10 +261,8 @@ static const F32 MIN_UI_SCALE = 0.75f;
|
|||
static const F32 MAX_UI_SCALE = 7.0f;
|
||||
static const F32 MIN_DISPLAY_SCALE = 0.75f;
|
||||
|
||||
std::string LLViewerWindow::sSnapshotBaseName;
|
||||
std::string LLViewerWindow::sSnapshotDir;
|
||||
|
||||
std::string LLViewerWindow::sMovieBaseName;
|
||||
static LLCachedControl<std::string> sSnapshotBaseName(LLCachedControl<std::string>(gSavedPerAccountSettings, "SnapshotBaseName", "Snapshot"));
|
||||
static LLCachedControl<std::string> sSnapshotDir(LLCachedControl<std::string>(gSavedPerAccountSettings, "SnapshotBaseDir", ""));
|
||||
|
||||
LLTrace::SampleStatHandle<> LLViewerWindow::sMouseVelocityStat("Mouse Velocity");
|
||||
|
||||
|
|
@ -1694,11 +1692,6 @@ LLViewerWindow::LLViewerWindow(const Params& p)
|
|||
LL_INFOS() << "NOTE: ALL NOTIFICATIONS THAT OCCUR WILL GET ADDED TO IGNORE LIST FOR LATER RUNS." << LL_ENDL;
|
||||
}
|
||||
|
||||
// Default to application directory.
|
||||
LLViewerWindow::sSnapshotBaseName = "Snapshot";
|
||||
LLViewerWindow::sMovieBaseName = "SLmovie";
|
||||
resetSnapshotLoc();
|
||||
|
||||
|
||||
/*
|
||||
LLWindowCallbacks* callbacks,
|
||||
|
|
@ -1877,6 +1870,11 @@ void LLViewerWindow::showSystemUIScaleFactorChanged()
|
|||
LLNotificationsUtil::add("SystemUIScaleFactorChanged", LLSD(), LLSD(), onSystemUIScaleFactorChanged);
|
||||
}
|
||||
|
||||
std::string LLViewerWindow::getLastSnapshotDir()
|
||||
{
|
||||
return sSnapshotDir;
|
||||
}
|
||||
|
||||
//static
|
||||
bool LLViewerWindow::onSystemUIScaleFactorChanged(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
|
|
@ -4401,11 +4399,12 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picke
|
|||
// Copy the directory + file name
|
||||
std::string filepath = picker.getFirstFile();
|
||||
|
||||
LLViewerWindow::sSnapshotBaseName = gDirUtilp->getBaseFileName(filepath, true);
|
||||
LLViewerWindow::sSnapshotDir = gDirUtilp->getDirName(filepath);
|
||||
gSavedPerAccountSettings.setString("SnapshotBaseName", gDirUtilp->getBaseFileName(filepath, true));
|
||||
gSavedPerAccountSettings.setString("SnapshotBaseDir", gDirUtilp->getDirName(filepath));
|
||||
}
|
||||
|
||||
if(LLViewerWindow::sSnapshotDir.empty())
|
||||
std::string snapshot_dir = sSnapshotDir;
|
||||
if(snapshot_dir.empty())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -4452,7 +4451,7 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picke
|
|||
|
||||
void LLViewerWindow::resetSnapshotLoc()
|
||||
{
|
||||
sSnapshotDir.clear();
|
||||
gSavedPerAccountSettings.setString("SnapshotBaseDir", std::string());
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
@ -4506,6 +4505,17 @@ void LLViewerWindow::playSnapshotAnimAndSound()
|
|||
send_sound_trigger(LLUUID(gSavedSettings.getString("UISndSnapshot")), 1.0f);
|
||||
}
|
||||
|
||||
BOOL LLViewerWindow::isSnapshotLocSet() const
|
||||
{
|
||||
std::string snapshot_dir = sSnapshotDir;
|
||||
return !snapshot_dir.empty();
|
||||
}
|
||||
|
||||
void LLViewerWindow::resetSnapshotLoc() const
|
||||
{
|
||||
gSavedPerAccountSettings.setString("SnapshotBaseDir", std::string());
|
||||
}
|
||||
|
||||
BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type)
|
||||
{
|
||||
return rawSnapshot(raw, preview_width, preview_height, FALSE, FALSE, show_ui, do_rebuild, type);
|
||||
|
|
|
|||
|
|
@ -350,8 +350,8 @@ public:
|
|||
BOOL rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, BOOL keep_window_aspect = TRUE, BOOL is_texture = FALSE,
|
||||
BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, S32 max_size = MAX_SNAPSHOT_IMAGE_SIZE);
|
||||
BOOL thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type);
|
||||
BOOL isSnapshotLocSet() const { return ! sSnapshotDir.empty(); }
|
||||
void resetSnapshotLoc() const { sSnapshotDir.clear(); }
|
||||
BOOL isSnapshotLocSet() const;
|
||||
void resetSnapshotLoc() const;
|
||||
BOOL saveImageNumbered(LLImageFormatted *image, BOOL force_picker, BOOL& insufficient_memory);
|
||||
|
||||
// Reset the directory where snapshots are saved.
|
||||
|
|
@ -419,7 +419,7 @@ public:
|
|||
|
||||
bool getSystemUIScaleFactorChanged() { return mSystemUIScaleFactorChanged; }
|
||||
static void showSystemUIScaleFactorChanged();
|
||||
static std::string getLastSnapshotDir() { return sSnapshotDir; }
|
||||
static std::string getLastSnapshotDir();
|
||||
|
||||
private:
|
||||
bool shouldShowToolTipFor(LLMouseHandler *mh);
|
||||
|
|
@ -504,11 +504,6 @@ private:
|
|||
boost::scoped_ptr<LLWindowListener> mWindowListener;
|
||||
boost::scoped_ptr<LLViewerWindowListener> mViewerWindowListener;
|
||||
|
||||
static std::string sSnapshotBaseName;
|
||||
static std::string sSnapshotDir;
|
||||
|
||||
static std::string sMovieBaseName;
|
||||
|
||||
// Object temporarily hovered over while dragging
|
||||
LLPointer<LLViewerObject> mDragHoveredObject;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue