The following commit has been merged in the master branch:
commit d5c60abcd79f351cf06d3f7b7f9492dd844d7736
Author: Robin Cornelius <[EMAIL PROTECTED]>
Date:   Fri Jul 18 22:26:53 2008 +0100

    new patches and version bump

diff --git a/debian/changelog b/debian/changelog
index 1a6cd32..885c753 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,9 @@
 omvviewer (1.20.14-1) experimental; urgency=low
 
   * New Upstream Version
+    + New patch VWR-5917_multiple_user_day_cycles_in_rw_area.dpatch 
+    + Modify VWR-4981_save_windlight_settings_in_user_rw_area.dpatch 
+    + Bump artwork dependencies
 
  -- Robin Cornelius <[EMAIL PROTECTED]>  Wed, 16 Jul 2008 23:11:35 +0200
 
diff --git a/debian/patches/00list b/debian/patches/00list
index 38ad0bc..c9b1dc0 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -78,3 +78,4 @@ VWR-7831_smart_pointer_explicit_casting.dpatch
 
 VWR-5082_set_bulk_inv_permissions.dpatch
 VWR-4981_save_windlight_settings_in_user_rw_area.dpatch
+VWR-5917_multiple_user_day_cycles_in_rw_area.dpatch
diff --git a/debian/patches/VWR-5917_multiple_user_day_cycles_in_rw_area.dpatch 
b/debian/patches/VWR-5917_multiple_user_day_cycles_in_rw_area.dpatch
new file mode 100755
index 0000000..9882c80
--- /dev/null
+++ b/debian/patches/VWR-5917_multiple_user_day_cycles_in_rw_area.dpatch
@@ -0,0 +1,530 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## Allow multiple user savable daycycles.dpatch by  <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: VWR-5917 fix
+
[EMAIL PROTECTED]@
+
+diff --git a/indra/newview/llfloaterdaycycle.cpp 
b/indra/newview/llfloaterdaycycle.cpp
+index f517439..154975e 100644
+--- a/indra/newview/llfloaterdaycycle.cpp
++++ b/indra/newview/llfloaterdaycycle.cpp
+@@ -65,6 +65,30 @@ const F32 LLFloaterDayCycle::sHoursPerDay = 24.0f;
+ LLFloaterDayCycle::LLFloaterDayCycle() : LLFloater("Day Cycle Floater")
+ {
+       LLUICtrlFactory::getInstance()->buildFloater(this, 
"floater_day_cycle_options.xml");
++
++
++      // This populates M2's combo with the names of avaiable day cycles.
++
++      // add the combo boxes
++      LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo");
++
++      if(comboBox != NULL) {
++              
++              std::map<std::string, std::string>::iterator mIt = 
++                      LLWLParamManager::instance()->mDay.mDayList.begin();
++              for(; mIt !=LLWLParamManager::instance()->mDay.mDayList.end(); 
mIt++) 
++              {
++                      comboBox->add(mIt->first);
++                      llinfos << "adding "<<mIt->first<<llendl;               
++              }
++
++              // entry for when we're in estate time
++              //comboBox->add("");
++
++              // set defaults on combo boxes
++              comboBox->selectByValue(LLSD("Default"));
++      }
++
+       
+       // add the combo boxes
+       LLComboBox* keyCombo = getChild<LLComboBox>("WLKeyPresets");
+@@ -135,11 +159,20 @@ void LLFloaterDayCycle::initCallbacks(void)
+       childSetAction("WLAnimSky", onRunAnimSky, NULL);
+       childSetAction("WLStopAnimSky", onStopAnimSky, NULL);
+ 
+-      childSetAction("WLLoadDayCycle", onLoadDayCycle, NULL);
+-      childSetAction("WLSaveDayCycle", onSaveDayCycle, NULL);
+-
+       childSetAction("WLAddKey", onAddKey, NULL);
+       childSetAction("WLDeleteKey", onDeleteKey, NULL);
++
++      // Load/save
++      LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo");
++
++      childSetAction("WLLoadDayCycle", onLoadDayCycle, (void*)comboBox);
++      childSetAction("WLSaveDayCycle", onSaveDayCycle, (void*)comboBox);
++
++      childSetAction("WLNewPreset", onNewPreset, (void*)this);
++      childSetAction("WLDeletePreset", onDeletePreset, (void*)this);
++
++      comboBox->setCommitCallback(onChangePresetName);
++
+ }
+ 
+ void LLFloaterDayCycle::syncMenu()
+@@ -323,9 +356,17 @@ void LLFloaterDayCycle::onUseLindenTime(void* userData)
+       LLWLParamManager::instance()->mAnimator.mUseLindenTime = true;  
+ }
+ 
+-void LLFloaterDayCycle::onLoadDayCycle(void* userData)
++void LLFloaterDayCycle::onLoadDayCycle(void * userData)
+ {
+-      LLWLParamManager::instance()->mDay.loadDayCycle("Default.xml");
++
++      LLComboBox * combo_box = static_cast<LLComboBox*>(userData);
++      
++      if(combo_box->getSimple() == "")
++      {
++              return;
++      }
++
++      
LLWLParamManager::instance()->mDay.loadDayCycle(combo_box->getSelectedValue().asString());
+       
+       // sync it all up
+       syncSliderTrack();
+@@ -343,9 +384,25 @@ void LLFloaterDayCycle::onLoadDayCycle(void* userData)
+               LLWLParamManager::instance()->mCurParams);
+ }
+ 
+-void LLFloaterDayCycle::onSaveDayCycle(void* userData)
++void LLFloaterDayCycle::onSaveDayCycle(void * userData)
+ {
+-      LLWLParamManager::instance()->mDay.saveDayCycle("Default.xml");
++      LLComboBox * combo_box = static_cast<LLComboBox*>(userData);
++      
++      if(combo_box->getSimple() == "")
++      {
++              return;
++      }
++
++      std::string name(combo_box->getSelectedValue().asString());
++
++      if(name=="Default")
++      {
++                      gViewerWindow->alertXml("WLNoEditDefault");
++                      return;
++      }
++
++
++      LLWLParamManager::instance()->mDay.saveDayCycle(name);
+ }
+ 
+ 
+@@ -592,5 +649,108 @@ void LLFloaterDayCycle::onDeleteKey(void* userData)
+       minSpin->set(min);
+ 
+       syncTrack();
++}
++
++void LLFloaterDayCycle::onChangePresetName(LLUICtrl* ctrl, void * userData)
++{
++
++      LLComboBox * combo_box = static_cast<LLComboBox*>(ctrl);
++      
++      if(combo_box->getSimple() == "")
++      {
++              return;
++      }
++      
++      // We probably should not do this here, day cycle should look after its 
own map lookups
++//    std::map<std::string,std::string>::iterator iter = 
LLWLParamManager::instance()->mDay.mDayList.find(combo_box->getSelectedValue().asString());
++
++      llinfos<<"New day cycle selected: 
"<<combo_box->getSelectedValue().asString()<<llendl;
++
++      onLoadDayCycle((void*)combo_box);
+ 
+ }
++
++/// button to add a new day
++void LLFloaterDayCycle::onNewPreset(void * userData)
++{
++      gViewerWindow->alertXmlEditText("NewSkyPreset", 
LLString::format_map_t(), 
++              NULL, NULL, newPromptCallback, userData);
++}
++      
++/// button to delete a day
++void LLFloaterDayCycle::onDeletePreset(void * userData)
++{
++      LLFloaterDayCycle * pthis=(LLFloaterDayCycle *)userData;
++
++      LLComboBox* combo_box = pthis->getChild<LLComboBox>("WLPresetsCombo");
++
++      if(combo_box->getSelectedValue().asString() == "")
++      {
++              return;
++      }
++
++      LLString::format_map_t args;
++      args["[SKY]"] = combo_box->getSelectedValue().asString();
++      gViewerWindow->alertXml("WLDeletePresetAlert", args, 
deleteAlertCallback, pthis);
++
++}
++
++void LLFloaterDayCycle::deleteAlertCallback(S32 option, void* userData)
++{
++      //Need to delete the current settings and then fallback to *something*
++      // either next in list or may be just Default ???
++
++      if(option!=0)
++              return;
++
++      LLFloaterDayCycle * pthis=(LLFloaterDayCycle *)userData;
++
++      LLComboBox* combo_box = pthis->getChild<LLComboBox>("WLPresetsCombo");
++
++      std::string name(combo_box->getSelectedValue().asString());
++
++      if(name=="Default")
++      {
++                      gViewerWindow->alertXml("WLNoEditDefault");
++                      return;
++      }
++
++      combo_box->remove(name);
++
++      LLWLParamManager::instance()->mDay.deleteDayCycle(name,TRUE);
++
++      combo_box->selectByValue("Default");
++
++      onLoadDayCycle(combo_box);
++
++}
++
++
++void LLFloaterDayCycle::newPromptCallback(S32 option, const LLString& text, 
void* userData)
++{
++      // Save the curent settings as the new filename.
++
++      LLFloaterDayCycle * pthis=(LLFloaterDayCycle *)userData;
++      
++      std::map<std::string, std::string>::iterator mIt = 
LLWLParamManager::instance()->mDay.mDayList.find(text);
++      if(mIt != LLWLParamManager::instance()->mDay.mDayList.end()) 
++      {
++              //cannot add name already in use
++              gViewerWindow->alertXml("WLDayNameInUse");
++              return; 
++      }
++
++
++      LLComboBox* combo_box = pthis->getChild<LLComboBox>("WLPresetsCombo");
++
++      combo_box->add(text);
++      combo_box->selectByValue(text);
++
++      LLWLParamManager::instance()->mDay.mDayList[text] = "NO PATH"; // this 
is because i'm using a map, change to vector
++
++      LLWLParamManager::instance()->mDay.saveDayCycle(text);
++
++      // dont need to reload as what is current is current
++      
++}
++
+diff --git a/indra/newview/llfloaterdaycycle.h 
b/indra/newview/llfloaterdaycycle.h
+index edddbb5..cb5fa76 100644
+--- a/indra/newview/llfloaterdaycycle.h
++++ b/indra/newview/llfloaterdaycycle.h
+@@ -99,14 +99,24 @@ public:
+       static void onDeleteKey(void* userData);
+ 
+       /// button to load day
+-      static void onLoadDayCycle(void* userData);
++      static void onLoadDayCycle(void * userData);
+ 
+       /// button to save day
+-      static void onSaveDayCycle(void* userData);
++      static void onSaveDayCycle(void * userData);
++
++      /// button to add a new day
++      static void onNewPreset(void * userData);
++      static void newPromptCallback(S32 option, const LLString& text, void* 
userData);
++
++      /// button to delete a day
++      static void onDeletePreset(void * userData);
++      static void deleteAlertCallback(S32 option, void* userdata);
+ 
+       /// toggle for Linden time
+       static void onUseLindenTime(void* userData);
+ 
++      /// what to do when you change the preset name
++      static void onChangePresetName(LLUICtrl* ctrl, void* userData);
+ 
+       //// menu management
+ 
+diff --git a/indra/newview/llwldaycycle.cpp b/indra/newview/llwldaycycle.cpp
+index 4626160..a36c654 100644
+--- a/indra/newview/llwldaycycle.cpp
++++ b/indra/newview/llwldaycycle.cpp
+@@ -41,6 +41,7 @@
+ 
+ LLWLDayCycle::LLWLDayCycle() : mDayRate(120)
+ {
++      loadDayCycles();
+ }
+ 
+ 
+@@ -48,17 +49,91 @@ LLWLDayCycle::~LLWLDayCycle()
+ {
+ }
+ 
++void LLWLDayCycle::loadDayCycles()
++{
++
++      bool found = true;                      
++      
++      llinfos << "Searching for default day cycles" << llendl;
++      LLString path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, 
"windlight/days", ""));
++                      
++      while(found) 
++      {
++              std::string name;
++              found = gDirUtilp->getNextFileInDir(path_name, "*.xml", name, 
false);
++              if(found) 
++              {
++
++                      // bugfix for SL-46920: preventing filenames that break 
stuff.
++                      char * curl_str = curl_unescape(name.c_str(), 
name.size());
++                      std::string unescaped_name(curl_str);
++                      curl_free(curl_str);
++                      curl_str = NULL;
++
++                      llinfos << "Adding system day cycle " << unescaped_name 
<< " at "<< path_name<<llendl;
++                      std::string 
tname=unescaped_name.substr(0,unescaped_name.length()-4);
++                      mDayList[tname] = path_name;
++              }
++      }
++
++      llinfos << "Searching for user day cycles" << llendl;
++      found=true;
++
++      path_name=gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , 
"windlight/days", "");
++      while(found) 
++      {
++              std::string name;
++              found = gDirUtilp->getNextFileInDir(path_name, "*.xml", name, 
false);
++              if(found) 
++              {
++
++                      // bugfix for SL-46920: preventing filenames that break 
stuff.
++                      char * curl_str = curl_unescape(name.c_str(), 
name.size());
++                      std::string unescaped_name(curl_str);
++                      curl_free(curl_str);
++                      curl_str = NULL;
++
++                      llinfos << "Adding user day cycle " << unescaped_name 
<< " at "<< path_name<<llendl;
++                      std::string 
tname=unescaped_name.substr(0,unescaped_name.length()-4);
++                      mDayList[tname] = path_name;
++              }
++      }
++}
++
+ void LLWLDayCycle::loadDayCycle(const LLString & fileName)
+ {
++
++      // bugfix for SL-46920: preventing filenames that break stuff.
++      char * curl_str = curl_escape(fileName.c_str(), fileName.size());
++      std::string escaped_filename(curl_str);
++      curl_free(curl_str);
++      curl_str = NULL;
++
++      escaped_filename += ".xml";
++
++
+       // clear the first few things
+       mTimeMap.clear();
+ 
+       // now load the file
+-      LLString pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, 
+-              "windlight/days", fileName));
+-      llinfos << "Loading DayCycle settings from " << pathName << llendl;
++      LLString pathName(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS 
, 
++              "windlight/days", escaped_filename));
+       
+-      llifstream day_cycle_xml(pathName.c_str());
++      llifstream day_cycle_xml;
++      day_cycle_xml.open(pathName.c_str());
++      
++      if(day_cycle_xml)
++              llinfos << "Loading USER DayCycle settings from " << pathName 
<< llendl;
++
++      if(!day_cycle_xml)
++      {
++              LLString 
pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, 
++              "windlight/days", escaped_filename));
++              day_cycle_xml.open(pathName.c_str());
++              if(day_cycle_xml)       
++                      llinfos << "Loading Default DayCycle settings from " << 
pathName << llendl;
++      }
++
+       if (day_cycle_xml.is_open())
+       {
+               // load and parse it
+@@ -98,10 +173,19 @@ void LLWLDayCycle::loadDayCycle(const LLString & fileName)
+ 
+ void LLWLDayCycle::saveDayCycle(const LLString & fileName)
+ {
++
++      // bugfix for SL-46920: preventing filenames that break stuff.
++      char * curl_str = curl_escape(fileName.c_str(), fileName.size());
++      std::string escaped_filename(curl_str);
++      curl_free(curl_str);
++      curl_str = NULL;
++
++      escaped_filename += ".xml";
++
+       LLSD day_data(LLSD::emptyArray());
+ 
+-      LLString pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, 
"windlight/days", fileName));
+-      //llinfos << "Saving WindLight settings to " << pathName << llendl;
++      LLString pathName(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS 
, "windlight/days", escaped_filename));
++      llinfos << "Saving Day cycle settings to " << pathName << llendl;
+ 
+       for(std::map<F32, std::string>::const_iterator mIt = mTimeMap.begin();
+               mIt != mTimeMap.end();
+@@ -120,6 +204,29 @@ void LLWLDayCycle::saveDayCycle(const LLString & fileName)
+       //day_cycle_xml.close();
+ }
+ 
++void LLWLDayCycle::deleteDayCycle(std::string name,bool delete_from_disk)
++{
++
++      std::map<std::string, std::string>::iterator mIt = mDayList.find(name);
++      if(mIt != mDayList.end()) 
++      {
++              mDayList.erase(mIt);
++      }
++
++      if(delete_from_disk)
++      {
++              LLString path_name(gDirUtilp->getExpandedFilename( 
LL_PATH_USER_SETTINGS , "windlight/days", ""));
++              
++              // use full curl escaped name
++              char * curl_str = curl_escape(name.c_str(), name.size());
++              std::string escaped_name(curl_str);
++              curl_free(curl_str);
++              curl_str = NULL;
++              
++              gDirUtilp->deleteFilesInDir(path_name, escaped_name + ".xml");
++      }
++}
++
+ 
+ void LLWLDayCycle::clearKeys()
+ {
+diff --git a/indra/newview/llwldaycycle.h b/indra/newview/llwldaycycle.h
+index 85e75c2..c850438 100644
+--- a/indra/newview/llwldaycycle.h
++++ b/indra/newview/llwldaycycle.h
+@@ -48,6 +48,9 @@ public:
+ 
+       // lists what param sets are used when during the day
+       std::map<F32, std::string> mTimeMap;
++      std::map<std::string,std::string> mDayList; //I'm using a map for the 
moment just incase we suddenly want to be like
++                                                  // the other WL parameters 
and hold a class with the details. The second
++                                                  // string is not actualy 
used at the moment.
+ 
+       // how long is my day
+       F32 mDayRate;
+@@ -60,12 +63,18 @@ public:
+       /// simple destructor
+       ~LLWLDayCycle();
+ 
++      // Load the list of day cycles
++      void loadDayCycles();
++
+       /// load a day cycle
+       void loadDayCycle(const LLString & fileName);
+ 
+       /// load a day cycle
+       void saveDayCycle(const LLString & fileName);
+ 
++      /// delete a day cycle  
++      void deleteDayCycle(std::string name,bool delete_from_disk);
++
+       /// clear keys
+       void clearKeys();
+ 
+diff --git a/indra/newview/llwlparammanager.cpp 
b/indra/newview/llwlparammanager.cpp
+index 9f23b37..a916823 100644
+--- a/indra/newview/llwlparammanager.cpp
++++ b/indra/newview/llwlparammanager.cpp
+@@ -556,7 +556,7 @@ LLWLParamManager * LLWLParamManager::instance()
+               sInstance->loadPresets("");
+ 
+               // load the day
+-              sInstance->mDay.loadDayCycle("Default.xml");
++              sInstance->mDay.loadDayCycle("Default");
+ 
+               // *HACK - sets cloud scrolling to what we want... fix this 
better in the future
+               sInstance->getParamSet("Default", sInstance->mCurParams);
+diff --git a/indra/newview/skins/default/xui/en-us/alerts.xml 
b/indra/newview/skins/xui/en-us/alerts.xml
+index 08a316a..dd8efc1 100644
+--- a/indra/newview/skins/default/xui/en-us/alerts.xml
++++ b/indra/newview/skins/default/xui/en-us/alerts.xml
+@@ -4555,6 +4555,11 @@ Terrain Detail: Sets the amount of detail you would 
like to see for the terrain
+                       No
+               </option>
+       </alert>
++      <alert modal="true" name="WLDayNameInUse">
++              <message name="message">
++                      That name is already in use, please pick a new name.
++              </message>
++      </alert>
+       <alert modal="true" name="WLNoEditDefault">
+               <message name="message">
+                       You cannot edit or delete a default preset.
+diff --git 
a/indra/newview/skins/default/xui/en-us/floater_day_cycle_options.xml 
b/indra/newview/skins/xui/en-us/floater_day_cycle_options.xml
+index 84812b9..a4c6667 100644
+--- a/indra/newview/skins/default/xui/en-us/floater_day_cycle_options.xml
++++ b/indra/newview/skins/default/xui/en-us/floater_day_cycle_options.xml
+@@ -1,9 +1,12 @@
+ <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+ <floater bottom="-150" can_close="true" can_drag_on_left="false" 
can_minimize="true"
+-     can_resize="false" height="275" left="50" min_height="180"
++     can_resize="false" height="300" left="50" min_height="180"
+      min_width="400" mouse_opaque="true" name="Day Cycle Floater"
+      rect_control="FloaterDayCycleRect" title="Day Cycle Editor" width="646">
+-      <tab_container bottom="-275" follows="left|top" height="255" left="0"
++      
++      
++
++      <tab_container bottom="-300" follows="left|top" height="255" left="0"
+            mouse_opaque="false" name="Day Cycle Tabs" tab_position="top" 
width="644">
+               <panel border="true" bottom="-255" 
follows="left|top|right|bottom" height="255"
+                    label="Day Cycle" left="1" mouse_opaque="false"
+@@ -237,14 +240,27 @@
+                            label="Use Estate Time" label_selected="Go to 
Estate Time"
+                            left_delta="55" mouse_opaque="true" 
name="WLUseLindenTime"
+                            scale_image="true" width="140" />
+-                      <button bottom="-195" enabled="true" font="SansSerif" 
halign="center" height="20"
+-                           label="Save Test Day" label_selected="Save Test 
Day"
++
++                      <combo_box allow_text_entry="false" bottom="-190" 
follows="left|top" height="18"
++                              left="480" max_chars="20" mouse_opaque="true" 
name="WLPresetsCombo"
++                              width="150" />
++
++                      <button bottom="-215" enabled="true" font="SansSerif" 
halign="center" height="20"
++                              label="New" label_selected="New" left="560"
++                              mouse_opaque="true" name="WLNewPreset" 
scale_image="true" width="70" />
++
++                      <button bottom="-235" enabled="true" font="SansSerif" 
halign="center" height="20"
++                              label="Delete" label_selected="Delete" 
left="560"
++                              mouse_opaque="true" name="WLDeletePreset" 
scale_image="true" width="70" />
++
++                      <button bottom="-215" enabled="true" font="SansSerif" 
halign="center" height="20"
++                           label="Save" label_selected="Save Test Day"
+                            left="480" mouse_opaque="true" 
name="WLSaveDayCycle" scale_image="true"
+-                           width="150" />
+-                      <button bottom="-220" enabled="true" font="SansSerif" 
halign="center" height="20"
+-                           label="Load Test Day" label_selected="Load Test 
Day"
++                           width="75" />
++                      <button bottom="-235" enabled="true" font="SansSerif" 
halign="center" height="20"
++                           label="(Re)Load" label_selected="Load Test Day"
+                            left="480" mouse_opaque="true" 
name="WLLoadDayCycle" scale_image="true"
+-                           width="150" />
++                           width="75" />
+               </panel>
+       </tab_container>
+ </floater>

-- 
A client for connecting to 3D metaverses such as Linden Labs Secondlife(tm) and 
OpenSim grids

_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-games-commits

Reply via email to