1 |
/* |
2 |
Copyright (c) 2014 Christian Schoenebeck |
3 |
|
4 |
This file is part of "gigedit" and released under the terms of the |
5 |
GNU General Public License version 2. |
6 |
*/ |
7 |
|
8 |
#ifndef GIGEDIT_COMBINEINSTRUMENTSDIALOG |
9 |
#define GIGEDIT_COMBINEINSTRUMENTSDIALOG |
10 |
|
11 |
#include <gig.h> |
12 |
|
13 |
#include <gtkmm/buttonbox.h> |
14 |
#include <gtkmm/window.h> |
15 |
#include <gtkmm/dialog.h> |
16 |
#include <gtkmm/treeview.h> |
17 |
#include <gtkmm/liststore.h> |
18 |
|
19 |
#include "wrapLabel.hh" |
20 |
|
21 |
/** |
22 |
* @brief Modal dialog which allows to merge instruments. |
23 |
* |
24 |
* This dialog shows a list of all instruments of the currently open .gig file |
25 |
* in gigedit and allows the user to shift select a set of instruments to be |
26 |
* combined. |
27 |
* |
28 |
* If the user successfully combined instruments in this dialog, then |
29 |
* newCombinedInstrument() will return a pointer to that new instrument. |
30 |
*/ |
31 |
class CombineInstrumentsDialog : public Gtk::Dialog { |
32 |
public: |
33 |
CombineInstrumentsDialog(Gtk::Window& parent, gig::File* gig); |
34 |
bool fileWasChanged() const; |
35 |
gig::Instrument* newCombinedInstrument() const; |
36 |
protected: |
37 |
gig::File* m_gig; |
38 |
bool m_fileWasChanged; |
39 |
gig::Instrument* m_newCombinedInstrument; |
40 |
|
41 |
Gtk::HButtonBox m_buttonBox; |
42 |
Gtk::TreeView m_treeView; |
43 |
Gtk::Button m_cancelButton; |
44 |
Gtk::Button m_OKButton; |
45 |
#if GTKMM_MAJOR_VERSION < 3 |
46 |
view::WrapLabel m_descriptionLabel; |
47 |
#else |
48 |
Gtk::Label m_descriptionLabel; |
49 |
#endif |
50 |
|
51 |
class ListModel : public Gtk::TreeModel::ColumnRecord { |
52 |
public: |
53 |
ListModel() { |
54 |
add(m_col_name); |
55 |
add(m_col_instr); |
56 |
} |
57 |
|
58 |
Gtk::TreeModelColumn<Glib::ustring> m_col_name; |
59 |
Gtk::TreeModelColumn<gig::Instrument*> m_col_instr; |
60 |
} m_columns; |
61 |
|
62 |
Glib::RefPtr<Gtk::ListStore> m_refTreeModel; |
63 |
|
64 |
void combineSelectedInstruments(); |
65 |
void onSelectionChanged(); |
66 |
}; |
67 |
|
68 |
#endif // GIGEDIT_COMBINEINSTRUMENTSDIALOG |