Ejemplo n.º 1
0
void ui_load()
{
    builder = gtk_builder_new();

    GError* error = NULL;

    // GLADE_FILE is set in src/Makefile.am
    const char* filename = GLADE_FILE;

#ifdef DEBUG
    /* try to load ui in current dir first */
    char* local_file = "pasystray.glade";
    if(g_file_test(local_file, G_FILE_TEST_EXISTS))
        filename = local_file;
    local_file = "src/pasystray.glade";
    if(g_file_test(local_file, G_FILE_TEST_EXISTS))
        filename = local_file;

    g_message("using UI file: %s", filename);
#endif

    guint ret = gtk_builder_add_from_file(builder, filename, &error);

    if(!ret)
    {
        g_error("[ui] %s", error->message);
        g_error_free(error);
        return;
    }

    gtk_about_dialog_set_version(ui_aboutdialog(), PACKAGE_VERSION);
    gtk_about_dialog_set_website(ui_aboutdialog(), PACKAGE_URL);
    gtk_about_dialog_set_website_label(ui_aboutdialog(), PACKAGE_URL);
}
Ejemplo n.º 2
0
void systray_about_dialog()
{
    GtkAboutDialog* dialog = ui_aboutdialog();
    g_signal_connect_swapped(dialog, "response", G_CALLBACK(gtk_widget_hide), dialog);
    gtk_widget_show_all(GTK_WIDGET(dialog));
}