GnuCash c935c2f+
Loading...
Searching...
No Matches
Public Member Functions
GncGtkPixmapUIItem Class Reference
Inheritance diagram for GncGtkPixmapUIItem:
GncOptionGtkUIItem GncOptionUIItem

Public Member Functions

 GncGtkPixmapUIItem (GtkWidget *widget)
 
void set_ui_item_from_option (GncOption &option) noexcept override
 
void set_option_from_ui_item (GncOption &option) noexcept override
 
- Public Member Functions inherited from GncOptionGtkUIItem
 GncOptionGtkUIItem (GtkWidget *widget, GncOptionUIType type)
 
 GncOptionGtkUIItem (const GncOptionGtkUIItem &item)
 
 GncOptionGtkUIItem (GncOptionGtkUIItem &&)=default
 
virtual void set_selectable (bool) const noexcept override
 Control wether the widget is sensitive.
 
void clear_ui_item () override
 Clear the data from the widget.
 
void set_widget (GtkWidget *widget)
 
virtual GtkWidget * get_widget () const
 
virtual SCM get_widget_scm_value (const GncOption &) const
 
- Public Member Functions inherited from GncOptionUIItem
 GncOptionUIItem (GncOptionUIType type)
 
GncOptionUIType get_ui_type () const noexcept
 
virtual void set_dirty (bool status) noexcept
 
virtual bool get_dirty () const noexcept
 

Detailed Description

Definition at line 1496 of file gnc-option-gtk-ui.cpp.

Constructor & Destructor Documentation

◆ GncGtkPixmapUIItem()

GncGtkPixmapUIItem::GncGtkPixmapUIItem ( GtkWidget *  widget)
inline

Definition at line 1499 of file gnc-option-gtk-ui.cpp.

1499 :
1500 GncOptionGtkUIItem{widget, GncOptionUIType::PIXMAP} {}
class GncOptionGtkUIItem Gtk-specific Interface class for Option Widget

Member Function Documentation

◆ set_option_from_ui_item()

void GncGtkPixmapUIItem::set_option_from_ui_item ( GncOption option)
inlineoverridevirtualnoexcept

Implements GncOptionUIItem.

Definition at line 1517 of file gnc-option-gtk-ui.cpp.

1518 {
1519 auto string = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(get_widget()));
1520 DEBUG("filename %s", string ? string : "(null)");
1521 if (string)
1522 {
1523 option.set_value(std::string{string});
1524 g_free(string);
1525 }
1526 }
#define DEBUG(format, args...)
Print a debugging message.
Definition qoflog.h:264

◆ set_ui_item_from_option()

void GncGtkPixmapUIItem::set_ui_item_from_option ( GncOption option)
inlineoverridevirtualnoexcept

Implements GncOptionUIItem.

Definition at line 1501 of file gnc-option-gtk-ui.cpp.

1502 {
1503 auto string{option.get_value<std::string>()};
1504 if (!string.empty())
1505 {
1506 DEBUG("string = %s", string.c_str());
1507 auto chooser{GTK_FILE_CHOOSER(get_widget())};
1508 gtk_file_chooser_select_filename(chooser, string.c_str());
1509 auto filename{gtk_file_chooser_get_filename(chooser)};
1510 g_object_set_data_full(G_OBJECT(chooser), LAST_SELECTION,
1511 g_strdup(string.c_str()), g_free);
1512 DEBUG("Set %s, retrieved %s", string.c_str(),
1513 filename ? filename : "(null)");
1514 update_preview_cb(chooser, &option);
1515 }
1516 }

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