Package: peacock
Version: 1.9.1-6
Severity: normal
Tags: patch
Peacock is using GtkFileSelector in peacock-utils.c, that makes the app
look old and out of date. I already emailed you the patch but got no
response.
I'm attaching a patch
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12
Locale: LANG=es_PE.UTF-8, LC_CTYPE=es_PE.UTF-8 (charmap=UTF-8)
Versions of packages peacock depends on:
ii gtkhtml3.6 3.6.2-1 HTML rendering/editing library - b
ii libart-2.0-2 2.3.17-1 Library of functions for 2D graphi
ii libatk1.0-0 1.10.1-2 The ATK accessibility toolkit
ii libbonobo2-0 2.10.0-1 Bonobo CORBA interfaces library
ii libbonoboui2-0 2.10.0-1 The Bonobo UI library
ii libc6 2.3.5-1 GNU C Library: Shared libraries an
ii libgconf2-4 2.10.0-2 GNOME configuration database syste
ii libglade2-0 1:2.5.1-2 library to load .glade files at ru
ii libglib2.0-0 2.6.5-1 The GLib library of C routines
ii libgnome2-0 2.10.0-3 The GNOME 2 library - runtime file
ii libgnomecanvas2-0 2.10.2-2 A powerful object-oriented display
ii libgnomeprint2.2-0 2.10.3-2 The GNOME 2.2 print architecture -
ii libgnomeui-0 2.10.0-2 The GNOME 2 libraries (User Interf
ii libgnomevfs2-0 2.10.1-5 The GNOME virtual file-system libr
ii libgtk2.0-0 2.6.8-1 The GTK+ graphical user interface
ii libgtksourceview1.0-0 1.2.0-2 shared libraries for the GTK+ synt
ii libice6 6.8.2.dfsg.1-3 Inter-Client Exchange library
ii liborbit2 1:2.12.2-1 libraries for ORBit2 - a CORBA ORB
ii libpango1.0-0 1.8.1-1 Layout and rendering of internatio
ii libpopt0 1.7-5 lib for parsing cmdline parameters
ii libsm6 6.8.2.dfsg.1-3 X Window System Session Management
ii libxml2 2.6.20-1 GNOME XML library
ii xlibs 6.8.2.dfsg.1-3 X Window System client libraries m
ii zlib1g 1:1.2.2-4 compression library - runtime
peacock recommends no packages.
-- no debconf information
diff -uN peacock-1.9.1/src/peacock-file-client.c peacock-1.9.1-d/src/peacock-file-client.c
--- peacock-1.9.1/src/peacock-file-client.c 2003-09-06 15:12:28.000000000 -0500
+++ peacock-1.9.1-d/src/peacock-file-client.c 2005-07-19 15:06:49.000000000 -0500
@@ -217,7 +217,7 @@
const gchar *uri;
PeacockFileClient *fileClient;
- uri = peacock_util_get_uri (_("Open URI"));
+ uri = peacock_util_get_uri ("Open URI", GTK_FILE_CHOOSER_ACTION_OPEN);
/* If Ok is not pressed, can be Cancel or delete_event. */
if (uri == NULL)
@@ -257,8 +257,8 @@
{
PeacockFileClient *fileClient;
const gchar *uri;
-
- uri = peacock_util_get_uri (_("Save As"));
+
+ uri = peacock_util_get_uri ("Save As", GTK_FILE_CHOOSER_ACTION_SAVE);
/* In case of Cancel or other failures. */
if (!uri) return;
diff -uN peacock-1.9.1/src/peacock-utils.c peacock-1.9.1-d/src/peacock-utils.c
--- peacock-1.9.1/src/peacock-utils.c 2003-09-03 14:56:08.000000000 -0500
+++ peacock-1.9.1-d/src/peacock-utils.c 2005-07-19 15:23:25.000000000 -0500
@@ -34,28 +34,48 @@
* Show a GtkFileSelector Dialog to get filenames from local harddisk.
*
* Return Value: filename selected.
+ ***
+ * Diego Escalante Urrelo <[EMAIL PROTECTED]>
+ * 19 - July - 2005
+ * Change this function to use GtkFileChooser (the new dialog in gtk 2.4 and forth)
**/
static const gchar *
-peacock_util_get_local_uri (const gchar *title)
+peacock_util_get_local_uri (const gchar *title, GtkFileChooserAction action)
{
gchar *filename = NULL;
- GtkWidget *filesel;
+ GtkWidget *filechooser;
gint response;
+
+ switch (action) {
+ case GTK_FILE_CHOOSER_ACTION_OPEN:
+ filechooser = gtk_file_chooser_dialog_new ( title, NULL,
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_OK,
+ NULL);
+ break;
+ case GTK_FILE_CHOOSER_ACTION_SAVE:
+ filechooser = gtk_file_chooser_dialog_new (title, NULL,
+ GTK_FILE_CHOOSER_ACTION_SAVE,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_SAVE_AS, GTK_RESPONSE_OK,
+ NULL);
+ break;
+ }
+
+ gtk_widget_show (filechooser);
- filesel = gtk_file_selection_new (title);
- gtk_widget_show (filesel);
-
- response = gtk_dialog_run (GTK_DIALOG (filesel));
+ response = gtk_dialog_run (GTK_DIALOG (filechooser));
switch (response) {
case GTK_RESPONSE_OK:
- filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel));
+ filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filechooser));
break;
default:
filename = NULL;
}
- gtk_widget_destroy (filesel);
+ gtk_widget_destroy (filechooser);
return filename;
}
@@ -71,9 +91,9 @@
* Return Value: filename selected.
**/
const gchar *
-peacock_util_get_uri (const gchar *title)
+peacock_util_get_uri (const gchar *title, GtkFileChooserAction action)
{
- return peacock_util_get_local_uri (title);
+ return peacock_util_get_local_uri (title, action);
}
/**
diff -uN peacock-1.9.1/src/peacock-utils.h peacock-1.9.1-d/src/peacock-utils.h
--- peacock-1.9.1/src/peacock-utils.h 2003-09-03 14:56:25.000000000 -0500
+++ peacock-1.9.1-d/src/peacock-utils.h 2005-07-19 15:07:56.000000000 -0500
@@ -30,7 +30,7 @@
#include <glade/glade-xml.h>
#include <bonobo/bonobo-widget.h>
-const gchar * peacock_util_get_uri (const gchar *title);
+const gchar * peacock_util_get_uri (const gchar *title, GtkFileChooserAction action);
void peacock_util_show_ui_error (const gchar *err_msg);