| 570 if(ngroups > 0) { |
570 if(ngroups > 0) { |
| 571 uic_add_state_widget_i(ctx, widget, (ui_enablefunc)ui_set_visible, states, ngroups); |
571 uic_add_state_widget_i(ctx, widget, (ui_enablefunc)ui_set_visible, states, ngroups); |
| 572 ui_set_visible(widget, FALSE); |
572 ui_set_visible(widget, FALSE); |
| 573 } |
573 } |
| 574 } |
574 } |
| |
575 |
| |
576 void ui_open_uri(const char *uri) { |
| |
577 #if GTK_CHECK_VERSION(4, 0, 0) |
| |
578 GtkUriLauncher *launcher = gtk_uri_launcher_new(uri); |
| |
579 gtk_uri_launcher_launch(launcher, NULL, NULL, NULL, NULL); |
| |
580 g_object_unref(launcher); |
| |
581 #elif GTK_CHECK_VERSION(3, 22, 0) |
| |
582 GError *error = NULL; |
| |
583 gtk_show_uri_on_window(NULL, uri, GDK_CURRENT_TIME, &error); |
| |
584 #elif |
| |
585 // TODO: call xdg-open |
| |
586 #endif |
| |
587 } |