gui/collection: Toggle library state through the gui
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
8dece02eed
commit
0afe46b5df
|
@ -57,6 +57,21 @@ void __collection_activated(GtkTreeView *treeview, GtkTreePath *path,
|
||||||
gui_collection_idle_enable();
|
gui_collection_idle_enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __collection_toggled(GtkCellRendererToggle *toggle, gchar *path,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
struct library *library = NULL;
|
||||||
|
GtkTreeIter iter;
|
||||||
|
|
||||||
|
if (gtk_tree_model_get_iter_from_string(c_model, &iter, path))
|
||||||
|
library = __collection_get_library(&iter);
|
||||||
|
if (!library)
|
||||||
|
return;
|
||||||
|
|
||||||
|
collection_set_enabled(library, !library->li_enabled);
|
||||||
|
__collection_set_library(&iter, library);
|
||||||
|
}
|
||||||
|
|
||||||
void __collection_add(GtkButton *button, GtkFileChooser *chooser)
|
void __collection_add(GtkButton *button, GtkFileChooser *chooser)
|
||||||
{
|
{
|
||||||
gchar *filename = gtk_file_chooser_get_filename(chooser);
|
gchar *filename = gtk_file_chooser_get_filename(chooser);
|
||||||
|
|
|
@ -19,6 +19,7 @@ void __sidebar_resize() {}
|
||||||
void __collection_activated() {}
|
void __collection_activated() {}
|
||||||
void __collection_add() {}
|
void __collection_add() {}
|
||||||
void __collection_selection_changed() {}
|
void __collection_selection_changed() {}
|
||||||
|
void __collection_toggled() {}
|
||||||
#endif /* TEST_NEED_COLLECTION */
|
#endif /* TEST_NEED_COLLECTION */
|
||||||
|
|
||||||
#endif /* TESTS_GUI_H */
|
#endif /* TESTS_GUI_H */
|
||||||
|
|
|
@ -649,7 +649,9 @@
|
||||||
<object class="GtkTreeViewColumn" id="treeviewcolumn4">
|
<object class="GtkTreeViewColumn" id="treeviewcolumn4">
|
||||||
<property name="title" translatable="yes">Enabled</property>
|
<property name="title" translatable="yes">Enabled</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererToggle" id="cellrenderertoggle1"/>
|
<object class="GtkCellRendererToggle" id="cellrenderertoggle1">
|
||||||
|
<signal name="toggled" handler="__collection_toggled" swapped="no"/>
|
||||||
|
</object>
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="visible">3</attribute>
|
<attribute name="visible">3</attribute>
|
||||||
<attribute name="active">2</attribute>
|
<attribute name="active">2</attribute>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user