Mercurial > hg > forks > geeqie
annotate src/bar_gps.c @ 2587:c6f9494f6be1
Fix #508: Copy and Move windows scale incorrectly
https://github.com/BestImageViewer/geeqie/issues/508
author | cclark <colin.clark@cclark.uk> |
---|---|
date | Wed, 06 Sep 2017 11:59:47 +0100 |
parents | aaca094d2f32 |
children | ade287ae8e45 |
rev | line source |
---|---|
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1 /* |
2350
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
2 * Copyright (C) 2004 John Ellis |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
3 * Copyright (C) 2008 - 2016 The Geeqie Team |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
4 * |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
5 * Author: Colin Clark |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
6 * |
2350
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
10 * (at your option) any later version. |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
11 * |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
15 * GNU General Public License for more details. |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
16 * |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
17 * You should have received a copy of the GNU General Public License along |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
18 * with this program; if not, write to the Free Software Foundation, Inc., |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2333
diff
changeset
|
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
20 */ |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
21 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
22 #include "main.h" |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
23 #ifdef HAVE_LIBCHAMPLAIN |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
24 #ifdef HAVE_LIBCHAMPLAIN_GTK |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
25 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
26 #include "bar_gps.h" |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
27 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
28 #include "bar.h" |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
29 #include "filedata.h" |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
30 #include "layout.h" |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
31 #include "metadata.h" |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
32 #include "menu.h" |
2478
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
33 #include "misc.h" |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
34 #include "rcfile.h" |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
35 #include "thumb.h" |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
36 #include "ui_menu.h" |
2478
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
37 #include "uri_utils.h" |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
38 #include "ui_utildlg.h" |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
39 |
1758
dba1d6eaf8ce
require libchamplain 0.4
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1754
diff
changeset
|
40 #include <clutter-gtk/clutter-gtk.h> |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
41 #include <champlain/champlain.h> |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
42 #include <champlain-gtk/champlain-gtk.h> |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
43 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
44 #define MARKER_COLOUR 0x00, 0x00, 0xff, 0xff |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
45 #define TEXT_COLOUR 0x00, 0x00, 0x00, 0xff |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
46 #define THUMB_COLOUR 0xff, 0xff, 0xff, 0xff |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
47 #define THUMB_SIZE 100 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
48 |
2385 | 49 #define DIRECTION_SIZE 300 |
50 | |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
51 /* |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
52 *------------------------------------------------------------------- |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
53 * GPS Map utils |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
54 *------------------------------------------------------------------- |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
55 */ |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
56 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
57 typedef struct _PaneGPSData PaneGPSData; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
58 struct _PaneGPSData |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
59 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
60 PaneData pane; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
61 GtkWidget *widget; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
62 gchar *map_source; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
63 gint height; |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
64 FileData *fd; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
65 ClutterActor *gps_view; |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
66 ChamplainMarkerLayer *icon_layer; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
67 GList *selection_list; |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
68 GList *not_added; |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
69 ChamplainBoundingBox *bbox; |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
70 guint num_added; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
71 guint create_markers_id; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
72 GtkWidget *progress; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
73 GtkWidget *slider; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
74 GtkWidget *state; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
75 gint selection_count; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
76 gboolean centre_map_checked; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
77 gboolean enable_markers_checked; |
2478
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
78 gdouble dest_latitude; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
79 gdouble dest_longitude; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
80 GList *geocode_list; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
81 }; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
82 |
2478
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
83 /* |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
84 *------------------------------------------------------------------- |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
85 * drag-and-drop |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
86 *------------------------------------------------------------------- |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
87 */ |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
88 enum { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
89 TARGET_APP_COLLECTION_MEMBER, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
90 TARGET_APP_EXIF_ENTRY, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
91 TARGET_APP_KEYWORD_PATH, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
92 TARGET_URI_LIST, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
93 TARGET_TEXT_PLAIN |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
94 }; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
95 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
96 static GtkTargetEntry bar_pane_gps_drop_types[] = { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
97 { "text/uri-list", 0, TARGET_URI_LIST }, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
98 { "text/plain", 0, TARGET_TEXT_PLAIN } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
99 }; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
100 static gint n_gps_entry_drop_types = 2; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
101 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
102 static void bar_pane_gps_close_cancel_cb(GenericDialog *gd, gpointer data) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
103 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
104 PaneGPSData *pgd = data; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
105 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
106 g_list_free(pgd->geocode_list); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
107 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
108 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
109 static void bar_pane_gps_close_save_cb(GenericDialog *gd, gpointer data) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
110 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
111 PaneGPSData *pgd = data; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
112 FileData *fd; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
113 GList *work; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
114 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
115 work = g_list_first(pgd->geocode_list); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
116 while (work) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
117 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
118 fd = work->data; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
119 if (fd->name && !fd->parent) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
120 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
121 work = work->next; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
122 metadata_write_GPS_coord(fd, "Xmp.exif.GPSLatitude", pgd->dest_latitude); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
123 metadata_write_GPS_coord(fd, "Xmp.exif.GPSLongitude", pgd->dest_longitude); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
124 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
125 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
126 g_list_free(work); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
127 g_list_free(pgd->geocode_list); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
128 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
129 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
130 static void bar_pane_gps_dnd_receive(GtkWidget *pane, GdkDragContext *context, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
131 gint x, gint y, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
132 GtkSelectionData *selection_data, guint info, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
133 guint time, gpointer data) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
134 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
135 PaneGPSData *pgd; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
136 GenericDialog *gd; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
137 FileData *fd, *fd_found; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
138 GList *work, *list; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
139 gint count, geocoded_count; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
140 gdouble latitude, longitude; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
141 GString *message; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
142 gchar *location; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
143 gchar **latlong; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
144 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
145 pgd = g_object_get_data(G_OBJECT(pane), "pane_data"); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
146 if (!pgd) return; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
147 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
148 if (info == TARGET_URI_LIST) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
149 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
150 pgd->dest_longitude = champlain_view_x_to_longitude(CHAMPLAIN_VIEW(pgd->gps_view), x); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
151 pgd->dest_latitude = champlain_view_y_to_latitude(CHAMPLAIN_VIEW(pgd->gps_view), y); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
152 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
153 count = 0; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
154 geocoded_count = 0; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
155 pgd->geocode_list = NULL; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
156 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
157 list = uri_filelist_from_gtk_selection_data(selection_data); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
158 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
159 if (list) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
160 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
161 work = list; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
162 while (work) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
163 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
164 fd = work->data; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
165 work = work->next; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
166 if (fd->name && !fd->parent) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
167 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
168 count++; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
169 pgd->geocode_list = g_list_append(pgd->geocode_list, fd); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
170 latitude = metadata_read_GPS_coord(fd, "Xmp.exif.GPSLatitude", 1000); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
171 longitude = metadata_read_GPS_coord(fd, "Xmp.exif.GPSLongitude", 1000); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
172 if (latitude != 1000 && longitude != 1000) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
173 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
174 geocoded_count++; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
175 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
176 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
177 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
178 g_list_free(work); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
179 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
180 if(count) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
181 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
182 message = g_string_new(""); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
183 if (count == 1) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
184 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
185 fd_found = g_list_first(pgd->geocode_list)->data; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
186 g_string_append_printf(message, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
187 _("\nDo you want to geocode image %s?"), fd_found->name); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
188 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
189 else |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
190 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
191 g_string_append_printf(message, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
192 _("\nDo you want to geocode %i images?"), count); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
193 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
194 if (geocoded_count == 1 && count == 1) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
195 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
196 g_string_append_printf(message, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
197 _("\nThis image is already geocoded!")); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
198 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
199 else if (geocoded_count == 1 && count > 1) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
200 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
201 g_string_append_printf(message, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
202 _("\nOne image is already geocoded!")); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
203 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
204 else if (geocoded_count > 1 && count > 1) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
205 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
206 g_string_append_printf(message, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
207 _("\n%i Images are already geocoded!"), geocoded_count); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
208 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
209 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
210 location = g_strdup_printf("%lf %lf", pgd->dest_latitude, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
211 pgd->dest_longitude); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
212 g_string_append_printf(message, _("\n\nPosition: %s \n"), location); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
213 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
214 gd = generic_dialog_new(_("Geocode images"), |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
215 "geocode_images", NULL, TRUE, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
216 bar_pane_gps_close_cancel_cb, pgd); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
217 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
218 _("Write lat/long to meta-data?"), |
2587
c6f9494f6be1
Fix #508: Copy and Move windows scale incorrectly
cclark <colin.clark@cclark.uk>
parents:
2570
diff
changeset
|
219 message->str, TRUE); |
2478
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
220 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
221 generic_dialog_add_button(gd, GTK_STOCK_SAVE, NULL, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
222 bar_pane_gps_close_save_cb, TRUE); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
223 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
224 gtk_widget_show(gd->dialog); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
225 g_free(location); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
226 g_string_free(message, TRUE); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
227 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
228 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
229 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
230 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
231 if (info == TARGET_TEXT_PLAIN) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
232 { |
2519
4d1bf123eeed
Fix clang compile errors
Colin Clark <colin.clark@cclark.uk>
parents:
2478
diff
changeset
|
233 location = decode_geo_parameters((gchar *)gtk_selection_data_get_data(selection_data)); |
2478
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
234 if (!(g_strstr_len(location,-1,"Error"))) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
235 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
236 latlong = g_strsplit(location, " ", 2); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
237 champlain_view_center_on(CHAMPLAIN_VIEW(pgd->gps_view), |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
238 g_ascii_strtod(latlong[0],NULL), |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
239 g_ascii_strtod(latlong[1],NULL)); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
240 g_strfreev(latlong); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
241 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
242 g_free(location); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
243 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
244 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
245 return; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
246 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
247 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
248 static void bar_pane_gps_dnd_init(gpointer data) |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
249 { |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
250 PaneGPSData *pgd = data; |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
251 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
252 gtk_drag_dest_set(pgd->widget, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
253 GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
254 bar_pane_gps_drop_types, n_gps_entry_drop_types, |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
255 GDK_ACTION_COPY | GDK_ACTION_MOVE); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
256 g_signal_connect(G_OBJECT(pgd->widget), "drag_data_received", |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
257 G_CALLBACK(bar_pane_gps_dnd_receive), NULL); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
258 |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
259 } |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
260 |
2385 | 261 static gboolean bar_gps_draw_direction (ClutterCanvas *canvas, |
262 cairo_t *cr, gpointer data) | |
263 { | |
264 cairo_set_source_rgb(cr, 255, 0, 0); | |
265 | |
266 cairo_set_line_width(cr, 2); | |
267 cairo_move_to(cr, 0, 1); | |
268 cairo_line_to(cr, DIRECTION_SIZE, 1); | |
269 | |
270 cairo_stroke(cr); | |
271 | |
272 return TRUE; | |
273 } | |
274 | |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
275 static void bar_pane_gps_thumb_done_cb(ThumbLoader *tl, gpointer data) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
276 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
277 FileData *fd; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
278 ClutterActor *marker; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
279 ClutterActor *actor; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
280 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
281 marker = CLUTTER_ACTOR(data); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
282 fd = g_object_get_data(G_OBJECT(marker), "file_fd"); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
283 if (fd->thumb_pixbuf != NULL) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
284 { |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
285 actor = gtk_clutter_texture_new(); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
286 gtk_clutter_texture_set_from_pixbuf(GTK_CLUTTER_TEXTURE(actor), fd->thumb_pixbuf, NULL); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
287 champlain_label_set_image(CHAMPLAIN_LABEL(marker), actor); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
288 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
289 thumb_loader_free(tl); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
290 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
291 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
292 static void bar_pane_gps_thumb_error_cb(ThumbLoader *tl, gpointer data) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
293 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
294 thumb_loader_free(tl); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
295 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
296 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
297 static gboolean bar_pane_gps_marker_keypress_cb(GtkWidget *widget, ClutterButtonEvent *bevent, gpointer data) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
298 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
299 //PaneGPSData *pgd = data; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
300 FileData *fd; |
2385 | 301 ClutterActor *label_marker, *parent_marker; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
302 ClutterColor marker_colour = { MARKER_COLOUR }; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
303 ClutterColor text_colour = { TEXT_COLOUR }; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
304 ClutterColor thumb_colour = { THUMB_COLOUR }; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
305 gchar *current_text; |
2385 | 306 ClutterActor *actor, *direction; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
307 ClutterActor *current_image; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
308 GString *text; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
309 gint height, width, rotate; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
310 gchar *altitude = NULL; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
311 ThumbLoader *tl; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
312 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
313 if (bevent->button == MOUSE_BUTTON_LEFT) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
314 { |
2385 | 315 label_marker = CLUTTER_ACTOR(widget); |
316 fd = g_object_get_data(G_OBJECT(label_marker), "file_fd"); | |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
317 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
318 /* If the marker is showing a thumbnail, delete it |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
319 */ |
2385 | 320 current_image = champlain_label_get_image(CHAMPLAIN_LABEL(label_marker)); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
321 if (current_image != NULL) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
322 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
323 clutter_actor_destroy(CLUTTER_ACTOR(current_image)); |
2385 | 324 champlain_label_set_image(CHAMPLAIN_LABEL(label_marker), NULL); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
325 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
326 |
2385 | 327 current_text = g_strdup(champlain_label_get_text(CHAMPLAIN_LABEL(label_marker))); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
328 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
329 /* If the marker is showing only the text character, replace it with a |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
330 * thumbnail and date and altitude |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
331 */ |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
332 if (g_strcmp0(current_text, "i") == 0) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
333 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
334 /* If a thumbail has already been generated, use that. If not try the pixbuf of the full image. |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
335 * If not, call the thumb_loader to generate a thumbnail and update the marker later in the |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
336 * thumb_loader callback |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
337 */ |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
338 if (fd->thumb_pixbuf != NULL) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
339 { |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
340 actor = gtk_clutter_texture_new(); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
341 gtk_clutter_texture_set_from_pixbuf(GTK_CLUTTER_TEXTURE(actor), fd->thumb_pixbuf, NULL); |
2385 | 342 champlain_label_set_image(CHAMPLAIN_LABEL(label_marker), actor); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
343 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
344 else if (fd->pixbuf != NULL) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
345 { |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
346 actor = gtk_clutter_texture_new(); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
347 width = gdk_pixbuf_get_width (fd->pixbuf); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
348 height = gdk_pixbuf_get_height (fd->pixbuf); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
349 switch (fd->exif_orientation) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
350 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
351 case 8: |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
352 rotate = GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
353 break; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
354 case 3: |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
355 rotate = GDK_PIXBUF_ROTATE_UPSIDEDOWN; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
356 break; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
357 case 6: |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
358 rotate = GDK_PIXBUF_ROTATE_CLOCKWISE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
359 break; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
360 default: |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
361 rotate = GDK_PIXBUF_ROTATE_NONE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
362 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
363 |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
364 gtk_clutter_texture_set_from_pixbuf(GTK_CLUTTER_TEXTURE(actor), |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
365 gdk_pixbuf_rotate_simple(gdk_pixbuf_scale_simple(fd->pixbuf, THUMB_SIZE, height * THUMB_SIZE / width, |
1758
dba1d6eaf8ce
require libchamplain 0.4
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1754
diff
changeset
|
366 GDK_INTERP_NEAREST), rotate), NULL); |
2385 | 367 champlain_label_set_image(CHAMPLAIN_LABEL(label_marker), actor); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
368 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
369 else |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
370 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
371 tl = thumb_loader_new(THUMB_SIZE, THUMB_SIZE); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
372 thumb_loader_set_callbacks(tl, |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
373 bar_pane_gps_thumb_done_cb, |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
374 bar_pane_gps_thumb_error_cb, |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
375 NULL, |
2385 | 376 label_marker); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
377 thumb_loader_start(tl, fd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
378 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
379 |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
380 text = g_string_new(fd->name); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
381 g_string_append(text, "\n"); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
382 g_string_append(text, text_from_time(fd->date)); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
383 g_string_append(text, "\n"); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
384 altitude = metadata_read_string(fd, "formatted.GPSAltitude", METADATA_FORMATTED); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
385 if (altitude != NULL) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
386 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
387 g_string_append(text, altitude); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
388 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
389 |
2385 | 390 champlain_label_set_text(CHAMPLAIN_LABEL(label_marker), text->str); |
391 champlain_label_set_font_name(CHAMPLAIN_LABEL(label_marker), "sans 8"); | |
392 champlain_marker_set_selection_color(&thumb_colour); | |
393 champlain_marker_set_selection_text_color(&text_colour); | |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
394 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
395 g_free(altitude); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
396 g_string_free(text, TRUE); |
2385 | 397 |
398 parent_marker = clutter_actor_get_parent(label_marker); | |
399 direction = clutter_actor_get_child_at_index(parent_marker, 0); | |
400 clutter_actor_set_opacity(direction, 255); | |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
401 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
402 /* otherwise, revert to the hidden text marker |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
403 */ |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
404 else |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
405 { |
2385 | 406 champlain_label_set_text(CHAMPLAIN_LABEL(label_marker), "i"); |
407 champlain_label_set_font_name(CHAMPLAIN_LABEL(label_marker), "courier 5"); | |
408 champlain_marker_set_selection_color(&marker_colour); | |
409 champlain_marker_set_selection_text_color(&marker_colour); | |
410 | |
411 parent_marker = clutter_actor_get_parent(label_marker); | |
412 direction = clutter_actor_get_child_at_index(parent_marker, 0); | |
413 clutter_actor_set_opacity(direction, 0); | |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
414 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
415 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
416 g_free(current_text); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
417 |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
418 return TRUE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
419 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
420 return TRUE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
421 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
422 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
423 static gboolean bar_pane_gps_create_markers_cb(gpointer data) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
424 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
425 PaneGPSData *pgd = data; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
426 gdouble latitude; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
427 gdouble longitude; |
2385 | 428 gdouble compass; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
429 FileData *fd; |
2385 | 430 ClutterActor *parent_marker, *label_marker; |
431 ClutterActor *direction; | |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
432 ClutterColor marker_colour = { MARKER_COLOUR }; |
2385 | 433 ClutterColor thumb_colour = { THUMB_COLOUR }; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
434 GString *message; |
2385 | 435 ClutterContent *canvas; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
436 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
437 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pgd->progress), |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
438 (gdouble)(pgd->selection_count - g_list_length(pgd->not_added)) / |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
439 (gdouble)pgd->selection_count); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
440 |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
441 message = g_string_new(""); |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
442 g_string_printf(message, "%i/%i", (pgd->selection_count - g_list_length(pgd->not_added)), |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
443 pgd->selection_count); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
444 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(pgd->progress), message->str); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
445 g_string_free(message, TRUE); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
446 |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
447 if(pgd->not_added) |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
448 { |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
449 fd = pgd->not_added->data; |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
450 pgd->not_added = pgd->not_added->next; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
451 |
2359
4287c981aa44
Check if GPS data is reasonable
Colin Clark <cclark@mcb.net>
parents:
2350
diff
changeset
|
452 latitude = metadata_read_GPS_coord(fd, "Xmp.exif.GPSLatitude", 0); |
4287c981aa44
Check if GPS data is reasonable
Colin Clark <cclark@mcb.net>
parents:
2350
diff
changeset
|
453 longitude = metadata_read_GPS_coord(fd, "Xmp.exif.GPSLongitude", 0); |
2385 | 454 compass = metadata_read_GPS_direction(fd, "Xmp.exif.GPSImgDirection", 1000); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
455 |
2360
b9cf3f1375c8
Check if GPS data is reasonable
Colin Clark <cclark@mcb.net>
parents:
2359
diff
changeset
|
456 if (!(latitude == 0 && longitude == 0)) |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
457 { |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
458 pgd->num_added++; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
459 |
2385 | 460 parent_marker = champlain_marker_new(); |
461 clutter_actor_set_reactive(parent_marker, FALSE); | |
462 label_marker = champlain_label_new_with_text("i","courier 5", &marker_colour, &marker_colour); | |
463 clutter_actor_set_reactive(label_marker, TRUE); | |
464 champlain_marker_set_selection_color(&thumb_colour); | |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
465 |
2385 | 466 if (compass != 1000) |
467 { | |
468 canvas = clutter_canvas_new(); | |
469 clutter_canvas_set_size(CLUTTER_CANVAS (canvas), DIRECTION_SIZE, 3); | |
470 g_signal_connect(canvas, "draw", G_CALLBACK(bar_gps_draw_direction), NULL); | |
471 direction = clutter_actor_new(); | |
472 clutter_actor_set_size(direction, DIRECTION_SIZE, 3); | |
473 clutter_actor_set_position(direction, 0, 0); | |
474 clutter_actor_set_rotation_angle(direction, CLUTTER_Z_AXIS, compass -90.00); | |
475 clutter_actor_set_content(direction, canvas); | |
476 clutter_content_invalidate(canvas); | |
477 g_object_unref(canvas); | |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
478 |
2385 | 479 clutter_actor_add_child(parent_marker, direction); |
480 clutter_actor_set_opacity(direction, 0); | |
481 } | |
482 | |
483 clutter_actor_add_child(parent_marker, label_marker); | |
484 | |
485 champlain_location_set_location(CHAMPLAIN_LOCATION(parent_marker), latitude, longitude); | |
486 champlain_marker_layer_add_marker(pgd->icon_layer, CHAMPLAIN_MARKER(parent_marker)); | |
487 | |
488 g_signal_connect(G_OBJECT(label_marker), "button_release_event", | |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
489 G_CALLBACK(bar_pane_gps_marker_keypress_cb), pgd); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
490 |
2385 | 491 g_object_set_data(G_OBJECT(label_marker), "file_fd", fd); |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
492 |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
493 champlain_bounding_box_extend(pgd->bbox, latitude, longitude); |
2385 | 494 |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
495 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
496 return TRUE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
497 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
498 |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
499 if (pgd->centre_map_checked) |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
500 { |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
501 if (pgd->num_added == 1) |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
502 { |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
503 champlain_bounding_box_get_center(pgd->bbox, &latitude, &longitude); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
504 champlain_view_go_to(CHAMPLAIN_VIEW(pgd->gps_view), latitude, longitude); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
505 } |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
506 else if (pgd->num_added > 1) |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
507 { |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
508 champlain_view_ensure_visible(CHAMPLAIN_VIEW(pgd->gps_view), pgd->bbox, TRUE); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
509 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
510 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
511 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pgd->progress), 0); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
512 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(pgd->progress), NULL); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
513 pgd->create_markers_id = 0; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
514 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
515 return FALSE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
516 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
517 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
518 static void bar_pane_gps_update(PaneGPSData *pgd) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
519 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
520 GList *list; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
521 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
522 /* If a create-marker background process is running, kill it |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
523 * and start again |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
524 */ |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
525 if (pgd->create_markers_id != 0) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
526 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
527 if (g_idle_remove_by_data(pgd)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
528 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
529 pgd->create_markers_id = 0; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
530 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
531 else |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
532 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
533 return; |
2184 | 534 } |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
535 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
536 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
537 /* Delete any markers currently displayed |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
538 */ |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
539 |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
540 champlain_marker_layer_remove_all(pgd->icon_layer); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
541 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
542 if (!pgd->enable_markers_checked) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
543 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
544 return; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
545 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
546 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
547 /* For each selected photo that has GPS data, create a marker containing |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
548 * a single, small text character the same colour as the marker background. |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
549 * Use a background process in case the user selects a large number of files. |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
550 */ |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
551 filelist_free(pgd->selection_list); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
552 if (pgd->bbox) champlain_bounding_box_free(pgd->bbox); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
553 |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
554 list = layout_selection_list(pgd->pane.lw); |
1754
4659e78fd247
fixed selection handling in sidebar
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1733
diff
changeset
|
555 list = file_data_process_groups_in_selection(list, FALSE, NULL); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
556 |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
557 pgd->selection_list = list; |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
558 pgd->not_added = list; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
559 |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
560 pgd->bbox = champlain_bounding_box_new(); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
561 pgd->selection_count = g_list_length(pgd->selection_list); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
562 pgd->create_markers_id = g_idle_add(bar_pane_gps_create_markers_cb, pgd); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
563 pgd->num_added = 0; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
564 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
565 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
566 void bar_pane_gps_set_map_source(PaneGPSData *pgd, const gchar *map_id) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
567 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
568 ChamplainMapSource *map_source; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
569 ChamplainMapSourceFactory *map_factory; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
570 |
1733
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
571 map_factory = champlain_map_source_factory_dup_default(); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
572 map_source = champlain_map_source_factory_create(map_factory, map_id); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
573 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
574 if (map_source != NULL) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
575 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
576 g_object_set(G_OBJECT(pgd->gps_view), "map-source", map_source, NULL); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
577 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
578 |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
579 g_object_unref(map_factory); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
580 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
581 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
582 void bar_pane_gps_enable_markers_checked_toggle_cb(GtkWidget *menu_widget, gpointer data) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
583 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
584 PaneGPSData *pgd = data; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
585 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
586 if (pgd->enable_markers_checked) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
587 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
588 pgd->enable_markers_checked = FALSE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
589 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
590 else |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
591 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
592 pgd->enable_markers_checked = TRUE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
593 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
594 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
595 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
596 static void bar_pane_gps_centre_map_checked_toggle_cb(GtkWidget *menu_widget, gpointer data) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
597 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
598 PaneGPSData *pgd = data; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
599 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
600 if (pgd->centre_map_checked) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
601 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
602 pgd->centre_map_checked = FALSE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
603 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
604 else |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
605 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
606 pgd->centre_map_checked = TRUE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
607 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
608 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
609 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
610 static void bar_pane_gps_change_map_cb(GtkWidget *widget, gpointer data) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
611 { |
1667
4482edafd1fa
simplified menu_item_add_radio usage
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1604
diff
changeset
|
612 PaneGPSData *pgd = data; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
613 gchar *mapsource; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
614 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
615 if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
616 return; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
617 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
618 if (!pgd) return; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
619 |
1667
4482edafd1fa
simplified menu_item_add_radio usage
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1604
diff
changeset
|
620 mapsource = g_object_get_data(G_OBJECT(widget), "menu_item_radio_data"); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
621 bar_pane_gps_set_map_source(pgd, mapsource); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
622 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
623 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
624 static void bar_pane_gps_notify_selection(GtkWidget *bar, gint count) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
625 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
626 PaneGPSData *pgd; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
627 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
628 if (count == 0) return; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
629 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
630 pgd = g_object_get_data(G_OBJECT(bar), "pane_data"); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
631 if (!pgd) return; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
632 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
633 bar_pane_gps_update(pgd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
634 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
635 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
636 static void bar_pane_gps_set_fd(GtkWidget *bar, FileData *fd) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
637 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
638 PaneGPSData *pgd; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
639 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
640 pgd = g_object_get_data(G_OBJECT(bar), "pane_data"); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
641 if (!pgd) return; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
642 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
643 file_data_unref(pgd->fd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
644 pgd->fd = file_data_ref(fd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
645 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
646 bar_pane_gps_update(pgd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
647 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
648 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
649 static gint bar_pane_gps_event(GtkWidget *bar, GdkEvent *event) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
650 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
651 PaneGPSData *pgd; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
652 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
653 pgd = g_object_get_data(G_OBJECT(bar), "pane_data"); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
654 if (!pgd) return FALSE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
655 |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
656 if (gtk_widget_has_focus(pgd->widget)) return gtk_widget_event(GTK_WIDGET(pgd->widget), event); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
657 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
658 return FALSE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
659 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
660 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
661 static void bar_pane_gps_write_config(GtkWidget *pane, GString *outstr, gint indent) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
662 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
663 PaneGPSData *pgd; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
664 gint zoom; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
665 ChamplainMapSource *mapsource; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
666 const gchar *map_id; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
667 gchar *str = NULL; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
668 GString *buffer = g_string_new(str); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
669 gdouble position; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
670 gint int_position; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
671 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
672 pgd = g_object_get_data(G_OBJECT(pane), "pane_data"); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
673 if (!pgd) return; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
674 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
675 WRITE_NL(); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
676 WRITE_STRING("<pane_gps "); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
677 write_char_option(outstr, indent, "id", pgd->pane.id); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
678 write_char_option(outstr, indent, "title", gtk_label_get_text(GTK_LABEL(pgd->pane.title))); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
679 WRITE_BOOL(pgd->pane, expanded); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
680 WRITE_INT(*pgd, height); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
681 indent++; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
682 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
683 g_object_get(G_OBJECT(pgd->gps_view), "map-source", &mapsource, NULL); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
684 map_id = champlain_map_source_get_id(mapsource); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
685 WRITE_NL(); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
686 write_char_option(outstr, indent, "map-id", map_id); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
687 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
688 g_object_get(G_OBJECT(pgd->gps_view), "zoom-level", &zoom, NULL); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
689 g_string_printf(buffer, "%d", zoom); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
690 WRITE_NL(); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
691 write_char_option(outstr, indent, "zoom-level", buffer->str); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
692 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
693 g_object_get(G_OBJECT(pgd->gps_view), "latitude", &position, NULL); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
694 int_position = position * 1000000; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
695 g_string_printf(buffer, "%i", int_position); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
696 WRITE_NL(); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
697 write_char_option(outstr, indent, "latitude", buffer->str); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
698 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
699 g_object_get(G_OBJECT(pgd->gps_view), "longitude", &position, NULL); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
700 int_position = position * 1000000; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
701 g_string_printf(buffer, "%i", int_position); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
702 WRITE_NL(); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
703 write_char_option(outstr, indent, "longitude", buffer->str); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
704 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
705 indent--; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
706 WRITE_NL(); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
707 WRITE_STRING("/>"); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
708 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
709 g_object_unref(mapsource); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
710 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
711 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
712 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
713 static void bar_pane_gps_slider_changed_cb(GtkScaleButton *slider, |
1733
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
714 gdouble zoom, |
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
715 gpointer data) |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
716 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
717 PaneGPSData *pgd = data; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
718 GString *message; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
719 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
720 message = g_string_new(""); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
721 g_string_printf(message, _("Zoom %i"), (gint)zoom); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
722 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
723 g_object_set(G_OBJECT(CHAMPLAIN_VIEW(pgd->gps_view)), "zoom-level", (gint)zoom, NULL); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
724 gtk_widget_set_tooltip_text(GTK_WIDGET(slider), message->str); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
725 g_string_free(message, TRUE); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
726 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
727 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
728 static void bar_pane_gps_view_state_changed_cb(ChamplainView *view, |
1733
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
729 GParamSpec *gobject, |
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
730 gpointer data) |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
731 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
732 PaneGPSData *pgd = data; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
733 ChamplainState status; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
734 gint zoom; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
735 GString *message; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
736 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
737 g_object_get(G_OBJECT(view), "zoom-level", &zoom, NULL); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
738 message = g_string_new(""); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
739 g_string_printf(message, _("Zoom level %i"), zoom); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
740 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
741 g_object_get(G_OBJECT(view), "state", &status, NULL); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
742 if (status == CHAMPLAIN_STATE_LOADING) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
743 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
744 gtk_label_set_text(GTK_LABEL(pgd->state), _("Loading map")); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
745 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
746 else |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
747 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
748 gtk_label_set_text(GTK_LABEL(pgd->state), message->str); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
749 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
750 |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
751 gtk_widget_set_tooltip_text(GTK_WIDGET(pgd->slider), message->str); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
752 gtk_scale_button_set_value(GTK_SCALE_BUTTON(pgd->slider), (gdouble)zoom); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
753 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
754 g_string_free(message, TRUE); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
755 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
756 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
757 static void bar_pane_gps_notify_cb(FileData *fd, NotifyType type, gpointer data) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
758 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
759 PaneGPSData *pgd = data; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
760 |
2184 | 761 if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && |
762 g_list_find(pgd->selection_list, fd)) | |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
763 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
764 bar_pane_gps_update(pgd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
765 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
766 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
767 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
768 const gchar *bar_pane_gps_get_map_id(PaneGPSData *pgd) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
769 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
770 const gchar *map_id; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
771 ChamplainMapSource *mapsource; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
772 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
773 g_object_get(G_OBJECT(pgd->gps_view), "map-source", &mapsource, NULL); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
774 map_id = champlain_map_source_get_id(mapsource); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
775 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
776 g_object_unref(mapsource); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
777 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
778 return map_id; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
779 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
780 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
781 static GtkWidget *bar_pane_gps_menu(PaneGPSData *pgd) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
782 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
783 GtkWidget *menu; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
784 GtkWidget *map_centre; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
785 ChamplainMapSourceFactory *map_factory; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
786 GSList *map_list; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
787 ChamplainMapSourceDesc *map_desc; |
1667
4482edafd1fa
simplified menu_item_add_radio usage
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1604
diff
changeset
|
788 const gchar *current; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
789 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
790 menu = popup_menu_short_lived(); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
791 |
1733
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
792 map_factory = champlain_map_source_factory_dup_default(); |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
793 map_list = champlain_map_source_factory_get_registered(map_factory); |
1667
4482edafd1fa
simplified menu_item_add_radio usage
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1604
diff
changeset
|
794 current = bar_pane_gps_get_map_id(pgd); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
795 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
796 while (map_list) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
797 { |
1667
4482edafd1fa
simplified menu_item_add_radio usage
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1604
diff
changeset
|
798 map_desc = (ChamplainMapSourceDesc *)(map_list->data); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
799 |
2184 | 800 menu_item_add_radio(menu, |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
801 champlain_map_source_desc_get_name(map_desc), |
2184 | 802 (gpointer)champlain_map_source_desc_get_id(map_desc), |
803 strcmp(champlain_map_source_desc_get_id(map_desc), current) == 0, | |
804 G_CALLBACK(bar_pane_gps_change_map_cb), pgd); | |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
805 |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
806 map_list = g_slist_next(map_list); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
807 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
808 |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
809 menu_item_add_divider(menu); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
810 menu_item_add_check(menu, _("Enable markers"), pgd->enable_markers_checked, |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
811 G_CALLBACK(bar_pane_gps_enable_markers_checked_toggle_cb), pgd); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
812 map_centre = menu_item_add_check(menu, _("Centre map on marker"), pgd->centre_map_checked, |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
813 G_CALLBACK(bar_pane_gps_centre_map_checked_toggle_cb), pgd); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
814 if (!pgd->enable_markers_checked) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
815 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
816 gtk_widget_set_sensitive(map_centre, FALSE); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
817 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
818 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
819 g_slist_free(map_list); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
820 g_object_unref(map_factory); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
821 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
822 return menu; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
823 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
824 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
825 /* Determine if the map is to be re-centred on the marker when another photo is selected |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
826 */ |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
827 void bar_pane_gps_map_centreing(PaneGPSData *pgd) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
828 { |
2478
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
829 GenericDialog *gd; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
830 GString *message = g_string_new(""); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
831 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
832 if (pgd->centre_map_checked) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
833 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
834 message = g_string_append(message, _("Move map centre to marker\n is disabled")); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
835 pgd->centre_map_checked = FALSE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
836 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
837 else |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
838 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
839 message = g_string_append(message, _("Move map centre to marker\n is enabled")); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
840 pgd->centre_map_checked = TRUE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
841 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
842 |
2478
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
843 gd = generic_dialog_new(_("Map centering"), |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
844 "map_centering", NULL, TRUE, NULL, pgd); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
845 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_INFO, |
2587
c6f9494f6be1
Fix #508: Copy and Move windows scale incorrectly
cclark <colin.clark@cclark.uk>
parents:
2570
diff
changeset
|
846 "Map Centering", message->str, TRUE); |
2478
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
847 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, NULL, TRUE); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
848 |
2478
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
849 gtk_widget_show(gd->dialog); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
850 |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
851 g_string_free(message, TRUE); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
852 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
853 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
854 static gboolean bar_pane_gps_map_keypress_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
855 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
856 PaneGPSData *pgd = data; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
857 GtkWidget *menu; |
2477
9e65967e9af0
Search on geo-position
Colin Clark <colin.clark@cclark.uk>
parents:
2439
diff
changeset
|
858 GtkClipboard *clipboard; |
9e65967e9af0
Search on geo-position
Colin Clark <colin.clark@cclark.uk>
parents:
2439
diff
changeset
|
859 gchar *geo_coords; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
860 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
861 if (bevent->button == MOUSE_BUTTON_RIGHT) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
862 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
863 menu = bar_pane_gps_menu(pgd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
864 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, bevent->button, bevent->time); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
865 return TRUE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
866 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
867 else if (bevent->button == MOUSE_BUTTON_MIDDLE) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
868 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
869 bar_pane_gps_map_centreing(pgd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
870 return TRUE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
871 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
872 else if (bevent->button == MOUSE_BUTTON_LEFT) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
873 { |
2477
9e65967e9af0
Search on geo-position
Colin Clark <colin.clark@cclark.uk>
parents:
2439
diff
changeset
|
874 clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); |
9e65967e9af0
Search on geo-position
Colin Clark <colin.clark@cclark.uk>
parents:
2439
diff
changeset
|
875 geo_coords = g_strdup_printf("%lf %lf", |
9e65967e9af0
Search on geo-position
Colin Clark <colin.clark@cclark.uk>
parents:
2439
diff
changeset
|
876 champlain_view_y_to_latitude( |
9e65967e9af0
Search on geo-position
Colin Clark <colin.clark@cclark.uk>
parents:
2439
diff
changeset
|
877 CHAMPLAIN_VIEW(pgd->gps_view),bevent->y), |
9e65967e9af0
Search on geo-position
Colin Clark <colin.clark@cclark.uk>
parents:
2439
diff
changeset
|
878 champlain_view_x_to_longitude( |
9e65967e9af0
Search on geo-position
Colin Clark <colin.clark@cclark.uk>
parents:
2439
diff
changeset
|
879 CHAMPLAIN_VIEW(pgd->gps_view),bevent->x)); |
9e65967e9af0
Search on geo-position
Colin Clark <colin.clark@cclark.uk>
parents:
2439
diff
changeset
|
880 gtk_clipboard_set_text(clipboard, geo_coords, -1); |
9e65967e9af0
Search on geo-position
Colin Clark <colin.clark@cclark.uk>
parents:
2439
diff
changeset
|
881 |
9e65967e9af0
Search on geo-position
Colin Clark <colin.clark@cclark.uk>
parents:
2439
diff
changeset
|
882 g_free(geo_coords); |
9e65967e9af0
Search on geo-position
Colin Clark <colin.clark@cclark.uk>
parents:
2439
diff
changeset
|
883 |
9e65967e9af0
Search on geo-position
Colin Clark <colin.clark@cclark.uk>
parents:
2439
diff
changeset
|
884 return TRUE; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
885 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
886 else |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
887 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
888 return FALSE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
889 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
890 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
891 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
892 static void bar_pane_gps_destroy(GtkWidget *widget, gpointer data) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
893 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
894 PaneGPSData *pgd = data; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
895 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
896 file_data_unregister_notify_func(bar_pane_gps_notify_cb, pgd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
897 |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
898 g_idle_remove_by_data(pgd); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
899 |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
900 filelist_free(pgd->selection_list); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
901 if (pgd->bbox) champlain_bounding_box_free(pgd->bbox); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
902 |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
903 file_data_unref(pgd->fd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
904 g_free(pgd->map_source); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
905 g_free(pgd->pane.id); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
906 clutter_actor_destroy(pgd->gps_view); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
907 g_free(pgd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
908 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
909 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
910 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
911 GtkWidget *bar_pane_gps_new(const gchar *id, const gchar *title, const gchar *map_id, |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
912 const gint zoom, const gdouble latitude, const gdouble longitude, |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
913 gboolean expanded, gint height) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
914 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
915 PaneGPSData *pgd; |
1760 | 916 GtkWidget *vbox, *frame; |
2333 | 917 GtkWidget *gpswidget; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
918 GtkWidget *status, *state, *progress, *slider; |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
919 ChamplainMarkerLayer *layer; |
1733
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
920 ChamplainView *view; |
2333 | 921 const gchar *slider_list[] = {"zoom-in", "zoom-out", NULL}; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
922 const gchar **slider_icons = slider_list; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
923 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
924 pgd = g_new0(PaneGPSData, 1); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
925 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
926 pgd->pane.pane_set_fd = bar_pane_gps_set_fd; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
927 pgd->pane.pane_notify_selection = bar_pane_gps_notify_selection; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
928 pgd->pane.pane_event = bar_pane_gps_event; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
929 pgd->pane.pane_write_config = bar_pane_gps_write_config; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
930 pgd->pane.title = bar_pane_expander_title(title); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
931 pgd->pane.id = g_strdup(id); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
932 pgd->pane.type = PANE_GPS; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
933 pgd->pane.expanded = expanded; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
934 pgd->height = height; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
935 |
1760 | 936 frame = gtk_frame_new(NULL); |
2333 | 937 vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); |
1667
4482edafd1fa
simplified menu_item_add_radio usage
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1604
diff
changeset
|
938 |
1733
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
939 gpswidget = gtk_champlain_embed_new(); |
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
940 view = gtk_champlain_embed_get_view(GTK_CHAMPLAIN_EMBED(gpswidget)); |
1760 | 941 |
942 gtk_box_pack_start(GTK_BOX(vbox), gpswidget, TRUE, TRUE, 0); | |
943 gtk_container_add(GTK_CONTAINER(frame), vbox); | |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
944 |
2333 | 945 status = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
946 slider = gtk_scale_button_new(GTK_ICON_SIZE_SMALL_TOOLBAR, 1, 17, 1, slider_icons); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
947 gtk_widget_set_tooltip_text(slider, "Zoom"); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
948 gtk_scale_button_set_value(GTK_SCALE_BUTTON(slider), (gdouble)zoom); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
949 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
950 progress = gtk_progress_bar_new(); |
2439 | 951 #if GTK_CHECK_VERSION(3,0,0) |
952 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress), ""); | |
953 gtk_progress_bar_set_show_text(GTK_PROGRESS_BAR(progress), TRUE); | |
954 #endif | |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
955 state = gtk_label_new(""); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
956 gtk_label_set_justify(GTK_LABEL(state), GTK_JUSTIFY_CENTER); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
957 |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
958 gtk_box_pack_start(GTK_BOX(status), GTK_WIDGET(slider), FALSE, FALSE, 0); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
959 gtk_box_pack_start(GTK_BOX(status), GTK_WIDGET(state), FALSE, FALSE, 5); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
960 gtk_box_pack_end(GTK_BOX(status), GTK_WIDGET(progress), FALSE, FALSE, 0); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
961 gtk_box_pack_end(GTK_BOX(vbox),GTK_WIDGET(status), FALSE, FALSE, 0); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
962 |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
963 layer = champlain_marker_layer_new(); |
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
964 champlain_view_add_layer(view, CHAMPLAIN_LAYER(layer)); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
965 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
966 pgd->icon_layer = layer; |
1733
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
967 pgd->gps_view = CLUTTER_ACTOR(view); |
1760 | 968 pgd->widget = frame; |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
969 pgd->progress = progress; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
970 pgd->slider = slider; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
971 pgd->state = state; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
972 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
973 bar_pane_gps_set_map_source(pgd, map_id); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
974 |
2037
ad2e0cac775c
updated libchamplain code
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
975 g_object_set(G_OBJECT(view), "kinetic-mode", TRUE, |
1733
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
976 "zoom-level", zoom, |
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
977 "keep-center-on-resize", TRUE, |
2333 | 978 "deceleration", 1.1, |
1733
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
979 "zoom-on-double-click", FALSE, |
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
980 "max-zoom-level", 17, |
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
981 "min-zoom-level", 1, |
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
982 NULL); |
c47eee6c8248
Fix up compilation issues related to libchamplain.
Laurent Monin <geeqie@norz.org>
parents:
1708
diff
changeset
|
983 champlain_view_center_on(view, latitude, longitude); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
984 pgd->centre_map_checked = TRUE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
985 g_object_set_data(G_OBJECT(pgd->widget), "pane_data", pgd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
986 g_signal_connect(G_OBJECT(pgd->widget), "destroy", G_CALLBACK(bar_pane_gps_destroy), pgd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
987 |
1760 | 988 gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
989 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
990 gtk_widget_set_size_request(pgd->widget, -1, height); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
991 |
1760 | 992 g_signal_connect(G_OBJECT(gpswidget), "button_press_event", G_CALLBACK(bar_pane_gps_map_keypress_cb), pgd); |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
993 g_signal_connect(pgd->gps_view, "notify::state", G_CALLBACK(bar_pane_gps_view_state_changed_cb), pgd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
994 g_signal_connect(pgd->gps_view, "notify::zoom-level", G_CALLBACK(bar_pane_gps_view_state_changed_cb), pgd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
995 g_signal_connect(G_OBJECT(slider), "value-changed", G_CALLBACK(bar_pane_gps_slider_changed_cb), pgd); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
996 |
2478
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
997 bar_pane_gps_dnd_init(pgd); |
b3462ee88422
Geocode image by drag-drop
Colin Clark <colin.clark@cclark.uk>
parents:
2477
diff
changeset
|
998 |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
999 file_data_register_notify_func(bar_pane_gps_notify_cb, pgd, NOTIFY_PRIORITY_LOW); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1000 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1001 pgd->create_markers_id = 0; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1002 pgd->enable_markers_checked = TRUE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1003 pgd->centre_map_checked = TRUE; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
1004 |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1005 return pgd->widget; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1006 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1007 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1008 GtkWidget *bar_pane_gps_new_from_config(const gchar **attribute_names, const gchar **attribute_values) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1009 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1010 gchar *title = g_strdup(_("GPS Map")); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1011 gchar *map_id = NULL; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1012 gboolean expanded = TRUE; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1013 gint height = 350; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1014 gint zoom = 7; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1015 gdouble latitude; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1016 gdouble longitude; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1017 /* Latitude and longitude are stored in the config file as an integer of |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1018 * (actual value * 1,000,000). There is no READ_DOUBLE utilty function. |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1019 */ |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1020 gint int_latitude = 54000000; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1021 gint int_longitude = -4000000; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1022 gchar *id = g_strdup("gps"); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1023 GtkWidget *ret; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1024 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1025 while (*attribute_names) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1026 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1027 const gchar *option = *attribute_names++; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1028 const gchar *value = *attribute_values++; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1029 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1030 if (READ_CHAR_FULL("title", title)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1031 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1032 if (READ_CHAR_FULL("map-id", map_id)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1033 continue; |
2333 | 1034 if (READ_INT_CLAMP_FULL("zoom-level", zoom, 1, 20)) |
1604
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1035 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1036 if (READ_INT_CLAMP_FULL("latitude", int_latitude, -90000000, +90000000)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1037 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1038 if (READ_INT_CLAMP_FULL("longitude", int_longitude, -90000000, +90000000)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1039 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1040 if (READ_BOOL_FULL("expanded", expanded)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1041 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1042 if (READ_INT_FULL("height", height)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1043 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1044 if (READ_CHAR_FULL("id", id)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1045 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1046 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1047 log_printf("unknown attribute %s = %s\n", option, value); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1048 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1049 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1050 bar_pane_translate_title(PANE_COMMENT, id, &title); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1051 latitude = int_latitude / 1000000; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1052 longitude = int_longitude / 1000000; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1053 ret = bar_pane_gps_new(id, title, map_id, zoom, latitude, longitude, expanded, height); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1054 g_free(title); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1055 g_free(map_id); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1056 g_free(id); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1057 return ret; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1058 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1059 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1060 void bar_pane_gps_update_from_config(GtkWidget *pane, const gchar **attribute_names, |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1061 const gchar **attribute_values) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1062 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1063 PaneGPSData *pgd; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1064 gint zoom; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1065 gint int_longitude, int_latitude; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1066 gdouble longitude, latitude; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1067 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1068 pgd = g_object_get_data(G_OBJECT(pane), "pane_data"); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1069 if (!pgd) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1070 return; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1071 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1072 gchar *title = NULL; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1073 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1074 while (*attribute_names) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1075 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1076 const gchar *option = *attribute_names++; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1077 const gchar *value = *attribute_values++; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1078 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1079 if (READ_CHAR_FULL("title", title)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1080 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1081 if (READ_CHAR_FULL("map-id", pgd->map_source)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1082 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1083 if (READ_BOOL_FULL("expanded", pgd->pane.expanded)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1084 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1085 if (READ_INT_FULL("height", pgd->height)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1086 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1087 if (READ_CHAR_FULL("id", pgd->pane.id)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1088 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1089 if (READ_INT_CLAMP_FULL("zoom-level", zoom, 1, 8)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1090 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1091 g_object_set(G_OBJECT(CHAMPLAIN_VIEW(pgd->gps_view)), "zoom-level", zoom, NULL); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1092 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1093 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1094 if (READ_INT_CLAMP_FULL("longitude", int_longitude, -90000000, +90000000)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1095 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1096 longitude = int_longitude / 1000000; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1097 g_object_set(G_OBJECT(CHAMPLAIN_VIEW(pgd->gps_view)), "longitude", longitude, NULL); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1098 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1099 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1100 if (READ_INT_CLAMP_FULL("latitude", int_latitude, -90000000, +90000000)) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1101 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1102 latitude = int_latitude / 1000000; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1103 g_object_set(G_OBJECT(CHAMPLAIN_VIEW(pgd->gps_view)), "latitude", latitude, NULL); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1104 continue; |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1105 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1106 log_printf("unknown attribute %s = %s\n", option, value); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1107 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1108 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1109 if (title) |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1110 { |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1111 bar_pane_translate_title(PANE_COMMENT, pgd->pane.id, &title); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1112 gtk_label_set_text(GTK_LABEL(pgd->pane.title), title); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1113 g_free(title); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1114 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1115 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1116 gtk_widget_set_size_request(pgd->widget, -1, pgd->height); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1117 bar_update_expander(pane); |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1118 } |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1119 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1120 #endif |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1121 #endif |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1122 |
934646ea4af8
added GPS map support - patch by Colin Clark
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff
changeset
|
1123 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |