MuseScore  3.4
Music composition and notation
templateBrowser.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2014 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 __TEMPLATEBROWSER_H__
14 #define __TEMPLATEBROWSER_H__
15 
16 #include "ui_templateBrowser.h"
17 #include "scoreInfo.h"
18 
19 class QTreeWidgetItem;
20 
21 namespace Ms {
22 
23 class TemplateItem;
24 class TemplateCategory;
25 
26 //---------------------------------------------------------
27 // TemplateBrowser
28 //---------------------------------------------------------
29 
30 class TemplateBrowser : public QWidget, public Ui::TemplateBrowser
31  {
32  Q_OBJECT
33 
34  bool _stripNumbers { false }; // remove number prefix from filenames
35  bool _showPreview { true }; // show preview of templates
36  bool _showCustomCategory { false }; // show a custom category for user's own templates
37 
38  TemplateItem* genTemplateItem(QTreeWidgetItem*, const QFileInfo&);
39 
40  private slots:
41  void scoreClicked();
42  void handleItemActivated(QTreeWidgetItem* item);
43 
44  signals:
45  void leave();
46  void scoreSelected(QString);
47  void scoreActivated(QString path);
48 
49  public:
50  TemplateBrowser(QWidget* parent = 0);
51  void setScores(QFileInfoList&);
52  void setStripNumbers(bool val) { _stripNumbers = val; }
53  void filter(const QString&);
54  };
55 }
56 
57 #endif
bool _showCustomCategory
Definition: templateBrowser.h:36
void setStripNumbers(bool val)
Definition: templateBrowser.h:52
Definition: templateBrowser.h:30
void handleItemActivated(QTreeWidgetItem *item)
Definition: templateBrowser.cpp:213
void filter(const QString &)
Definition: templateBrowser.cpp:182
void scoreClicked()
Definition: templateBrowser.cpp:191
bool _showPreview
Definition: templateBrowser.h:35
bool _stripNumbers
Definition: templateBrowser.h:34
Definition: aeolus.cpp:26
TemplateBrowser(QWidget *parent=0)
Definition: templateBrowser.cpp:64
TemplateItem * genTemplateItem(QTreeWidgetItem *, const QFileInfo &)
Definition: templateBrowser.cpp:83
void scoreSelected(QString)
void scoreActivated(QString path)
void setScores(QFileInfoList &)
Definition: templateBrowser.cpp:130
Definition: templateBrowser.cpp:22