/*************************************************************************** * LoadSearchedTorrentDialog.h * * Fri Oct 3 12:14:53 2008 * Copyright 2008 Fernando TarĂ­n Morales * ****************************************************************************/ /* * 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 3 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 Library 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 _LOADONETORRENTDIALOG_H #define _LOADONETORRENTDIALOG_H #include #include "libtorrent/torrent_info.hpp" class LoadOneTorrentDialog : public Gtk::Dialog{ private: Glib::ustring torrentname, *torrentpathsave; std::vector *priorities; std::vector *newfilenames; Gtk::Entry saveDirectoryEntry; class ModelColumnsLoadTorrentDialog : public Gtk::TreeModel::ColumnRecord{ public: ModelColumnsLoadTorrentDialog(){ add(m_position); add(m_download); add(m_name); add(m_size); add(m_size_type); add(m_prio_choosen); add(m_priority); } Gtk::TreeModelColumn< int > m_position; Gtk::TreeModelColumn< bool > m_download; Gtk::TreeModelColumn< Glib::ustring > m_name; Gtk::TreeModelColumn< Glib::ustring > m_size; Gtk::TreeModelColumn< libtorrent::size_type > m_size_type; Gtk::TreeModelColumn< Glib::ustring > m_prio_choosen; Gtk::TreeModelColumn< Glib::RefPtr > m_priority; }; Gtk::TreeView dialogTorrentTreeView; Glib::RefPtr refTreeModel; ModelColumnsLoadTorrentDialog columnsDialogTorrent; // Priority column Glib::RefPtr pr_refTreeModel; // Menu Glib::RefPtr m_refActionGroup; Glib::RefPtr refUIManager; Gtk::Menu* pMenuPopup; void mouse_button_press_event(GdkEventButton* event); void addRow(int, Glib::ustring &, const libtorrent::size_type &); bool isRowSelected(); // Signals void selectAndSetSaveDirectory(); void on_cellrenderer_choice_edited(const Glib::ustring& path_string, const Glib::ustring& new_text); void changeName(); void downloadFileToggled(const Glib::ustring &); public: LoadOneTorrentDialog(const std::string &, Glib::ustring *, std::vector *, std::vector *); ~LoadOneTorrentDialog(); }; #endif /* LOADSEARCHEDTORRENTDIALOG_H */