//------------------------------------------------------------------------------
const StringColumn& ColumnsModel::append_markup_column(const int bec_tm_idx, const std::string& name,
                                                       const Iconic have_icon) {
  Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf>>* icon = 0;

  Gtk::TreeViewColumn* column = Gtk::manage(new Gtk::TreeViewColumn(base::replaceString(name, "_", "__")));

  if (have_icon == WITH_ICON) {
    icon = new Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf>>;
    add(*icon);
    add_bec_index_mapping(bec_tm_idx);
    column->pack_start(*icon, false);

    _columns.push_back(icon);
  }

  Gtk::TreeModelColumn<Glib::ustring>* col = new Gtk::TreeModelColumn<Glib::ustring>;
  Gtk::CellRendererText* cell = Gtk::manage(new Gtk::CellRendererText());
  add(*col);
  add_bec_index_mapping(bec_tm_idx);
  column->pack_start(*cell);
  column->add_attribute(cell->property_markup(), *col);

  _columns.push_back(col);

  int nr_of_cols = _treeview->append_column(*column);
  _treeview->get_column(nr_of_cols - 1)->set_resizable(true);

  return *col;
}
Beispiel #2
0
int MidiRuleCtrlTrigger::append_note_column(
    const char* title,
    const Gtk::TreeModelColumn<Glib::ustring>& column) {
    Gtk::CellRendererSpin* renderer = Gtk::manage(new Gtk::CellRendererSpin());
    renderer->property_editable() = true;
    renderer->signal_editing_started().connect(
        sigc::bind(
            sigc::mem_fun(*this, &MidiRuleCtrlTrigger::note_editing_started),
            renderer));
    renderer->signal_edited().connect(
        sigc::bind(
            sigc::mem_fun(*this, &MidiRuleCtrlTrigger::note_edited),
            column));
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
    renderer->property_adjustment() = new Gtk::Adjustment(0, 0, 127);
#else
    renderer->property_adjustment() = Gtk::Adjustment::create(0, 0, 127);
#endif

    int cols_count = tree_view.append_column(title, *renderer);
    Gtk::TreeViewColumn* col = tree_view.get_column(cols_count - 1);
    col->add_attribute(*renderer, "text", column);
    col->set_min_width(98);
    return cols_count;
}
void
PluginTreeView::ctor()
{
  m_plugin_list = Gtk::ListStore::create(m_plugin_record);
  set_model(m_plugin_list);
  set_rules_hint(true);
  append_column("#", m_plugin_record.index);
  append_column_editable("Status", m_plugin_record.loaded);
  append_plugin_column();

  on_name_clicked();
  Gtk::TreeViewColumn *column = get_column(0);
  column->signal_clicked().connect(sigc::mem_fun(*this, &PluginTreeView::on_id_clicked));
  column = get_column(1);
  column->signal_clicked().connect(sigc::mem_fun(*this, &PluginTreeView::on_status_clicked));

  Gtk::CellRendererToggle* renderer;
  renderer = dynamic_cast<Gtk::CellRendererToggle*>( get_column_cell_renderer(1) );
  renderer->signal_toggled().connect( sigc::mem_fun(*this, &PluginTreeView::on_status_toggled));

  m_dispatcher.signal_connected().connect(sigc::mem_fun(*this, &PluginTreeView::on_connected));
  m_dispatcher.signal_disconnected().connect(sigc::mem_fun(*this, &PluginTreeView::on_disconnected));
  m_dispatcher.signal_message_received().connect(sigc::mem_fun(*this, &PluginTreeView::on_message_received));

}
Beispiel #4
0
ModuleWindow::ModuleWindow(Module* module, MainWindow* parent, 
                               Manager* manager)
{
    m_pModule = module;
    m_pParent = parent;
    m_pManager = manager;

    /* Create a new scrolled window, with scrollbars only if needed */
    set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
    add(m_TreeView);

    /* create tree store */
    m_refTreeModel = Gtk::TreeStore::create(m_Columns);
    m_TreeView.set_model(m_refTreeModel);

    //Add the Model’s column to the View’s columns: 
    Gtk::CellRendererText* cellText = Gtk::manage(new Gtk::CellRendererText());
    Gtk::CellRendererPixbuf* cellPix = Gtk::manage(new Gtk::CellRendererPixbuf()); 
    Gtk::TreeViewColumn* col = Gtk::manage(new Gtk::TreeViewColumn("Item"));
    col->pack_start(*cellPix, false);
    col->pack_start(*cellText, true);
    col->add_attribute(*cellText, "text", 1);
    col->add_attribute(*cellPix, "pixbuf", 0);
    m_TreeView.append_column(*col);
    m_TreeView.get_column(0)->set_resizable(true);

    m_TreeView.append_column("Value", m_Columns.m_col_value);
    m_TreeView.get_column(1)->set_resizable(true);
    
    updateWidget();
    show_all_children();
}
void GtkPeerTreeView::setupColumns()
{
	int cid;
	Gtk::TreeViewColumn *col;
	cid = append_column("IP"      , m_cols.m_col_ip);
	col = get_column(cid - 1);
	col->set_sort_column(m_cols.m_col_ip);
	append_column("Port", m_cols.m_col_port);
	cid = append_column("Client"  , m_cols.m_col_client);
	col = get_column(cid - 1);
	col->set_sort_column(m_cols.m_col_client);
	append_column("Flags", m_cols.m_col_flags);
	append_column("%", m_cols.m_col_percent);
	append_column("Relevance", m_cols.m_col_relevance);
	cid = append_column("Down Speed", m_cols.m_col_down);
	col = get_column(cid - 1);
	col->set_sort_column(m_cols.m_col_down);
	cid = append_column("Up Speed"  , m_cols.m_col_up);
	col = get_column(cid - 1);
	col->set_sort_column(m_cols.m_col_up);
	append_column("Reqs", m_cols.m_col_reqs);
	append_column("Waited", m_cols.m_col_waited);
	append_column("Downloaded", m_cols.m_col_downloaded);
	append_column("Uploaded", m_cols.m_col_uploaded);
	append_column("Hasherr", m_cols.m_col_hasherr);
	append_column("Peer Download Rate", m_cols.m_col_peer_download_rate);
	append_column("MaxDown", m_cols.m_col_max_down);
	append_column("MaxUp", m_cols.m_col_max_up);
	append_column("Queued", m_cols.m_col_queued);
	append_column("Inactive", m_cols.m_col_inactive);
	append_column("Debug", m_cols.m_col_debug);
}
Beispiel #6
0
void ResViewerViewImpl::setColumns(ResViewerColumns* Columns)
{
  mp_TreeView->remove_all_columns();

  if (Columns)
  {
    Gtk::TreeViewColumn* CurrentCol;

    mp_TreeView->append_column(_("Time step"), *Columns->getStepColumn());
    CurrentCol = mp_TreeView->get_column(0);
    CurrentCol->set_sort_column(*Columns->getStepColumn());
    CurrentCol->set_resizable(true);
    CurrentCol->set_reorderable(true);

    mp_TreeView->append_column(_("Date-Time"), *Columns->getDateColumn());
    CurrentCol = mp_TreeView->get_column(1);
    CurrentCol->set_sort_column(*Columns->getDateColumn());
    CurrentCol->set_resizable(true);
    CurrentCol->set_reorderable(true);

    std::map<std::string, Gtk::TreeModelColumn<std::string>*> ColumnsByTitle =
        Columns->getByTitleColumns();

    for (std::map<std::string, Gtk::TreeModelColumn<std::string>*>::iterator
        it = ColumnsByTitle.begin(); it != ColumnsByTitle.end(); ++it)
    {
      int ColNb = mp_TreeView->append_column(it->first, *it->second);
      CurrentCol = mp_TreeView->get_column(ColNb - 1);
      CurrentCol->set_sort_column(*it->second);
      CurrentCol->set_resizable(true);
      CurrentCol->set_reorderable(true);
    }
  }
}
Beispiel #7
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);
         }
