/*************************************************************************** * FilesInfoNoteBookTab.h * * Mon Sep 10 00:49:59 2007 * Copyright 2007 Fernando TarĂ­n Morales * icemanf@gmail.com ****************************************************************************/ /* * 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 _FILESINFONOTEBOOKTAB_H #define _FILESINFONOTEBOOKTAB_H #include "gtkmm.h" #include "Utils.h" #include "Lince/Torrent.h" class TorrentInfoTab; class FilesInfoNoteBookTab: public Gtk::ScrolledWindow{ private: Glib::ustring nameTab; class FilesModelColumns : public Gtk::TreeModel::ColumnRecord{ public: FilesModelColumns() { add(m_file_download); add(m_file_firstpiece); add(m_file_lastpiece); add(m_file_name); add(m_file_percentage); add(m_file_size); add(m_prio_choosen); add(m_file_priority); add(file_size); add(file_index);} Gtk::TreeModelColumn m_file_download; Gtk::TreeModelColumn m_file_firstpiece; Gtk::TreeModelColumn m_file_lastpiece; Gtk::TreeModelColumn m_file_name; Gtk::TreeModelColumn m_file_size; Gtk::TreeModelColumn m_file_percentage; //Gtk::TreeModelColumn m_file_priority; Gtk::TreeModelColumn m_prio_choosen; Gtk::TreeModelColumn< Glib::RefPtr > m_file_priority; // Sort Column Gtk::TreeModelColumn file_size; // File position Gtk::TreeModelColumn file_index; }; FilesModelColumns filesColumns; // Rows Gtk::TreeView filesTreeView; Glib::RefPtr refTreeModel; // Priority column Glib::RefPtr pr_refTreeModel; bool isModelFilled; // Used to update percentage just when needed int downloadedPieces; int getFilePercentage(int, int, const libtorrent::bitfield &); void mouse_button_press_event(GdkEventButton* event); void downloadFileToggled(const Glib::ustring &s); void on_cellrenderer_choice_edited(const Glib::ustring& path_string, const Glib::ustring& new_text); void unselectRows(); // Signal to change de the priority sigc::signal sig_to_change_file_priority; public: FilesInfoNoteBookTab(TorrentInfoTab *); ~FilesInfoNoteBookTab(); const Glib::ustring & getNameTab() { return nameTab; }; void updateFilesInfoNoteBookTab(Lince::Torrent *); virtual Gtk::Widget * getTabChild(void) { return this; }; }; #endif /* _FILESINFONOTEBOOKTAB_H */