Example #1
0
static void
action_connect_to_server_callback (GtkAction *action,
                                   gpointer user_data)
{
    CajaWindow *window = CAJA_WINDOW (user_data);
    GtkWidget *dialog;

    dialog = caja_connect_server_dialog_new (window);

    gtk_widget_show (dialog);
}
int
main (int argc, char *argv[])
{
    GtkWidget *dialog;
    GOptionContext *context;
    GError *error;

    bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
    textdomain (GETTEXT_PACKAGE);

    error = NULL;
    /* Translators: This is the --help description for the connect to server app,
       the initial newlines are between the command line arg and the description */
    context = g_option_context_new (N_("\n\nAdd connect to server mount"));
    g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
    g_option_context_add_group (context, gtk_get_option_group (TRUE));

    if (!g_option_context_parse (context, &argc, &argv, &error))
    {
        g_critical ("Failed to parse arguments: %s", error->message);
        g_error_free (error);
        g_option_context_free (context);
        exit (1);
    }

    g_option_context_free (context);

    caja_global_preferences_init ();

    gtk_window_set_default_icon_name (CAJA_ICON_FOLDER);

    dialog = caja_connect_server_dialog_new (NULL);

    g_signal_connect (dialog, "destroy",
                      G_CALLBACK (main_dialog_destroyed), NULL);

    gtk_widget_show (dialog);

    gtk_main ();

    return 0;
}
Example #3
0
static void
action_connect_to_server_callback (GtkAction *action,
                                   gpointer user_data)
{
    CajaWindow *window = CAJA_WINDOW (user_data);
    CajaWindowSlot *slot;
    GtkWidget *dialog;
    GFile *location;

    slot = caja_window_get_active_slot (window);
    location = caja_window_slot_get_location (slot);
    dialog = caja_connect_server_dialog_new (window, location);
    if (location)
    {
        g_object_unref (location);
    }

    gtk_widget_show (dialog);
}