Commits

alain_linden committed 94d8007 Merge

Comments (0)

Files changed (4)

indra/newview/llappviewer.cpp

     // do we need a file llupdaterui.cpp or something? -brad
     bool notify_update(LLSD const & evt)
     {
-        LLNotificationsUtil::add("DownloadBackground");
-        // let others also handle this event by default
+		switch (evt["type"].asInteger())
+		{
+			case LLUpdaterService::DOWNLOAD_COMPLETE:
+				LLNotificationsUtil::add("DownloadBackground");
+				break;
+			case LLUpdaterService::INSTALL_ERROR:
+				LLNotificationsUtil::add("FailedUpdateInstall");
+				break;
+			default:
+				llinfos << "unhandled update event " << evt << llendl;
+				break;
+		}
+
+		// let others also handle this event by default
         return false;
     }
 };

indra/newview/skins/default/xui/en/notifications.xml

   </notification>
 
   <notification
+   icon="alertmodal.tga"
+   name="FailedUpdateInstall"
+   type="alertmodal">
+Gadzooks, I failed to install the latest update.
+Get thee to the interwebs and install it thyself.
+    <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
+  <notification
    icon="notifytip.tga"
    name="DownloadBackground"
    type="notifytip">

indra/viewer_components/updater/llupdaterservice.cpp

 			llinfos << "found marker " << ll_install_failed_marker_path() << llendl;
 			llinfos << "last install attempt failed" << llendl;
 			LLFile::remove(ll_install_failed_marker_path());
+			
+			LLSD event;
+			event["type"] = LLSD(LLUpdaterService::INSTALL_ERROR);
+			LLEventPumps::instance().obtain(LLUpdaterService::pumpName()).post(event);
 		}
 		else
 		{

indra/viewer_components/updater/llupdaterservice.h

 	static std::string const & pumpName(void);
 	
 	// Type codes for events posted by this service.  Stored the event's 'type' element.
-	enum UpdateEvent {
+	enum eUpdateEvent {
 		INVALID,
 		DOWNLOAD_COMPLETE,
-		DOWNLOAD_ERROR
+		DOWNLOAD_ERROR,
+		INSTALL_ERROR
 	};
 
 	LLUpdaterService();