2004-09-19 14:24:53 -06:00
|
|
|
/* Copyright (C) 2004 Bart
|
|
|
|
*
|
|
|
|
* 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
|
2014-01-23 03:59:48 -07:00
|
|
|
* GNU General Public License for more details.
|
2004-09-19 14:24:53 -06:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2014-01-23 03:59:48 -07:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2004-09-19 14:24:53 -06:00
|
|
|
*/
|
2013-05-27 05:20:16 -06:00
|
|
|
|
|
|
|
#ifndef GPARTED_TREEVIEW_DETAIL_H
|
|
|
|
#define GPARTED_TREEVIEW_DETAIL_H
|
2004-09-19 14:24:53 -06:00
|
|
|
|
|
|
|
#include "../include/Partition.h"
|
|
|
|
|
|
|
|
#include <gtkmm/treeview.h>
|
|
|
|
#include <gtkmm/treestore.h>
|
|
|
|
#include <gtkmm/entry.h>
|
|
|
|
|
|
|
|
#include <gtkmm/stock.h>
|
|
|
|
#include <gdkmm/pixbuf.h>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace GParted
|
|
|
|
{
|
|
|
|
|
|
|
|
class TreeView_Detail : public Gtk::TreeView
|
|
|
|
{
|
|
|
|
public:
|
2005-12-23 17:06:05 -07:00
|
|
|
TreeView_Detail();
|
|
|
|
void load_partitions( const std::vector<Partition> & partitions ) ;
|
|
|
|
void set_selected( const Partition & partition );
|
|
|
|
void clear() ;
|
2004-09-19 14:24:53 -06:00
|
|
|
|
|
|
|
//signals for interclass communication
|
2005-12-23 17:06:05 -07:00
|
|
|
sigc::signal< void, const Partition &, bool > signal_partition_selected ;
|
|
|
|
sigc::signal< void > signal_partition_activated ;
|
|
|
|
sigc::signal< void, unsigned int, unsigned int > signal_popup_menu ;
|
2004-09-19 14:24:53 -06:00
|
|
|
|
|
|
|
private:
|
2006-09-16 09:00:25 -06:00
|
|
|
void load_partitions( const std::vector<Partition> & partitions,
|
|
|
|
bool & mountpoints,
|
|
|
|
bool & labels,
|
|
|
|
const Gtk::TreeRow & parent_row = Gtk::TreeRow() ) ;
|
2005-12-23 17:06:05 -07:00
|
|
|
bool set_selected( Gtk::TreeModel::Children rows, const Partition & partition, bool inside_extended = false ) ;
|
|
|
|
void create_row( const Gtk::TreeRow & treerow, const Partition & partition );
|
2004-09-19 14:24:53 -06:00
|
|
|
|
2005-12-23 17:06:05 -07:00
|
|
|
//(overridden) signals
|
|
|
|
bool on_button_press_event( GdkEventButton * event );
|
|
|
|
void on_row_activated( const Gtk::TreeModel::Path & path, Gtk::TreeViewColumn * column ) ;
|
|
|
|
void on_selection_changed() ;
|
2004-09-19 14:24:53 -06:00
|
|
|
|
|
|
|
Glib::RefPtr<Gtk::TreeStore> treestore_detail;
|
|
|
|
Glib::RefPtr<Gtk::TreeSelection> treeselection;
|
|
|
|
|
2005-12-23 17:06:05 -07:00
|
|
|
bool block ;
|
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
//columns for this treeview
|
|
|
|
struct treeview_detail_Columns : public Gtk::TreeModelColumnRecord
|
|
|
|
{
|
2006-03-06 06:39:21 -07:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> path;
|
2005-12-15 08:10:34 -07:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> filesystem;
|
2006-02-02 03:59:44 -07:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> mountpoint;
|
2006-09-12 14:34:33 -06:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> label ;
|
2004-09-19 14:24:53 -06:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> size;
|
|
|
|
Gtk::TreeModelColumn<Glib::ustring> used;
|
|
|
|
Gtk::TreeModelColumn<Glib::ustring> unused;
|
2006-03-27 12:21:37 -07:00
|
|
|
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > color ;
|
2004-09-19 14:24:53 -06:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> text_color;
|
2006-03-07 04:55:27 -07:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> mount_text_color;
|
2006-03-27 12:21:37 -07:00
|
|
|
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > icon1 ;
|
|
|
|
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > icon2 ;
|
2004-09-19 14:24:53 -06:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> flags;
|
2006-03-06 06:39:21 -07:00
|
|
|
Gtk::TreeModelColumn<Partition> partition; //hidden column
|
2004-09-19 14:24:53 -06:00
|
|
|
|
2006-03-06 06:39:21 -07:00
|
|
|
treeview_detail_Columns()
|
2005-12-15 08:10:34 -07:00
|
|
|
{
|
2006-09-12 14:34:33 -06:00
|
|
|
add( path ); add( filesystem ); add( mountpoint ) ; add( label ) ;
|
2006-03-07 04:55:27 -07:00
|
|
|
add( size ); add( used ); add( unused ); add( color );
|
2006-03-27 12:21:37 -07:00
|
|
|
add( text_color ); add( mount_text_color ); add( icon1 );
|
|
|
|
add( icon2 ) ; add( flags ); add( partition );
|
2004-09-19 14:24:53 -06:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
treeview_detail_Columns treeview_detail_columns;
|
|
|
|
};
|
|
|
|
|
|
|
|
} //GParted
|
|
|
|
|
2013-05-27 05:20:16 -06:00
|
|
|
#endif /* GPARTED_TREEVIEW_DETAIL_H */
|