...
 
Commits (140)
......@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1)
cmake_policy(VERSION 3.1)
project(evolution
VERSION 3.24.0
VERSION 3.24.7
LANGUAGES C)
set(PROJECT_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=Evolution")
set(PROJECT_URL "http://wiki.gnome.org/Apps/Evolution/")
......@@ -98,7 +98,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Packagers might want to need different settings for the RPATH related things
# From experience, especially CMAKE_BUILD_WITH_INSTALL_RPATH might need to be
# switched to ON, if CMake fails to set the right values during make install
set(CMAKE_SKIP_RPATH OFF)
set(CMAKE_SKIP_RPATH OFF CACHE BOOL INTERNAL)
set(CMAKE_SKIP_BUILD_RPATH OFF CACHE BOOL INTERNAL)
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF CACHE BOOL INTERNAL)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON CACHE BOOL INTERNAL)
......@@ -151,7 +151,7 @@ set(privincludedir "${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}")
set(privlibdir "${LIB_INSTALL_DIR}/${PROJECT_NAME}")
set(privlibexecdir "${LIBEXEC_INSTALL_DIR}/${PROJECT_NAME}")
SET(CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}:${privlibdir}")
SET(CMAKE_INSTALL_RPATH "${privlibdir}")
if(WIN32)
# On Win32 there is no "rpath" mechanism. We install the private
......@@ -572,6 +572,15 @@ CHECK_C_SOURCE_COMPILES("#include <libical/ical.h>
return 0;
}" HAVE_ICALTZUTIL_SET_EXACT_VTIMEZONES_SUPPORT)
CHECK_C_SOURCE_COMPILES("#include <libical/ical.h>
int main(void) {
icalparameter *param;
param = icalproperty_get_first_parameter (NULL, ICAL_FILENAME_PARAMETER);
icalparameter_get_filename (param);
icalparameter_new_filename (NULL);
return 0;
}" HAVE_ICAL_FILENAME_PARAMETER)
unset(CMAKE_REQUIRED_DEFINITIONS)
unset(CMAKE_REQUIRED_INCLUDES)
unset(CMAKE_REQUIRED_LIBRARIES)
......
Evolution 3.24.6 2017-10-02
---------------------------
Bug Fixes:
Bug 785178 - Message preview pane size gets reset every time on HiDPI (Milan Crha)
Bug 788164 - Allow adding notes to messages in a search folder (Milan Crha)
Bug 788231 - PageDown in Contacts List view mode misbehaves (Milan Crha)
Translations:
Marek Cernocky (cs)
Matej Urbančič (sl)
Stas Solovey (ru)
Dušan Kazik (sk)
Evolution 3.24.5 2017-08-07
---------------------------
Bug Fixes:
Bug 785031 - Indefinite loop under e_editor_dom_merge_siblings_if_necessary() (Milan Crha)
Bug 785127 - Change in composer body doesn't trigger autosave timeout (Milan Crha)
Bug 785188 - Do not add LIB_INSTALL_DIR into RPATH (Milan Crha)
Bug 785233 - Do not add extra comma in Open Map query (Milan Crha)
Bug 785412 - Skip disabled accounts in Reply-all user address lookup (Milan Crha)
Bug 777086 - Composer sometimes hangs on right-click above a word in the body (Milan Crha)
Bug 785717 - Add plain minus key to collapse thread (Milan Crha)
Bug 785800 - Page Up/Down in monthly calendar view not skipping a month (Milan Crha)
Miscellaneous:
Workaround broken GPG encrypted messages from Exchange and GroupWise servers (Milan Crha)
Reply-To header value lost on Draft message reopen (Milan Crha)
Set shadow for Aliases scrolled window in mail account Properties (Milan Crha)
Translations:
Matej Urbančič (sl)
Evolution 3.24.4 2017-07-17
---------------------------
Bug Fixes:
Bug 783905 - Drag in Minicard view stuck (Milan Crha)
Bug 782210 - Divide message list and preview panel size proportionally ][ (Milan Crha)
Bug 784246 - Unset encoding in text-highlight module output (Milan Crha)
Bug 780934 - Component not moved when changing calendar in editor (Milan Crha)
Bug 784445 - [Wayland] Date chooser on Tasks is misplaced on screen (Milan Crha)
Bug 784438 - Hyperlinks href changed to text when expanding the text (Milan Crha)
Bug 781309 - Signature and import previews hard to read with dark theme (Milan Crha)
Bug 784664 - Avoid folding in ESourceMailIdentity::aliases property (Milan Crha)
Bug 784665 - Reply/Forward fails to pair account alias with recipient (Milan Crha)
Bug 784776 - Don't change default view on middle-click of switcher button (Milan Crha)
Bug 784663 - Sort aliases list on save of account Properties (Milan Crha)
Bug 784874 - Huge icons in Edit->Preferences sections column (Milan Crha)
Miscellaneous:
Sort accounts in identity combo box (From: combo in mail composer) (Milan Crha)
Cannot focus contact list editor's list name (Milan Crha)
Fix runtime warning on close from e_content_request_process() (Milan Crha)
Prefer gtk_clipboard_wait_for_targets() over gtk_clipboard_request_targets() (Milan Crha)
Wrong folder URI used for message notifications (Milan Crha)
AlertBar from ShellContent not freed (Milan Crha)
Translations:
Baurzhan Muftakhidinov (kk)
Evolution 3.24.3 2017-06-19
---------------------------
Bug Fixes:
Bug 720197 - [IMAPx] Indefinite waiting for message download ][ (Lubomir Rintel)
Bug 782529 - Hide end time in week/month views when same as start (Milan Crha)
Bug 773420 - Prevent crash when e_content_editor_get_content() returns NULL (Milan Crha)
Bug 782803 - Select also day when going to Today in Month/Week views (Milan Crha)
Bug 783106 - Crash under webkit_editor_paste_clipboard_targets_cb() (Milan Crha)
Bug 537048 - [Month view] Clicking outside of appointment doesn't stop editing (Milan Crha)
Bug 783191 - Fix conditional to prevent a compiler warning (Antoine Jacoutot)
Bug 782052 - Today in mini-calendar not easy to distinguish from selected days (Milan Crha)
Bug 783317 - Use https for autoconfig API (Tobias Mueller)
Bug 782210 - Divide message list and preview panel size proportionally (Milan Crha)
Bug 783353 - Composer spell checks with no language selected (Milan Crha)
Bug 782470 - Style <blockquote> in HTML replies (Milan Crha)
Bug 783682 - Misleading start date set for Memos created inline in Calendar view (Milan Crha)
Miscellaneous:
[ECompEditor] Ensure local store directory exists before saving attachments (Milan Crha)
[ECompEditor] Use ICAL_FILENAME_PARAMETER for attachments, if available (Milan Crha)
Use SIGTERM instead of SIGQUIT in killev (evolution --force-shutdown) (Milan Crha)
Allow select the same source and destination calendar in Copy To Calendar (Milan Crha)
Crash under e_dom_resize_document_content_to_preview_width() (Milan Crha)
Allow overwrite of CMAKE_SKIP_RPATH variable (Milan Crha)
e_mail_folder_to_full_display_name: Special-case virtual Trash/Junk folders (Milan Crha)
Translations:
Марко Костић (sr)
Evolution 3.24.2 2017-05-08
---------------------------
Bug Fixes:
Bug 781404 - Disable inline audio play in message preview (Milan Crha)
Bug 781557 - Inserting/removing rows/columns in tables don't work (Milan Crha)
Bug 781570 - Replace Unicode NBSP to ASCII space in text/plain before send (Milan Crha)
Bug 781660 - Component editor marked changed after open (Milan Crha)
Bug 781647 - Hide evolution-alarm-notify in Startup Applications (Jeremy Bicha)
Bug 781722 - Switching citation in Reply to "Preformatted" duplicates citation marks (Tomas Popela)
Bug 781833 - Do not set '-Wl,--no-undefined' on BSD (Antoine Jacoutot)
Bug 781890 - Signature editor doesn't set correct format (Milan Crha)
Bug 781116 - Wrap Lines in citation breaks citation (Tomas Popela)
Bug 778423 - Deleting quoted content from GMail could leave empty blocks (Tomas Popela)
Bug 780088 - Pasted URL not recognized/rendered as such; renders all remaining email text as link after pressing Enter (Tomas Popela)
Bug 569684 - Click-mark message read/unread stops mark-seen timer (Milan Crha)
Bug 782153 - Missing name when replying to sender with quotes (Milan Crha)
Miscellaneous:
Crash under e_meeting_time_selector_refresh_cb() (Milan Crha)
Drag and drop to the editor can lock the Evolution (Tomas Popela)
Dropping text/* content to the editor is not handled by WebKit (Tomas Popela)
Fix the compilation warning with gcc 7 (Tomas Popela)
[ENameSelectorEntry] Avoid fake "changed" signals on focus-in (Milan Crha)
Calendar Print skips print dialog (Milan Crha)
Show VERSION_SUBSTRING and VERSION_COMMENT in Help->About (Milan Crha)
Fix occasional runtime warning from e_web_extension_set_clipboard_flags() (Milan Crha)
Mark editor as changed if using 'Wrap lines' action (Tomas Popela)
Mark editor as changed if deleting a selection (Tomas Popela)
MailFolderCache can sometimes block folder 'changed' notifications (Milan Crha)
Correct possible ref/unref imbalance of a CamelFolder instance (Milan Crha)
Translations:
Kukuh Syafaat (id)
Efstathios Iosifidis (el)
Stas Solovey (ru)
Evolution 3.24.1 2017-04-10
---------------------------
Bug Fixes:
Bug 780045 - MBOX preview not shown in --import dialog (Milan Crha)
Bug 779907 - Backup file name extension not updated after switching file filter (Milan Crha)
Bug 780085 - Fails to recognize Gmail HTML new line marker before signature (Milan Crha)
Bug 780080 - Ignore caret-mode when processing magic-spacebar (Milan Crha)
Bug 726533 - [webkit-composer] Text can be "bound" to an image object (Tomas Popela)
Bug 780275 - Problems with citation (Tomas Popela)
Bug 780988 - Show default application for open-with as the first (Milan Crha)
Miscellaneous:
Fix few issues reported by Coverity scan (Milan Crha)
[EUndoRedoManager] Move two selection related functions to e-editor-dom-functions.h (Tomas Popela)
Fix drag and drop in composer (Tomas Popela)
Remove code that is not needed with WebKit2 anymore (Tomas Popela)
Undo and redo buttons not active if switching from headers to editor (Tomas Popela)
Fix the replace dialog functionality (Tomas Popela)
Be more verbose about some of the history events (Tomas Popela)
Allow the attachments and inline images to be dragged to the editor (Tomas Popela)
Remove some of the WK2 FIXMEs (Tomas Popela)
Undoing the HISTORY_IMAGE event won't remove the image (Tomas Popela)
No initial paragraph presented if composing a new message (Tomas Popela)
Possible deadlock in the replace dialog (Tomas Popela)
Can't change the font color on caret in WebKitGTK+ 2.16 (Tomas Popela)
[Mail] Cached remote content not always found in cache (Milan Crha)
Use the right format string for WebPage's id (Tomas Popela)
Don't hardcode base64 image data in tests (Tomas Popela)
Last BR in inserted content is left marked (Tomas Popela)
Remove duplicate function for determining the citation level (Tomas Popela)
Minor code style fixes (Tomas Popela)
Warning could be printed if debug enabled for undo&redo (Tomas Popela)
Fix a compiler warning (maybe-uninitialized) (Milan Crha)
Translations:
Alexandre Franke (fr)
Kjartan Maraas (nb)
Piotr Drąg (pl)
Yuras Shumovich (be)
Fabio Tomat (fur)
Rūdolfs Mazurs (lv)
Dušan Kazik (sk)
Evolution 3.24.0 2017-03-20
---------------------------
......
......@@ -77,9 +77,9 @@ macro(setup_build_flags _maintainer_mode)
endforeach()
endif(CMAKE_CXX_COMPILER_ID)
if(("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU"))
if(("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") AND (NOT ${CMAKE_SYSTEM_NAME} MATCHES "BSD"))
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
endif(("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU"))
endif(("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") AND (NOT ${CMAKE_SYSTEM_NAME} MATCHES "BSD"))
endmacro()
......@@ -99,6 +99,9 @@
/* libical provides icaltzutil_set_exact_vtimezones_support function */
#cmakedefine HAVE_ICALTZUTIL_SET_EXACT_VTIMEZONES_SUPPORT 1
/* libical provides ICAL_FILENAME_PARAMETER */
#cmakedefine HAVE_ICAL_FILENAME_PARAMETER 1
/* When defined spell checking is enabled */
#cmakedefine HAVE_GTKSPELL 1
......
......@@ -5,9 +5,9 @@ _Comment=Calendar event notifications
Icon=appointment-soon
Exec=@privlibexecdir@/evolution-alarm-notify
Terminal=false
Type=Application
Categories=
OnlyShowIn=GNOME;Unity;XFCE;Dawati;MATE;
NoDisplay=true
X-Meego-Priority=Low
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=evolution
......
This diff is collapsed.
This diff is collapsed.
......@@ -772,7 +772,7 @@ msgstr "Upřednostňovaná položka tlačítka Nový"
#: ../data/org.gnome.evolution.calendar.gschema.xml.in.h:99
msgid "Name of the preferred New toolbar button item"
msgstr "Název upřednostňované položky tlačítka Nový v liště nástrojů"
msgstr "Název upřednostňované položky tlačítka Nový v násrojové liště"
#: ../data/org.gnome.evolution.calendar.gschema.xml.in.h:100
msgid "Primary calendar"
......@@ -1280,7 +1280,7 @@ msgid ""
"replying."
msgstr ""
"Na rozdíl od normálního „Odpovědět všem“, tato volba zajistí, že tlačítko "
"„Skupinová odpověď“ na liště nástrojů zkusí odpovědět pouze do poštovní "
"„Skupinová odpověď“ na nástrojové liště zkusí odpovědět pouze do poštovní "
"konference, přes kterou jste obdrželi kopii zprávy, na kterou odpovídáte."
#: ../data/org.gnome.evolution.mail.gschema.xml.in.h:25
......@@ -2922,7 +2922,7 @@ msgid ""
"toolbar setting."
msgstr ""
"Styl tlačítek okna. Může být „text“ (text), „icons“ (ikony), „both“ (oboje), "
"„toolbar“ (panel nástrojů). Je-li nastaveno „toolbar“, styl tlačítek je "
"„toolbar“ (nástrojová lišta). Je-li nastaveno „toolbar“, styl tlačítek je "
"určen nastavením nástrojových lišt GNOME."
#: ../data/org.gnome.evolution.shell.gschema.xml.in.h:23
......@@ -2955,7 +2955,7 @@ msgstr "Stavová lišta je viditelná"
#: ../data/org.gnome.evolution.shell.gschema.xml.in.h:30
msgid "Whether the status bar should be visible."
msgstr "Jestli má být stavový řádek viditelný."
msgstr "Jestli má být stavová lišta viditelná."
#: ../data/org.gnome.evolution.shell.gschema.xml.in.h:31
msgid "ID or alias of the component to be shown by default at start-up."
......@@ -6029,7 +6029,7 @@ msgstr "Přílohy"
#: ../src/mail/filtertypes.xml.in.h:48 ../src/mail/searchtypes.xml.in.h:50
#: ../src/mail/vfoldertypes.xml.in.h:51
msgid "Exist"
msgstr "Existují"
msgstr "existují"
#: ../src/calendar/gui/caltypes.xml.in.h:18
#: ../src/calendar/gui/memotypes.xml.in.h:16
......@@ -6037,7 +6037,7 @@ msgstr "Existují"
#: ../src/mail/filtertypes.xml.in.h:49 ../src/mail/searchtypes.xml.in.h:51
#: ../src/mail/vfoldertypes.xml.in.h:52
msgid "Do Not Exist"
msgstr "Neexistují"
msgstr "neexistují"
#: ../src/calendar/gui/caltypes.xml.in.h:19
#: ../src/calendar/gui/e-comp-editor-page-recurrence.c:2003
......@@ -14151,7 +14151,7 @@ msgstr "Přidat pravidlo"
#: ../src/e-util/e-rule-editor.c:284
msgid "Edit Rule"
msgstr "Upravit pravidlo"
msgstr "Úprava pravidla"
#: ../src/e-util/e-search-bar.c:82
#, c-format
......@@ -17581,7 +17581,7 @@ msgstr "nemá slova"
#: ../src/mail/filtertypes.xml.in.h:19 ../src/mail/searchtypes.xml.in.h:20
#: ../src/mail/vfoldertypes.xml.in.h:20
msgid "Specific header"
msgstr "Specifická hlavička"
msgstr "Určená hlavička"
#: ../src/mail/filtertypes.xml.in.h:20 ../src/mail/searchtypes.xml.in.h:21
#: ../src/mail/vfoldertypes.xml.in.h:21
......@@ -17702,7 +17702,7 @@ msgstr "Poštovní konference"
#: ../src/mail/filtertypes.xml.in.h:52 ../src/mail/searchtypes.xml.in.h:54
#: ../src/mail/vfoldertypes.xml.in.h:55
msgid "Regex Match"
msgstr "Odp. regexu"
msgstr "Regulární výraz"
#: ../src/mail/filtertypes.xml.in.h:53 ../src/mail/searchtypes.xml.in.h:55
#: ../src/mail/vfoldertypes.xml.in.h:56
......@@ -17739,11 +17739,11 @@ msgstr "Test na nevyžádané zprávy"
#: ../src/mail/filtertypes.xml.in.h:61
msgid "Message is Junk"
msgstr "Zpráva je nevyžádaná"
msgstr "zpráva je nevyžádaná"
#: ../src/mail/filtertypes.xml.in.h:62
msgid "Message is not Junk"
msgstr "Zpráva není nevyžádaná"
msgstr "zpráva není nevyžádaná"
#: ../src/mail/filtertypes.xml.in.h:63 ../src/mail/vfoldertypes.xml.in.h:57
msgid "Message Location"
......@@ -25005,19 +25005,19 @@ msgstr "Zobrazovat tlačítka přepínače"
#: ../src/shell/e-shell-window-actions.c:1060
msgid "Show _Status Bar"
msgstr "Zobrazovat _stavový řádek"
msgstr "Zobrazovat _stavovou lištu"
#: ../src/shell/e-shell-window-actions.c:1062
msgid "Show the status bar"
msgstr "Zobrazovat stavový řádek"
msgstr "Zobrazovat stavovou lištu"
#: ../src/shell/e-shell-window-actions.c:1068
msgid "Show _Tool Bar"
msgstr "Zobrazovat _lištu nástrojů"
msgstr "Zobrazovat nás_trojovou lištu"
#: ../src/shell/e-shell-window-actions.c:1070
msgid "Show the tool bar"
msgstr "Zobrazovat lištu nástrojů"
msgstr "Zobrazovat nástrojovou lištu"
#: ../src/shell/e-shell-window-actions.c:1092
msgid "_Icons Only"
......@@ -25045,7 +25045,7 @@ msgstr "Zobrazovat tlačítka okna s ikonami a textem"
#: ../src/shell/e-shell-window-actions.c:1113
msgid "Tool_bar Style"
msgstr "St_yl lišty nástrojů"
msgstr "St_yl nástrojové lišty"
#: ../src/shell/e-shell-window-actions.c:1115
msgid "Display window buttons using the desktop toolbar setting"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -128,7 +128,7 @@
<child>
<object class="GtkEntry" id="list-name-entry">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<signal name="changed" handler="contact_list_editor_list_name_entry_changed_cb" swapped="no"/>
</object>
<packing>
......
......@@ -621,13 +621,13 @@ e_minicard_event (GnomeCanvasItem *item,
event->motion.x, event->motion.y)) {
gint ret_val;
ret_val = e_minicard_drag_begin (e_minicard, event);
if (gtk_widget_has_grab (GTK_WIDGET (GNOME_CANVAS_ITEM (e_minicard)->canvas))) {
gtk_grab_remove (GTK_WIDGET (GNOME_CANVAS_ITEM (e_minicard)->canvas));
gnome_canvas_item_ungrab (GNOME_CANVAS_ITEM (e_minicard), event->motion.time);
}
ret_val = e_minicard_drag_begin (e_minicard, event);
e_minicard->drag_button = 0;
e_minicard->drag_button_down = FALSE;
e_minicard->button_x = -1;
......
......@@ -123,16 +123,28 @@ render_address_link (GString *buffer,
gchar *escaped;
if (adr->street && *adr->street)
g_string_append_printf (link, "%s, ", adr->street);
g_string_append_printf (link, "%s", adr->street);
if (adr->locality && *adr->locality)
g_string_append_printf (link, "%s, ", adr->locality);
if (adr->locality && *adr->locality) {
if (link->len)
g_string_append (link, ", ");
if (adr->region && *adr->region)
g_string_append_printf (link, "%s, ", adr->region);
g_string_append_printf (link, "%s", adr->locality);
}
if (adr->region && *adr->region) {
if (link->len)
g_string_append (link, ", ");
g_string_append_printf (link, "%s", adr->region);
}
if (adr->country && *adr->country) {
if (link->len)
g_string_append (link, ", ");
if (adr->country && *adr->country)
g_string_append_printf (link, "%s", adr->country);
}
escaped = g_uri_escape_string (link->str, NULL, TRUE);
g_string_assign (link, escaped);
......
......@@ -1088,6 +1088,7 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
struct ForeachTzidData ftd;
ECalClientSourceType source_type;
GHashTable *processed_uids;
gboolean same_client;
gboolean success = FALSE;
g_return_val_if_fail (E_IS_CAL_CLIENT (src_client), FALSE);
......@@ -1112,6 +1113,8 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
g_return_val_if_reached (FALSE);
}
same_client = src_client == dest_client || e_source_equal (
e_client_get_source (E_CLIENT (src_client)), e_client_get_source (E_CLIENT (dest_client)));
processed_uids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
icalcomp_event = icalcomponent_get_first_component (icalcomp_vcal, icalcomp_kind);
......@@ -1132,7 +1135,10 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
if (g_hash_table_lookup (processed_uids, uid))
continue;
success = e_cal_client_get_object_sync (dest_client, uid, NULL, &icalcomp, cancellable, &local_error);
if (do_copy && same_client)
success = FALSE;
else
success = e_cal_client_get_object_sync (dest_client, uid, NULL, &icalcomp, cancellable, &local_error);
if (success) {
success = e_cal_client_modify_object_sync (
dest_client, icalcomp_event, E_CAL_OBJ_MOD_ALL, cancellable, error);
......
......@@ -1440,7 +1440,9 @@ cal_model_create_component_from_values_thread (EAlertSinkThreadJobData *job_data
time_t tt = ccd->model->priv->get_default_time (ccd->model, ccd->model->priv->get_default_time_user_data);
if (tt > 0) {
struct icaltimetype itt = icaltime_from_timet_with_zone (tt, FALSE, e_cal_model_get_timezone (ccd->model));
/* Store Memo DTSTART as date, not as date-time */
struct icaltimetype itt = icaltime_from_timet_with_zone (tt,
icalcomponent_isa (comp_data->icalcomp) == ICAL_VJOURNAL_COMPONENT, e_cal_model_get_timezone (ccd->model));
icalproperty *prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTSTART_PROPERTY);
if (prop) {
......
......@@ -2039,7 +2039,7 @@ e_cal_ops_transfer_components (EShellView *shell_view,
ESource *source = key;
GSList *icalcomps = value;
if (!e_source_equal (source, destination))
if (!is_move || !e_source_equal (source, destination))
nobjects += g_slist_length (icalcomps);
}
......@@ -2086,7 +2086,7 @@ e_cal_ops_transfer_components (EShellView *shell_view,
ESource *source = key;
GSList *icalcomps = value;
if (!e_source_equal (source, destination)) {
if (!is_move || !e_source_equal (source, destination)) {
GSList *link;
icalcomps = g_slist_copy (icalcomps);
......
......@@ -139,8 +139,6 @@ ecep_attachments_attachment_loaded_cb (EAttachment *attachment,
{
GFileInfo *file_info;
const gchar *display_name;
const gchar *uid;
gchar *new_name;
GError *error = NULL;
/* Prior to 2.27.2, attachment files were named:
......@@ -163,10 +161,19 @@ ecep_attachments_attachment_loaded_cb (EAttachment *attachment,
file_info = e_attachment_ref_file_info (attachment);
if (file_info) {
const gchar *uid;
const gchar *prefer_filename;
display_name = g_file_info_get_display_name (file_info);
uid = g_object_get_data (G_OBJECT (attachment), "uid");
prefer_filename = g_object_get_data (G_OBJECT (attachment), "prefer-filename");
if (prefer_filename && *prefer_filename) {
g_file_info_set_display_name (file_info, prefer_filename);
g_object_notify (G_OBJECT (attachment), "file-info");
} else if (g_str_has_prefix (display_name, uid)) {
gchar *new_name;
if (g_str_has_prefix (display_name, uid)) {
new_name = g_strdup (display_name + strlen (uid) + 1);
g_file_info_set_display_name (file_info, new_name);
g_object_notify (G_OBJECT (attachment), "file-info");
......@@ -266,13 +273,25 @@ ecep_attachments_fill_widgets (ECompEditorPage *page,
for (prop = icalcomponent_get_first_property (component, ICAL_ATTACH_PROPERTY), index = 0;
prop;
prop = icalcomponent_get_next_property (component, ICAL_ATTACH_PROPERTY), index++) {
icalparameter *param;
icalattach *attach;
gchar *uri = NULL;
gchar *uri = NULL, *filename = NULL;
attach = icalproperty_get_attach (prop);
if (!attach)
continue;
#ifdef HAVE_ICAL_FILENAME_PARAMETER
param = icalproperty_get_first_parameter (prop, ICAL_FILENAME_PARAMETER);
if (param) {
filename = g_strdup (icalparameter_get_filename (param));
if (!filename || !*filename) {
g_free (filename);
filename = NULL;
}
}
#endif
if (icalattach_get_is_url (attach)) {
const gchar *data;
gsize buf_size;
......@@ -325,22 +344,24 @@ ecep_attachments_fill_widgets (ECompEditorPage *page,
g_free (id_str);
if (g_mkdir_with_parents (dir, 0700) >= 0) {
icalparameter *param;
gchar *file = NULL;
for (param = icalproperty_get_first_parameter (prop, ICAL_X_PARAMETER);
param && !file;
param && !filename;
param = icalproperty_get_next_parameter (prop, ICAL_X_PARAMETER)) {
if (e_util_strstrcase (icalparameter_get_xname (param), "NAME") &&
icalparameter_get_xvalue (param) &&
*icalparameter_get_xvalue (param))
file = g_strdup (icalparameter_get_xvalue (param));
*icalparameter_get_xvalue (param)) {
filename = g_strdup (icalparameter_get_xvalue (param));
if (!filename || !*filename) {
g_free (filename);
filename = NULL;
}
}
}
if (!file)
file = g_strdup_printf ("%d.dat", index);
if (!filename)
filename = g_strdup_printf ("%d.dat", index);
temporary_filename = g_build_filename (dir, file, NULL);
temporary_filename = g_build_filename (dir, filename, NULL);
if (!g_file_set_contents (temporary_filename, (const gchar *) data, data_len, NULL)) {
g_free (temporary_filename);
temporary_filename = NULL;
......@@ -366,16 +387,16 @@ ecep_attachments_fill_widgets (ECompEditorPage *page,
attachment = e_attachment_new_for_uri (uri);
e_attachment_store_add_attachment (store, attachment);
g_object_set_data_full (
G_OBJECT (attachment),
"uid", g_strdup (uid),
(GDestroyNotify) g_free);
g_object_set_data_full (G_OBJECT (attachment), "uid", g_strdup (uid), g_free);
if (filename)
g_object_set_data_full (G_OBJECT (attachment), "prefer-filename", g_strdup (filename), g_free);
e_attachment_load_async (
attachment, (GAsyncReadyCallback)
ecep_attachments_attachment_loaded_cb, page_attachments);
g_object_unref (attachment);
}
g_free (filename);
g_free (uri);
}
}
......@@ -412,6 +433,9 @@ ecep_attachments_fill_component (ECompEditorPage *page,
gsize buf_size;
gchar *buf, *uri, *description;
GFile *file;
#ifdef HAVE_ICAL_FILENAME_PARAMETER
GFileInfo *file_info;
#endif
if (!attachment)
continue;
......@@ -462,6 +486,23 @@ ecep_attachments_fill_component (ECompEditorPage *page,
icalvalue_encode_ical_string (uri, buf, buf_size);
attach = icalattach_new_from_url (buf);
prop = icalproperty_new_attach (attach);
#ifdef HAVE_ICAL_FILENAME_PARAMETER
file_info = e_attachment_ref_file_info (attachment);
if (file_info) {
const gchar *display_name = g_file_info_get_display_name (file_info);
if (display_name && *display_name) {
icalparameter *param;
param = icalparameter_new_filename (display_name);
icalproperty_add_parameter (prop, param);
}
g_object_unref (file_info);
}
#endif
icalcomponent_add_property (component, prop);
icalattach_unref (attach);
......
......@@ -630,6 +630,7 @@ ece_save_component_attachments_sync (ECalClient *cal_client,
GError **error)
{
icalproperty *prop;
const gchar *local_store;
gchar *target_filename_prefix, *filename_prefix, *tmp;
gboolean success = TRUE;
......@@ -641,9 +642,13 @@ ece_save_component_attachments_sync (ECalClient *cal_client,
filename_prefix = g_strconcat (tmp, "-", NULL);
g_free (tmp);
target_filename_prefix = g_build_filename (
e_cal_client_get_local_attachment_store (cal_client),
filename_prefix, NULL);
local_store = e_cal_client_get_local_attachment_store (cal_client);
if (local_store && *local_store &&
g_mkdir_with_parents (local_store, 0700) < 0) {
g_debug ("%s: Failed to create local store directory '%s'", G_STRFUNC, local_store);
}
target_filename_prefix = g_build_filename (local_store, filename_prefix, NULL);
g_free (filename_prefix);
......@@ -798,7 +803,7 @@ ece_save_component_thread (EAlertSinkThreadJobData *job_data,
{
SaveData *sd = user_data;
const gchar *create_alert_ident, *modify_alert_ident, *remove_alert_ident, *get_alert_ident;
gchar *orig_uid;
gchar *orig_uid, *new_uid = NULL;
g_return_if_fail (sd != NULL);
g_return_if_fail (E_IS_CAL_CLIENT (sd->target_client));
......@@ -870,18 +875,12 @@ ece_save_component_thread (EAlertSinkThreadJobData *job_data,
g_clear_object (&comp);
} else {
gchar *uid = NULL;
e_alert_sink_thread_job_set_alert_ident (job_data, create_alert_ident);
sd->success = e_cal_client_create_object_sync (sd->target_client, sd->component, &uid, cancellable, error);
if (sd->success) {
icalcomponent_set_uid (sd->component, uid);
g_free (uid);
sd->success = e_cal_client_create_object_sync (sd->target_client, sd->component, &new_uid, cancellable, error);
if (sd->success)
sd->object_created = TRUE;
}
}
if (sd->success && sd->source_client &&
......@@ -912,6 +911,11 @@ ece_save_component_thread (EAlertSinkThreadJobData *job_data,
}
}
if (new_uid) {
icalcomponent_set_uid (sd->component, new_uid);
g_free (new_uid);
}
g_free (orig_uid);
if (sd->success && !sd->close_after_save) {
......@@ -1019,12 +1023,16 @@ open_target_client_data_free (gpointer ptr)
if (otc) {
if (otc->comp_editor) {
if (otc->client) {
gboolean previous_changed = e_comp_editor_get_changed (otc->comp_editor);
e_comp_editor_set_alarm_email_address (otc->comp_editor, otc->alarm_email_address);
e_comp_editor_set_cal_email_address (otc->comp_editor, otc->cal_email_address);
e_comp_editor_set_target_client (otc->comp_editor, E_CAL_CLIENT (otc->client));
if (otc->is_target_client_change)
e_comp_editor_set_changed (otc->comp_editor, TRUE);
else
e_comp_editor_set_changed (otc->comp_editor, previous_changed);
}
if (otc->comp_editor->priv->activity_bar && otc->activity) {
......
......@@ -1425,6 +1425,12 @@ e_meeting_time_selector_refresh_cb (gpointer data)
{
EMeetingTimeSelector *mts = data;
if (!mts->model) {
/* Destroyed, do not do anything */
g_object_unref (mts);
return FALSE;
}
if (e_meeting_store_get_num_queries (mts->model) == 0) {
GdkCursor *cursor;
GdkWindow *window;
......
......@@ -895,7 +895,7 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item,
time_x += time_width;
}
if (draw_end) {
if (draw_end && (!draw_start || event->start_minute != event->end_minute)) {
time_x += E_WEEK_VIEW_EVENT_TIME_SPACING;
week_view_draw_time (
week_view, bg_rgba, cr, time_x,
......
......@@ -2323,7 +2323,7 @@ e_week_view_set_multi_week_view (EWeekView *week_view,
if (week_view->month_scroll_by_week) {
page_increment = 1;
page_size = 1;
page_size = 5;
} else {
page_increment = 4;
page_size = 5;
......@@ -2402,7 +2402,7 @@ e_week_view_set_weeks_shown (EWeekView *week_view,
if (e_week_view_get_multi_week_view (week_view)) {
if (week_view->month_scroll_by_week) {
page_increment = 1;
page_size = 1;
page_size = 5;
} else {
page_increment = 4;
page_size = 5;
......@@ -2836,8 +2836,16 @@ ewv_pass_gdkevent_to_etext (EWeekView *week_view,
span = &g_array_index (week_view->spans, EWeekViewEventSpan, event->spans_index + week_view->editing_span_num);
if (span->text_item && E_IS_TEXT (span->text_item)) {
GNOME_CANVAS_ITEM_GET_CLASS (span->text_item)->event (span->text_item, gevent);
return TRUE;
gdouble x1 = 0.0, y1 = 0.0, x2 = 0.0, y2 = 0.0, ex = 0.0, ey = 0.0;
gdk_event_get_coords (gevent, &ex, &ey);
gnome_canvas_item_get_bounds (span->text_item, &x1, &y1, &x2, &y2);
if (ex >= x1 && ex <= x2 && ey >= y1 && ey <= y2) {
GNOME_CANVAS_ITEM_GET_CLASS (span->text_item)->event (span->text_item, gevent);
return TRUE;
}
}
}
......@@ -2871,6 +2879,8 @@ e_week_view_on_button_press (GtkWidget *widget,
if (week_view->pressed_event_num != -1)
return FALSE;
e_week_view_stop_editing_event (week_view);
if (event_button == 1 && button_event->type == GDK_2BUTTON_PRESS) {
time_t dtstart, dtend;
......@@ -3757,8 +3767,12 @@ e_week_view_reshape_event_span (EWeekView *week_view,
time_width = e_week_view_get_time_string_width (week_view);
/* Calculate the space needed for the icons. */
icons_width = (E_WEEK_VIEW_ICON_WIDTH + E_WEEK_VIEW_ICON_X_PAD)
* num_icons - E_WEEK_VIEW_ICON_X_PAD + E_WEEK_VIEW_ICON_R_PAD;
if (num_icons > 0) {
icons_width = (E_WEEK_VIEW_ICON_WIDTH + E_WEEK_VIEW_ICON_X_PAD)
* num_icons - E_WEEK_VIEW_ICON_X_PAD + E_WEEK_VIEW_ICON_R_PAD;
} else {
icons_width = 0;
}
/* The y position and height are the same for both event types. */
text_y = span_y + E_WEEK_VIEW_EVENT_BORDER_HEIGHT
......@@ -3769,6 +3783,10 @@ e_week_view_reshape_event_span (EWeekView *week_view,
PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics));
if (one_day_event) {
gboolean hide_end_time;
hide_end_time = event->start_minute == event->end_minute;
/* Note that 1-day events don't have a border. Although we
* still use the border height to position the events
* vertically so they still line up neatly (see above),
......@@ -3780,8 +3798,8 @@ e_week_view_reshape_event_span (EWeekView *week_view,
case E_WEEK_VIEW_TIME_BOTH:
/* These have 2 time strings with a small space between
* them and some space before the EText item. */
text_x += time_width * 2
+ E_WEEK_VIEW_EVENT_TIME_SPACING
text_x += time_width * (hide_end_time ? 1 : 2)
+ (hide_end_time ? 0 : E_WEEK_VIEW_EVENT_TIME_SPACING)
+ E_WEEK_VIEW_EVENT_TIME_X_PAD;
break;
case E_WEEK_VIEW_TIME_START_SMALL_MIN:
......
......@@ -2475,8 +2475,6 @@ reply_to_calendar_comp (ESourceRegistry *registry,
cleanup:
if (comp != NULL)
g_object_unref (comp);
if (top_level != NULL)
icalcomponent_free (top_level);
......
......@@ -132,8 +132,6 @@ e_composer_private_constructed (EMsgComposer *composer)
priv->disable_signature = FALSE;
priv->busy = FALSE;
priv->saved_editable = FALSE;
priv->drop_occured = FALSE;
priv->dnd_is_uri = FALSE;
priv->dnd_history_saved = FALSE;
priv->check_if_signature_is_changed = FALSE;
priv->ignore_next_signature_change = FALSE;
......
......@@ -100,8 +100,6 @@ struct _EMsgComposerPrivate {
* This is used to restore the previous editable state. */
gboolean saved_editable;
gboolean set_signature_from_message;
gboolean drop_occured;
gboolean dnd_is_uri;
gboolean is_sending_message;
gboolean dnd_history_saved;
gboolean check_if_signature_is_changed;
......@@ -119,6 +117,8 @@ struct _EMsgComposerPrivate {
gulong notify_signature_uid_handler;
gulong notify_subject_handler;
gulong notify_subject_changed_handler;
gulong drag_data_received_handler_id;
};
void e_composer_private_constructed (EMsgComposer *composer);
......
......@@ -103,24 +103,14 @@ enum {
LAST_SIGNAL
};
enum DndTargetType {
DND_TARGET_TYPE_TEXT_URI_LIST,
DND_TARGET_TYPE_MOZILLA_URL,
DND_TARGET_TYPE_TEXT_HTML,
DND_TARGET_TYPE_UTF8_STRING,
DND_TARGET_TYPE_TEXT_PLAIN,
DND_TARGET_TYPE_STRING,
DND_TARGET_TYPE_TEXT_PLAIN_UTF8
};
static GtkTargetEntry drag_dest_targets[] = {
{ (gchar *) "text/uri-list", 0, DND_TARGET_TYPE_TEXT_URI_LIST },
{ (gchar *) "_NETSCAPE_URL", 0, DND_TARGET_TYPE_MOZILLA_URL },
{ (gchar *) "text/html", 0, DND_TARGET_TYPE_TEXT_HTML },
{ (gchar *) "UTF8_STRING", 0, DND_TARGET_TYPE_UTF8_STRING },
{ (gchar *) "text/plain", 0, DND_TARGET_TYPE_TEXT_PLAIN },
{ (gchar *) "STRING", 0, DND_TARGET_TYPE_STRING },
{ (gchar *) "text/plain;charset=utf-8", 0, DND_TARGET_TYPE_TEXT_PLAIN_UTF8 },
{ (gchar *) "text/uri-list", 0, E_DND_TARGET_TYPE_TEXT_URI_LIST },
{ (gchar *) "_NETSCAPE_URL", 0, E_DND_TARGET_TYPE_MOZILLA_URL },
{ (gchar *) "text/html", 0, E_DND_TARGET_TYPE_TEXT_HTML },
{ (gchar *) "UTF8_STRING", 0, E_DND_TARGET_TYPE_UTF8_STRING },
{ (gchar *) "text/plain", 0, E_DND_TARGET_TYPE_TEXT_PLAIN },
{ (gchar *) "STRING", 0, E_DND_TARGET_TYPE_STRING },
{ (gchar *) "text/plain;charset=utf-8", 0, E_DND_TARGET_TYPE_TEXT_PLAIN_UTF8 },
};
static guint signals[LAST_SIGNAL];
......@@ -1259,6 +1249,11 @@ composer_build_message (EMsgComposer *composer,
E_CONTENT_EDITOR_GET_PROCESSED,
NULL, NULL);
if (!text) {
g_warning ("%s: Failed to retrieve text/plain processed content", G_STRFUNC);
text = g_strdup ("");
}
g_byte_array_append (data, (guint8 *) text, strlen (text));
g_free (text);
......@@ -1345,6 +1340,11 @@ composer_build_message (EMsgComposer *composer,
E_CONTENT_EDITOR_GET_TEXT_HTML |
E_CONTENT_EDITOR_GET_INLINE_IMAGES,
from_domain, &inline_images_parts);
if (!text) {
g_warning ("%s: Failed to retrieve draft content", G_STRFUNC);
text = g_strdup ("");
}
} else {
text = e_content_editor_get_content (
cnt_editor,
......@@ -1352,6 +1352,11 @@ composer_build_message (EMsgComposer *composer,
E_CONTENT_EDITOR_GET_PROCESSED |
E_CONTENT_EDITOR_GET_INLINE_IMAGES,
from_domain, &inline_images_parts);
if (!text) {
g_warning ("%s: Failed to retrieve HTML processed content", G_STRFUNC);
text = g_strdup ("");
}
}
length = strlen (text);
......@@ -1755,14 +1760,17 @@ msg_composer_paste_primary_clipboard_cb (EContentEditor *cnt_editor,
EMsgComposer *composer)
{
GtkClipboard *clipboard;
GdkAtom *targets = NULL;
gint n_targets;
clipboard = gtk_clipboard_get (GDK_SELECTION_PRIMARY);
composer->priv->last_signal_was_paste_primary = TRUE;
gtk_clipboard_request_targets (
clipboard, (GtkClipboardTargetsReceivedFunc)
msg_composer_paste_clipboard_targets_cb, composer);
if (gtk_clipboard_wait_for_targets (clipboard, &targets, &n_targets)) {
msg_composer_paste_clipboard_targets_cb (clipboard, targets, n_targets, composer);
g_free (targets);
}
return TRUE;
}
......@@ -1772,170 +1780,19 @@ msg_composer_paste_clipboard_cb (EContentEditor *cnt_editor,
EMsgComposer *composer)
{
GtkClipboard *clipboard;
GdkAtom *targets = NULL;
gint n_targets;
clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
composer->priv->last_signal_was_paste_primary = FALSE;
gtk_clipboard_request_targets (
clipboard, (GtkClipboardTargetsReceivedFunc)
msg_composer_paste_clipboard_targets_cb, composer);
return TRUE;
}
#if 0 /* FIXME WK2 */
static gboolean
msg_composer_drag_motion_cb (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
guint time,
EMsgComposer *composer)
{
GtkWidget *source_widget;
EHTMLEditor *editor = e_msg_composer_get_editor (composer);
EHTMLEditorView *editor_view = e_html_editor_get_view (editor);
source_widget = gtk_drag_get_source_widget (context);
/* When we are doind DnD just inside the web view, the DnD is supposed
* to move things around. */
if (E_IS_HTML_EDITOR_VIEW (source_widget)) {
if ((gpointer) editor_view == (gpointer) source_widget) {
gdk_drag_status (context, GDK_ACTION_MOVE, time);
return FALSE;
}
}
gdk_drag_status (context, GDK_ACTION_COPY, time);
return FALSE;
}
static gboolean
msg_composer_drag_drop_cb (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
guint time,
EMsgComposer *composer)
{
GdkAtom target;
GtkWidget *source_widget;
/* When we are doing DnD just inside the web view, the DnD is supposed
* to move things around. */
source_widget = gtk_drag_get_source_widget (context);
if (E_IS_HTML_EDITOR_VIEW (source_widget)) {
EHTMLEditor *editor = e_msg_composer_get_editor (composer);
EHTMLEditorView *editor_view = e_html_editor_get_view (editor);
if ((gpointer) editor_view == (gpointer) source_widget) {
GDBusProxy *web_extension;
web_extension = e_html_editor_view_get_web_extension_proxy (editor_view);
if (web_extension) {
e_util_invoke_g_dbus_proxy_call_sync_wrapper_with_error_check (
web_extension,
"DOMSaveDragAndDropHistory",
g_variant_new (
"(t)",
webkit_web_view_get_page_id (WEBKIT_WEB_VIEW (editor_view))),
NULL);
}
return FALSE;
}
}
target = gtk_drag_dest_find_target (widget, context, NULL);
if (target == GDK_NONE)
gdk_drag_status (context, 0, time);
else {
/* Prevent WebKit from pasting the URI of file into the view. Also
* prevent it from inserting the text/plain or text/html content as we
* want to insert it ourselves. */
if (composer->priv->dnd_is_uri || !E_IS_HTML_EDITOR_VIEW (source_widget))
g_signal_stop_emission_by_name (widget, "drag-drop");
composer->priv->dnd_is_uri = FALSE;
if (E_IS_HTML_EDITOR_VIEW (source_widget))
gdk_drag_status (context, GDK_ACTION_MOVE, time);
else
gdk_drag_status (context, GDK_ACTION_COPY, time);
composer->priv->drop_occured = TRUE;
gtk_drag_get_data (widget, context, target, time);
return TRUE;
if (gtk_clipboard_wait_for_targets (clipboard, &targets, &n_targets)) {
msg_composer_paste_clipboard_targets_cb (clipboard, targets, n_targets, composer);
g_free (targets);
}
return FALSE;
}
static void
msg_composer_drag_data_received_after_cb (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
GtkSelectionData *selection,
guint info,
guint time,
EMsgComposer *composer)
{
EHTMLEditor *editor;
EHTMLEditorView *view;
GDBusProxy *web_extension;
if (!composer->priv->drop_occured)
goto out;
/* Save just history for events handled by WebKit. */
if (composer->priv->dnd_history_saved)
goto out;
editor = e_msg_composer_get_editor (composer);
view = e_html_editor_get_view (editor);
web_extension = e_html_editor_view_get_web_extension_proxy (view);
if (!web_extension)
goto out;
e_util_invoke_g_dbus_proxy_call_sync_wrapper_with_error_check (
web_extension,
"DOMCleanAfterDragAndDrop",
g_variant_new (
"(t)",
webkit_web_view_get_page_id (WEBKIT_WEB_VIEW (view))),
NULL);
out:
composer->priv->drop_occured = FALSE;
composer->priv->dnd_history_saved = FALSE;
}
static gchar *
next_uri (guchar **uri_list,
gint *len,
gint *list_len)
{
guchar *uri, *begin;
begin = *uri_list;
*len = 0;
while (**uri_list && **uri_list != '\n' && **uri_list != '\r' && *list_len) {
(*uri_list) ++;
(*len) ++;
(*list_len) --;
}
uri = (guchar *) g_strndup ((gchar *) begin, *len);
while ((!**uri_list || **uri_list == '\n' || **uri_list == '\r') && *list_len) {
(*uri_list) ++;
(*list_len) --;
}
return (gchar *) uri;
return TRUE;
}
static void
......@@ -1950,90 +1807,16 @@ msg_composer_drag_data_received_cb (GtkWidget *widget,
{
EHTMLEditor *editor;
EContentEditor *cnt_editor;
gboolean html_mode, same_widget = FALSE;
GtkWidget *source_widget;
gboolean html_mode, is_move;
editor = e_msg_composer_get_editor (composer);
cnt_editor = e_html_editor_get_content_editor (editor);
html_mode = e_content_editor_get_html_mode (cnt_editor);
composer->priv->dnd_history_saved = TRUE;
g_signal_handler_disconnect (cnt_editor, composer->priv->drag_data_received_handler_id);
composer->priv->drag_data_received_handler_id = 0;
/* When we are doing DnD just inside the web view, the DnD is supposed
* to move things around. */
source_widget = gtk_drag_get_source_widget (context);
if (E_IS_CONTENT_EDITOR (source_widget) &&
((gpointer) cnt_editor == (gpointer) source_widget))
same_widget = TRUE;
/* Leave DnD inside the view on WebKit. */
if (composer->priv->drop_occured && same_widget) {
gdk_drag_status (context, 0, time);
return;
}
if (!composer->priv->drop_occured) {
if (!same_widget) {
/* Check if we are DnD'ing some URI, if so WebKit will
* insert the URI into the view and we have to prevent it
* from doing that. */
if (info == DND_TARGET_TYPE_TEXT_URI_LIST) {
gchar **uris;
uris = gtk_selection_data_get_uris (selection);
/* I don't know what regressed outside of Evo, but
* this is called twice. Firstly with uris set
* following by one with uris not set. */
if (!composer->priv->dnd_is_uri)
composer->priv->dnd_is_uri = uris != NULL;
g_strfreev (uris);
}
}
return;
}
composer->priv->dnd_is_uri = FALSE;
/* Leave the text on WebKit to handle it. */
if (info == DND_TARGET_TYPE_UTF8_STRING ||
info == DND_TARGET_TYPE_STRING ||
info == DND_TARGET_TYPE_TEXT_PLAIN ||
info == DND_TARGET_TYPE_TEXT_PLAIN_UTF8) {
composer->priv->dnd_history_saved = FALSE;
gdk_drag_status (context, 0, time);
return;
}
if (info == DND_TARGET_TYPE_TEXT_HTML) {
const guchar *data;
gint length;
gint list_len, len;
gchar *text;
data = gtk_selection_data_get_data (selection);
length = gtk_selection_data_get_length (selection);
if (!data || length < 0) {
gtk_drag_finish (context, FALSE, FALSE, time);
return;
}
e_content_editor_move_caret_on_coordinates (cnt_editor, x, y, FALSE);
list_len = length;
do {
text = next_uri ((guchar **) &data, &len, &list_len);
e_content_editor_insert_content (
cnt_editor,
text,
E_CONTENT_EDITOR_INSERT_TEXT_HTML);
g_free (text);
} while (list_len);
gtk_drag_finish (context, TRUE, FALSE, time);
return;
}
is_move = gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE;
/* HTML mode has a few special cases for drops... */
/* If we're receiving URIs and -all- the URIs point to
......@@ -2059,12 +1842,12 @@ msg_composer_drag_data_received_cb (GtkWidget *widget,
list_len = length;
do {
uri = next_uri ((guchar **) &data, &len, &list_len);
uri = e_util_next_uri_from_uri_list ((guchar **) &data, &len, &list_len);
e_content_editor_insert_image (cnt_editor, uri);
g_free (uri);
} while (list_len);
gtk_drag_finish (context, TRUE, FALSE, time);
gtk_drag_finish (context, TRUE, is_move, time);
} else {
EAttachmentView *attachment_view =
e_msg_composer_get_attachment_view (composer);
......@@ -2077,7 +1860,53 @@ msg_composer_drag_data_received_cb (GtkWidget *widget,
context, x, y, selection, info, time);
}
}
#endif
static gboolean
msg_composer_drag_drop_cb (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
guint time,
EMsgComposer *composer)
{
GdkAtom target = gtk_drag_dest_find_target (widget, context, NULL);
if (target == GDK_NONE) {
gdk_drag_status (context, 0, time);
} else {
composer->priv->drag_data_received_handler_id = g_signal_connect (
E_CONTENT_EDITOR (widget), "drag-data-received",
G_CALLBACK (msg_composer_drag_data_received_cb), composer);
gtk_drag_get_data (widget, context, target, time);
return TRUE;
}
return FALSE;
}
static void
msg_composer_drop_handled_cb (EContentEditor *cnt_editor,
EMsgComposer *composer)
{
if (composer->priv->drag_data_received_handler_id != 0) {
g_signal_handler_disconnect (cnt_editor, composer->priv->drag_data_received_handler_id);
composer->priv->drag_data_received_handler_id = 0;
}
}
static void
msg_composer_drag_begin_cb (GtkWidget *widget,
GdkDragContext *context,
EMsgComposer *composer)
{
if (composer->priv->drag_data_received_handler_id != 0) {
g_signal_handler_disconnect (E_CONTENT_EDITOR( widget), composer->priv->drag_data_received_handler_id);
composer->priv->drag_data_received_handler_id = 0;
}
}
static void
msg_composer_notify_header_cb (EMsgComposer *composer)
{
......@@ -2466,28 +2295,18 @@ msg_composer_constructed (GObject *object)
G_CALLBACK (msg_composer_paste_primary_clipboard_cb), composer);
/* Drag-and-Drop Support */
#if 0 /* FIXME WK2 */
EHTMLEditorView *view;
view = e_html_editor_get_view (editor);
g_signal_connect (
view, "drag-motion",
G_CALLBACK (msg_composer_drag_motion_cb), composer);
g_signal_connect (
view, "drag-drop",
cnt_editor, "drag-drop",
G_CALLBACK (msg_composer_drag_drop_cb), composer);
g_signal_connect (
view, "drag-data-received",
G_CALLBACK (msg_composer_drag_data_received_cb), composer);
cnt_editor, "drag-begin",
G_CALLBACK (msg_composer_drag_begin_cb), composer);
g_signal_connect (
cnt_editor, "drop-handled",
G_CALLBACK (msg_composer_drop_handled_cb), composer);
/* Used for fixing various stuff after WebKit processed the DnD data. */
g_signal_connect_after (
view, "drag-data-received",
G_CALLBACK (msg_composer_drag_data_received_after_cb), composer);
#endif
g_signal_connect (
composer->priv->gallery_icon_view, "drag-data-get",
G_CALLBACK (msg_composer_gallery_drag_data_get), NULL);
......@@ -3789,6 +3608,17 @@ e_msg_composer_setup_with_message (EMsgComposer *composer,
g_strfreev (flags);
}
if (is_message_from_draft || (
camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Identity") &&
camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Transport"))) {
const gchar *reply_to;
reply_to = camel_medium_get_header (CAMEL_MEDIUM (message), "Reply-To");
if (reply_to)
e_composer_header_table_set_reply_to (table, reply_to);
}
/* Remove any other X-Evolution-* headers that may have been set */
camel_name_value_array_free (mail_tool_remove_xevolution_headers (message));
......@@ -5378,6 +5208,11 @@ e_msg_composer_get_raw_message_text_without_signature (EMsgComposer *composer)
E_CONTENT_EDITOR_GET_EXCLUDE_SIGNATURE,
NULL, NULL);
if (!content) {
g_warning ("%s: Failed to retrieve content", G_STRFUNC);
content = g_strdup ("");
}
return g_byte_array_new_take ((guint8 *) content, strlen (content));
}
......@@ -5404,6 +5239,11 @@ e_msg_composer_get_raw_message_text (EMsgComposer *composer)
E_CONTENT_EDITOR_GET_TEXT_PLAIN,
NULL, NULL);
if (!content) {
g_warning ("%s: Failed to retrieve content", G_STRFUNC);
content = g_strdup ("");
}
return g_byte_array_new_take ((guint8 *) content, strlen (content));
}
......@@ -5577,8 +5417,6 @@ e_msg_composer_restore_focus_on_composer (EMsgComposer *composer)
if (E_IS_CONTENT_EDITOR (widget)) {
EContentEditor *cnt_editor = E_CONTENT_EDITOR (widget);
/* FIXME WK2