Пример #1
0
         void statusRecord::appendToView(Gtk::TreeView* _treeview)
         {
            _treeview->append_column("Filename", filename);
            _treeview->append_column("Status",   status);
#if GTKMM_2_6_OR_BETTER
            // Add a progress bar, showing status.

            Gtk::CellRendererProgress* cell = Gtk::manage(new Gtk::CellRendererProgress);
            int last_count = _treeview->append_column("Progress", *cell);

            Gtk::TreeViewColumn* column = _treeview->get_column(last_count - 1);
            if (column)
               {
                  column->add_attribute(cell->property_value(), done);
                  column->add_attribute(cell->property_text(), doneText);
               }

#else
            // Old gtkmm version, so use boring text.
            _treeview->append_column("Progress", done);
#endif // GTKMM_2_6_OR_BETTER

            _treeview->append_column("Download", dn_rate);
            _treeview->append_column("Upload",   ul_rate);
            _treeview->append_column("Filesize", filesize);
            _treeview->append_column("Peers l/s", peers);
         }
Пример #2
0
// TODO REFACTOR THE LIVING HELL OUT OF THIS ABOMINATION -- nyanpasu
void GtkTorrentTreeView::setupColumns()
{
	Gtk::TreeViewColumn *col = nullptr;
	Gtk::CellRendererProgress *cell = nullptr;

	vector<pair<int, int>> columns; //First element id second element size
	columns.push_back(make_pair(this->append_column("#", m_cols.m_col_queue), 30));
	columns.push_back(make_pair(this->append_column("Status", m_cols.m_col_name), 200));
	columns.push_back(make_pair(this->append_column("Name", m_cols.m_col_name), 200));
	columns.push_back(make_pair(this->append_column("Size", m_cols.m_col_size), 80));
	columns.push_back(make_pair(this->append_column("Down", m_cols.m_col_dl_speed), 60));
	columns.push_back(make_pair(this->append_column("Up", m_cols.m_col_ul_speed), 60));
	columns.push_back(make_pair(this->append_column("Ratio", m_cols.m_col_dl_ratio), 60));
	columns.push_back(make_pair(this->append_column("Downloaded", m_cols.m_col_dl_total), 80));
	get_column(columns.back().first - 1)->set_visible(false);
	columns.push_back(make_pair(this->append_column("Uploaded", m_cols.m_col_ul_total), 80));
	get_column(columns.back().first - 1)->set_visible(false);
	columns.push_back(make_pair(this->append_column("Seed", m_cols.m_col_seeders), 60));
	columns.push_back(make_pair(this->append_column("Leech", m_cols.m_col_leechers), 60));
	columns.push_back(make_pair(this->append_column("Age", m_cols.m_col_age), 50));
	columns.push_back(make_pair(this->append_column("ETA", m_cols.m_col_eta), 80));
	cell = Gtk::manage(new Gtk::CellRendererProgress());
	columns.push_back(make_pair(this->append_column("Progress", *cell), 160));
	col = this->get_column(columns.back().first - 1);
	col->add_attribute(cell->property_value(), m_cols.m_col_percent);
	col->add_attribute(cell->property_text(), m_cols.m_col_percent_text);



	columns.push_back(make_pair(this->append_column("Remains", m_cols.m_col_remaining), 80));
	get_column(columns.back().first - 1)->set_visible(false);

	for (pair<int, int> colpair : columns)
	{
		Gtk::Button *butt = get_column(colpair.first - 1)->get_button();
		butt->signal_button_press_event().connect(sigc::mem_fun(*this, &GtkTorrentTreeView::torrentColumns_onClick));
		get_column(colpair.first - 1)->set_sizing(Gtk::TreeViewColumnSizing::TREE_VIEW_COLUMN_FIXED);
		get_column(colpair.first - 1)->set_alignment(0.5f);
		get_column(colpair.first - 1)->set_clickable();
		get_column(colpair.first - 1)->set_resizable();
		get_column(colpair.first - 1)->set_reorderable();
		get_column(colpair.first - 1)->set_fixed_width(colpair.second);

	}
}
void GtkTorrentTreeView::setupColumns()
{
	unsigned int cid = 0;
	Gtk::TreeViewColumn *col = nullptr;

	cid = this->append_column("Name", m_cols.m_col_name);
	col = this->get_column(cid - 1);
	col->set_fixed_width(250);

	cid = this->append_column("Seeders", m_cols.m_col_seeders);
	col = this->get_column(cid - 1);
	col->set_alignment(0.5);
	col->set_fixed_width(90);
	
	cid = this->append_column("Leechers", m_cols.m_col_leechers);
	col = this->get_column(cid - 1);
	col->set_alignment(0.5);
	col->set_fixed_width(90);

	cid = this->append_column("Rate (KB/s)", m_cols.m_col_dl_speed);
	col = this->get_column(cid - 1);
	col->set_alignment(0.5);
	col->set_fixed_width(95);

	Gtk::CellRendererProgress *cell = Gtk::manage(new Gtk::CellRendererProgress());
	cid = this->append_column("Progress", *cell);
	col = this->get_column(cid - 1);

	if (col) {
		col->add_attribute(cell->property_value(), m_cols.m_col_percent);
		col->add_attribute(cell->property_text(), m_cols.m_col_percent_text);
	}

	for (auto &c : this->get_columns()) {
		c->set_sizing(Gtk::TreeViewColumnSizing::TREE_VIEW_COLUMN_FIXED);
		c->set_clickable();
		c->set_resizable();
		c->set_reorderable();
	}
}
Пример #4
0
// TODO REFACTOR THE LIVING HELL OUT OF THIS ABOMINATION -- nyanpasu
void GtkTorrentTreeView::setupColumns()
{
	unsigned int cid = 0;
	Gtk::TreeViewColumn *col = nullptr;
	Gtk::CellRendererProgress *cell = nullptr;

	this->append_column("Queue", m_cols.m_col_queue);
	this->append_column("Age", m_cols.m_col_age);
	this->append_column("ETA", m_cols.m_col_eta);
	this->append_column("Name", m_cols.m_col_name);
	this->append_column("Seed", m_cols.m_col_seeders);
	this->append_column("Leech", m_cols.m_col_leechers);
	this->append_column("Upload Speed", m_cols.m_col_ul_speed);
	this->append_column("Download Speed", m_cols.m_col_dl_speed);
	this->append_column("Uploaded", m_cols.m_col_ul_total);
	this->append_column("Downloaded", m_cols.m_col_dl_total);
	this->append_column("Size", m_cols.m_col_size);
	this->append_column("Remains", m_cols.m_col_remaining);
	this->append_column("Ratio", m_cols.m_col_dl_ratio);

	cell = Gtk::manage(new Gtk::CellRendererProgress());
	cid = this->append_column("Progress", *cell);
	col = this->get_column(cid - 1);
	col->add_attribute(cell->property_value(), m_cols.m_col_percent);
	col->add_attribute(cell->property_text(), m_cols.m_col_percent_text);

	for (auto & c : this->get_columns())
	{
		Gtk::Button *butt = c->get_button();
		butt->signal_button_press_event().connect(sigc::mem_fun(*this, &GtkTorrentTreeView::torrentColumns_onClick));
		c->set_sizing(Gtk::TreeViewColumnSizing::TREE_VIEW_COLUMN_FIXED);
		c->set_alignment(0.5f);
		c->set_clickable();
		c->set_resizable();
		c->set_reorderable();
                c->set_fixed_width(96);
	}
}
Пример #5
0
         void statusRecord::appendToView(Gtk::TreeView* _treeview)
         {
            _treeview->append_column("Filename", filename);
            
            _treeview->append_column("Status",   status);

            // Add a progress bar, showing status.
            Gtk::CellRendererProgress* cell = Gtk::manage(new Gtk::CellRendererProgress);
            int last_count = _treeview->append_column("Progress", *cell);

            Gtk::TreeViewColumn* column = _treeview->get_column(last_count - 1);
            if (column)
               {
                  column->add_attribute(cell->property_value(), done);
                  column->add_attribute(cell->property_text(), doneText);
               }

            _treeview->append_column("Download", dn_rate);
            _treeview->append_column("Upload",   ul_rate);
            _treeview->append_column("Filesize", filesize);
            _treeview->append_column("Peers l/s", peers);
            
            headersSetResizable(*_treeview);
         }