55
66struct _ExmExtensionRow
77{
8- AdwExpanderRow parent_instance ;
8+ AdwActionRow parent_instance ;
99
1010 GSimpleActionGroup * action_group ;
1111
1212 ExmExtension * extension ;
1313 gchar * uuid ;
1414
15- GtkButton * remove_btn ;
15+ // GtkButton *remove_btn;
1616 GtkButton * prefs_btn ;
17- GtkButton * details_btn ;
17+ // GtkButton *details_btn;
1818 GtkSwitch * ext_toggle ;
1919
20- GtkLabel * description_label ;
21- GtkLabel * version_label ;
22- GtkLabel * error_label ;
23- GtkLabel * error_label_tag ;
20+ // GtkLabel *description_label;
21+ // GtkLabel *version_label;
22+ // GtkLabel *error_label;
23+ // GtkLabel *error_label_tag;
2424
2525 GtkImage * update_icon ;
2626 GtkImage * error_icon ;
@@ -29,7 +29,7 @@ struct _ExmExtensionRow
2929 guint signal_handler ;
3030};
3131
32- G_DEFINE_FINAL_TYPE (ExmExtensionRow , exm_extension_row , ADW_TYPE_EXPANDER_ROW )
32+ G_DEFINE_FINAL_TYPE (ExmExtensionRow , exm_extension_row , ADW_TYPE_ACTION_ROW )
3333
3434enum {
3535 PROP_0 ,
@@ -176,13 +176,13 @@ update_state (ExmExtension *extension,
176176 g_simple_action_set_state (G_SIMPLE_ACTION (action ), g_variant_new_boolean (is_enabled ));
177177}
178178
179- static void
179+ /* static void
180180set_error_label_visible (ExmExtensionRow *self,
181181 gboolean visible)
182182{
183183 gtk_widget_set_visible (GTK_WIDGET (self->error_label), visible);
184184 gtk_widget_set_visible (GTK_WIDGET (self->error_label_tag), visible);
185- }
185+ }*/
186186
187187static void
188188unbind_extension (ExmExtensionRow * self )
@@ -234,21 +234,23 @@ bind_extension (ExmExtensionRow *self,
234234
235235 g_object_set (self , "title" , g_markup_escape_text (name , -1 ), "subtitle" , uuid , NULL );
236236 g_object_set (self -> prefs_btn , "visible" , has_prefs , NULL );
237- g_object_set (self -> remove_btn , "visible" , is_user , NULL );
237+ // g_object_set (self->remove_btn, "visible", is_user, NULL);
238238 g_object_set (self -> update_icon , "visible" , has_update , NULL );
239- g_object_set (self -> version_label , "label" , version , NULL );
239+ // g_object_set (self->version_label, "label", version, NULL);
240+ // TODO: Re-add version
240241
241242 // Trim description label's leading and trailing whitespace
242- char * description_trimmed = g_strchomp (g_strstrip (description ));
243+ /* char *description_trimmed = g_strchomp (g_strstrip (description));
243244 g_object_set (self->description_label, "label", description_trimmed, NULL);
244- g_free (description_trimmed );
245+ g_free (description_trimmed);*/
245246
246247 // Only show if error_msg exists and is not empty
247- g_object_set (self -> error_label , "label" , error_msg , NULL );
248+ /* g_object_set (self->error_label, "label", error_msg, NULL);
248249 gboolean has_error = (error_msg != NULL) && (strlen(error_msg) != 0);
249- set_error_label_visible (self , has_error );
250+ set_error_label_visible (self, has_error);*/
250251
251- gtk_actionable_set_action_target (GTK_ACTIONABLE (self -> details_btn ), "s" , uuid );
252+ gtk_actionable_set_action_name (GTK_ACTIONABLE (self ), "win.show-detail" );
253+ gtk_actionable_set_action_target (GTK_ACTIONABLE (self ), "s" , uuid );
252254
253255 // One way binding from extension ("source of truth") to switch
254256 self -> signal_handler = g_signal_connect (self -> extension ,
@@ -293,14 +295,14 @@ exm_extension_row_class_init (ExmExtensionRowClass *klass)
293295
294296 gtk_widget_class_set_template_from_resource (widget_class , "/com/mattjakeman/ExtensionManager/exm-extension-row.ui" );
295297
296- gtk_widget_class_bind_template_child (widget_class , ExmExtensionRow , description_label );
297- gtk_widget_class_bind_template_child (widget_class , ExmExtensionRow , error_label );
298- gtk_widget_class_bind_template_child (widget_class , ExmExtensionRow , error_label_tag );
299- gtk_widget_class_bind_template_child (widget_class , ExmExtensionRow , version_label );
298+ // gtk_widget_class_bind_template_child (widget_class, ExmExtensionRow, description_label);
299+ // gtk_widget_class_bind_template_child (widget_class, ExmExtensionRow, error_label);
300+ // gtk_widget_class_bind_template_child (widget_class, ExmExtensionRow, error_label_tag);
301+ // gtk_widget_class_bind_template_child (widget_class, ExmExtensionRow, version_label);
300302
301303 gtk_widget_class_bind_template_child (widget_class , ExmExtensionRow , prefs_btn );
302- gtk_widget_class_bind_template_child (widget_class , ExmExtensionRow , remove_btn );
303- gtk_widget_class_bind_template_child (widget_class , ExmExtensionRow , details_btn );
304+ // gtk_widget_class_bind_template_child (widget_class, ExmExtensionRow, remove_btn);
305+ // gtk_widget_class_bind_template_child (widget_class, ExmExtensionRow, details_btn);
304306 gtk_widget_class_bind_template_child (widget_class , ExmExtensionRow , ext_toggle );
305307 gtk_widget_class_bind_template_child (widget_class , ExmExtensionRow , update_icon );
306308 gtk_widget_class_bind_template_child (widget_class , ExmExtensionRow , error_icon );
0 commit comments