2005-10-29 [paul] 1.9.15cvs126
[claws.git] / src / crash.c
index ec91e910fb80637a745787b56431d42b00204366..b2012558b804c18b4529afe11bb5c9bfb3af3044 100644 (file)
@@ -14,7 +14,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -26,6 +26,7 @@
 #include "defs.h"
 
 #include <glib.h>
+#include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -48,7 +49,7 @@
 #ifdef SIGTERM
 #include "main.h"
 #endif
-#include "intl.h"
+#include "sylpheed.h"
 #include "crash.h"
 #include "utils.h"
 #include "filesel.h"
@@ -138,7 +139,7 @@ void crash_main(const char *arg)
        tokens = g_strsplit(arg, ",", 0);
 
        pid = atol(tokens[0]);
-       text = g_strdup_printf(_("Sylpheed process (%ld) received signal %ld"),
+       text = g_strdup_printf(_("Sylpheed-Claws process (%ld) received signal %ld"),
                               pid, atol(tokens[1]));
 
        output = g_string_new("");     
@@ -147,7 +148,6 @@ void crash_main(const char *arg)
        /*
         * try to get the settings
         */
-       prefs_common_init();
        prefs_common_read_config();
 
        crash_dialog_show(text, output->str);
@@ -180,10 +180,12 @@ static GtkWidget *crash_dialog_show(const gchar *text, const gchar *debug_output
        GtkWidget *button4;
        GtkWidget *button5;
        gchar     *crash_report;
+       GtkTextBuffer *buffer;
+       GtkTextIter iter;
 
        window1 = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_container_set_border_width(GTK_CONTAINER(window1), 5);
-       gtk_window_set_title(GTK_WINDOW(window1), _("Sylpheed has crashed"));
+       gtk_window_set_title(GTK_WINDOW(window1), _("Sylpheed-Claws has crashed"));
        gtk_window_set_position(GTK_WINDOW(window1), GTK_WIN_POS_CENTER);
        gtk_window_set_modal(GTK_WINDOW(window1), TRUE);
        gtk_window_set_default_size(GTK_WINDOW(window1), 460, 272);
@@ -213,15 +215,15 @@ static GtkWidget *crash_dialog_show(const gchar *text, const gchar *debug_output
        gtk_container_add(GTK_CONTAINER(frame1), scrolledwindow1);
        gtk_container_set_border_width(GTK_CONTAINER(scrolledwindow1), 3);
        gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow1),
-                                      GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
+                                      GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
 
-       text1 = gtk_text_new(NULL, NULL);
-       gtk_text_set_editable((text1), FALSE);
+       text1 = gtk_text_view_new();
+       gtk_text_view_set_editable(GTK_TEXT_VIEW(text1), FALSE);
        gtk_widget_show(text1);
        gtk_container_add(GTK_CONTAINER(scrolledwindow1), text1);
        
        crash_report = g_strdup_printf(
-               "Sylpheed version %s\nGTK+ version %d.%d.%d\nFeatures:%s\nOperating system: %s\nC Library: %s\n--\n%s",
+               "Sylpheed-Claws version %s\nGTK+ version %d.%d.%d\nFeatures:%s\nOperating system: %s\nC Library: %s\n--\n%s",
                VERSION,
                gtk_major_version, gtk_minor_version, gtk_micro_version,
                get_compiled_in_features(),
@@ -229,7 +231,9 @@ static GtkWidget *crash_dialog_show(const gchar *text, const gchar *debug_output
                get_lib_version(),
                debug_output);
 
-       gtk_text_insert((text1), NULL, NULL, NULL, crash_report, -1);
+       buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text1));
+       gtk_text_buffer_get_start_iter(buffer, &iter);
+       gtk_text_buffer_insert(buffer, &iter, crash_report, -1);
 
        hbuttonbox3 = gtk_hbutton_box_new();
        gtk_widget_show(hbuttonbox3);
@@ -307,7 +311,7 @@ static void crash_save_crash_log(GtkButton *button, const gchar *text)
  */
 static void crash_create_bug_report(GtkButton *button, const gchar *data)
 {
-       open_uri(CLAWS_BUGZILLA_URI, prefs_common.uri_cmd);
+       open_uri(BUGZILLA_URI, prefs_common.uri_cmd);
 }
 
 /*!
@@ -393,26 +397,17 @@ static void crash_debug(unsigned long crash_pid,
 static const gchar *get_compiled_in_features(void)
 {
        return g_strdup_printf("%s",
-#if HAVE_GDK_IMLIB
-                  " gdk_imlib"
-#endif
-#if HAVE_GDK_PIXBUF
-                  " gdk-pixbuf"
-#endif
 #if USE_THREADS
                   " gthread"
 #endif
 #if INET6
                   " IPv6"
 #endif
-#if HAVE_LIBCOMPFACE
-                  " libcompface"
-#endif
-#if HAVE_LIBJCONV
-                  " libjconv"
+#if HAVE_ICONV
+                  " iconv"
 #endif
-#if USE_GPGME
-                  " GPGME"
+#if HAVE_LIBCOMPFACE
+                  " compface"
 #endif
 #if USE_OPENSSL
                   " OpenSSL"
@@ -425,6 +420,12 @@ static const gchar *get_compiled_in_features(void)
 #endif
 #if USE_ASPELL
                   " GNU/aspell"
+#endif
+#if HAVE_LIBETPAN
+                  " libetpan"
+#endif
+#if USE_GNOMEPRINT
+                  " libgnomeprint"
 #endif
        "");
 }
@@ -547,7 +548,7 @@ static void crash_cleanup_exit(void)
 {
        extern gchar *get_socket_name(void);
        const char *filename = get_socket_name();
-       unlink(filename);
+       g_unlink(filename);
 }
 
 #endif