Commit 29784a35 authored by Jonh Wendell's avatar Jonh Wendell Committed by Jonh Wendell S. Santana
Browse files

configure.ac, src/vinagre-main.c, src/vinagre-connection.c Use gio instead

2008-01-24  Jonh Wendell <jwendell@gnome.org>

	* configure.ac,
	* src/vinagre-main.c,
	* src/vinagre-connection.c
	* src/vinagre-commands.c: Use gio instead of gnome-vfs.

svn path=/trunk/; revision=145
parent ce1c705d
2008-01-24 Jonh Wendell <jwendell@gnome.org>
* configure.ac,
* src/vinagre-main.c,
* src/vinagre-connection.c
* src/vinagre-commands.c: Use gio instead of gnome-vfs.
2008-01-20 Jonh Wendell <jwendell@gnome.org>
* src/vnagre-tab.c (open_vnc): Don't use new symbol from gtk-vnc trunk.
......
......@@ -3,12 +3,12 @@ Vinagre Installation Instructions
You'll need the devel packages of the following libraries:
- gtk+-2.0 >= 2.11
- gtk+ >= 2.12
- glib >= 2.15.3
- libglade-2.0
- gconf-2.0
- gnome-vfs
- gnome-keyring
- gtk-vnc widget >= 0.3 (http://gtk-vnc.sf.net)
- gtk-vnc widget >= 0.3.2 (http://gtk-vnc.sf.net)
To compile it, just do:
......
......@@ -33,19 +33,19 @@ GNOME_DOC_INIT
# Check required GNOME libraries
#*******************************************************************************
GLIB_REQUIRED=2.11.0
GTK_REQUIRED=2.11.0
GLIB_REQUIRED=2.15.3
GTK_REQUIRED=2.12.0
LIBGLADE_REQUIRED=2.6.0
GCONF_REQUIRED=2.16.0
GTK_VNC_REQUIRED=0.3
PKG_CHECK_MODULES(VINAGRE, \
glib-2.0 >= $GLIB_REQUIRED \
gio-2.0 >= $GLIB_REQUIRED \
gtk+-2.0 >= $GTK_REQUIRED \
libglade-2.0 >= $LIBGLADE_REQUIRED \
gconf-2.0 >= $GCONF_REQUIRED \
gnome-keyring-1 \
gnome-vfs-2.0 \
gtk-vnc-1.0 >= $GTK_VNC_REQUIRED)
AC_SUBST(VINAGRE_CFLAGS)
AC_SUBST(VINAGRE_LIBS)
......@@ -92,6 +92,9 @@ src/Makefile
#*******************************************************************************
echo "
This is vinagre version AC_PACKAGE_VERSION
Configure summary:
Compiler ...................: ${CC}
......
......@@ -2,7 +2,7 @@
* vinagre-commands.c
* This file is part of vinagre
*
* Copyright (C) 2007 - Jonh Wendell <wendell@bani.com.br>
* Copyright (C) 2007,2008 - Jonh Wendell <wendell@bani.com.br>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -25,7 +25,6 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <libgnomevfs/gnome-vfs.h>
#include <string.h>
#include "vinagre-commands.h"
......@@ -290,19 +289,32 @@ vinagre_cmd_bookmarks_del (GtkAction *action,
/* Make url in about dialog clickable */
static void
vinagre_about_dialog_handle_url (GtkAboutDialog *about, const char *link, gpointer data)
vinagre_about_dialog_handle_url (GtkAboutDialog *about,
const char *link,
gpointer data)
{
gnome_vfs_url_show (link);
}
GError *error = NULL;
gchar *address, *command;
/* Make email in about dialog clickable */
static void
vinagre_about_dialog_handle_email (GtkAboutDialog *about, const char *link, gpointer data)
{
char *address;
VinagreWindow *window = VINAGRE_WINDOW (data);
if (g_strstr_len (link, strlen (link), "@"))
address = g_strdup_printf ("mailto:%s", link);
else
address = g_strdup (link);
command = g_strconcat ("gnome-open ", address, NULL);
gdk_spawn_command_line_on_screen (gtk_window_get_screen (GTK_WINDOW (window)),
command,
&error);
if (error != NULL)
{
vinagre_utils_show_error (error->message, GTK_WINDOW (window));
g_error_free (error);
}
address = g_strdup_printf ("mailto:%s", link);
gnome_vfs_url_show (address);
g_free (command);
g_free (address);
}
......@@ -389,8 +401,8 @@ vinagre_cmd_help_about (GtkAction *action,
_(license[2]), NULL);
/* Make URLs and email clickable in about dialog */
gtk_about_dialog_set_url_hook (vinagre_about_dialog_handle_url, NULL, NULL);
gtk_about_dialog_set_email_hook (vinagre_about_dialog_handle_email, NULL, NULL);
gtk_about_dialog_set_url_hook (vinagre_about_dialog_handle_url, window, NULL);
gtk_about_dialog_set_email_hook (vinagre_about_dialog_handle_url, window, NULL);
gtk_show_about_dialog (GTK_WINDOW (window),
......
......@@ -2,7 +2,7 @@
* vinagre-connection.c
* This file is part of vinagre
*
* Copyright (C) 2007 - Jonh Wendell <wendell@bani.com.br>
* Copyright (C) 2007,2008 - Jonh Wendell <wendell@bani.com.br>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -20,7 +20,7 @@
#include <stdlib.h>
#include <glib/gi18n.h>
#include <libgnomevfs/gnome-vfs.h>
#include <gio/gio.h>
#include "vinagre-connection.h"
#include "vinagre-bookmarks.h"
......@@ -176,18 +176,29 @@ vinagre_connection_new_from_file (const gchar *uri, gchar **error_msg)
VinagreConnection *conn = NULL;
gchar *host = NULL;
gint port;
GnomeVFSResult result;
int file_size;
char *data = NULL;
result = gnome_vfs_read_entire_file (uri, &file_size, &data);
if (result != GNOME_VFS_OK)
GFile *file_a;
file_a = g_file_new_for_commandline_arg (uri);
loaded = g_file_load_contents (file_a,
NULL,
&data,
&file_size,
NULL,
&error);
if (!loaded)
{
*error_msg = g_strdup (gnome_vfs_result_to_string (result));
if (error)
{
*error_msg = g_strdup (error->message);
g_error_free (error);
}
if (data)
g_free (data);
g_object_unref (file_a);
return NULL;
}
......@@ -226,6 +237,7 @@ vinagre_connection_new_from_file (const gchar *uri, gchar **error_msg)
g_free (data);
g_key_file_free (file);
g_object_unref (file_a);
*error_msg = NULL;
return conn;
......
......@@ -2,7 +2,7 @@
* vinagre-main.c
* This file is part of vinagre
*
* Copyright (C) 2007 - Jonh Wendell <wendell@bani.com.br>
* Copyright (C) 2007,2008 - Jonh Wendell <wendell@bani.com.br>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -22,7 +22,6 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <glib/goption.h>
#include <libgnomevfs/gnome-vfs.h>
#include <config.h>
#include "vinagre-prefs-manager.h"
......@@ -122,9 +121,6 @@ int main (int argc, char **argv) {
if (!g_thread_supported ())
g_thread_init (NULL);
if (!gnome_vfs_init ())
g_error (_("Could not initialize GnomeVFS\n"));
vinagre_prefs_manager_init ();
main_window = vinagre_window_new ();
......@@ -143,7 +139,6 @@ int main (int argc, char **argv) {
gtk_main ();
vinagre_prefs_manager_shutdown ();
gnome_vfs_shutdown ();
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment