/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
*
* 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
#include "utils.h"
#include "gtkutils.h"
#include "prefs_common.h"
+#include "file-utils.h"
static void source_window_size_alloc_cb (GtkWidget *widget,
GtkAllocation *allocation);
window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "sourcewindow");
gtk_window_set_title(GTK_WINDOW(window), _("Source of the message"));
gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
+ gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_widget_set_size_request(window, prefs_common.sourcewin_width,
prefs_common.sourcewin_height);
cm_return_if_fail(file != NULL);
- if ((fp = g_fopen(file, "rb")) == NULL) {
- FILE_OP_ERROR(file, "fopen");
+ if ((fp = claws_fopen(file, "rb")) == NULL) {
+ FILE_OP_ERROR(file, "claws_fopen");
g_free(file);
return;
}
g_free(title);
g_free(file);
- while (fgets(buf, sizeof(buf), fp) != NULL)
+ while (claws_fgets(buf, sizeof(buf), fp) != NULL)
source_window_append(sourcewin, buf);
- fclose(fp);
+ claws_fclose(fp);
}
static void source_window_append(SourceWindow *sourcewin, const gchar *str)
static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event,
SourceWindow *sourcewin)
{
-
if (!event || !sourcewin) return FALSE;
-
+
switch (event->keyval) {
- case GDK_KEY_A:
- case GDK_KEY_a:
- if ((event->state & GDK_CONTROL_MASK) != 0)
- gtk_editable_select_region(GTK_EDITABLE(sourcewin->text), 0, -1);
- break;
case GDK_KEY_W:
case GDK_KEY_w:
if ((event->state & GDK_CONTROL_MASK) != 0)