From c12e8ee1a34d06731d35b5f5fced033646d7f5c1 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Fri, 24 Jul 2015 14:00:27 -0700 Subject: [PATCH] Put in new icons for library Moved classes to their own file --- AboutPage/UpdateControlData.cs | 2 +- Library/LibraryDataView.cs | 15 +- Library/Provider/LibraryProvider.cs | 87 +++++--- Library/Provider/LibraryProviderFileSystem.cs | 37 ++-- Library/Provider/LibraryProviderPlugin.cs | 8 +- Library/Provider/LibraryProviderSelector.cs | 21 +- MatterControl.csproj | 3 + StaticData/Icons/FileDialog/cloud_folder.png | Bin 0 -> 689 bytes .../Icons/FileDialog/download_folder.png | Bin 0 -> 514 bytes StaticData/Icons/FileDialog/folder.png | Bin 343 -> 444 bytes .../Icons/FileDialog/library_folder.png | Bin 0 -> 496 bytes .../Icons/FileDialog/purchased_folder.png | Bin 0 -> 608 bytes StaticData/Icons/FileDialog/sd_folder.png | Bin 0 -> 668 bytes StaticData/Icons/FileDialog/up_folder.png | Bin 0 -> 528 bytes StaticData/Icons/FileDialog/upfolder.png | Bin 505 -> 0 bytes StaticData/OEMSettings/ReleaseNotes.html | 193 ++++++++++++++++++ StaticData/Translations/Master.txt | 3 + VersionManagement/ClientTokenRequest.cs | 57 ++++++ VersionManagement/ContactFormRequest.cs | 87 ++++++++ VersionManagement/LatestVersionRequest.cs | 102 +++++++++ VersionManagement/VersionFileHandler.cs | 31 ++- VersionManagement/WebRequestHandler.cs | 135 +----------- 22 files changed, 586 insertions(+), 195 deletions(-) create mode 100644 StaticData/Icons/FileDialog/cloud_folder.png create mode 100644 StaticData/Icons/FileDialog/download_folder.png create mode 100644 StaticData/Icons/FileDialog/library_folder.png create mode 100644 StaticData/Icons/FileDialog/purchased_folder.png create mode 100644 StaticData/Icons/FileDialog/sd_folder.png create mode 100644 StaticData/Icons/FileDialog/up_folder.png delete mode 100644 StaticData/Icons/FileDialog/upfolder.png create mode 100644 StaticData/OEMSettings/ReleaseNotes.html create mode 100644 VersionManagement/ClientTokenRequest.cs create mode 100644 VersionManagement/ContactFormRequest.cs create mode 100644 VersionManagement/LatestVersionRequest.cs diff --git a/AboutPage/UpdateControlData.cs b/AboutPage/UpdateControlData.cs index 15ce3dc6a..4220405bf 100644 --- a/AboutPage/UpdateControlData.cs +++ b/AboutPage/UpdateControlData.cs @@ -168,7 +168,7 @@ namespace MatterHackers.MatterControl if (!WaitingToCompleteTransaction()) { SetUpdateStatus(UpdateStatusStates.CheckingForUpdate); - RequestLatestVersion request = new RequestLatestVersion(); + LatestVersionRequest request = new LatestVersionRequest(); request.RequestSucceeded += new EventHandler(onVersionRequestSucceeded); request.RequestFailed += onVersionRequestFailed; request.Request(); diff --git a/Library/LibraryDataView.cs b/Library/LibraryDataView.cs index 5ac0ef131..3a2776968 100644 --- a/Library/LibraryDataView.cs +++ b/Library/LibraryDataView.cs @@ -400,17 +400,8 @@ namespace MatterHackers.MatterControl.PrintLibrary } } - protected GuiWidget GetThumbnailWidget(bool upFolder, LibraryProvider parentProvider, PrintItemCollection printItemCollection) + protected GuiWidget GetThumbnailWidget(LibraryProvider parentProvider, PrintItemCollection printItemCollection, ImageBuffer imageBuffer) { - string path = Path.Combine("Icons", "FileDialog", "folder.png"); - if (upFolder) - { - path = Path.Combine("Icons", "FileDialog", "upfolder.png"); - } - - ImageBuffer imageBuffer = new ImageBuffer(); - StaticData.Instance.LoadImage(path, imageBuffer); - Vector2 expectedSize = new Vector2((int)(50 * TextWidget.GlobalPointSizeScaleRatio), (int)(50 * TextWidget.GlobalPointSizeScaleRatio)); if (imageBuffer.Width != expectedSize.x) { @@ -451,14 +442,14 @@ namespace MatterHackers.MatterControl.PrintLibrary if (provider != null && provider.ProviderKey != "ProviderSelectorKey") { PrintItemCollection parent = new PrintItemCollection("..", provider.ProviderKey); - LibraryRowItem queueItem = new LibraryRowItemCollection(parent, -1, this, provider.ParentLibraryProvider, GetThumbnailWidget(true, provider.ParentLibraryProvider, parent)); + LibraryRowItem queueItem = new LibraryRowItemCollection(parent, -1, this, provider.ParentLibraryProvider, GetThumbnailWidget(provider.ParentLibraryProvider, parent, LibraryProvider.UpFolderImage)); AddListItemToTopToBottom(queueItem); } for (int i = 0; i < provider.CollectionCount; i++) { PrintItemCollection item = provider.GetCollectionItem(i); - LibraryRowItem queueItem = new LibraryRowItemCollection(item, i, this, null, GetThumbnailWidget(false, null, item)); + LibraryRowItem queueItem = new LibraryRowItemCollection(item, i, this, null, GetThumbnailWidget(null, item, provider.GetCollectionFolderImage(i))); AddListItemToTopToBottom(queueItem); } diff --git a/Library/Provider/LibraryProvider.cs b/Library/Provider/LibraryProvider.cs index 87d3ec49b..716935133 100644 --- a/Library/Provider/LibraryProvider.cs +++ b/Library/Provider/LibraryProvider.cs @@ -28,13 +28,13 @@ either expressed or implied, of the FreeBSD Project. */ using MatterHackers.Agg; +using MatterHackers.Agg.Image; +using MatterHackers.Agg.PlatformAbstract; using MatterHackers.Agg.UI; using MatterHackers.MatterControl.DataStorage; using MatterHackers.MatterControl.PrintQueue; -using MatterHackers.PolygonMesh; using System; using System.Collections.Generic; -using System.ComponentModel; using System.IO; using System.Threading.Tasks; @@ -54,8 +54,6 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider #region Member Methods - public abstract bool Visible { get; } - public bool HasParent { get @@ -69,6 +67,42 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider } } + public abstract bool Visible { get; } + + static ImageBuffer normalFolderImage = null; + public static ImageBuffer NormalFolderImage + { + get + { + if (normalFolderImage == null) + { + string path = Path.Combine("Icons", "FileDialog", "folder.png"); + + normalFolderImage = new ImageBuffer(); + StaticData.Instance.LoadImage(path, normalFolderImage); + } + + return normalFolderImage; + } + } + + static ImageBuffer upFolderImage = null; + public static ImageBuffer UpFolderImage + { + get + { + if (upFolderImage == null) + { + string path = Path.Combine("Icons", "FileDialog", "up_folder.png"); + + upFolderImage = new ImageBuffer(); + StaticData.Instance.LoadImage(path, upFolderImage); + } + + return upFolderImage; + } + } + public void AddFilesToLibrary(IList files, ReportProgressRatio reportProgress = null) { foreach (string file in files) @@ -95,10 +129,6 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider #region Abstract Methods - public abstract void AddItem(PrintItemWrapper itemToAdd); - - public abstract void Dispose(); - public abstract int CollectionCount { get; } public abstract int ItemCount { get; } @@ -113,6 +143,10 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider public abstract void AddCollectionToLibrary(string collectionName); + public abstract void AddItem(PrintItemWrapper itemToAdd); + + public abstract void Dispose(); + public abstract PrintItemCollection GetCollectionItem(int collectionIndex); public abstract Task GetPrintItemWrapperAsync(int itemIndex, ReportProgressRatio reportProgress = null); @@ -136,6 +170,27 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider #endregion Static Methods + public virtual int GetCollectionChildCollectionCount(int collectionIndex) + { + return GetProviderForCollection(GetCollectionItem(collectionIndex)).CollectionCount; + } + + public virtual int GetCollectionItemCount(int collectionIndex) + { + return GetProviderForCollection(GetCollectionItem(collectionIndex)).ItemCount; + } + + public virtual ImageBuffer GetCollectionFolderImage(int collectionIndex) + { + return NormalFolderImage; + } + + public virtual GuiWidget GetItemThumbnail(int printItemIndex) + { + var printItemWrapper = GetPrintItemWrapperAsync(printItemIndex).Result; + return new PartThumbnailWidget(printItemWrapper, "part_icon_transparent_40x40.png", "building_thumbnail_40x40.png", PartThumbnailWidget.ImageSizes.Size50x50); + } + public virtual string GetPrintItemName(int itemIndex) { return ""; @@ -150,22 +205,6 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider { return false; } - - public virtual GuiWidget GetItemThumbnail(int printItemIndex) - { - var printItemWrapper = GetPrintItemWrapperAsync(printItemIndex).Result; - return new PartThumbnailWidget(printItemWrapper, "part_icon_transparent_40x40.png", "building_thumbnail_40x40.png", PartThumbnailWidget.ImageSizes.Size50x50); - } - - public virtual int GetCollectionChildCollectionCount(int collectionIndex) - { - return GetProviderForCollection(GetCollectionItem(collectionIndex)).CollectionCount; - } - - public virtual int GetCollectionItemCount(int collectionIndex) - { - return GetProviderForCollection(GetCollectionItem(collectionIndex)).ItemCount; - } } public class ProviderLocatorNode diff --git a/Library/Provider/LibraryProviderFileSystem.cs b/Library/Provider/LibraryProviderFileSystem.cs index 23e96be57..d93388207 100644 --- a/Library/Provider/LibraryProviderFileSystem.cs +++ b/Library/Provider/LibraryProviderFileSystem.cs @@ -31,11 +31,8 @@ using MatterHackers.Agg; using MatterHackers.Agg.UI; using MatterHackers.MatterControl.DataStorage; using MatterHackers.MatterControl.PrintQueue; -using MatterHackers.PolygonMesh; -using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Threading; @@ -79,21 +76,6 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider GetFilesAndCollectionsInCurrentDirectory(); } - public override bool Visible - { - get { return true; } - } - - public override void Dispose() - { - directoryWatcher.EnableRaisingEvents = false; - - directoryWatcher.Changed -= DiretoryContentsChanged; - directoryWatcher.Created -= DiretoryContentsChanged; - directoryWatcher.Deleted -= DiretoryContentsChanged; - directoryWatcher.Renamed -= DiretoryContentsChanged; - } - public override int CollectionCount { get @@ -142,6 +124,11 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider } } + public override bool Visible + { + get { return true; } + } + public override void AddCollectionToLibrary(string collectionName) { string directoryPath = Path.Combine(rootPath, currentDirectory, collectionName); @@ -161,6 +148,16 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider GetFilesAndCollectionsInCurrentDirectory(); } + public override void Dispose() + { + directoryWatcher.EnableRaisingEvents = false; + + directoryWatcher.Changed -= DiretoryContentsChanged; + directoryWatcher.Created -= DiretoryContentsChanged; + directoryWatcher.Deleted -= DiretoryContentsChanged; + directoryWatcher.Renamed -= DiretoryContentsChanged; + } + public override PrintItemCollection GetCollectionItem(int collectionIndex) { string directoryName = currentDirectoryDirectories[collectionIndex]; @@ -175,7 +172,7 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider public async override Task GetPrintItemWrapperAsync(int itemIndex, ReportProgressRatio reportProgress = null) { string fileName = currentDirectoryFiles[itemIndex]; - + return new PrintItemWrapper(new DataStorage.PrintItem(Path.GetFileNameWithoutExtension(fileName), fileName), this); } @@ -192,7 +189,7 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider Stopwatch time = Stopwatch.StartNew(); Directory.Delete(directoryPath, true); // Wait for up to some amount of time for the directory to be gone. - while (Directory.Exists(directoryPath) + while (Directory.Exists(directoryPath) && time.ElapsedMilliseconds < 100) { Thread.Sleep(1); // make sure we are not eating all the cpu time. diff --git a/Library/Provider/LibraryProviderPlugin.cs b/Library/Provider/LibraryProviderPlugin.cs index 86f707bba..b26ff3008 100644 --- a/Library/Provider/LibraryProviderPlugin.cs +++ b/Library/Provider/LibraryProviderPlugin.cs @@ -28,6 +28,7 @@ either expressed or implied, of the FreeBSD Project. */ using MatterHackers.Agg; +using MatterHackers.Agg.Image; using MatterHackers.MatterControl.DataStorage; using MatterHackers.MatterControl.PrintQueue; using System; @@ -38,9 +39,14 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider { public class LibraryProviderPlugin { - virtual public LibraryProvider CreateLibraryProvider(LibraryProvider parentLibraryProvider) + public virtual LibraryProvider CreateLibraryProvider(LibraryProvider parentLibraryProvider) { throw new NotImplementedException(); } + + public virtual ImageBuffer GetFolderImage() + { + return LibraryProvider.NormalFolderImage; + } } } \ No newline at end of file diff --git a/Library/Provider/LibraryProviderSelector.cs b/Library/Provider/LibraryProviderSelector.cs index f70c39102..d3a174fc9 100644 --- a/Library/Provider/LibraryProviderSelector.cs +++ b/Library/Provider/LibraryProviderSelector.cs @@ -39,6 +39,8 @@ using System.IO; using System.Linq; using MatterHackers.Agg.UI; using System.Threading.Tasks; +using MatterHackers.Agg.Image; +using MatterHackers.Agg.PlatformAbstract; namespace MatterHackers.MatterControl.PrintLibrary.Provider { @@ -53,6 +55,8 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider private event EventHandler unregisterEvents; + List folderImagesForChildren = new List(); + private LibraryProviderSelector() : base(null) { @@ -62,8 +66,7 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider // put in the sqlite provider libraryProviders.Add(new LibraryProviderSQLite(null, this)); - //#if __ANDROID__ - //libraryProviders.Add(new LibraryProviderFileSystem(ApplicationDataStorage.Instance.PublicDataStoragePath, "Downloads", this.ProviderKey)); + AddFolderImage("library_folder.png"); // Check for LibraryProvider factories and put them in the list too. PluginFinder libraryProviderPlugins = new PluginFinder(); @@ -77,6 +80,7 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider } libraryProviders.Add(pluginProvider); + folderImagesForChildren.Add(libraryProviderPlugin.GetFolderImage()); } // and any directory providers (sd card provider, etc...) @@ -85,11 +89,24 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider if (Directory.Exists(downloadsDirectory)) { libraryProviders.Add(new LibraryProviderFileSystem(downloadsDirectory, "Downloads", this)); + AddFolderImage("download_folder.png"); } this.FilterProviders(); } + private void AddFolderImage(string iconFileName) + { + string libraryIconPath = Path.Combine("Icons", "FileDialog", iconFileName); + ImageBuffer libraryFolderImage = new ImageBuffer(); + StaticData.Instance.LoadImage(libraryIconPath, libraryFolderImage); + folderImagesForChildren.Add(libraryFolderImage); + } + + public override ImageBuffer GetCollectionFolderImage(int collectionIndex) + { + return folderImagesForChildren[collectionIndex]; + } private void FilterProviders() { diff --git a/MatterControl.csproj b/MatterControl.csproj index 91667e4d3..5039b57ca 100644 --- a/MatterControl.csproj +++ b/MatterControl.csproj @@ -325,6 +325,9 @@ + + + diff --git a/StaticData/Icons/FileDialog/cloud_folder.png b/StaticData/Icons/FileDialog/cloud_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..8ed11499349fc43689f9d6174ac80967117c4574 GIT binary patch literal 689 zcmeAS@N?(olHy`uVBq!ia0y~yU~mLs4mJh`hQ9A7T^Se{BuiW)N`mv#O3D+9QW+dm z@{>{(JaZG%Q-e|yQz{EjrrIztFa>+MIEGZ*dNZrL@Q?vdoA5g3CDIc(XYq0gJE&{S zUGS1+0;huT66Gzz2iTSfPw)#cTOhQ&U|&py<<_}V;>)erJ2?O8oSe2{zw*btm>LHL z7Ib95pXfa+`wO?n;;_IQFFoC)Oe)g0Wlww&!4&QA;`hI8ihpLzstmuI=*rM$G=b5y zIh!Hqek)UwlkYXx@(8WkbgRFi;fr1yzU=ode_{FH+_Yi_$7vrO&j#E%)A>cl)?7$n zV#5hmmy1VdTv)#B{)3;awc!hQxJ`aKS@%uow1jHIg}H|sqtw;@XmcaTm z3A=f`M9E;A7XzaJ!$XB~zWHYvb6kJ9{!(~dQ{X-AfMNWNg&I_Nt6q~L1#Avtk zPPw@|%qK4Lo*CL^mN28N-HFY3x}=@j!Ws2`(GPkj&D2}+e^=tRS675?ta)tA@Ga9o zJX~dMoaX!EUDYMmWGfu{)xU8r_1Sq(Lo!SB#)*=RM@?E5sI5+xuU{0oKRj)&ukGho z-P?|x&ReF~lj^#Hd)mF$w0ZM5m#yXR3BI&xLe#WiS^&d)DHhY?+yC3B|`PL~Ye-Z|YX*{gZdo;^k;y;Ha0B2-lT#Uwr@J zo0=xhiAzf#$3`zJE(|&s)#CMM{Bz2_41g?Pua)kf@$nV8YxX R#lXP8;OXk;vd$@?2>>RP8{_~0 literal 0 HcmV?d00001 diff --git a/StaticData/Icons/FileDialog/download_folder.png b/StaticData/Icons/FileDialog/download_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..735b476ca16201b123e2db5043ba3604db85f3c7 GIT binary patch literal 514 zcmeAS@N?(olHy`uVBq!ia0y~yU~mLs4mJh`hQ9A7T^Se{BuiW)N`mv#O3D+9QW+dm z@{>{(JaZG%Q-e|yQz{EjrrIztFfQ?QaSW-r^=8(^+`|e2ZM|0+ZJc&Bns;n=+~a8N zIE(X<&xD)@qMIBg6{W98n@I0yFIlPKZ`vW#@?WK7n`+PBm+y8kU-1bN)#DOiU_?ic zoOcB7uKJR_VykE1jK3*MuCer3p5yH7SC!zd2=%(l^ss({)zepevlw!IxLXC?6>7Nh zJ*Tlk+4R{9zWHJI4=&&T)~jUi(r>yi`L;5YCtL1UIANr>#OzI)QV@6VZKIB9jxmx) zrX>4BOpIdfvA?)m?X;=WGXLa6>v>J`;=)0~!Yhh9IX|9>(tJDlz}3bl?Jl3@9z2=6 ziKEApQ-Og=fx#(Dpzo6W2PK<-_d=%5*&^q)rRDVAHEOxfDr2Qsg7x=UpRZcULtpuSOr95B*S-BF>#=KE)3*k5$$J&CKjCa(;K=MsIkuxr%=wzC z(~DK9(&h#14h$>~CzK3cx%^XpVSVJB`VoP9$9}JxmUq;1PDm%~f$uCmM`kXaaW(U^ qMtOx5BMV4512WlCf2yB>nZb(tcjceDUD*r_3=E#GelF{r5}E*${>r5Q literal 0 HcmV?d00001 diff --git a/StaticData/Icons/FileDialog/folder.png b/StaticData/Icons/FileDialog/folder.png index eb893ce7f742205aa3e8627b9f4db086a858b8a9..de65ae6f3e4543d6efeface427aef5af2a118af8 100644 GIT binary patch delta 416 zcmcc4w1-)-Gr-TCmrII^fq{Y7)59f*fq}shggMw47#RA#pLCt5s9w()=jq}YQgQ3e z?T2fd34j#eq2dFp@D&k13~B?y>#)L;!@Ks+DoQHYL;wUu~eil`&z7J*Eg#CSJ0*oby7FCH1Yx{9A|X zd=8(Q5SX`9uc~Cxwk0R}qYSFMGaQgQ3e z&4;{A1_G=J=PVfV9&q$1NbhLud8GD;!^dH+gL?t<%?0~reJ;PfWUa}*=`nvEs=ieh z(d=-Y)wMZOi=UB2z=47BKkp5?#dzK5zf5>sxUpbxT*XLSO$RX2tKC?Y4YY&&@k&P@$ue4e?ziwpK zND{A%+P{w)gN?KAx>raW023t#&B)EyWo*Taq&A03=9mOu6{1- HoD!M<+7o!K diff --git a/StaticData/Icons/FileDialog/library_folder.png b/StaticData/Icons/FileDialog/library_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..7de97db09ba2552979f9c4e96fd5cb91a6c9c856 GIT binary patch literal 496 zcmeAS@N?(olHy`uVBq!ia0y~yU~mLs4mJh`hQ9A7T^Se{BuiW)N`mv#O3D+9QW+dm z@{>{(JaZG%Q-e|yQz{EjrrIztFi!GxaSW-r^=8)H+`|eYZq8R2B^2)-P_~dRY00}# z)|@jT=Yi-h$32dFL9nrUrAO^8+^RDSH7S*%5`_W9xICi10#n61Cu}l z1BBVZpE%L1vgh)pU5hl<)JZLQ*wJm3=33d>KHRmjDpZ9f_jJL%$I%|`^O?Agbr^1nOxj%Xx#d7s$aN+b+3L>25{(Qj z3R6;gk`?a@ezD$k*S|yYxB0#2&px~L&DPq;@Z(;?$-;EaXO6zhz1p9#KmrOW%ziB1 c$11_Vxj*BEGLwxL0|Nttr>mdKI;Vst0L^O0cmMzZ literal 0 HcmV?d00001 diff --git a/StaticData/Icons/FileDialog/purchased_folder.png b/StaticData/Icons/FileDialog/purchased_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..d9c534df5a12bc921b0085ca562c3d9c37aa36a1 GIT binary patch literal 608 zcmeAS@N?(olHy`uVBq!ia0y~yU~mLs4mJh`hQ9A7T^Se{BuiW)N`mv#O3D+9QW+dm z@{>{(JaZG%Q-e|yQz{EjrrIztFfn<$IEGZ*dNb>7?jZw#w&W{}mpG%$IHX%R8#oi1 zw+T=16ENeDp2BM&Jc0KV+gY}kb4#ZEX_h~lx1ss|WIw+NJ|7O(T7}tqPTS#Q#G$~z zgo+N$e{wQ8&;6FwnbV%#D>T03U7GMr?tIR#4j0Qe>Kj;nrUuPb|5GmYYU3{FY=#R? zUQ(x`87|$CjsM{B`DgVk!{aSJ3_1B*8d!O?**te`cX+Z;q2&Z0&%2Byu11Rs2IA)4 zTCQSDiv$GLHtguRDEn>6E#tFkY%Gp5E0_3h+hDG~z37C-@rZ6YzAJi~pB8GlZBlz1 zbimilo%o!>KXG%#=^w;VWn@%fEv_I!p*_83`xT zo^$#tps0{>*>5sy&KlooPF-`Ixdi++6`1|qT64_c+?Si%W9)5O#8(%aI0kl0?^z}! zY<7(I$e+qNlkL2HGJ+cp95Q^6bF}4B(&#Ch$29+0B&*Oi~_ow03^ChPm7+#%u7`x=tiOcKKr?usr_*A`< oc@r~g+%PFHIIa4meSqQoud=VQe%dz}7#J8lUHx3vIVCg!04aF*jsO4v literal 0 HcmV?d00001 diff --git a/StaticData/Icons/FileDialog/sd_folder.png b/StaticData/Icons/FileDialog/sd_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..861e473bbe1f273b653a1fec73cc3fdee580cf4c GIT binary patch literal 668 zcmeAS@N?(olHy`uVBq!ia0y~yU~mLs4mJh`hQ9A7T^Se{BuiW)N`mv#O3D+9QW+dm z@{>{(JaZG%Q-e|yQz{EjrrIztFxh#!IEGZ*dNaE__mF`=Tk;WxdkadMmI*tkXIMKX zHcjJPAnc&-VdZ$Up`RF~uK2!USh6vD--CI_K0i+}e9zg*5OL*7L-i{;Nfpn$#tXiV8HcP5cC5V_%yFb` zm$l*MxSc0L9F{OG5)rs>ILp~DsAAX6BMk}~+vVO(HhpvRC z_RhYnS@|N9tSyV?q5>HM^~lppcvy5zk8epj`qTEYpTmS*D%|4X%Xtn()$Ti=y1h4} z+g4AVGmG#4E7=SqZ!2QDl%N2 z5&Y6*n(|?dRSZlDF**JkQAYgh-(S4(v!&tZ$#v_}iwxQ84xD#aJ z&s>_Ichl4?@W*fdJ{(JaZG%Q-e|yQz{EjrrIztFmCd6aSW-r_2%|P-@^t1Yze!Q8rB?OOKe&u?BJHr zbcn@Q-NW3&{RP`uj++c_FW4UX6)h3?*zkVJt#$t=>o_mn@@4Y*Z;TVB~OMU;;D$XwMV5es2YD(`&A*)DW)4I#yY&kBoO4F51xanMIEA{Iy%Nh5k41 zGP_zLp~mn_Nwjn-zd~&FBl#W6U;nJ#HRU5P{KQd~wmF~N#d=U`mA%c@Z@%j(J1O}eXRIV@&i PU|{fc^>bP0l+XkKUESF> literal 0 HcmV?d00001 diff --git a/StaticData/Icons/FileDialog/upfolder.png b/StaticData/Icons/FileDialog/upfolder.png deleted file mode 100644 index da990da59df0beebe9a5eb5cef1805a535ac0fbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 505 zcmeAS@N?(olHy`uVBq!ia0y~yU@!n-4mJh`hH$2z?Fk&S=WWH*1e$061gnMu)Yxvtwnc^KAl z%X;cdY%~25Es<>JaQ|@e)MSDEho2bo#VwEx;!F}hp?kTEb@c|8393w-$7Tc@eULix zdd5n@N;b%+@JO89?`p|Q5kKmWW*Tw33tlNHb zKYpt}?L^bv3Mqqv_J8tQW;{MIclF#2Dle{^fBBr&BRum+t6xmwfs^?q;+LX3QyA{J zHau}sXjOQ}9mkXq`DcnYL!R4u%^eq%Uz#;V?>_Z)R&vga`zJQ&R5a|lH_5);>c)+G z68Gm6_B>FYzceaMyn@xss$ASI+~GSTIPgH>C-6!607GH5>o3a%Gb0!n7#KWV{an^L HB{Ts5vUSz2 diff --git a/StaticData/OEMSettings/ReleaseNotes.html b/StaticData/OEMSettings/ReleaseNotes.html new file mode 100644 index 000000000..d525d34b3 --- /dev/null +++ b/StaticData/OEMSettings/ReleaseNotes.html @@ -0,0 +1,193 @@ +
+

On this page you can find a brief description about what is new in each release of MatterControl.  The version number shown is for the official MatterHackers release - the release numbers for specific manufacturers may vary.

+

1.3.0 (June, 23, 2015)

+
    +
  • + New Features:
      +
    • Auto arrange has been improved
    • +
    • Added profiles for MakerGear, PrintSpace, Huxley
    • +
    • Adding TouchScreen mode for tablets
    • +
    • Support for ATX power hardware
    • +
    • Improved Basic and Standard UI settings
    • +
    • Perimeters, Bottom and Top layers can all be set in millimeters.
    • +
    • Perimeters can now be printed outer layer first or last.
    • +
    +
  • +
  • + Minor Changes:
      +
    • Updated Lulzbot settings
    • +
    • Added tool change g-code
    • +
    • Added crash reporting to alpha and beta channels
    • +
    • Better default printer naming
    • +
    • Fixed slicing problems with very complex models during top and bottom layer creation.
    • +
    +
  • +
+

1.2.2 (March, 6, 2015)

+
    +
  • PC Download
  • +
  • Mac Download
  • +
  • + New Features:
      +
    • Improved printer connection stability
    • +
    • Updated Serial Driver for RAMPS
    • +
    • Added profiles for Revolution 3D, Solidoodle
    • +
    • Added hexagon infill
    • +
    • Added the ability to turn on 'Reset Connection' works as an e-stop
    • +
    +
  • +
  • + Minor Changes:
      +
    • Bug fixes
    • +
    • Better memory reporting and stability
    • +
    • Fixed a bug with temp being set repeatedly
    • +
    • Using sub-modules (easier to build from GitHub)
    • +
    +
  • +
+

1.2.1 (January, 28, 2015)

+
    +
  • PC Download
  • +
  • Mac Download
  • +
  • + New Features:
      +
    • Pop Out Windows - now you can show settings and controls all the time
    • +
    • Ability to send parts to other computers and MatterControl Touch
    • +
    • We now display a big 3D view on startup
    • +
    • Better connection handling
    • +
    • Support for many more printers
    • +
    • Added a Simple mode to slice settings
    • +
    +
  • +
  • + Minor Changes:
      +
    • External Perimeter First slice setting
    • +
    • Improved edge detection during slicing
    • +
    • Select Raft Extruder
    • +
    • Vertical offsets in edit mode
    • +
    • Faster editing of models
    • +
    • More accurate gcode generation
    • +
    • More accurate support angles
    • +
    • Better slice settings help and defaults
    • +
    • Fixed some very obscure errors with Print Leveling being too high sometimes
    • +
    • Better detection of co-linear edges (highly tessellated round things work better)
    • +
    +
  • +
+

1.2 (November, 19, 2014)

+
    +
  • PC Download
  • +
  • Mac Download
  • +
  • + New Features:
      +
    • Dual-Extrusion Support
    • +
    • Simple Multi-Material Workflow
    • +
    • Advanced Support Material Generation
    • +
    • New Touch-Friendly UI
    • +
    • Signed Windows Drivers (no more Windows 8 pain)
    • +
    • AMF support
    • +
    +
  • +
  • + Minor Changes:
      +
    • Improved Pausing (remembers and returns to pause position)
    • +
    • Support for @pause and M226 (user requested pause from gcode)
    • +
    • + MatterSlice
        +
      • Skirt always draws from the outside
      • +
      +
    • +
    +
  • +
+

1.1.3 (August 8, 2014)

+
    +
  • PC Download, last XP compatible build
  • +
  • Mac Download
  • +
  • + New Features:
      +
    • Updated to Slic3r 1.1.7
    • +
    • + MatterSlice significantly improved
        +
      • Support can now have interface layers
      • +
      • Many bugs and performance improvements
      • +
      +
    • +
    • New 3D Display options (outline view)
    • +
    • MakerBot X3G support now available (beta)
    • +
    • Added Turkish translation
    • +
    +
  • +
  • + Minor Changes:
      +
    • Make sure the 3D views always match the current printer size and shape
    • +
    • Improved 3D GCode view (more display options)
    • +
    • Faster Mesh and GCode loading
    • +
    • New driver for RoBo3D
    • +
    • Made smoothie boards work better
    • +
    +
  • +
+

1.1.2 (July 22, 2014)

+
    +
  • + New Features:
      +
    • 3D GCode View
    • +
    • Cloud Monitoring: While logged in, printer status viewable from the web
    • +
    • SD Card Support: Allows you to print from and view/edit the contents of the on-board SD Card
    • +
    • Triangle infill in MatterSlice, for incredibly strong parts
    • +
    +
  • +
  • + Minor Changes
    +
      +
    • Minor UI fixes (ex. added scrollbars to slice presets)
    • +
    • Added 'Preheat' temperature preset - sets temp to current slice settings
    • +
    • Fixed slice implementation of Raft settings. It was not putting in correct spacing
    • +
    • Fixed issue with update download not starting.
    • +
    • Fixed issue with auto-connect causing start-up crash (on printrboards specifically)
    • +
    +
  • +
+

1.1.1 (May 27, 2014)

+
    +
  • + New Features:
      +
    • New Advanced Raft in MatterSlice
    • +
    • GCode playback during printing
    • +
    +
  • +
  • + Minor Changes
      +
    • Independent Axis Scaling Improved
    • +
    • Fixed a bug in Macros being sent in reverse order
    • +
    • Better international support (
    • +
    • Bug fixes and performance improvements
    • +
    +
  • +
+

1.1.0 (May 14, 2014)

+
    +
  • + New Features:
      +
    • MatterSlice : A new high quality, high speed slicing engine by MatterHackers
    • +
    • Material/Quality Presets : Layers settings to that modify the base settings
    • +
    • Widescreen Mode
    • +
    • Expanded Themes
    • +
    • Image Converter : A new tool that lets you change images into printable models
    • +
    • Print History updates and improvements
    • +
    +
  • +
  • + Minor Changes
      +
    • Pause, cancel, resume functionality can now be assigned custom gcode.
    • +
    • Added visualization for retraction and partial path viewing to gcode view.
    • +
    • When parts are repositioned in the plate editor, the offsets are now preserved.
    • +
    • Localization support has been added. We'll be integrating translations as they become available.
    • +
    • Saving part file edits is now significantly faster.
    • +
    • Loading images is now faster (uses caching).
    • +
    • Many bug fixes and performance improvements
    • +
    +
  • +
+
diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index 930b733ff..89307ce50 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -3424,3 +3424,6 @@ Translated:The folder '{0}' is not empty.\n\nWould you like to delete it anyway? English:Delete folder? Translated:Delete folder? +English:Cloud Library +Translated:Cloud Library + diff --git a/VersionManagement/ClientTokenRequest.cs b/VersionManagement/ClientTokenRequest.cs new file mode 100644 index 000000000..7b3ba4f9c --- /dev/null +++ b/VersionManagement/ClientTokenRequest.cs @@ -0,0 +1,57 @@ +/* +Copyright (c) 2014, Kevin Pope +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those +of the authors and should not be interpreted as representing official policies, +either expressed or implied, of the FreeBSD Project. +*/ + +using MatterHackers.Localizations; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Threading.Tasks; + +namespace MatterHackers.MatterControl.VersionManagement +{ + public class ClientTokenRequest : WebRequestBase + { + public ClientTokenRequest() + { + requestValues["RequestToken"] = "ekshdsd5d5ssss5kels"; + requestValues["ProjectToken"] = VersionInfo.Instance.ProjectToken; + uri = "https://mattercontrol.appspot.com/api/1/get-client-consumer-token"; + } + + public override void ProcessSuccessResponse(JsonResponseDictionary responseValues) + { + string clientToken = responseValues.get("ClientToken"); + if (clientToken != null) + { + ApplicationSettings.Instance.set("ClientToken", clientToken); + } + } + } +} \ No newline at end of file diff --git a/VersionManagement/ContactFormRequest.cs b/VersionManagement/ContactFormRequest.cs new file mode 100644 index 000000000..61d1a67a7 --- /dev/null +++ b/VersionManagement/ContactFormRequest.cs @@ -0,0 +1,87 @@ +/* +Copyright (c) 2014, Kevin Pope +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those +of the authors and should not be interpreted as representing official policies, +either expressed or implied, of the FreeBSD Project. +*/ + +using MatterHackers.Localizations; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Threading.Tasks; + +namespace MatterHackers.MatterControl.VersionManagement +{ + //To do - move this + internal class ContactFormRequest : WebRequestBase + { + public ContactFormRequest(string question, string details, string email, string firstName, string lastName) + { + requestValues["FirstName"] = firstName; + requestValues["LastName"] = lastName; + requestValues["Email"] = email; + requestValues["FeedbackType"] = "Question"; + requestValues["Comment"] = string.Format("{0}\n{1}", question, details); + uri = "https://mattercontrol.appspot.com/api/1/submit-feedback"; + } + + public override void ProcessSuccessResponse(JsonResponseDictionary responseValues) + { + JsonResponseDictionary response = responseValues; + } + + public override void Request() + { + //If the client token exists, use it, otherwise wait for client token before making request + if (ApplicationSettings.Instance.get("ClientToken") == null) + { + ClientTokenRequest request = new ClientTokenRequest(); + request.RequestSucceeded += new EventHandler(onClientTokenRequestSucceeded); + request.Request(); + } + else + { + onClientTokenReady(); + } + } + + private void onClientTokenRequestSucceeded(object sender, EventArgs e) + { + onClientTokenReady(); + } + + public void onClientTokenReady() + { + string clientToken = ApplicationSettings.Instance.get("ClientToken"); + requestValues["ClientToken"] = clientToken; + if (clientToken != null) + { + base.Request(); + } + } + } +} \ No newline at end of file diff --git a/VersionManagement/LatestVersionRequest.cs b/VersionManagement/LatestVersionRequest.cs new file mode 100644 index 000000000..85d3a8e0e --- /dev/null +++ b/VersionManagement/LatestVersionRequest.cs @@ -0,0 +1,102 @@ +/* +Copyright (c) 2014, Kevin Pope +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those +of the authors and should not be interpreted as representing official policies, +either expressed or implied, of the FreeBSD Project. +*/ + +using MatterHackers.Localizations; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Threading.Tasks; + +namespace MatterHackers.MatterControl.VersionManagement +{ + internal class LatestVersionRequest : WebRequestBase + { + public LatestVersionRequest() + { + string feedType = UserSettings.Instance.get("UpdateFeedType"); + if (feedType == null) + { + feedType = "release"; + UserSettings.Instance.set("UpdateFeedType", feedType); + } + requestValues["ProjectToken"] = VersionInfo.Instance.ProjectToken; + requestValues["UpdateFeedType"] = feedType; + uri = "https://mattercontrol.appspot.com/api/1/get-current-release-version"; + } + + public override void Request() + { + //If the client token exists, use it, otherwise wait for client token before making request + if (ApplicationSettings.Instance.get("ClientToken") == null) + { + ClientTokenRequest request = new ClientTokenRequest(); + request.RequestSucceeded += new EventHandler(onRequestSucceeded); + request.Request(); + } + else + { + onClientTokenReady(); + } + } + + private void onRequestSucceeded(object sender, EventArgs e) + { + onClientTokenReady(); + } + + public void onClientTokenReady() + { + string clientToken = ApplicationSettings.Instance.get("ClientToken"); + requestValues["ClientToken"] = clientToken; + if (clientToken != null) + { + base.Request(); + } + } + + public override void ProcessSuccessResponse(JsonResponseDictionary responseValues) + { + List responseKeys = new List { "CurrentBuildToken", "CurrentBuildNumber", "CurrentBuildUrl", "CurrentReleaseVersion", "CurrentReleaseDate" }; + foreach (string key in responseKeys) + { + saveResponse(key, responseValues); + } + } + + private void saveResponse(string key, JsonResponseDictionary responseValues) + { + string value = responseValues.get(key); + if (value != null) + { + ApplicationSettings.Instance.set(key, value); + } + } + } +} \ No newline at end of file diff --git a/VersionManagement/VersionFileHandler.cs b/VersionManagement/VersionFileHandler.cs index c6e98b561..f79f7281d 100644 --- a/VersionManagement/VersionFileHandler.cs +++ b/VersionManagement/VersionFileHandler.cs @@ -1,4 +1,33 @@ -using MatterHackers.Agg.PlatformAbstract; +/* +Copyright (c) 2014, Kevin Pope +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those +of the authors and should not be interpreted as representing official policies, +either expressed or implied, of the FreeBSD Project. +*/ + +using MatterHackers.Agg.PlatformAbstract; using System.IO; namespace MatterHackers.MatterControl diff --git a/VersionManagement/WebRequestHandler.cs b/VersionManagement/WebRequestHandler.cs index 0490902f2..f88c78df1 100644 --- a/VersionManagement/WebRequestHandler.cs +++ b/VersionManagement/WebRequestHandler.cs @@ -46,7 +46,7 @@ namespace MatterHackers.MatterControl.VersionManagement public ResponseType ResponseItem { get; set; } } - public class WebRequestBase where ResponseType : class + public class WebRequestBase where ResponseType : class { protected string uri; protected Dictionary requestValues; @@ -142,7 +142,6 @@ namespace MatterHackers.MatterControl.VersionManagement } } - public class WebRequestBase { protected string uri; @@ -304,136 +303,4 @@ namespace MatterHackers.MatterControl.VersionManagement tempRequest.Request(); } } - - //To do - move this - internal class ContactFormRequest : WebRequestBase - { - public ContactFormRequest(string question, string details, string email, string firstName, string lastName) - { - requestValues["FirstName"] = firstName; - requestValues["LastName"] = lastName; - requestValues["Email"] = email; - requestValues["FeedbackType"] = "Question"; - requestValues["Comment"] = string.Format("{0}\n{1}", question, details); - uri = "https://mattercontrol.appspot.com/api/1/submit-feedback"; - } - - public override void ProcessSuccessResponse(JsonResponseDictionary responseValues) - { - JsonResponseDictionary response = responseValues; - } - - public override void Request() - { - //If the client token exists, use it, otherwise wait for client token before making request - if (ApplicationSettings.Instance.get("ClientToken") == null) - { - RequestClientToken request = new RequestClientToken(); - request.RequestSucceeded += new EventHandler(onClientTokenRequestSucceeded); - request.Request(); - } - else - { - onClientTokenReady(); - } - } - - private void onClientTokenRequestSucceeded(object sender, EventArgs e) - { - onClientTokenReady(); - } - - public void onClientTokenReady() - { - string clientToken = ApplicationSettings.Instance.get("ClientToken"); - requestValues["ClientToken"] = clientToken; - if (clientToken != null) - { - base.Request(); - } - } - } - - public class RequestClientToken : WebRequestBase - { - public RequestClientToken() - { - requestValues["RequestToken"] = "ekshdsd5d5ssss5kels"; - requestValues["ProjectToken"] = VersionInfo.Instance.ProjectToken; - uri = "https://mattercontrol.appspot.com/api/1/get-client-consumer-token"; - } - - public override void ProcessSuccessResponse(JsonResponseDictionary responseValues) - { - string clientToken = responseValues.get("ClientToken"); - if (clientToken != null) - { - ApplicationSettings.Instance.set("ClientToken", clientToken); - } - } - } - - internal class RequestLatestVersion : WebRequestBase - { - public RequestLatestVersion() - { - string feedType = UserSettings.Instance.get("UpdateFeedType"); - if (feedType == null) - { - feedType = "release"; - UserSettings.Instance.set("UpdateFeedType", feedType); - } - requestValues["ProjectToken"] = VersionInfo.Instance.ProjectToken; - requestValues["UpdateFeedType"] = feedType; - uri = "https://mattercontrol.appspot.com/api/1/get-current-release-version"; - } - - public override void Request() - { - //If the client token exists, use it, otherwise wait for client token before making request - if (ApplicationSettings.Instance.get("ClientToken") == null) - { - RequestClientToken request = new RequestClientToken(); - request.RequestSucceeded += new EventHandler(onRequestSucceeded); - request.Request(); - } - else - { - onClientTokenReady(); - } - } - - private void onRequestSucceeded(object sender, EventArgs e) - { - onClientTokenReady(); - } - - public void onClientTokenReady() - { - string clientToken = ApplicationSettings.Instance.get("ClientToken"); - requestValues["ClientToken"] = clientToken; - if (clientToken != null) - { - base.Request(); - } - } - - public override void ProcessSuccessResponse(JsonResponseDictionary responseValues) - { - List responseKeys = new List { "CurrentBuildToken", "CurrentBuildNumber", "CurrentBuildUrl", "CurrentReleaseVersion", "CurrentReleaseDate" }; - foreach (string key in responseKeys) - { - saveResponse(key, responseValues); - } - } - - private void saveResponse(string key, JsonResponseDictionary responseValues) - { - string value = responseValues.get(key); - if (value != null) - { - ApplicationSettings.Instance.set(key, value); - } - } - } } \ No newline at end of file