Go to the documentation of this file.
28 #ifndef __NMV_UI_UTILS_H__
29 #define __NMV_UI_UTILS_H__
38 #define NEMIVER_CATCH \
39 } catch (Glib::Exception &e) { \
40 LOG_ERROR (std::string ("caught exception: '") + e.what () + "'"); \
41 nemiver::ui_utils::display_error_not_transient (e.what ()); \
42 } catch (std::exception &e) { \
43 LOG_ERROR (std::string ("caught exception: '") + e.what () + "'"); \
44 nemiver::ui_utils::display_error_not_transient (e.what ()); \
46 LOG_ERROR ("caught unknown exception"); \
47 nemiver::ui_utils::display_error_not_transient ("An unknown error occured"); \
51 #ifndef NEMIVER_CATCH_AND_RETURN
52 #define NEMIVER_CATCH_AND_RETURN(a_value) \
53 } catch (Glib::Exception &e) { \
54 LOG_ERROR (std::string ("caught exception: '") + e.what () + "'"); \
55 nemiver::ui_utils::display_error_not_transient (e.what ()); \
57 } catch (std::exception &e) { \
58 LOG_ERROR (std::string ("caught exception: '") + e.what () + "'"); \
59 nemiver::ui_utils::display_error_not_transient (e.what ()); \
62 LOG_ERROR ("Caught unknown exception"); \
63 nemiver::ui_utils::display_error_not_transient ("An unknown error occured"); \
92 Glib::RefPtr<Gtk::Action> result;
111 Gtk::ToggleAction::create (
m_name,
118 THROW (
"should never reach this point");
129 (
const ActionEntry a_tab[],
131 Glib::RefPtr<Gtk::ActionGroup> &a_group);
149 bool a_propose_dont_ask_question,
150 bool &a_dont_ask_this_again);
158 UString &a_selected_file_path);
162 const list<UString> &a_where_to_look,
163 list<UString> &a_session_dirs,
164 map<UString, bool> &a_ignore_paths,
165 bool a_ignore_if_not_found,
171 const list<UString> &a_where_to_look,
172 list<UString> &a_sess_dirs,
173 map<UString, bool> &a_ignore_paths,
183 a_gtkbuilder->get_widget (a_widget_name, widget);
185 THROW (
"couldn't find widget '"
196 a_widget->reference ();
205 a_widget->unreference ();
212 #endif// __NMV_UI_UTILS_H__
NEMIVER_API int display_warning(Gtk::Window &a_parent_window, const common::UString &a_message)
Definition: nmv-address.h:31
Definition: nmv-ui-utils.h:73
#define THROW(a_reason)
Definition: nmv-exception.h:99
#define NEMIVER_API
Definition: nmv-api-macros.h:53
Glib::RefPtr< Gtk::Action > to_action() const
Definition: nmv-ui-utils.h:90
Definition: nmv-ustring.h:45
@ TOGGLE
Definition: nmv-ui-utils.h:78
NEMIVER_API int display_error_not_transient(const UString &a_message)
bool m_is_important
Definition: nmv-ui-utils.h:88
Type
Definition: nmv-ui-utils.h:76
NEMIVER_API int ask_yes_no_question(Gtk::Window &a_parent_window, const common::UString &a_message)
NEMIVER_API int display_info(Gtk::Window &a_parent_window, const common::UString &a_message)
NEMIVER_API int display_error(Gtk::Window &a_parent_window, const common::UString &a_message)
bool find_file_and_read_line(Gtk::Window &a_parent_window, const UString &a_file_path, const list< UString > &a_where_to_look, list< UString > &a_sess_dirs, map< UString, bool > &a_ignore_paths, int a_line_number, string &a_line)
sigc::slot< void > m_activate_slot
Definition: nmv-ui-utils.h:85
common::UString m_accel
Definition: nmv-ui-utils.h:87
Gtk::StockID m_stock_id
Definition: nmv-ui-utils.h:82
Type m_type
Definition: nmv-ui-utils.h:86
common::UString m_tooltip
Definition: nmv-ui-utils.h:84
NEMIVER_API bool find_file_or_ask_user(Gtk::Window &a_parent_window, const UString &a_file_path, const list< UString > &a_where_to_look, list< UString > &a_session_dirs, map< UString, bool > &a_ignore_paths, bool a_ignore_if_not_found, UString &a_absolute_path)
NEMIVER_API int ask_yes_no_cancel_question(Gtk::Window &a_parent_window, const common::UString &a_message)
common::UString m_name
Definition: nmv-ui-utils.h:81
NEMIVER_API bool ask_user_to_select_file(Gtk::Window &a_parent, const UString &a_file_name, const UString &a_default_dir, UString &a_selected_file_path)
@ DEFAULT
Definition: nmv-ui-utils.h:77
NEMIVER_API void add_action_entries_to_action_group(const ActionEntry a_tab[], int a_num_entries, Glib::RefPtr< Gtk::ActionGroup > &a_group)
T * get_widget_from_gtkbuilder(const Glib::RefPtr< Gtk::Builder > &a_gtkbuilder, const UString &a_widget_name)
Definition: nmv-ui-utils.h:179
common::UString m_label
Definition: nmv-ui-utils.h:83