Beispiel #8
0
bool
KeyframeTree::on_event(GdkEvent *event)
{
    switch(event->type)
    {
	case GDK_BUTTON_PRESS:
		{
			Gtk::TreeModel::Path path;
			Gtk::TreeViewColumn *column;
			int cell_x, cell_y;
			int wx(round_to_int(event->button.x)),wy(round_to_int(event->button.y));
			//tree_to_widget_coords (,, wx, wy);
			if(!get_path_at_pos(
				wx,wy,	// x, y
				path, // TreeModel::Path&
				column, //TreeViewColumn*&
				cell_x,cell_y //int&cell_x,int&cell_y
				)
			) break;
			const Gtk::TreeRow row = *(get_model()->get_iter(path));

			signal_user_click()(event->button.button,row,(ColumnID)column->get_sort_column_id());
			if((ColumnID)column->get_sort_column_id()==COLUMNID_JUMP)
			{
				keyframe_tree_store_->canvas_interface()->set_time(row[model.time]);
			}
		}
		break;
	case GDK_2BUTTON_PRESS:
		{
			Gtk::TreeModel::Path path;
			Gtk::TreeViewColumn *column;
			int cell_x, cell_y;
			if(!get_path_at_pos(
				int(event->button.x),int(event->button.y),	// x, y
				path, // TreeModel::Path&
				column, //TreeViewColumn*&
				cell_x,cell_y //int&cell_x,int&cell_y
				)
			) break;
			const Gtk::TreeRow row = *(get_model()->get_iter(path));

			{
				keyframe_tree_store_->canvas_interface()->set_time(row[model.time]);
				return true;
			}
		}
		break;

	case GDK_BUTTON_RELEASE:
		break;
	default:
		break;
	}
	return false;
}
void AttributesView::setNotificationsView() {
	columns_notif.add(col_notif);
	list_notif = Gtk::ListStore::create(columns_notif);
	view_notif->set_model(list_notif);

	int i = this->view_notif->append_column("Notificaciones", col_notif);
	Gtk::TreeViewColumn* pColumn = this->view_files->get_column(i);
	pColumn->set_resizable(true);

}
Beispiel #10
0
/// @fn void LibraryView::fillTagsList()
/// @brief Method responsible for loading tags list from library.
void LibraryView::fillTagsList() {
  tags_list = core->getTagsList();
  tags_view.set_model(tags_list);
  tags_view.append_column("Tags List", tags_columns.name);
  Gtk::TreeViewColumn *column = tags_view.get_column(0);
  if(column) column->set_expand(true);
  tags_view.append_column_editable("", tags_columns.selected);
  tags_view.signal_cursor_changed().connect(sigc::mem_fun(*this,
        &LibraryView::loadImagesByTags));
}
void Portfolio::reflesh()
{
	  //Fill the TreeView's model
      m_refTreeModel->clear();
      m_TreeView.remove_all_columns();

	  //Add the TreeView's view columns:
	  m_TreeView.append_column("Currency", m_Columns.m_col_currency);
	  m_TreeView.append_column("Amount", m_Columns.m_col_amount);

	  vector<AccountDatum*> accountData = OutgoingRequest::requestAccountData();
	  vector<double> in_yens;
	  vector<double> percentages;
	  double sum;

	  for(size_t i=0; i<accountData.size(); i++)
	  {
		  string symbol = accountData.at(i)->currency;
		  double rate = lexical_cast<double>(OutgoingRequest::requestLatestRate(symbol, "JPY"));
		  double in_yen = accountData.at(i)->amount * rate;
		  in_yens.push_back(in_yen);
	  }

	  sum = boost::accumulate(in_yens, 0);

	  for(size_t i=0; i<accountData.size(); i++)
	  {
		  double percentage = in_yens.at(i)/sum * 100;
		  percentages.push_back(percentage);
	  }

	  Gtk::TreeModel::Row row;
	  for(size_t i=0; i<accountData.size(); i++){
		  row = *(m_refTreeModel->append());
		  row[m_Columns.m_col_currency] = accountData.at(i)->currency;
		  row[m_Columns.m_col_amount] = accountData.at(i)->amount;
		  row[m_Columns.m_col_percentage] = percentages.at(i);
	  }

	  Gtk::CellRendererProgress* cell = Gtk::manage(new Gtk::CellRendererProgress);
	  int cols_count = m_TreeView.append_column("Percentage", *cell);
	  Gtk::TreeViewColumn* pColumn = m_TreeView.get_column(cols_count - 1);
	  if(pColumn)
	  {
	    pColumn->add_attribute(cell->property_value(), m_Columns.m_col_percentage);
	  }

	  for(guint i = 0; i < 2; i++)
	  {
	    Gtk::TreeView::Column* pColumn = m_TreeView.get_column(i);
	    pColumn->set_reorderable();
	  }

	  show_all_children();
}
Beispiel #12
0
bool
Dock_History::on_action_event(GdkEvent *event)
{
	studio::HistoryTreeStore::Model model;
    switch(event->type)
    {
	case GDK_BUTTON_PRESS:
	case GDK_2BUTTON_PRESS:
		{
			Gtk::TreeModel::Path path;
			Gtk::TreeViewColumn *column;
			int cell_x, cell_y;
			if(!action_tree->get_path_at_pos(
				int(event->button.x),int(event->button.y),	// x, y
				path, // TreeModel::Path&
				column, //TreeViewColumn*&
				cell_x,cell_y //int&cell_x,int&cell_y
				)
			) break;
			const Gtk::TreeRow row = *(action_tree->get_model()->get_iter(path));

			//signal_user_click()(event->button.button,row,(ColumnID)column->get_sort_column_id());
			if((ColumnID)column->get_sort_column_id()==COLUMNID_JUMP)
			{
				etl::handle<synfigapp::Action::Undoable> action(row[model.action]);
				try{
				if((bool)row[model.is_undo])
				{
					while(get_selected_instance()->undo_action_stack().size() && get_selected_instance()->undo_action_stack().front()!=action)
						if(get_selected_instance()->undo()==false)
							throw int();
				}
				else if((bool)row[model.is_redo])
				{
					while(get_selected_instance()->redo_action_stack().size() && get_selected_instance()->undo_action_stack().front()!=action)
						if(get_selected_instance()->redo()==false)
							throw int();
				}
				}
				catch(int)
				{
					return true;
				}
			}
			break;
		}

	case GDK_BUTTON_RELEASE:
		break;
	default:
		break;
	}
	return false;
}
void
LiningAdjustmentDialog::init_ui()
{
	builder_->get_widget( "combobox-chip", combobox_chip_);
	builder_->get_widget( "spinbutton-strip", spinbutton_strip_);
	builder_->get_widget( "spinbutton-code", spinbutton_code_);
	builder_->get_widget( "spinbutton-broadcast", spinbutton_broadcast_);
	builder_->get_widget( "toolbutton-load-from-file", menutoolbutton_load_from_file_);
	builder_->get_widget( "menuitem-restore-current", menuitem_restore_current_);
	builder_->get_widget( "menuitem-restore-all", menuitem_restore_all_);

	builder_->get_widget( "toolbutton-write-current", menutoolbutton_write_current_);
	builder_->get_widget( "menuitem-write-all", menuitem_write_all_);

	Glib::RefPtr<Glib::Object> obj;
	obj = builder_->get_object("liststore-strip-code");
	liststore_strip_code_ = Glib::RefPtr<Gtk::ListStore>::cast_dynamic(obj);

	// create items
	StripCodeVector codes;
	for ( int i = 0; i < SCANNER_STRIPS_PER_CHIP_REAL; ++i) {
		codes.push_back(StripCode( i + 1, 0));
	}

	// add rows
	for ( StripCodeVector::const_iterator it = codes.begin();
		it != codes.end(); ++ it) {
		Gtk::TreeRow row = *(liststore_strip_code_->append());
		row[model_columns.strip] = it->first;
		row[model_columns.code] = it->second;
	}

	builder_->get_widget( "treeview-strip-code", treeview_strip_code_);

	selection_strip_code_ = treeview_strip_code_->get_selection();
	selection_strip_code_->set_mode(Gtk::SELECTION_SINGLE);

	// add columns
	Gtk::TreeViewColumn* column;
	Gtk::CellRenderer* renderer;
	column = new Gtk::TreeView::Column( _("Strip"), model_columns.strip);
	column->set_alignment(Gtk::ALIGN_CENTER);
	renderer = column->get_first_cell_renderer();
	renderer->property_xalign() = 1.;
	treeview_strip_code_->append_column(*Gtk::manage(column));

	column = new Gtk::TreeView::Column( _("Code"), model_columns.code);
	column->set_alignment(Gtk::ALIGN_CENTER);
	renderer = column->get_first_cell_renderer();
	renderer->property_xalign() = .5;
	treeview_strip_code_->append_column(*Gtk::manage(column));
}
/**
 * Append appropriate plugin column - depending on the GConf value
 */
