/* * Copyright (C) 2022 Paul Davis * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef __gtk2_ardour_library_download_dialog_h__ #define __gtk2_ardour_library_download_dialog_h__ #include #include #include #include #include "ardour_dialog.h" namespace ARDOUR { class LibraryDescription; class Downloader; } class LibraryDownloadDialog : public ArdourDialog { public: LibraryDownloadDialog (); void add_library (ARDOUR::LibraryDescription const &); private: class LibraryColumns : public Gtk::TreeModelColumnRecord { public: LibraryColumns() { add (name); add (author); add (license); add (size); add (installed); add (description); add (url); } Gtk::TreeModelColumn name; Gtk::TreeModelColumn author; Gtk::TreeModelColumn license; Gtk::TreeModelColumn size; Gtk::TreeModelColumn description; Gtk::TreeModelColumn url; Gtk::TreeModelColumn installed; Gtk::TreeModelColumn downloader; }; Gtk::TreeView _display; Glib::RefPtr _model; LibraryColumns _columns; template Gtk::TreeViewColumn* append_col (Gtk::TreeModelColumn const& col, int width = 0) { Gtk::TreeViewColumn* c = manage (new Gtk::TreeViewColumn ("", col)); if (width) { c->set_fixed_width (width); c->set_sizing (Gtk::TREE_VIEW_COLUMN_FIXED); } _display.append_column (*c); return c; } bool tv_query_tooltip (int x, int y, bool kbd, const Glib::RefPtr& tooltip); void setup_col (Gtk::TreeViewColumn*, int, Gtk::AlignmentEnum, const char*, const char*); void setup_toggle (Gtk::TreeViewColumn*, sigc::slot); void install_activated (std::string str); bool dl_timer_callback (ARDOUR::Downloader*, std::string); }; #endif /* __gtk2_ardour_library_download_dialog_h__ */