*
* 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
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
*/
#ifdef HAVE_CONFIG_H
# include <gnu/libc-version.h>
#endif
-#ifdef SIGTERM
#include "main.h"
-#endif
-#include "sylpheed.h"
+#include "claws.h"
#include "crash.h"
#include "utils.h"
#include "filesel.h"
#include "prefs_common.h"
/*
- * NOTE: the crash dialog is called when sylpheed is not
+ * NOTE: the crash dialog is called when claws is not
* initialized, so do not assume settings are available.
* for example, loading / creating pixmaps seems not
* to be possible.
/***/
-static const gchar *DEBUG_SCRIPT = "bt\nkill\nq";
+static const gchar *DEBUG_SCRIPT = "thread all apply\nbt full\nkill\nq";
/***/
GtkTextBuffer *buffer;
GtkTextIter iter;
- window1 = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ window1 = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "crash");
gtk_container_set_border_width(GTK_CONTAINER(window1), 5);
gtk_window_set_title(GTK_WINDOW(window1), _("Claws Mail has crashed"));
gtk_window_set_position(GTK_WINDOW(window1), GTK_WIN_POS_CENTER);
button3 = gtk_button_new_with_label(_("Close"));
gtk_widget_show(button3);
gtk_container_add(GTK_CONTAINER(hbuttonbox4), button3);
- GTK_WIDGET_SET_FLAGS(button3, GTK_CAN_DEFAULT);
+ gtkut_widget_set_can_default(button3, TRUE);
button4 = gtk_button_new_with_label(_("Save..."));
gtk_widget_show(button4);
gtk_container_add(GTK_CONTAINER(hbuttonbox4), button4);
- GTK_WIDGET_SET_FLAGS(button4, GTK_CAN_DEFAULT);
+ gtkut_widget_set_can_default(button4, TRUE);
button5 = gtk_button_new_with_label(_("Create bug report"));
gtk_widget_show(button5);
gtk_container_add(GTK_CONTAINER(hbuttonbox4), button5);
- GTK_WIDGET_SET_FLAGS(button5, GTK_CAN_DEFAULT);
+ gtkut_widget_set_can_default(button5, TRUE);
g_signal_connect(G_OBJECT(window1), "delete_event",
G_CALLBACK(gtk_main_quit), NULL);
/*!
- *\brief create debugger script file in sylpheed directory.
+ *\brief create debugger script file in claws directory.
* all the other options (creating temp files) looked too
* convoluted.
*/
time_t timer;
struct tm *lt;
char buf[100];
+ struct tm buft;
gchar *filename;
timer = time(NULL);
- lt = localtime(&timer);
+ lt = localtime_r(&timer, &buft);
strftime(buf, sizeof buf, "claws-crash-log-%Y-%m-%d-%H-%M-%S.txt", lt);
if (NULL != (filename = filesel_select_file_save(_("Save crash information"), buf))
&& *filename)
*/
static void crash_create_bug_report(GtkButton *button, const gchar *data)
{
- open_uri(BUGZILLA_URI, prefs_common.uri_cmd);
+ open_uri(BUGZILLA_URI, prefs_common_get_uri_cmd());
}
/*!
- *\brief launches debugger and attaches it to crashed sylpheed
+ *\brief launches debugger and attaches it to crashed claws
*/
static void crash_debug(unsigned long crash_pid,
gchar *exe_image,
setuid(getuid());
/*
- * setup debugger to attach to crashed sylpheed
+ * setup debugger to attach to crashed claws
*/
*argptr++ = "gdb";
*argptr++ = "--nw";
dup(choutput[1]);
close(choutput[0]);
if (-1 == execvp("gdb", argp))
- puts("error execvp\n");
+ g_print("error execvp\n");
} else {
char buf[100];
int r;
* make it non blocking
*/
if (-1 == fcntl(choutput[0], F_SETFL, O_NONBLOCK))
- puts("set to non blocking failed\n");
+ g_print("set to non blocking failed\n");
/*
* get the output
#if HAVE_LIBCOMPFACE
" compface"
#endif
-#if USE_OPENSSL
- " OpenSSL"
+#if USE_GNUTLS
+ " GnuTLS"
#endif
#if USE_LDAP
" LDAP"
#if USE_JPILOT
" JPilot"
#endif
-#if USE_ASPELL
+#if USE_ENCHANT
" GNU/aspell"
#endif
#if HAVE_LIBETPAN
" libetpan"
#endif
-#if USE_GNOMEPRINT
- " libgnomeprint"
-#endif
#if HAVE_LIBSM
" libSM"
#endif
args[3] = buf;
args[4] = NULL;
- chdir(sylpheed_get_startup_dir());
+ chdir(claws_get_startup_dir());
setgid(getgid());
setuid(getuid());
execvp(argv0, args);
*/
static void crash_cleanup_exit(void)
{
- extern gchar *get_socket_name(void);
- const char *filename = get_socket_name();
- g_unlink(filename);
+ const char *filename = claws_get_socket_name();
+ claws_unlink(filename);
}
#endif