vinagre r145 - in trunk: . src



Author: jwendell
Date: Thu Jan 24 18:26:45 2008
New Revision: 145
URL: http://svn.gnome.org/viewvc/vinagre?rev=145&view=rev

Log:
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.


Modified:
   trunk/ChangeLog
   trunk/INSTALL
   trunk/configure.ac
   trunk/src/vinagre-commands.c
   trunk/src/vinagre-connection.c
   trunk/src/vinagre-main.c

Modified: trunk/INSTALL
==============================================================================
--- trunk/INSTALL	(original)
+++ trunk/INSTALL	Thu Jan 24 18:26:45 2008
@@ -3,12 +3,12 @@
 
 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:
 

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Thu Jan 24 18:26:45 2008
@@ -33,19 +33,19 @@
 # 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 @@
 #*******************************************************************************
 
 echo "
+
+This is vinagre version AC_PACKAGE_VERSION
+
 Configure summary:
 
 	Compiler ...................:  ${CC} 

Modified: trunk/src/vinagre-commands.c
==============================================================================
--- trunk/src/vinagre-commands.c	(original)
+++ trunk/src/vinagre-commands.c	Thu Jan 24 18:26:45 2008
@@ -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 @@
 
 /* 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 @@
 				     _(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),

Modified: trunk/src/vinagre-connection.c
==============================================================================
--- trunk/src/vinagre-connection.c	(original)
+++ trunk/src/vinagre-connection.c	Thu Jan 24 18:26:45 2008
@@ -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 @@
   VinagreConnection *conn = NULL;
   gchar             *host = NULL;
   gint               port;
-  GnomeVFSResult     result;
   int                file_size;
   char              *data = NULL;
+  GFile             *file_a;
 
-  result = gnome_vfs_read_entire_file (uri, &file_size, &data);
-  if (result != GNOME_VFS_OK)
+  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 @@
     g_free (data);
 
   g_key_file_free (file);
+  g_object_unref (file_a);
   *error_msg = NULL;
 
   return conn;

Modified: trunk/src/vinagre-main.c
==============================================================================
--- trunk/src/vinagre-main.c	(original)
+++ trunk/src/vinagre-main.c	Thu Jan 24 18:26:45 2008
@@ -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 @@
   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 @@
   gtk_main ();
 
   vinagre_prefs_manager_shutdown ();
-  gnome_vfs_shutdown ();
 
   return 0;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]