#include "codeconv.h"
#include "utils.h"
#include "gtkutils.h"
+#include "gtkshruler.h"
#include "socket.h"
#include "alertpanel.h"
#include "manage_window.h"
-#if !GTK_CHECK_VERSION(2, 24, 0)
-#include "gtkshruler.h"
-#endif
#include "folder.h"
#include "addr_compl.h"
#include "quote_fmt.h"
/* callback functions */
-#if !GTK_CHECK_VERSION(2, 24, 0)
static gboolean compose_edit_size_alloc (GtkEditable *widget,
GtkAllocation *allocation,
GtkSHRuler *shruler);
-#endif
static void account_activated (GtkComboBox *optmenu,
gpointer data);
static void attach_selected (GtkTreeView *tree_view,
static void compose_toggle_autoindent_cb(GtkToggleAction *action,
gpointer data);
-#if !GTK_CHECK_VERSION(2, 24, 0)
static void compose_toggle_ruler_cb (GtkToggleAction *action,
gpointer data);
-#endif
static void compose_toggle_sign_cb (GtkToggleAction *action,
gpointer data);
static void compose_toggle_encrypt_cb (GtkToggleAction *action,
{"Edit/Copy", NULL, N_("_Copy"), "<control>C", NULL, G_CALLBACK(compose_copy_cb) },
{"Edit/Paste", NULL, N_("_Paste"), "<control>V", NULL, G_CALLBACK(compose_paste_cb) },
- {"Edit/SpecialPaste", NULL, N_("Special paste") },
+ {"Edit/SpecialPaste", NULL, N_("_Special paste") },
{"Edit/SpecialPaste/AsQuotation", NULL, N_("as _quotation"), NULL, NULL, G_CALLBACK(compose_paste_as_quote_cb) },
{"Edit/SpecialPaste/Wrapped", NULL, N_("_wrapped"), NULL, NULL, G_CALLBACK(compose_paste_wrap_cb) },
{"Edit/SpecialPaste/Unwrapped", NULL, N_("_unwrapped"), NULL, NULL, G_CALLBACK(compose_paste_no_wrap_cb) },
{"Options/Encrypt", NULL, N_("_Encrypt"), NULL, NULL, G_CALLBACK(compose_toggle_encrypt_cb) }, /* Toggle */
{"Options/RequestRetRcpt", NULL, N_("_Request Return Receipt"), NULL, NULL, G_CALLBACK(compose_toggle_return_receipt_cb) }, /* TOGGLE */
{"Options/RemoveReferences", NULL, N_("Remo_ve references"), NULL, NULL, G_CALLBACK(compose_toggle_remove_refs_cb) }, /* TOGGLE */
-#if !GTK_CHECK_VERSION(2, 24, 0)
{"Tools/ShowRuler", NULL, N_("Show _ruler"), NULL, NULL, G_CALLBACK(compose_toggle_ruler_cb) }, /* Toggle */
-#endif
};
static GtkRadioActionEntry compose_radio_rm_entries[] =
#if !GTK_CHECK_VERSION(2, 24, 0)
GdkColormap *cmap;
gboolean success[8];
+ int i;
#endif
GdkColor color[8];
- int i;
buffer = gtk_text_view_get_buffer(text);
cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Message/InsertSig", FALSE);
cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Edit", FALSE);
cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Options", FALSE);
-#if !GTK_CHECK_VERSION(2, 24, 0)
cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Tools/ShowRuler", FALSE);
-#endif
cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Tools/Actions", FALSE);
if (compose->toolbar->draft_btn)
static void compose_entry_mark_default_to(Compose *compose, const gchar *mailto)
{
-#if !GTK_CHECK_VERSION(2, 24, 0)
+#if !GTK_CHECK_VERSION(3, 0, 0)
static GdkColor yellow;
static GdkColor black;
static gboolean yellow_initialised = FALSE;
GSList *h_list;
GtkEntry *entry;
-#if !GTK_CHECK_VERSION(2, 24, 0)
+#if !GTK_CHECK_VERSION(3, 0, 0)
if (!yellow_initialised) {
gdk_color_parse("#f5f6be", &yellow);
gdk_color_parse("#000000", &black);
entry = GTK_ENTRY(((ComposeHeaderEntry *)h_list->data)->entry);
if (gtk_entry_get_text(entry) &&
!g_utf8_collate(gtk_entry_get_text(entry), mailto)) {
-#if !GTK_CHECK_VERSION(2, 24, 0)
+#if !GTK_CHECK_VERSION(3, 0, 0)
if (yellow_initialised) {
#endif
gtk_widget_modify_base(
gtk_widget_modify_text(
GTK_WIDGET(((ComposeHeaderEntry *)h_list->data)->entry),
GTK_STATE_NORMAL, &black);
-#if !GTK_CHECK_VERSION(2, 24, 0)
+#if !GTK_CHECK_VERSION(3, 0, 0)
}
#endif
}
}
if (msgpath == NULL) {
msgpath = folder_item_fetch_msg(folder, msgnum);
- val = procmsg_send_message_queue(msgpath, &errstr, folder, msgnum, &queued_removed);
+ val = procmsg_send_message_queue_with_lock(msgpath, &errstr, folder, msgnum, &queued_removed);
g_free(msgpath);
} else {
- val = procmsg_send_message_queue(msgpath, &errstr, folder, msgnum, &queued_removed);
+ val = procmsg_send_message_queue_with_lock(msgpath, &errstr, folder, msgnum, &queued_removed);
claws_unlink(msgpath);
g_free(msgpath);
}
GtkWidget *paned;
GtkWidget *edit_vbox;
-#if !GTK_CHECK_VERSION(2, 24, 0)
GtkWidget *ruler_hbox;
GtkWidget *ruler;
-#endif
GtkWidget *scrolledwin;
GtkWidget *text;
GtkTextBuffer *buffer;
GtkClipboard *clipboard;
- CLAWS_TIP_DECL();
UndoMain *undostruct;
/* phew. */
/* Tools menu */
-#if !GTK_CHECK_VERSION(2, 24, 0)
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Tools", "ShowRuler", "Tools/ShowRuler", GTK_UI_MANAGER_MENUITEM)
-#endif
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Tools", "AddressBook", "Tools/AddressBook", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Tools", "Template", "Tools/Template", GTK_UI_MANAGER_MENU)
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Tools/Template", "PlaceHolder", "Tools/Template/PlaceHolder", GTK_UI_MANAGER_MENUITEM)
gtk_box_pack_start(GTK_BOX(edit_vbox), subject_hbox, FALSE, FALSE, 0);
-#if !GTK_CHECK_VERSION(2, 24, 0)
/* ruler */
ruler_hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(edit_vbox), ruler_hbox, FALSE, FALSE, 0);
- ruler = gtk_shruler_new();
- gtk_ruler_set_range(GTK_RULER(ruler), 0.0, 100.0, 1.0, 100.0);
+ ruler = gtk_shruler_new(GTK_ORIENTATION_HORIZONTAL);
+ gtk_shruler_set_range(GTK_SHRULER(ruler), 0.0, 100.0, 1.0);
gtk_box_pack_start(GTK_BOX(ruler_hbox), ruler, TRUE, TRUE,
BORDER_WIDTH);
-#endif
/* text widget */
scrolledwin = gtk_scrolled_window_new(NULL, NULL);
gtk_text_buffer_add_selection_clipboard(buffer, clipboard);
gtk_container_add(GTK_CONTAINER(scrolledwin), text);
-#if !GTK_CHECK_VERSION(2, 24, 0)
g_signal_connect_after(G_OBJECT(text), "size_allocate",
G_CALLBACK(compose_edit_size_alloc),
ruler);
-#endif
g_signal_connect(G_OBJECT(buffer), "changed",
G_CALLBACK(compose_changed_cb), compose);
g_signal_connect(G_OBJECT(text), "grab_focus",
compose->notebook = notebook;
compose->edit_vbox = edit_vbox;
-#if !GTK_CHECK_VERSION(2, 24, 0)
compose->ruler_hbox = ruler_hbox;
compose->ruler = ruler;
-#endif
compose->scrolledwin = scrolledwin;
compose->text = text;
compose_list = g_list_append(compose_list, compose);
-#if !GTK_CHECK_VERSION(2, 24, 0)
if (!prefs_common.show_ruler)
gtk_widget_hide(ruler_hbox);
cm_toggle_menu_set_active_full(compose->ui_manager, "Menu/Tools/ShowRuler", prefs_common.show_ruler);
-#endif
/* Priority */
compose->priority = PRIORITY_NORMAL;
* includes "non-client" (windows-izm) in calculation, so this calculation
* may not be accurate.
*/
-#if !GTK_CHECK_VERSION(2, 24, 0)
static gboolean compose_edit_size_alloc(GtkEditable *widget,
GtkAllocation *allocation,
GtkSHRuler *shruler)
(allocation->width - allocation->x) / char_width;
/* got the maximum */
- gtk_ruler_set_range(GTK_RULER(shruler),
- 0.0, line_width_in_chars, 0,
- /*line_width_in_chars*/ char_width);
+ gtk_shruler_set_range(GTK_SHRULER(shruler),
+ 0.0, line_width_in_chars, 0);
}
return TRUE;
}
-#endif
typedef struct {
gchar *header;
Compose *compose = (Compose *)data;
if (compose->focused_editable
#ifndef GENERIC_UMPC
- && gtkut_widget_has_focus(compose->focused_editable)
+ && gtk_widget_has_focus(compose->focused_editable)
#endif
)
entry_cut_clipboard(compose->focused_editable);
Compose *compose = (Compose *)data;
if (compose->focused_editable
#ifndef GENERIC_UMPC
- && gtkut_widget_has_focus(compose->focused_editable)
+ && gtk_widget_has_focus(compose->focused_editable)
#endif
)
entry_copy_clipboard(compose->focused_editable);
GtkTextBuffer *buffer;
BLOCK_WRAP();
if (compose->focused_editable &&
- gtkut_widget_has_focus(compose->focused_editable))
+ gtk_widget_has_focus(compose->focused_editable))
entry_paste_clipboard(compose, compose->focused_editable,
prefs_common.linewrap_pastes,
GDK_SELECTION_CLIPBOARD, NULL);
UNBLOCK_WRAP();
#ifdef USE_ENCHANT
- if (gtkut_widget_has_focus(compose->text) &&
+ if (gtk_widget_has_focus(compose->text) &&
compose->gtkaspell &&
compose->gtkaspell->check_while_typing)
gtkaspell_highlight_all(compose->gtkaspell);
gint wrap_quote = prefs_common.linewrap_quote;
if (compose->focused_editable
#ifndef GENERIC_UMPC
- && gtkut_widget_has_focus(compose->focused_editable)
+ && gtk_widget_has_focus(compose->focused_editable)
#endif
) {
/* let text_insert() (called directly or at a later time
BLOCK_WRAP();
if (compose->focused_editable
#ifndef GENERIC_UMPC
- && gtkut_widget_has_focus(compose->focused_editable)
+ && gtk_widget_has_focus(compose->focused_editable)
#endif
)
entry_paste_clipboard(compose, compose->focused_editable, FALSE,
UNBLOCK_WRAP();
#ifdef USE_ENCHANT
- if (gtkut_widget_has_focus(compose->text) &&
+ if (gtk_widget_has_focus(compose->text) &&
compose->gtkaspell &&
compose->gtkaspell->check_while_typing)
gtkaspell_highlight_all(compose->gtkaspell);
BLOCK_WRAP();
if (compose->focused_editable
#ifndef GENERIC_UMPC
- && gtkut_widget_has_focus(compose->focused_editable)
+ && gtk_widget_has_focus(compose->focused_editable)
#endif
)
entry_paste_clipboard(compose, compose->focused_editable, TRUE,
UNBLOCK_WRAP();
#ifdef USE_ENCHANT
- if (gtkut_widget_has_focus(compose->text) &&
+ if (gtk_widget_has_focus(compose->text) &&
compose->gtkaspell &&
compose->gtkaspell->check_while_typing)
gtkaspell_highlight_all(compose->gtkaspell);
Compose *compose = (Compose *)data;
if (compose->focused_editable
#ifndef GENERIC_UMPC
- && gtkut_widget_has_focus(compose->focused_editable)
+ && gtk_widget_has_focus(compose->focused_editable)
#endif
)
entry_allsel(compose->focused_editable);
{textview_delete_to_line_end}
};
- if (!gtkut_widget_has_focus(GTK_WIDGET(text))) return;
+ if (!gtk_widget_has_focus(GTK_WIDGET(text))) return;
if (action >= COMPOSE_CALL_ADVANCED_ACTION_MOVE_BEGINNING_OF_LINE &&
action <= COMPOSE_CALL_ADVANCED_ACTION_DELETE_TO_LINE_END) {
compose_update_privacy_system_menu_item(compose, warn);
}
-#if !GTK_CHECK_VERSION(2, 24, 0)
static void compose_toggle_ruler_cb(GtkToggleAction *action, gpointer data)
{
Compose *compose = (Compose *)data;
prefs_common.show_ruler = FALSE;
}
}
-#endif
static void compose_attach_drag_received_cb (GtkWidget *widget,
GdkDragContext *context,
if (!compose->gtkaspell)
return;
- if (gtkut_widget_has_focus(compose->subject_entry))
+ if (gtk_widget_has_focus(compose->subject_entry))
claws_spell_entry_check_all(
CLAWS_SPELL_ENTRY(compose->subject_entry));
else
return;
}
- if (gtkut_widget_has_focus(compose->subject_entry))
+ if (gtk_widget_has_focus(compose->subject_entry))
claws_spell_entry_check_backwards(
CLAWS_SPELL_ENTRY(compose->subject_entry));
else
return;
}
- if (gtkut_widget_has_focus(compose->subject_entry))
+ if (gtk_widget_has_focus(compose->subject_entry))
claws_spell_entry_check_forwards_go(
CLAWS_SPELL_ENTRY(compose->subject_entry));
else