The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCER_JUCEUPDATER_JUCEHEADER__
  19. #define __JUCER_JUCEUPDATER_JUCEHEADER__
  20. //==============================================================================
  21. class JuceUpdater : public Component,
  22. public ButtonListener,
  23. public FilenameComponentListener,
  24. public ListBoxModel
  25. {
  26. public:
  27. JuceUpdater();
  28. ~JuceUpdater();
  29. static void show (Component* mainWindow);
  30. //==============================================================================
  31. void resized();
  32. void paint (Graphics& g);
  33. void buttonClicked (Button*);
  34. void filenameComponentChanged (FilenameComponent* fileComponentThatHasChanged);
  35. int getNumRows();
  36. void paintListBoxItem (int rowNumber, Graphics& g, int width, int height, bool rowIsSelected);
  37. Component* refreshComponentForRow (int rowNumber, bool isRowSelected, Component* existingComponentToUpdate);
  38. private:
  39. Label label, currentVersionLabel;
  40. FilenameComponent filenameComp;
  41. TextButton checkNowButton;
  42. ListBox availableVersionsList;
  43. XmlElement* downloadVersionList();
  44. String getCurrentVersion();
  45. bool isAlreadyUpToDate();
  46. struct VersionInfo
  47. {
  48. URL url;
  49. String desc;
  50. String version;
  51. String date;
  52. };
  53. OwnedArray<VersionInfo> availableVersions;
  54. void updateVersions (const XmlElement& xml);
  55. void applyVersion (VersionInfo* version);
  56. };
  57. #endif // __JUCER_JUCEUPDATER_JUCEHEADER__