void
PluginTreeView::append_plugin_column()
{
#if GTKMM_MAJOR_VERSION > 2 || ( GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION >= 14 )
  bool description_as_tooltip = false;
#  ifdef HAVE_GCONFMM
  if ( __gconf )
  {
#    ifdef GLIBMM_EXCEPTIONS_ENABLED
    description_as_tooltip = __gconf->get_bool(__gconf_prefix + "/description_as_tooltip");
#    else
    std::auto_ptr<Glib::Error> error;
    description_as_tooltip = __gconf->get_bool(__gconf_prefix + "/description_as_tooltip", error);
#    endif
  }
#  endif
#endif

#if GTKMM_MAJOR_VERSION > 2 || ( GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION >= 14 )
  if (description_as_tooltip)
  {
#endif
    append_column("Plugin", m_plugin_record.name);
#if GTKMM_MAJOR_VERSION > 2 || ( GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION >= 14 )
    set_tooltip_column(2);
  }
  else
  {
    TwoLinesCellRenderer *twolines_renderer = new TwoLinesCellRenderer();
    Gtk::TreeViewColumn *tlcol =
      new Gtk::TreeViewColumn("Plugin", *Gtk::manage(twolines_renderer));
    append_column(*Gtk::manage(tlcol));

 #  ifdef GLIBMM_PROPERTIES_ENABLED
    tlcol->add_attribute(twolines_renderer->property_line1(), m_plugin_record.name);
    tlcol->add_attribute(twolines_renderer->property_line2(), m_plugin_record.description);
 #  else
    tlcol->add_attribute(*twolines_renderer, "line1", m_plugin_record.name);
    tlcol->add_attribute(*twolines_renderer, "line2", m_plugin_record.description);
 #  endif

    set_tooltip_column(-1);
  }
#endif

  set_headers_clickable();
  Gtk::TreeViewColumn *plugin_col = get_column(2);
  if (plugin_col) plugin_col->signal_clicked().connect(sigc::mem_fun(*this, &PluginTreeView::on_name_clicked));
}
void AttributesView::setFilesView() {
	columns_files.add(col_size_files);
	columns_files.add(col_path_files);
	list_files = Gtk::ListStore::create(columns_files);
	view_files->set_model(list_files);

	this->view_files->append_column("Ruta del Archivo", col_path_files);
	int cols_count = this->view_files->append_column("Tamaño", col_size_files);

	Gtk::TreeViewColumn* pColumn;
	for (int i = 0; i < cols_count; i++) {
		pColumn = this->view_files->get_column(i);
		pColumn->set_resizable(true);
	}
}
Beispiel #16
0
/** Constructor.
 * @param cobject pointer to base object type
 * @param builder Gtk builder
 */
