Ardour  8.12
library_download_dialog.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 Paul Davis <paul@linuxaudiosystems.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef __gtk2_ardour_library_download_dialog_h__
20 #define __gtk2_ardour_library_download_dialog_h__
21 
22 #include <string>
23 
25 #include <gtkmm/cellrenderertext.h>
26 #include <gtkmm/entry.h>
27 #include <gtkmm/liststore.h>
28 #include <gtkmm/scrolledwindow.h>
29 #include <gtkmm/treeview.h>
30 #include <gtkmm/textview.h>
31 
32 #include "ardour_dialog.h"
33 
34 namespace PBD {
35  class Inflater;
36  class Downloader;
37 }
38 
39 namespace ARDOUR {
40  class LibraryDescription;
41  class LibraryFetcher;
42 }
43 
45 {
46  public:
49 
51  void on_show ();
52 
53  private:
55  public:
57  add (name);
58  add (author);
59  add (license);
60  add (size);
61  add (installed);
62  add (description);
63  add (url);
64  add (toplevel);
65  add (install);
66  add (progress);
67  add (downloader);
68  }
69 
76  /* these are not displayed */
81  /* used as tooltip */
83  };
84 
87  Glib::RefPtr<Gtk::ListStore> _model;
89 
90  template <class T>
92  {
93  Gtk::TreeViewColumn* c = manage (new Gtk::TreeViewColumn ("", col));
94  if (width) {
97  }
99  return c;
100  }
101 
104 
107 
108  void download (Gtk::TreePath const &);
109 
112 
114  void install (std::string const & path, Gtk::TreePath const & treepath);
115  void install_progress (float, std::string, Gtk::TreePath);
116  void install_finished (Gtk::TreeModel::iterator row, std::string path, int status);
118 
121  void refill ();
122 };
123 
124 
125 
126 #endif /* __gtk2_ardour_library_download_dialog_h__ */
void add(TreeModelColumnBase &column)
void set_sizing(TreeViewColumnSizing type)
void set_fixed_width(int fixed_width)
int append_column(TreeViewColumn &column)
void path(Glib::ustring &path, Glib::ustring &path_reversed)
Compute a widget's path of the form "GtkWindow.MyLabel".
Gtk::TreeModelColumn< std::string > install
Gtk::TreeModelColumn< std::string > author
Gtk::TreeModelColumn< std::string > size
Gtk::TreeModelColumn< std::string > toplevel
Gtk::TreeModelColumn< PBD::Downloader * > downloader
Gtk::TreeModelColumn< std::string > description
Gtk::TreeModelColumn< std::string > license
Gtk::TreeModelColumn< std::string > name
Gtk::TreeModelColumn< std::string > url
Gtk::CellRendererProgress * progress_renderer
PBD::ScopedConnection install_connection
Gtk::CellRendererText * install_renderer
void install(std::string const &path, Gtk::TreePath const &treepath)
void install_progress(float, std::string, Gtk::TreePath)
Gtk::TreeViewColumn * append_col(Gtk::TreeModelColumn< T > const &col, int width=0)
bool dl_timer_callback(PBD::Downloader *, Gtk::TreePath)
void add_library(ARDOUR::LibraryDescription const &)
void download(Gtk::TreePath const &)
bool display_button_press(GdkEventButton *ev)
Glib::RefPtr< Gtk::ListStore > _model
void install_finished(Gtk::TreeModel::iterator row, std::string path, int status)
void on_show()
This is a default handler for the signal signal_show().
Gtk::ScrolledWindow scroller
@ TREE_VIEW_COLUMN_FIXED
T * manage(T *obj)
Definition: object.h:58
Definition: axis_view.h:42
gint width
Definition: xcursors.h:1