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.

88 lines
3.3KB

  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. #include "../Project/jucer_Module.h"
  21. //==============================================================================
  22. class JuceUpdater : public Component,
  23. private ButtonListener,
  24. private FilenameComponentListener,
  25. private ListBoxModel,
  26. private ValueTree::Listener
  27. {
  28. public:
  29. JuceUpdater (ModuleList& moduleList, const String& message);
  30. ~JuceUpdater();
  31. static void show (ModuleList& moduleList, Component* mainWindow, const String& message);
  32. //==============================================================================
  33. void resized();
  34. void paint (Graphics& g);
  35. void buttonClicked (Button*);
  36. void filenameComponentChanged (FilenameComponent* fileComponentThatHasChanged);
  37. int getNumRows();
  38. void paintListBoxItem (int rowNumber, Graphics& g, int width, int height, bool rowIsSelected);
  39. Component* refreshComponentForRow (int rowNumber, bool isRowSelected, Component* existingComponentToUpdate);
  40. void backgroundUpdateComplete (const ModuleList& newList);
  41. private:
  42. ModuleList& moduleList;
  43. ModuleList latestList;
  44. Label messageLabel, label, currentVersionLabel;
  45. FilenameComponent filenameComp;
  46. TextButton checkNowButton;
  47. ListBox availableVersionsList;
  48. ValueTree versionsToDownload;
  49. TextButton installButton;
  50. ToggleButton selectAllButton;
  51. ScopedPointer<Thread> websiteContacterThread;
  52. void checkNow();
  53. void install();
  54. void updateInstallButtonStatus();
  55. void refresh();
  56. void selectAll();
  57. int getNumCheckedModules() const;
  58. bool isLatestVersion (const String& moduleID) const;
  59. void valueTreePropertyChanged (ValueTree&, const Identifier&);
  60. void valueTreeChildAdded (ValueTree&, ValueTree&);
  61. void valueTreeChildRemoved (ValueTree&, ValueTree&);
  62. void valueTreeChildOrderChanged (ValueTree&);
  63. void valueTreeParentChanged (ValueTree&);
  64. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceUpdater);
  65. };
  66. #endif // __JUCER_JUCEUPDATER_JUCEHEADER__