ConfigTreeView::ConfigTreeView(BaseObjectType* cobject,
			       const Glib::RefPtr<Gtk::Builder> &builder)
  : Gtk::TreeView(cobject)
{
  m_dlg_edit = NULL;
  builder->get_widget_derived("dlgConfigEdit", m_dlg_edit);

  m_dlg_add = NULL;
  builder->get_widget_derived("dlgConfigAdd", m_dlg_add);

  m_dlg_remove = NULL;
  builder->get_widget_derived("dlgConfigRemove", m_dlg_remove);

  m_config_tree = Gtk::TreeStore::create(m_config_record);
  m_config_tree->set_sort_column(0, Gtk::SORT_ASCENDING);

  set_model(m_config_tree);
  append_column("Path", m_config_record.node);

  Gtk::TreeViewColumn *column = get_column(0);
  Gtk::CellRendererText *cell =
#if GTK_VERSION_GE(3,0)
    (Gtk::CellRendererText *)column->get_first_cell();
#else
    (Gtk::CellRendererText *)column->get_first_cell_renderer();
#endif
#ifdef GLIBMM_PROPERTIES_ENABLED
  column->add_attribute(cell->property_underline(), m_config_record.is_default);
#else
  column->add_attribute(*cell, "underline", m_config_record.is_default);
#endif

  append_column("Value", m_config_record.value_string);

  /*
  Gtk::Menu::MenuList& menulist = m_menu.items();

  menulist.push_back( Gtk::Menu_Helpers::MenuElem("Edit", sigc::mem_fun( *this, &ConfigTreeView::on_menu_edit_selected) ) );
  menulist.push_back( Gtk::Menu_Helpers::MenuElem("Remove", sigc::mem_fun( *this, &ConfigTreeView::on_menu_remove_selected) ) );
  menulist.push_back( Gtk::Menu_Helpers::MenuElem("Add", sigc::mem_fun( *this, &ConfigTreeView::on_menu_add_selected) ) );
  */

  m_config = NULL;
  m_own_config = false;

  signal_button_press_event().connect_notify( sigc::mem_fun(*this, &ConfigTreeView::on_button_press_event_custom) );
}
void AttributesView::setPeersView() {
	columns_peers.add(col_name_peers);
	columns_peers.add(col_port_peers);
	columns_peers.add(col_type_peers);
	list_peers = Gtk::ListStore::create(columns_peers);
	view_peers->set_model(list_peers);

	this->view_peers->append_column("Nombre del Peer", col_name_peers);
	this->view_peers->append_column("Puerto", col_port_peers);
	int cols_count = this->view_peers->append_column("Tipo de Peer",
			col_type_peers);
	Gtk::TreeViewColumn* pColumn;
	for (int i = 0; i < cols_count; i++) {
		pColumn = this->view_peers->get_column(i);
		pColumn->set_resizable(true);
	}
}
// 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);

	}
}
Beispiel #19
0
void setup_model(){
	{
		//treeview
		treemodel = Gtk::ListStore::create(columns);	
		treeview1->set_model(treemodel);
		treeview1->append_column("Filename", columns.Filename);
		treeview1->append_column("Url", columns.url);
		treeview1->append_column("Size", columns.size);
		treeview1->append_column("%", columns.percentage_complete);
		treeview1->append_column("Time Left", columns.time_left);
		treeview1->append_column("Action", columns.action);

		//make all columns resizeable and set width
		std::vector<Gtk::TreeViewColumn*> tv_columns = treeview1->get_columns();	
		std::vector<Gtk::TreeViewColumn*>::iterator iter = tv_columns.begin();
		int count = 0;
		for (; iter!=tv_columns.end(); iter++, count++){
			Gtk::TreeViewColumn* col = *iter;
			col->set_resizable(true);
			col->set_fixed_width(column_widths[count]);
		}
		Gtk::TreeModel::Row row = *(treemodel->append());
		row[columns.Filename] = "33";
		row[columns.url] = "SFDSD";

		Gtk::TreeModel::Children children = treemodel->children();
		for(Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter){
			Gtk::TreeModel::Row row = *iter;
			row->set_value(0, (Glib::ustring)"asdfaksdhfakshdfklasjdfhklsafdhlaskjdhflksajdhfasdfads");
			row->set_value(4, (Glib::ustring)"asdfads");
		}
	}
	{
		comboboxmodel = Gtk::ListStore::create(combo_columns);	
		combobox_size->set_model(comboboxmodel);
		Gtk::TreeModel::Row row = *(comboboxmodel->append());
		combobox_size->set_id_column(0);
		Gtk::CellRendererText *cell = new Gtk::CellRendererText(); 
		combobox_size->pack_start(*cell);
		combobox_size->add_attribute(*cell, "text", combo_columns.size); 
		row[combo_columns.size] = "kB";
		(*(comboboxmodel->append()))[combo_columns.size] = "MB";
		combobox_size->set_active(0);
	}
}
Gtk::Widget& DifficultyEditor::createTreeView()
{
	// First, create the treeview
	_settingsView = Gtk::manage(new Gtk::TreeView(_settings->getTreeStore()));
	_settingsView->set_size_request(TREE_VIEW_MIN_WIDTH, -1);

	// Connect the tree view selection
	Glib::RefPtr<Gtk::TreeSelection> selection = _settingsView->get_selection();
	selection->signal_changed().connect(sigc::mem_fun(*this, &DifficultyEditor::onSettingSelectionChange));

	// Add columns to this view
	Gtk::CellRendererText* textRenderer = Gtk::manage(new Gtk::CellRendererText);

	Gtk::TreeViewColumn* settingCol = Gtk::manage(new Gtk::TreeViewColumn);
	settingCol->pack_start(*textRenderer, false);

    settingCol->set_title(_("Setting"));
	settingCol->set_sizing(Gtk::TREE_VIEW_COLUMN_AUTOSIZE);
    settingCol->set_spacing(3);

	_settingsView->append_column(*settingCol);

	settingCol->add_attribute(textRenderer->property_text(), _settings->getColumns().description);
	settingCol->add_attribute(textRenderer->property_foreground(), _settings->getColumns().colour);
	settingCol->add_attribute(textRenderer->property_strikethrough(), _settings->getColumns().isOverridden);

	Gtk::ScrolledWindow* frame = Gtk::manage(new gtkutil::ScrolledFrame(*_settingsView));

	// Create the action buttons
	Gtk::HBox* buttonHBox = Gtk::manage(new Gtk::HBox(false, 6));

	// Create button
	_createSettingButton = Gtk::manage(new Gtk::Button(Gtk::Stock::ADD));
	_createSettingButton->signal_clicked().connect(sigc::mem_fun(*this, &DifficultyEditor::onSettingCreate));

	// Delete button
	_deleteSettingButton = Gtk::manage(new Gtk::Button(Gtk::Stock::DELETE));
	_deleteSettingButton->signal_clicked().connect(sigc::mem_fun(*this, &DifficultyEditor::onSettingDelete));

	_refreshButton = Gtk::manage(new Gtk::Button(Gtk::Stock::REFRESH));
	_refreshButton->signal_clicked().connect(sigc::mem_fun(*this, &DifficultyEditor::onRefresh));

	buttonHBox->pack_start(*_createSettingButton, true, true, 0);
	buttonHBox->pack_start(*_deleteSettingButton, true, true, 0);
	buttonHBox->pack_start(*_refreshButton, true, true, 0);

	Gtk::VBox* vbox = Gtk::manage(new Gtk::VBox(false, 6));
	vbox->pack_start(*frame, true, true, 0);
	vbox->pack_start(*buttonHBox, false, false, 0);

	vbox->set_border_width(12);

	return *vbox;
}
Beispiel #21
0
void TorrentView::setTreeView(Gtk::TreeView *view_torrents) {
	this->view_torrents = view_torrents;

	//agrego la lista de torrents al tree view
	this->view_torrents->set_model(list_torrents);

	Gtk::TreeViewColumn* pColumn;
	int cols_count;

	//agrego columnas al Tree View
	this->view_torrents->append_column(COL_NAME, col_name);
	this->view_torrents->append_column(COL_SIZE, col_size);
	this->view_torrents->append_column(COL_STATUS, col_status);

	//mostrar una progress bar para el porcentaje de progreso
	Gtk::CellRendererProgress* cell =
		Gtk::manage(new Gtk::CellRendererProgress);
	cols_count = this->view_torrents->append_column(COL_PROGRESS, *cell);
	pColumn = this->view_torrents->get_column(cols_count - 1);
	if (pColumn) {
#ifdef GLIBMM_PROPERTIES_ENABLED
		pColumn->add_attribute(cell->property_value(), col_progress);
#else
		pColumn->add_attribute(*cell, "value", col_progress);
#endif
	}

	this->view_torrents->append_column(COL_COMPLETED, col_completed);
	this->view_torrents->append_column(COL_REMAINING, col_remaining);
	this->view_torrents->append_column(COL_DOWNSPEED, col_downspeed);
	this->view_torrents->append_column(COL_UPSPEED, col_upspeed);
	cols_count = this->view_torrents->append_column(COL_TIME, col_time);

	for (int i = 0; i < cols_count; i++) {
		pColumn = this->view_torrents->get_column(i);
		pColumn->set_resizable(true); //hago que sean columnas redimensionables
	}
	this->view_torrents->columns_autosize();

	selection = this->view_torrents->get_selection();
	selection->signal_changed().connect(sigc::mem_fun(*this,
			&TorrentView::on_row_selected));

}
Beispiel #22
0
void MidiRuleCtrlTrigger::num_edited(
    const Glib::ustring& path,
    const Glib::ustring& new_text,
    const Gtk::TreeModelColumn<int>& column) {
    Gtk::TreeModel::Row row = *list_store->get_iter(path);

    Gtk::TreeModel::Path cpath;
    Gtk::TreeViewColumn* col;
    tree_view.get_cursor(cpath, col);

    int lower = 0;
    int upper = 127;
    const Gtk::CellRenderer* r = col->get_first_cell();
    if (const Gtk::CellRendererSpin* renderer =
        dynamic_cast<const Gtk::CellRendererSpin*>(r)) {
        lower = renderer->property_adjustment().get_value()->get_lower();
        upper = renderer->property_adjustment().get_value()->get_upper();
    }

    row[column] = std::max(lower, std::min(atoi(new_text.c_str()), upper));
}
Beispiel #23
0
Gtk::Widget *SearchNotesWidget::make_notebooks_pane()
{
  m_notebooksTree = Gtk::manage(
    new notebooks::NotebooksTreeView(m_manager,
                                     notebooks::NotebookManager::obj()
                                       .get_notebooks_with_special_items()));

  m_notebooksTree->get_selection()->set_mode(Gtk::SELECTION_SINGLE);
  m_notebooksTree->set_headers_visible(true);
  m_notebooksTree->set_rules_hint(false);

  Gtk::CellRenderer *renderer;

  Gtk::TreeViewColumn *column = manage(new Gtk::TreeViewColumn());
  column->set_title(_("Notebooks"));
  column->set_sizing(Gtk::TREE_VIEW_COLUMN_AUTOSIZE);
  column->set_resizable(false);

  renderer = manage(new Gtk::CellRendererPixbuf());
  column->pack_start(*renderer, false);
  column->set_cell_data_func(*renderer,
                             sigc::mem_fun(*this, &SearchNotesWidget::notebook_pixbuf_cell_data_func));

  Gtk::CellRendererText *text_renderer = manage(new Gtk::CellRendererText());
  text_renderer->property_editable() = true;
  column->pack_start(*text_renderer, true);
  column->set_cell_data_func(*text_renderer,
                             sigc::mem_fun(*this, &SearchNotesWidget::notebook_text_cell_data_func));
  text_renderer->signal_edited().connect(sigc::mem_fun(*this, &SearchNotesWidget::on_notebook_row_edited));

  m_notebooksTree->append_column(*column);

  m_notebooksTree->signal_row_activated()
    .connect(sigc::mem_fun(*this, &SearchNotesWidget::on_notebook_row_activated));
  m_on_notebook_selection_changed_cid = m_notebooksTree->get_selection()->signal_changed()
    .connect(sigc::mem_fun(*this, &SearchNotesWidget::on_notebook_selection_changed));
  m_notebooksTree->signal_button_press_event()
    .connect(sigc::mem_fun(*this, &SearchNotesWidget::on_notebooks_tree_button_pressed), false);
  m_notebooksTree->signal_key_press_event()
    .connect(sigc::mem_fun(*this, &SearchNotesWidget::on_notebooks_key_pressed));

  m_notebooksTree->show();
  Gtk::ScrolledWindow *sw = new Gtk::ScrolledWindow();
  sw->property_hscrollbar_policy() = Gtk::POLICY_AUTOMATIC;
  sw->property_vscrollbar_policy() = Gtk::POLICY_AUTOMATIC;
  sw->add(*m_notebooksTree);
  sw->show();

  return sw;
}
ContactsTreeWidget::ContactsTreeWidget(BaseObjectType* baseObject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade) : Gtk::TreeView(baseObject) {
  appInstance->logEvent("ContactsTreeWidget::ContactsTreeWidget()", SEVERITY_DEBUG);
  treeModel = Gtk::TreeStore::create(columns);
  // sort by status codes.
  // STATUS_OFFLINE is 0, so it will always be at bottom of the list
  treeModel->set_sort_column(columns.contactStatus, Gtk::SORT_DESCENDING);
  set_model(treeModel);
  set_search_equal_func(sigc::mem_fun(*this, &ContactsTreeWidget::onSearchEqual));

  // appending columns
  gint colCount;
  Gtk::TreeViewColumn* pColumn;
  Gtk::CellRenderer* renderer;
  Gtk::CellRendererPixbuf *avatarRenderer, *statusRenderer;
  Gtk::CellRendererText *textRenderer;

  statusRenderer = Gtk::manage(new Gtk::CellRendererPixbuf);
  statusRenderer->property_xalign() = 0.0;
  colCount = append_column(_("Status"), *statusRenderer);
  pColumn = get_column(colCount - 1);
  pColumn->add_attribute(statusRenderer->property_pixbuf(), columns.statusImage);

  textRenderer = Gtk::manage(new Gtk::CellRendererText);
  textRenderer->property_xalign() = 0.0;
  colCount = append_column(_("Nickname"), *textRenderer);
  pColumn = get_column(colCount - 1);
  pColumn->set_resizable(true);
  pColumn->add_attribute(textRenderer->property_markup(), columns.contactNickname);

  avatarRenderer = Gtk::manage(new Gtk::CellRendererPixbuf);
  avatarRenderer->property_xalign() = 1.0;
  avatarRenderer->property_xpad() = 10;
  colCount = append_column("", *avatarRenderer);
  pColumn = get_column(colCount - 1);
  pColumn->add_attribute(avatarRenderer->property_pixbuf(), columns.contactAvatar);

  // connecting signal handlers
  signal_row_activated().connect(sigc::mem_fun(*this, &ContactsTreeWidget::contactsTreeOnActivate));
  appInstance->sigServer->signal_user_status().connect(sigc::mem_fun(*this, &ContactsTreeWidget::onStatusChange));
}
ArbitratorPropertyWindow::ArbitratorPropertyWindow(MainWindow* parent, 
                               Manager* manager, ApplicationWindow* appWnd)
{   
    m_pParent = parent;
    m_pManager = manager;
    m_pAppWindow = appWnd;
    m_arbPort.clear();

    /* Create a new scrolled window, with scrollbars only if needed */
    set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
    add(m_TreeView);

    /* create tree store */
    m_refTreeModel = Gtk::TreeStore::create(m_Columns);
    m_TreeView.set_model(m_refTreeModel);

    //Add the Model’s column to the View’s columns: 
    Gtk::CellRendererText* itemRenderer = Gtk::manage(new Gtk::CellRendererText());
    itemRenderer->property_editable() = false;
    Gtk::TreeViewColumn* itemCol = Gtk::manage(new Gtk::TreeViewColumn("Property", *itemRenderer));
    //itemCol->add_attribute(*itemRenderer, "background-gdk", m_Columns.m_col_color);
    itemCol->add_attribute(*itemRenderer, "text", m_Columns.m_col_name);
    itemCol->set_resizable(true);
    m_TreeView.append_column(*itemCol);



    Gtk::CellRendererText* valueRenderer = Gtk::manage(new Gtk::CellRendererText());
    valueRenderer->property_editable() = false;
    Gtk::TreeViewColumn* valueCol = Gtk::manage(new Gtk::TreeViewColumn("Value", *valueRenderer));
    valueCol->add_attribute(*valueRenderer, "foreground-gdk", m_Columns.m_col_color_value);
    valueCol->add_attribute(*valueRenderer, "text", m_Columns.m_col_value);
    valueCol->set_resizable(true);
    valueRenderer->property_editable() = true;
    //valueCol->set_cell_data_func(*valueRenderer, sigc::mem_fun(*this,
    //    &ArbitratorPropertyWindow::onCellData) );
    valueRenderer->signal_edited().connect( sigc::mem_fun(*this,
              &ArbitratorPropertyWindow::onCellEdited) );
    m_TreeView.append_column(*valueCol);
    valueCol->add_attribute(*valueRenderer, "editable", m_Columns.m_col_editable);   


    //m_TreeView.append_column_editable("Value", m_Columns.m_col_value);
    //m_TreeView.get_column(1)->set_resizable(true);
       //Tell the view column how to render the model values:
    m_TreeView.set_property("enable_grid_lines", true);
    show_all_children();
    m_TreeView.set_grid_lines(Gtk::TREE_VIEW_GRID_LINES_BOTH);
    m_TreeView.set_rules_hint(true);
}
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();
	}
}
const StringColumn& ColumnsModel::append_string_column(const int bec_tm_idx, const std::string& name,
                                                       const Editable editable, const Iconic have_icon) {
  Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf>>* icon = 0;

  Gtk::TreeViewColumn* column = Gtk::manage(new Gtk::TreeViewColumn(base::replaceString(name, "_", "__")));

  if (have_icon == WITH_ICON) {
    icon = new Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf>>;
    add(*icon);
    add_bec_index_mapping(bec_tm_idx);
    column->pack_start(*icon, false);

    _columns.push_back(icon);
  }

  Gtk::TreeModelColumn<Glib::ustring>* col = new Gtk::TreeModelColumn<Glib::ustring>;
  add(*col);
  add_bec_index_mapping(bec_tm_idx);
  column->pack_start(*col);

  _columns.push_back(col);

  int nr_of_cols = _treeview->append_column(*column);
  _treeview->get_column(nr_of_cols - 1)->set_resizable(true);

  if (editable == EDITABLE || editable == EDITABLE_WO_FIRST) {
    std::vector<Gtk::CellRenderer*> rends = column->get_cells();

    Gtk::CellRendererText* cell = (Gtk::CellRendererText*)rends[icon ? 1 : 0];
    cell->property_editable() = true;
    cell->signal_edited().connect(
      sigc::bind(sigc::mem_fun(*_tmw, &ListModelWrapper::after_cell_edit<Glib::ustring>), sigc::ref(*col)));

    if (editable == EDITABLE_WO_FIRST)
      column->set_cell_data_func(*cell, sigc::mem_fun(this, &ColumnsModel::disable_edit_first_row));
  }

  return *col;
}
// Create the objects panel (for manipulating the target_addobjectives objects)
void ObjectivesEditor::setupEntitiesPanel()
{
	// Tree view listing the target_addobjectives entities
    Gtk::TreeView* entityList = gladeWidget<Gtk::TreeView>(
        "entitiesTreeView"
    );
    entityList->set_model(_objectiveEntityList);
	entityList->set_headers_visible(false);

	entityList->get_selection()->signal_changed().connect(
		sigc::mem_fun(*this, &ObjectivesEditor::_onEntitySelectionChanged)
    );
	
	// Active-at-start column (checkbox)
	Gtk::CellRendererToggle* startToggle = Gtk::manage(new Gtk::CellRendererToggle);
	startToggle->signal_toggled().connect(
        sigc::mem_fun(*this, &ObjectivesEditor::_onStartActiveCellToggled)
    );
	
	Gtk::TreeViewColumn* startCol = Gtk::manage(new Gtk::TreeViewColumn(_("Start")));
	startCol->add_attribute(startToggle->property_active(), _objEntityColumns.startActive);
	
	entityList->append_column(*startCol);
	
	// Name column
	entityList->append_column(*Gtk::manage(new gtkutil::TextColumn("", _objEntityColumns.displayName)));
	
    // Connect button signals
    Gtk::Button* addButton = gladeWidget<Gtk::Button>("createEntityButton");
	addButton->signal_clicked().connect(
        sigc::mem_fun(*this, &ObjectivesEditor::_onAddEntity)
    );

    Gtk::Button* delButton = gladeWidget<Gtk::Button>("deleteEntityButton");
	delButton->set_sensitive(false); // disabled at start
	delButton->signal_clicked().connect(
        sigc::mem_fun(*this, &ObjectivesEditor::_onDeleteEntity)
    );
}
CheatListDialog::CheatListDialog(GtkDialog* _pstDialog, const Glib::RefPtr<Gtk::Builder>& refBuilder)
    : Gtk::Dialog(_pstDialog)
{
    refBuilder->get_widget("CheatOpenButton", m_poCheatOpenButton);
    refBuilder->get_widget("CheatSaveButton", m_poCheatSaveButton);
    refBuilder->get_widget("CheatAddButton", m_poCheatAddButton);
    refBuilder->get_widget("CheatRemoveButton", m_poCheatRemoveButton);
    refBuilder->get_widget("CheatRemoveAllButton", m_poCheatRemoveAllButton);
    refBuilder->get_widget("CheatMarkAllButton", m_poCheatMarkAllButton);
    refBuilder->get_widget("CheatTreeView", m_poCheatTreeView);

    // Tree View model
    m_poCheatListStore = Gtk::ListStore::create(m_oRecordModel);

    m_poCheatTreeView->set_model(m_poCheatListStore);

    Gtk::CellRendererToggle* pRenderer = Gtk::manage(new Gtk::CellRendererToggle());

    int cols_count = m_poCheatTreeView->append_column("", *pRenderer);

    pRenderer->signal_toggled().connect(sigc::mem_fun(*this, &CheatListDialog::vOnCheatToggled));

    Gtk::TreeViewColumn* pColumn = m_poCheatTreeView->get_column(cols_count - 1);

    if (pColumn)
        pColumn->add_attribute(pRenderer->property_active(), m_oRecordModel.bEnabled);

    m_poCheatTreeView->append_column("Description", m_oRecordModel.uDesc);

    m_poCheatOpenButton->signal_clicked().connect(sigc::mem_fun(*this, &CheatListDialog::vOnCheatListOpen));
    m_poCheatSaveButton->signal_clicked().connect(sigc::mem_fun(*this, &CheatListDialog::vOnCheatListSave));
    m_poCheatAddButton->signal_clicked().connect(sigc::mem_fun(*this, &CheatListDialog::vOnCheatAdd));
    m_poCheatRemoveButton->signal_clicked().connect(sigc::mem_fun(*this, &CheatListDialog::vOnCheatRemove));
    m_poCheatRemoveAllButton->signal_clicked().connect(sigc::mem_fun(*this, &CheatListDialog::vOnCheatRemoveAll));
    m_poCheatMarkAllButton->signal_clicked().connect(sigc::mem_fun(*this, &CheatListDialog::vOnCheatMarkAll));

    bMark = false;
}
// 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);
	}
}