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
|
|
|
|
2016-10-18 16:45:28 -06:00
|
|
|
#include "Partition.h"
|
|
|
|
#include "PartitionVector.h"
|
2004-09-19 14:24:53 -06:00
|
|
|
|
|
|
|
#include <gtkmm/treeview.h>
|
|
|
|
#include <gtkmm/treestore.h>
|
|
|
|
#include <gtkmm/entry.h>
|
|
|
|
|
|
|
|
#include <gtkmm/stock.h>
|
|
|
|
#include <gdkmm/pixbuf.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace GParted
|
|
|
|
{
|
|
|
|
|
|
|
|
class TreeView_Detail : public Gtk::TreeView
|
|
|
|
{
|
|
|
|
public:
|
2005-12-23 17:06:05 -07:00
|
|
|
TreeView_Detail();
|
2015-05-23 13:22:37 -06:00
|
|
|
void load_partitions( const PartitionVector & partitions );
|
2015-05-16 10:06:22 -06:00
|
|
|
void set_selected( const Partition * partition_ptr );
|
2005-12-23 17:06:05 -07:00
|
|
|
void clear() ;
|
2004-09-19 14:24:53 -06:00
|
|
|
|
2015-05-16 10:06:22 -06:00
|
|
|
// Signals for interclass communication
|
|
|
|
sigc::signal<void, const Partition *, bool> signal_partition_selected;
|
2005-12-23 17:06:05 -07:00
|
|
|
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:
|
2015-05-23 13:22:37 -06:00
|
|
|
void load_partitions( const PartitionVector & partitions,
|
2016-12-01 07:05:57 -07:00
|
|
|
bool & show_names,
|
|
|
|
bool & show_mountpoints,
|
|
|
|
bool & show_labels,
|
2014-12-12 00:00:02 -07:00
|
|
|
const Gtk::TreeRow & parent_row = Gtk::TreeRow() );
|
2015-05-16 10:06:22 -06:00
|
|
|
bool set_selected( Gtk::TreeModel::Children rows,
|
|
|
|
const Partition * partition_ptr, bool inside_extended = false );
|
2016-12-01 06:27:37 -07:00
|
|
|
void create_row( const Gtk::TreeRow & treerow,
|
|
|
|
const Partition & partition,
|
|
|
|
bool & show_names,
|
|
|
|
bool & show_mountpoints,
|
|
|
|
bool & show_labels );
|
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;
|
2014-12-12 00:00:02 -07:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> name;
|
2019-12-02 11:41:27 -07:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> fsname;
|
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 ;
|
|
|
|
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;
|
2015-05-16 15:36:29 -06:00
|
|
|
Gtk::TreeModelColumn<const Partition *> partition_ptr; // Hidden column. (Alias to element in
|
|
|
|
// Win_GParted::display_partitions[] vector).
|
|
|
|
|
2006-03-06 06:39:21 -07:00
|
|
|
treeview_detail_Columns()
|
2005-12-15 08:10:34 -07:00
|
|
|
{
|
2019-12-02 11:41:27 -07:00
|
|
|
add( path ); add( name ); add(fsname); add( mountpoint ); add( label );
|
2006-03-07 04:55:27 -07:00
|
|
|
add( size ); add( used ); add( unused ); add( color );
|
2016-09-18 14:06:57 -06:00
|
|
|
add( icon1 ); add( icon2 ); add( flags ); add( partition_ptr );
|
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 */
|