* src/compose.[ch]
add compose_draft() * src/crash.c add SIGTERM handler * src/main.[ch] add clean_quit() for the SIGTERM handler
This commit is contained in:
parent
7b67facdc3
commit
8e9458ad22
|
@ -1,3 +1,12 @@
|
|||
2002-11-05 [colin] 0.8.5claws74
|
||||
|
||||
* src/compose.[ch]
|
||||
add compose_draft()
|
||||
* src/crash.c
|
||||
add SIGTERM handler
|
||||
* src/main.[ch]
|
||||
add clean_quit() for the SIGTERM handler
|
||||
|
||||
2002-11-05 [paul] 0.8.5claws73
|
||||
|
||||
* po/es.po
|
||||
|
|
|
@ -11,7 +11,7 @@ MINOR_VERSION=8
|
|||
MICRO_VERSION=5
|
||||
INTERFACE_AGE=0
|
||||
BINARY_AGE=0
|
||||
EXTRA_VERSION=claws73
|
||||
EXTRA_VERSION=claws74
|
||||
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
|
||||
|
||||
dnl set $target
|
||||
|
|
|
@ -6269,6 +6269,11 @@ static void compose_send_later_cb(gpointer data, guint action,
|
|||
if (!val) gtk_widget_destroy(compose->window);
|
||||
}
|
||||
|
||||
void compose_draft (gpointer data)
|
||||
{
|
||||
compose_draft_cb(data, 0, NULL);
|
||||
}
|
||||
|
||||
static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
|
||||
{
|
||||
Compose *compose = (Compose *)data;
|
||||
|
|
|
@ -271,5 +271,6 @@ void compose_reflect_prefs_all (void);
|
|||
void compose_reflect_prefs_pixmap_theme (void);
|
||||
|
||||
void compose_destroy_all (void);
|
||||
void compose_draft (gpointer data);
|
||||
|
||||
#endif /* __COMPOSE_H__ */
|
||||
|
|
14
src/crash.c
14
src/crash.c
|
@ -41,6 +41,9 @@
|
|||
# include <gnu/libc-version.h>
|
||||
#endif
|
||||
|
||||
#ifdef SIGTERM
|
||||
#include "main.h"
|
||||
#endif
|
||||
#include "intl.h"
|
||||
#include "crash.h"
|
||||
#include "utils.h"
|
||||
|
@ -115,6 +118,11 @@ void crash_install_handlers(void)
|
|||
sigaddset(&mask, SIGABRT);
|
||||
#endif
|
||||
|
||||
#ifdef SIGTERM
|
||||
signal(SIGTERM, crash_handler);
|
||||
sigaddset(&mask, SIGTERM);
|
||||
#endif
|
||||
|
||||
sigprocmask(SIG_UNBLOCK, &mask, 0);
|
||||
#endif /* CRASH_DIALOG */
|
||||
}
|
||||
|
@ -503,6 +511,12 @@ static void crash_handler(int sig)
|
|||
|
||||
crashed_++;
|
||||
|
||||
#ifdef SIGTERM
|
||||
if(sig == SIGTERM) {
|
||||
clean_quit();
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* gnome ungrabs focus, and flushes gdk. mmmh, good idea.
|
||||
*/
|
||||
|
|
24
src/main.c
24
src/main.c
|
@ -158,6 +158,7 @@ _("File `%s' already exists.\n"
|
|||
} \
|
||||
}
|
||||
|
||||
static MainWindow *static_mainwindow;
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
gchar *userrc;
|
||||
|
@ -370,6 +371,7 @@ int main(int argc, char *argv[])
|
|||
if (cmd.online_mode == ONLINE_MODE_ONLINE)
|
||||
main_window_toggle_work_offline(mainwin, FALSE);
|
||||
|
||||
static_mainwindow = mainwin;
|
||||
gtk_main();
|
||||
|
||||
addressbook_destroy();
|
||||
|
@ -505,6 +507,28 @@ static void initial_processing(FolderItem *item, gpointer data)
|
|||
main_window_cursor_normal(mainwin);
|
||||
}
|
||||
|
||||
void clean_quit(void)
|
||||
{
|
||||
GList * compose_list = compose_get_compose_list();
|
||||
GList * elem = NULL;
|
||||
if(compose_list) {
|
||||
for (elem = compose_list; elem != NULL && elem->data != NULL; elem = elem->next) {
|
||||
Compose *c = (Compose*)elem->data;
|
||||
compose_draft(c);
|
||||
}
|
||||
}
|
||||
if (prefs_common.warn_queued_on_exit)
|
||||
{ /* disable the popup */
|
||||
prefs_common.warn_queued_on_exit = FALSE;
|
||||
app_will_exit(NULL, static_mainwindow);
|
||||
prefs_common.warn_queued_on_exit = TRUE;
|
||||
prefs_common_save_config();
|
||||
} else {
|
||||
app_will_exit(NULL, static_mainwindow);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void app_will_exit(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
MainWindow *mainwin = data;
|
||||
|
|
|
@ -28,5 +28,6 @@ extern gchar *startup_dir;
|
|||
extern gboolean debug_mode;
|
||||
|
||||
void app_will_exit (GtkWidget *widget, gpointer data);
|
||||
void clean_quit (void);
|
||||
|
||||
#endif /* __MAIN_H__ */
|
||||
|
|
Loading…
Reference in a new issue