#include <NewForm.h>
Inheritance diagram for NewForm:
Public Member Functions | |
NewForm (Gtk::Window &window) | |
Create a new form. | |
virtual | ~NewForm () |
sigc::signal< void, std::string > | signal_theme_picked () |
Signal emmited when the user picks a theme. | |
void | find_themes () |
Find and list avaliable themes. | |
void | grab_focus () |
Give the theme list keyboard focus for the window it is inside. | |
Protected Member Functions | |
void | set_themes () |
Find the themes. | |
void | add_themes_from (std::string filename) |
Add themes in a directory. | |
void | on_dir_changed (const Glib::RefPtr< Gio::File > &file, const Glib::RefPtr< Gio::File > &other_file, Gio::FileMonitorEvent event_type, std::string path) |
Change the list when a directory changes. | |
void | test_themes_avaliable () |
Show warning if there are no themes, otherwise show the themes. | |
void | on_new_button_clicked () |
Callback for when the button to confirm the theme choice was pressed. | |
void | on_item_activated (const Gtk::TreeModel::Path &path) |
Callback for when an theme was activated from the theme_icon_view. | |
bool | add_file (Glib::RefPtr< Gio::FileInfo > file_info, std::string path) |
Add a file to the list, or monitor a directory, if it could contain a theme. | |
Protected Attributes | |
Gtk::Window & | window |
parent window | |
Gtk::Label | caption |
message asking user to select a theme. | |
Gtk::IconView | theme_icon_view |
shows the list of themes | |
Gtk::Button | create_button |
a button to press when you have picked the theme. | |
Gtk::ScrolledWindow | m_scrolled_window |
contain the icons | |
NewForm::ThemeModelColumns | theme_model_columns |
description of data to show per theme icon. | |
Glib::RefPtr< Gtk::ListStore > | list_model_ptr |
list of themes. | |
std::vector< Glib::RefPtr< Gio::FileMonitor > > | dir_mon |
directory monitors and their paths | |
sigc::signal< void, std::string > | m_signal_theme_picked |
signal for when theme selected. | |
bool | m_loading |
True if 'loading' is displayed. | |
Classes | |
class | ThemeModelColumns |
description of data to show per theme icon. More... |
Definition at line 24 of file NewForm.h.
NewForm::NewForm | ( | Gtk::Window & | window | ) |
Create a new form.
window | the window the forms sits on. When NewForm needs to make a message box appear, it will be centred over this window. |
Definition at line 18 of file NewForm.cpp.
NewForm::~NewForm | ( | ) | [virtual] |
Definition at line 53 of file NewForm.cpp.
bool NewForm::add_file | ( | Glib::RefPtr< Gio::FileInfo > | file_info, | |
std::string | path | |||
) | [protected] |
Add a file to the list, or monitor a directory, if it could contain a theme.
A valid file or directory must contain the word 'theme' (it is case sensitive) in the name, must not be hidden, must not contain a '.', and must not end in '~'. If the file is invlaid, it is ignored.
file_info | Information about the file/directory to check. | |
path | the path to the file to use in the full theme file name. |
Definition at line 235 of file NewForm.cpp.
void NewForm::add_themes_from | ( | std::string | filename | ) | [protected] |
Add themes in a directory.
The directory will be monitored fo future changes. It is recursive, so a theme directory under the given directory will also be added and monitored.
filename | the directory to add. |
Definition at line 80 of file NewForm.cpp.
void NewForm::find_themes | ( | ) |
Find and list avaliable themes.
This must be called after creation if the NewForm is going to do anything other than say "Loading". This is a separate to the constuctor, so that finding the themes on disk doesn't delay the time until the main window appears.
Definition at line 58 of file NewForm.cpp.
void NewForm::grab_focus | ( | ) |
Give the theme list keyboard focus for the window it is inside.
Definition at line 70 of file NewForm.cpp.
void NewForm::on_dir_changed | ( | const Glib::RefPtr< Gio::File > & | file, | |
const Glib::RefPtr< Gio::File > & | other_file, | |||
Gio::FileMonitorEvent | event_type, | |||
std::string | path | |||
) | [protected] |
Change the list when a directory changes.
path | the path from the working directory to the directory being monitored that causes this event. |
iterate over objects in list to find the one that was deleted.
Definition at line 107 of file NewForm.cpp.
void NewForm::on_item_activated | ( | const Gtk::TreeModel::Path & | path | ) | [protected] |
Callback for when an theme was activated from the theme_icon_view.
Definition at line 229 of file NewForm.cpp.
void NewForm::on_new_button_clicked | ( | ) | [protected] |
Callback for when the button to confirm the theme choice was pressed.
Definition at line 200 of file NewForm.cpp.
void NewForm::set_themes | ( | ) | [protected] |
Find the themes.
Looks for themes in the data directory. Also causes the data directory to be monitored. Must not be called multiple times.
Definition at line 75 of file NewForm.cpp.
sigc::signal< void, std::string > NewForm::signal_theme_picked | ( | ) |
Signal emmited when the user picks a theme.
The singal should be wired to a function
void on_pick_theme(std::string filename)
Definition at line 224 of file NewForm.cpp.
void NewForm::test_themes_avaliable | ( | ) | [protected] |
Show warning if there are no themes, otherwise show the themes.
Definition at line 162 of file NewForm.cpp.
Gtk::Label NewForm::caption [protected] |
Gtk::Button NewForm::create_button [protected] |
std::vector<Glib::RefPtr<Gio::FileMonitor> > NewForm::dir_mon [protected] |
Glib::RefPtr<Gtk::ListStore> NewForm::list_model_ptr [protected] |
bool NewForm::m_loading [protected] |
Gtk::ScrolledWindow NewForm::m_scrolled_window [protected] |
sigc::signal<void, std::string> NewForm::m_signal_theme_picked [protected] |
Gtk::IconView NewForm::theme_icon_view [protected] |
description of data to show per theme icon.
Gtk::Window& NewForm::window [protected] |
Generated at Mon Sep 6 00:41:16 2010 by Doxygen version 1.4.7 for Racer version svn335.