nautilus r14683 - in trunk: . src test
- From: alexl svn gnome org
- To: svn-commits-list gnome org
- Subject: nautilus r14683 - in trunk: . src test
- Date: Mon, 6 Oct 2008 09:40:38 +0000 (UTC)
Author: alexl
Date: Mon Oct 6 09:40:38 2008
New Revision: 14683
URL: http://svn.gnome.org/viewvc/nautilus?rev=14683&view=rev
Log:
2008-10-06 Cosimo Cecchi <cosimoc gnome org>
* src/nautilus-window-menus.c:
(action_nautilus_manual_callback):
Use gtk_show_uri instead of gnome_help
* src/nautilus-file-management-properties-main.c:
* src/nautilus-connect-server-dialog-main.c:
* src/nautilus-autorun-software.c:
* test/test-nautilus-mime-actions-set.c:
* test/test-nautilus-mime-actions.c:
Use GOption instead of GnomeProgram
* src/nautilus-property-browser.c:
Use GtkColorButton instead of GnomeColorPicker
Use gtk_show_uri instead of gnome_help
Modified:
trunk/ChangeLog
trunk/src/nautilus-autorun-software.c
trunk/src/nautilus-connect-server-dialog-main.c
trunk/src/nautilus-file-management-properties-main.c
trunk/src/nautilus-property-browser.c
trunk/src/nautilus-window-menus.c
trunk/test/test-nautilus-mime-actions-set.c
trunk/test/test-nautilus-mime-actions.c
Modified: trunk/src/nautilus-autorun-software.c
==============================================================================
--- trunk/src/nautilus-autorun-software.c (original)
+++ trunk/src/nautilus-autorun-software.c Mon Oct 6 09:40:38 2008
@@ -28,13 +28,12 @@
#include <unistd.h>
#include <string.h>
#include <time.h>
+#include <errno.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glib/gi18n.h>
-#include <libgnome/gnome-program.h>
-#include <libgnomeui/gnome-ui-init.h>
#include <libnautilus-private/nautilus-module.h>
#include <libnautilus-private/nautilus-icon-info.h>
@@ -253,9 +252,7 @@
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
- gnome_program_init ("nautilus-autorun-software", VERSION,
- LIBGNOMEUI_MODULE, argc, argv,
- NULL, NULL);
+ gtk_init (&argc, &argv);
if (argc != 2) {
goto out;
Modified: trunk/src/nautilus-connect-server-dialog-main.c
==============================================================================
--- trunk/src/nautilus-connect-server-dialog-main.c (original)
+++ trunk/src/nautilus-connect-server-dialog-main.c Mon Oct 6 09:40:38 2008
@@ -31,9 +31,7 @@
#include <gtk/gtk.h>
#include <gdk/gdk.h>
-#include <libgnome/gnome-program.h>
-#include <libgnomeui/gnome-ui-init.h>
-#include <libgnomeui/gnome-authentication-manager.h>
+#include <stdlib.h>
#include <eel/eel-preferences.h>
#include <eel/eel-stock-dialogs.h>
@@ -163,11 +161,11 @@
int
main (int argc, char *argv[])
{
- GnomeProgram *program;
GtkWidget *dialog;
GOptionContext *context;
const char **args;
GFile *location;
+ GError *error;
const GOptionEntry options[] = {
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &args, NULL, N_("[URI]") },
{ NULL }
@@ -178,19 +176,23 @@
textdomain (GETTEXT_PACKAGE);
args = NULL;
- /* Translators: This is the --help description gor the connect to server app,
+ 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_add_main_entries (context, options, GETTEXT_PACKAGE);
- g_option_context_set_translation_domain(context, GETTEXT_PACKAGE);
+ g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, gtk_get_option_group (TRUE));
- program = gnome_program_init ("nautilus-connect-server", VERSION,
- LIBGNOMEUI_MODULE, argc, argv,
- GNOME_PARAM_GOPTION_CONTEXT, context,
- NULL);
+ 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);
+ }
- gnome_authentication_manager_init ();
+ g_option_context_free (context);
eel_preferences_init ("/apps/nautilus");
Modified: trunk/src/nautilus-file-management-properties-main.c
==============================================================================
--- trunk/src/nautilus-file-management-properties-main.c (original)
+++ trunk/src/nautilus-file-management-properties-main.c Mon Oct 6 09:40:38 2008
@@ -25,13 +25,10 @@
#include <config.h>
#include <gtk/gtk.h>
+#include <glib/gi18n.h>
-#include <libgnome/gnome-program.h>
-#include <libgnomeui/gnome-ui-init.h>
#include <libnautilus-private/nautilus-module.h>
-#include <libintl.h>
-
#include <eel/eel-preferences.h>
#include "nautilus-file-management-properties.h"
@@ -52,9 +49,7 @@
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
- gnome_program_init ("file-managment-properties", VERSION,
- LIBGNOMEUI_MODULE, argc, argv,
- NULL, NULL);
+ gtk_init (&argc, &argv);
eel_preferences_init ("/apps/nautilus");
Modified: trunk/src/nautilus-property-browser.c
==============================================================================
--- trunk/src/nautilus-property-browser.c (original)
+++ trunk/src/nautilus-property-browser.c Mon Oct 6 09:40:38 2008
@@ -50,13 +50,8 @@
#include <glib/gi18n.h>
#include <glib/gstdio.h>
#include <gio/gio.h>
-#include <libgnome/gnome-util.h>
-#include <libgnome/gnome-help.h>
#include <libgnomeui/gnome-color-picker.h>
#include <libgnomeui/gnome-icon-entry.h>
-#include <libgnomeui/gnome-help.h>
-#include <libgnomeui/gnome-stock-icons.h>
-#include <libgnomeui/gnome-uidefs.h>
#include <libnautilus-private/nautilus-customization-data.h>
#include <libnautilus-private/nautilus-directory.h>
#include <libnautilus-private/nautilus-emblem-utils.h>
@@ -791,11 +786,11 @@
color_square = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, COLOR_SQUARE_SIZE, COLOR_SQUARE_SIZE);
- eel_gdk_color_parse (color_spec, &color);
+ gdk_color_parse (color_spec, &color);
color.red >>= 8;
color.green >>= 8;
color.blue >>= 8;
-
+
pixels = gdk_pixbuf_get_pixels (color_square);
stride = gdk_pixbuf_get_rowstride (color_square);
@@ -1121,9 +1116,8 @@
widget = gtk_label_new_with_mnemonic(_("Color _value:"));
gtk_widget_show(widget);
gtk_table_attach(GTK_TABLE(table), widget, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0);
-
- /* set up a gnome file entry to pick the image file */
- property_browser->details->color_picker = gnome_color_picker_new ();
+
+ property_browser->details->color_picker = gtk_color_button_new ();
gtk_widget_show (property_browser->details->color_picker);
gtk_label_set_mnemonic_widget (GTK_LABEL (widget), property_browser->details->color_picker);
@@ -1284,20 +1278,17 @@
static void
add_color_to_browser (GtkWidget *widget, gint which_button, gpointer *data)
{
- char color_spec[8];
+ char * color_spec;
const char *color_name;
char *stripped_color_name;
- gdouble color[4];
NautilusPropertyBrowser *property_browser = NAUTILUS_PROPERTY_BROWSER (data);
if (which_button == GTK_RESPONSE_OK) {
- gnome_color_picker_get_d (GNOME_COLOR_PICKER (property_browser->details->color_picker), &color[0], &color[1], &color[2], &color[3]);
- g_snprintf (color_spec, sizeof (color_spec),
- "#%02X%02X%02X",
- (guint) (color[0] * 255.0 + 0.5),
- (guint) (color[1] * 255.0 + 0.5),
- (guint) (color[2] * 255.0 + 0.5));
+ GdkColor color;
+
+ gtk_color_button_get_color (GTK_COLOR_BUTTON (property_browser->details->color_picker), &color);
+ color_spec = gdk_color_to_string (&color);
color_name = gtk_entry_get_text (GTK_ENTRY (property_browser->details->color_name));
stripped_color_name = g_strstrip (g_strdup (color_name));
@@ -1311,6 +1302,7 @@
nautilus_property_browser_update_contents(property_browser);
}
g_free (stripped_color_name);
+ g_free (color_spec);
}
gtk_widget_destroy(property_browser->details->colors_dialog);
@@ -1331,17 +1323,16 @@
property_browser->details->colors_dialog = nautilus_color_selection_dialog_new (property_browser);
/* set the color to the one picked by the selector */
- gnome_color_picker_set_i16 (GNOME_COLOR_PICKER (property_browser->details->color_picker), color.red, color.green, color.blue, 1.0);
-
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (property_browser->details->color_picker), &color);
+
/* connect the signals to the new dialog */
-
+
eel_add_weak_pointer (&property_browser->details->colors_dialog);
g_signal_connect_object (property_browser->details->colors_dialog, "response",
G_CALLBACK (add_color_to_browser), property_browser, 0);
gtk_window_set_position (GTK_WINDOW (property_browser->details->colors_dialog), GTK_WIN_POS_MOUSE);
gtk_widget_show (GTK_WIDGET(property_browser->details->colors_dialog));
-
}
@@ -1515,9 +1506,9 @@
GError *error = NULL;
GtkWidget *dialog;
- gnome_help_display_desktop_on_screen (
- NULL, "user-guide", "user-guide.xml", "gosnautilus-50",
- gtk_window_get_screen (GTK_WINDOW (property_browser)), &error);
+ gtk_show_uri (gtk_widget_get_screen (property_browser),
+ "ghelp:user-guide#gosnautilus-50",
+ gtk_get_current_event_time (), &error);
if (error) {
dialog = gtk_message_dialog_new (GTK_WINDOW (property_browser),
Modified: trunk/src/nautilus-window-menus.c
==============================================================================
--- trunk/src/nautilus-window-menus.c (original)
+++ trunk/src/nautilus-window-menus.c Mon Oct 6 09:40:38 2008
@@ -43,7 +43,6 @@
#include <gio/gio.h>
#include <glib/gi18n.h>
#include <eel/eel-preferences.h>
-#include <libgnomeui/gnome-help.h>
#include <libnautilus-extension/nautilus-menu-provider.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-global-preferences.h>
@@ -606,9 +605,9 @@
gtk_window_get_screen (GTK_WINDOW (window)),
"gnome-help", &error);
} else {
- gnome_help_display_desktop_on_screen (
- NULL, "user-guide", "user-guide.xml", "gosnautilus-1",
- gtk_window_get_screen (GTK_WINDOW (window)), &error);
+ gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (window)),
+ "ghelp:user-guide#gosnautilus-1",
+ gtk_get_current_event_time (), &error);
}
if (error) {
Modified: trunk/test/test-nautilus-mime-actions-set.c
==============================================================================
--- trunk/test/test-nautilus-mime-actions-set.c (original)
+++ trunk/test/test-nautilus-mime-actions-set.c Mon Oct 6 09:40:38 2008
@@ -24,7 +24,7 @@
#include <config.h>
-#include <gnome.h>
+#include <gtk/gtk.h>
#include <libnautilus-private/nautilus-mime-actions.h>
#include <stdio.h>
@@ -107,9 +107,8 @@
const char *value;
NautilusFile *file;
NautilusFileAttributes attributes;
-
- gnome_program_init ("test-nautilus-mime-actions-set", "0.0",
- LIBGNOMEUI_MODULE, argc, argv, NULL);
+
+ gtk_init (&argc, &argv);
if (argc < 3) {
usage (argv[0]);
Modified: trunk/test/test-nautilus-mime-actions.c
==============================================================================
--- trunk/test/test-nautilus-mime-actions.c (original)
+++ trunk/test/test-nautilus-mime-actions.c Mon Oct 6 09:40:38 2008
@@ -24,7 +24,7 @@
#include <config.h>
-#include <gnome.h>
+#include <gtk/gtk.h>
#include <libnautilus-private/nautilus-mime-actions.h>
#include <stdio.h>
@@ -103,8 +103,7 @@
NautilusFile *file;
NautilusFileAttributes attributes;
- gnome_program_init ("test-nautilus-mime-actions", "0.0",
- LIBGNOMEUI_MODULE, argc, argv, NULL);
+ gtk_init (&argc, &argv);
if (argc != 2) {
fprintf (stderr, "Usage: %s uri\n", *argv);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]