MuseScore  3.4
Music composition and notation
resourceManager.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2002-2013 Werner Schweer
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2
9 // as published by the Free Software Foundation and appearing in
10 // the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef RESOURCE_H
14 #define RESOURCE_H
15 
16 #include "ui_resourceManager.h"
17 #include "downloadUtils.h"
18 
19 namespace Ms {
20 
21 class ResourceManager : public QDialog, public Ui::Resource
22  {
23  Q_OBJECT
24 
25  virtual void hideEvent(QHideEvent*);
26  QByteArray txt;
27  void displayLanguages();
28  void displayExtensions();
29  bool verifyFile(QString path, QString hash);
30  bool verifyLanguageFile(QString filename, QString hash);
31 
32  public:
33  explicit ResourceManager(QWidget *parent = 0);
34  void selectLanguagesTab();
35  void selectExtensionsTab();
36 
37  static inline QString baseAddr() { return "http://extensions.musescore.org/3.4/"; }
38 
39  private:
40  QMap <QPushButton *, QString> languageButtonMap; // QPushButton -> filename
41  QMap <QPushButton *, QString> languageButtonHashMap;// QPushButton -> hash of the file
42 
43  private slots:
44  void downloadLanguage();
45  void downloadExtension();
46  void uninstallExtension();
47  };
48 
49 class ExtensionFileSize : public QTableWidgetItem
50  {
51  int _size;
52 
53  public:
54  ExtensionFileSize(const int i);
55  int getSize() const { return _size; }
56  bool operator<(const QTableWidgetItem& nextItem) const;
57 
58  };
59 
60 class LanguageFileSize : public QTableWidgetItem
61  {
62  double _size;
63 
64  public:
65  LanguageFileSize(const double d);
66  double getSize() const { return _size; }
67  bool operator<(const QTableWidgetItem& nextItem) const;
68 
69  };
70 
71 }
72 #endif // RESOURCE_H
void downloadExtension()
Definition: resourceManager.cpp:367
void selectExtensionsTab()
Definition: resourceManager.cpp:101
QMap< QPushButton *, QString > languageButtonHashMap
Definition: resourceManager.h:41
ResourceManager(QWidget *parent=0)
Definition: resourceManager.cpp:27
static QString baseAddr()
Definition: resourceManager.h:37
QByteArray txt
Definition: resourceManager.h:26
Definition: resourceManager.h:49
Definition: resourceManager.h:21
Definition: resourceManager.h:60
bool verifyFile(QString path, QString hash)
Definition: resourceManager.cpp:437
bool verifyLanguageFile(QString filename, QString hash)
Definition: resourceManager.cpp:294
void uninstallExtension()
Definition: resourceManager.cpp:419
double _size
Definition: resourceManager.h:62
int getSize() const
Definition: resourceManager.h:55
int _size
Definition: resourceManager.h:51
Definition: aeolus.cpp:26
double getSize() const
Definition: resourceManager.h:66
void displayExtensions()
Definition: resourceManager.cpp:111
void downloadLanguage()
Definition: resourceManager.cpp:311
void displayLanguages()
Definition: resourceManager.cpp:190
virtual void hideEvent(QHideEvent *)
Definition: resourceManager.cpp:455
QMap< QPushButton *, QString > languageButtonMap
Definition: resourceManager.h:40
void selectLanguagesTab()
Definition: resourceManager.cpp:92