XGP::XFileList Class Reference

Class for a (columned) list which holds files represented by an icon and textual information. More...

List of all members.

Public Member Functions

 XFileList ()
 XFileList (const Glib::RefPtr< Gtk::TreeModel > &model)
virtual ~XFileList ()
virtual std::string getFilename (const Gtk::TreeIter &line) const
virtual void setFilename (Gtk::TreeIter &line, const std::string &file)

Static Public Member Functions

static Glib::RefPtr< Gdk::Pixbuf > getIcon4File (const YGP::File &file)

Protected Member Functions

virtual bool on_event (GdkEvent *event)
void startInTerm (const char *file, Gtk::TreeIter line)
void startProgram (const char *file, Gtk::TreeIter line)
void executeProgram (const char *file, Gtk::TreeIter line)
bool execProgram (const char *file, const char *const args[], bool sync)
virtual void addMenus (Gtk::Menu &menu, const Gtk::TreeIter &line)
void move (Gtk::TreeIter line)
void remove (Gtk::TreeIter line)

Protected Attributes

Gtk::Menu * pMenuPopAction


Detailed Description

Class for a (columned) list which holds files represented by an icon and textual information.

The model to display should depend on the column-records specified above.


Constructor & Destructor Documentation

XGP::XFileList::XFileList (  )  [inline]

Constructor of the XFileList widget.

XGP::XFileList::XFileList ( const Glib::RefPtr< Gtk::TreeModel > &  model  )  [inline]

Constructor of the XFileList widget; passing a model to display.

XGP::XFileList::~XFileList (  )  [virtual]

Destructor.


Member Function Documentation

void XGP::XFileList::addMenus ( Gtk::Menu &  menu,
const Gtk::TreeIter &  line 
) [protected, virtual]

Method to add menus to the popup menu activated with the right mouse button (button 3).

Adds further menus to the default popup-menu.

Parameters:
Menu where to add some entries to
Line for which to add entries

bool XGP::XFileList::execProgram ( const char *  file,
const char *const   args[],
bool  sync 
) [protected]

Starts the passed program with argument.

Parameters:
file File to execute
args Arguments for the program
sync Flag, if file should be executed synchron or not
Returns:
bool Status; false, if exeuctions failed

void XGP::XFileList::executeProgram ( const char *  file,
Gtk::TreeIter  line 
) [protected]

Starts the passed program in the foreground with argument as argument.

Parameters:
file File to execute
line Line in list of file to pass as argument

std::string XGP::XFileList::getFilename ( const Gtk::TreeIter &  line  )  const [virtual]

Retrieves the file name of the passed line; which is considered to be stored in the column 1.

Parameters:
line Line in list to get the filename from
Returns:
std::string Filename

Glib::RefPtr< Gdk::Pixbuf > XGP::XFileList::getIcon4File ( const YGP::File &  file  )  [static]

Searches for and sets an icon for the passed file The icon for the file is calculated according the following algorithm: - Use special (predifined) ones for directories or executeables.

  • Use the icon named as the name of file is stored in the icon-map. - Remove the first part (til the next dot (.)) of the name and repeat the previous step. - If no name-part is left use a special default-icon.
    Parameters:
    file Files to use as icon-files
    Returns:
    Glib::RefPtr<Gdk::Pixbuf> Reference to inserted line

void XGP::XFileList::move ( Gtk::TreeIter  line  )  [protected]

Moves the file in line to another location/name.

Parameters:
line Line in list of file to pass as argument

bool XGP::XFileList::on_event ( GdkEvent *  event  )  [protected, virtual]

Callback after clicking in list; if its by button 3: Display menu.

Parameters:
event Datails about the event
Returns:
bool true: Event has been handled; false else

void XGP::XFileList::remove ( Gtk::TreeIter  line  )  [protected]

Removes the passed file; both from the system and from the list.

Parameters:
line Line in list of file to pass as argument

void XGP::XFileList::setFilename ( Gtk::TreeIter &  line,
const std::string &  file 
) [virtual]

Sets the file name of the passed line; which is considered to be stored in the column 1.

Parameters:
line Line in list to get the filename from
file Filename to set

void XGP::XFileList::startInTerm ( const char *  file,
Gtk::TreeIter  line 
) [protected]

Starts the passed program in a terminal with argument as argument.

Parameters:
file File to execute
line Line in list of file to pass as argument

void XGP::XFileList::startProgram ( const char *  file,
Gtk::TreeIter  line 
) [protected]

Starts the passed program in the background with argument as argument.

Parameters:
file File to execute
line Line in list of file to pass as argument


Member Data Documentation

Gtk::Menu* XGP::XFileList::pMenuPopAction [protected]

Popup menu after pressing button 3.


The documentation for this class was generated from the following files:

XGP Version 0.9.31 - Generated on Wed Nov 18 11:25:30 2009 by doxygen 1.5.8